From be2926499af2e372c313d965533be3a7ee0dcf4d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 16 May 2016 11:19:10 +0200 Subject: add tobii eyex sdk --- Tobii EyeX/include/eyex-cpp/InteractionEvent.inl | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 Tobii EyeX/include/eyex-cpp/InteractionEvent.inl (limited to 'Tobii EyeX/include/eyex-cpp/InteractionEvent.inl') diff --git a/Tobii EyeX/include/eyex-cpp/InteractionEvent.inl b/Tobii EyeX/include/eyex-cpp/InteractionEvent.inl new file mode 100755 index 0000000..b650bef --- /dev/null +++ b/Tobii EyeX/include/eyex-cpp/InteractionEvent.inl @@ -0,0 +1,63 @@ +/********************************************************************************************************************* + * Copyright 2013-2014 Tobii Technology AB. All rights reserved. + * InteractionEvent.inl + *********************************************************************************************************************/ + +#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONEVENT__INL__) +#define __TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONEVENT__INL__ + +/*********************************************************************************************************************/ + +TX_NAMESPACE_BEGIN + +/*********************************************************************************************************************/ + +inline InteractionEvent::InteractionEvent(const std::shared_ptr& spContext, TX_HANDLE hEvent) +: InteractionObject(spContext, hEvent) +{} + +/*********************************************************************************************************************/ + +inline std::string InteractionEvent::GetInteractorId() const +{ + return GetString(txGetEventInteractorId, _hObject); +} + +/*********************************************************************************************************************/ + +inline std::vector> InteractionEvent::GetBehaviors() const +{ + std::vector behaviorHandles; + TX_VALIDATE(Tx::Utils::GetBufferData(behaviorHandles, txGetEventBehaviors, _hObject)); + + std::vector> behaviors; + for(auto& hBehavior : behaviorHandles) + { + auto spBehavior = _spContext->CreateObject(hBehavior); + behaviors.push_back(spBehavior); + } + + return behaviors; +} + +/*********************************************************************************************************************/ + +inline bool InteractionEvent::TryGetBehavior(std::shared_ptr* pspBehavior, TX_BEHAVIORTYPE behaviorType) const +{ + Tx::Utils::ScopedHandle hBehavior; + if(!TX_VALIDATE(txGetEventBehavior(_hObject, &hBehavior, behaviorType), TX_RESULT_NOTFOUND)) + return false; + + *pspBehavior = _spContext->CreateObject(hBehavior); + return true; +} + +/*********************************************************************************************************************/ + +TX_NAMESPACE_END + +/*********************************************************************************************************************/ + +#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_INTERACTIONEVENT__INL__) + +/*********************************************************************************************************************/ -- cgit v1.2.3