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/Bounds.inl | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100755 Tobii EyeX/include/eyex-cpp/Bounds.inl (limited to 'Tobii EyeX/include/eyex-cpp/Bounds.inl') diff --git a/Tobii EyeX/include/eyex-cpp/Bounds.inl b/Tobii EyeX/include/eyex-cpp/Bounds.inl new file mode 100755 index 0000000..495e779 --- /dev/null +++ b/Tobii EyeX/include/eyex-cpp/Bounds.inl @@ -0,0 +1,86 @@ +/********************************************************************************************************************* + * Copyright 2013-2014 Tobii Technology AB. All rights reserved. + * Bounds.inl + *********************************************************************************************************************/ + +#if !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Bounds__INL__) +#define __TOBII_TX_CLIENT_CPPBINDINGS_Bounds__INL__ + +/*********************************************************************************************************************/ + +TX_NAMESPACE_BEGIN + +/*********************************************************************************************************************/ + +inline Bounds::Bounds(const std::shared_ptr& spContext, TX_HANDLE hBounds) +: InteractionObject(spContext, hBounds) +{} + +/*********************************************************************************************************************/ + +inline TX_BOUNDSTYPE Bounds::GetType() const +{ + TX_BOUNDSTYPE boundsType; + TX_VALIDATE(txGetBoundsType(_hObject, &boundsType)); + return boundsType; +} + +/*********************************************************************************************************************/ + + +inline bool Bounds::TryGetRectangularData(TX_REAL* pX, TX_REAL* pY, TX_REAL* pWidth, TX_REAL* pHeight) const +{ + return txGetRectangularBoundsData(_hObject, pX, pY, pWidth, pHeight) == TX_RESULT_OK; +} + +/*********************************************************************************************************************/ + +inline void Bounds::SetRectangularData(TX_REAL x, TX_REAL y, TX_REAL width, TX_REAL height) +{ + txSetRectangularBoundsData(_hObject, x, y, width, height); +} + +/*********************************************************************************************************************/ + +inline bool Bounds::TryGetRectangularData(TX_RECT* pData) const +{ + return TryGetRectangularData(&pData->X, &pData->Y, &pData->Width, &pData->Height); +} + +/*********************************************************************************************************************/ + +inline void Bounds::SetRectangularData(const TX_RECT& data) +{ + SetRectangularData(data.X, data.Y, data.Width, data.Height); +} + +/*********************************************************************************************************************/ + +inline std::shared_ptr Bounds::GetData() const +{ + auto spProperty = GetProperty(TX_LITERAL_DATA); + + std::shared_ptr spData; + if(spProperty->TryGetValue(&spData)) + return spData; + + return nullptr; +} + +/*********************************************************************************************************************/ + +inline void Bounds::SetData(const std::shared_ptr& spData) +{ + auto spProperty = GetProperty(TX_LITERAL_DATA); + spProperty->SetValue(spData); +} + +/*********************************************************************************************************************/ + +TX_NAMESPACE_END + +/*********************************************************************************************************************/ + +#endif // !defined(__TOBII_TX_CLIENT_CPPBINDINGS_Bounds__INL__) + +/*********************************************************************************************************************/ -- cgit v1.2.3