|
NITE 1.5.1 - API Reference
|
#include <XnVSlider2D.h>
Public Types | |
| typedef void(XN_CALLBACK_TYPE * | ValueChangeCB )(XnFloat fXValue, XnFloat fYValue, void *pUserCxt) |
| typedef void(XN_CALLBACK_TYPE * | OffAxisMovementCB )(XnVDirection eDir, void *pUserCxt) |
Public Member Functions | |
| XnVSlider2D (const XnPoint3D &ptMin, const XnPoint3D &ptMax) | |
| XnVSlider2D (const XnPoint3D &ptInitialPosition, XnFloat fSliderXLength, XnFloat fSliderYLength, XnFloat fInitialXValue, XnFloat fInitialYValue) | |
| ~XnVSlider2D () | |
| XnStatus | Update (const XnPoint3D &pt, XnFloat fTime, XnBool bCheckOffAxis=true) |
| XnCallbackHandle | RegisterValueChange (void *cxt, ValueChangeCB CB) |
| XnCallbackHandle | RegisterOffAxisMovement (void *cxt, OffAxisMovementCB CB) |
| void | UnregisterValueChange (XnCallbackHandle hCB) |
| void | UnregisterOffAxisMovement (XnCallbackHandle hCB) |
| XnPoint3D | GetPosition () const |
| XnFloat | GetOffAxisDetectionVelocity () const |
| XnFloat | GetOffAxisDetectionAngle () const |
| XnUInt32 | GetOffAxisDetectionTime () const |
| void | SetOffAxisDetectionVelocity (XnFloat fVelocity) |
| void | SetOffAxisDetectionAngle (XnFloat fAngle) |
| void | SetOffAxisDetectionTime (XnUInt32 nTime) |
Protected Member Functions | |
| XnInt32 | CheckForOffAxisMovement (const XnPoint3D &pt, XnFloat fTime) |
| void | ValueChange (XnFloat fXValue, XnFloat fYValue) |
| void | OffAxisMovement (XnVDirection eDir) |
Protected Attributes | |
| XnPoint3D | m_ptMin |
| XnPoint3D | m_ptMax |
| XnFloat | m_fSizeX |
| XnFloat | m_fSizeY |
| XnVPointBuffer * | m_pPointBuffer |
| XnPoint3D | m_ptCurrentPosition |
| XnVFloatFloatSpecificEvent * | m_pValueChangeCBs |
| XnVDirectionSpecificEvent * | m_pOffAxisMovementCBs |
| XnFloat | m_fOffAxisDetectionVelocity |
| XnFloat | m_fOffAxisDetectionAngle |
| XnUInt32 | m_nOffAxisDetectionTime |
Static Protected Attributes | |
| static const XnFloat | ms_fOffAxisDefaultMininumVelocity |
| static const XnFloat | ms_fOffAxisDefaultDetectionAngle |
| static const XnUInt32 | ms_nDefaultTimeForOffAxisDetection |
This is a simple 2D slider. It receives a point, and normalizes it in the x-y 2D space to numbers between 0 and 1 for each. The XnVSlider2D defines 2 events:
Definition at line 26 of file XnVSlider2D.h.
| typedef void(XN_CALLBACK_TYPE * XnVSlider2D::OffAxisMovementCB)(XnVDirection eDir, void *pUserCxt) |
Type for the off axis movement event callback. It receives a direction of the off-axis movement.
Definition at line 36 of file XnVSlider2D.h.
| typedef void(XN_CALLBACK_TYPE * XnVSlider2D::ValueChangeCB)(XnFloat fXValue, XnFloat fYValue, void *pUserCxt) |
Type for the value change event callback. The values are between 0 and 1 in each axis
Definition at line 32 of file XnVSlider2D.h.
| XnVSlider2D::XnVSlider2D | ( | const XnPoint3D & | ptMin, |
| const XnPoint3D & | ptMax | ||
| ) |
Creation. It receives 2 points, defining the x-y 2D space.
| [in] | ptMin | One edge of the 2D space |
| [in] | ptMax | Other edge of the 2D space |
| XnVSlider2D::XnVSlider2D | ( | const XnPoint3D & | ptInitialPosition, |
| XnFloat | fSliderXLength, | ||
| XnFloat | fSliderYLength, | ||
| XnFloat | fInitialXValue, | ||
| XnFloat | fInitialYValue | ||
| ) |
Creation.
| [in] | ptInitialPosition | The initial point within the slider |
| [in] | fSliderXLength | The length of the slider in the x-coordinate |
| [in] | fSliderYLength | The length of the slider in the y-coordinate |
| [in] | fInitialXValue | The initial value to consider the initial point in the x-coordindate |
| [in] | fInitialYValue | The initial value to consider the initial point in the y-coordindate |
| XnInt32 XnVSlider2D::CheckForOffAxisMovement | ( | const XnPoint3D & | pt, |
| XnFloat | fTime | ||
| ) | [protected] |
| XnFloat XnVSlider2D::GetOffAxisDetectionAngle | ( | ) | const |
Get the minimum angle to consider Off Axis movement
| XnUInt32 XnVSlider2D::GetOffAxisDetectionTime | ( | ) | const |
Get the time span in which an off axis movement should be identified
| XnFloat XnVSlider2D::GetOffAxisDetectionVelocity | ( | ) | const |
Get the minimum velocity to consider Off Axis movement
| XnPoint3D XnVSlider2D::GetPosition | ( | ) | const [inline] |
Definition at line 98 of file XnVSlider2D.h.
| void XnVSlider2D::OffAxisMovement | ( | XnVDirection | eDir | ) | [protected] |
| XnCallbackHandle XnVSlider2D::RegisterOffAxisMovement | ( | void * | cxt, |
| OffAxisMovementCB | CB | ||
| ) |
Register for the off-axis event
| [in] | cxt | User's context |
| [in] | CB | The Callback to call when the event is invoked. |
| XnCallbackHandle XnVSlider2D::RegisterValueChange | ( | void * | cxt, |
| ValueChangeCB | CB | ||
| ) |
Register for the value change event
| [in] | cxt | User's context |
| [in] | CB | The Callback to call when the event is invoked. |
| void XnVSlider2D::SetOffAxisDetectionAngle | ( | XnFloat | fAngle | ) |
Change the minimum angle to consider Off Axis movement, in degrees. Default is 60
| [in] | fAngle | New minimum angle |
| void XnVSlider2D::SetOffAxisDetectionTime | ( | XnUInt32 | nTime | ) |
Change the time span in which an Off Axis movement should be identified, in milliseconds. Default is 350ms
| [in] | nTime | New time span |
| void XnVSlider2D::SetOffAxisDetectionVelocity | ( | XnFloat | fVelocity | ) |
Change the minimum velocity to consider Off Axis movement, in m/s. Default is 0.15m/s
| [in] | fVelocity | New minimum velocity |
| void XnVSlider2D::UnregisterOffAxisMovement | ( | XnCallbackHandle | hCB | ) |
Unregister from the off-axis event
| [in] | hCB | The handle provided on registration. |
| void XnVSlider2D::UnregisterValueChange | ( | XnCallbackHandle | hCB | ) |
Unregister from the value change event
| [in] | hCB | The handle provided on registration. |
| XnStatus XnVSlider2D::Update | ( | const XnPoint3D & | pt, |
| XnFloat | fTime, | ||
| XnBool | bCheckOffAxis = true |
||
| ) |
The main function. It receives a point, normalizes it, and calculates the new values.
| [in] | pt | The point to check in the slider. |
| [in] | fTime | The timestamp (in seconds) for the update |
| [in] | bCheckOffAxis | should check for OffAxis |
| void XnVSlider2D::ValueChange | ( | XnFloat | fXValue, |
| XnFloat | fYValue | ||
| ) | [protected] |
XnFloat XnVSlider2D::m_fOffAxisDetectionAngle [protected] |
Definition at line 159 of file XnVSlider2D.h.
XnFloat XnVSlider2D::m_fOffAxisDetectionVelocity [protected] |
Definition at line 158 of file XnVSlider2D.h.
XnFloat XnVSlider2D::m_fSizeX [protected] |
Definition at line 141 of file XnVSlider2D.h.
XnFloat XnVSlider2D::m_fSizeY [protected] |
Definition at line 141 of file XnVSlider2D.h.
XnUInt32 XnVSlider2D::m_nOffAxisDetectionTime [protected] |
Definition at line 160 of file XnVSlider2D.h.
XnVDirectionSpecificEvent* XnVSlider2D::m_pOffAxisMovementCBs [protected] |
Definition at line 152 of file XnVSlider2D.h.
XnVPointBuffer* XnVSlider2D::m_pPointBuffer [protected] |
Definition at line 143 of file XnVSlider2D.h.
XnPoint3D XnVSlider2D::m_ptCurrentPosition [protected] |
Definition at line 145 of file XnVSlider2D.h.
XnPoint3D XnVSlider2D::m_ptMax [protected] |
Definition at line 140 of file XnVSlider2D.h.
XnPoint3D XnVSlider2D::m_ptMin [protected] |
Definition at line 140 of file XnVSlider2D.h.
XnVFloatFloatSpecificEvent* XnVSlider2D::m_pValueChangeCBs [protected] |
Definition at line 151 of file XnVSlider2D.h.
const XnFloat XnVSlider2D::ms_fOffAxisDefaultDetectionAngle [static, protected] |
Definition at line 155 of file XnVSlider2D.h.
const XnFloat XnVSlider2D::ms_fOffAxisDefaultMininumVelocity [static, protected] |
Definition at line 154 of file XnVSlider2D.h.
const XnUInt32 XnVSlider2D::ms_nDefaultTimeForOffAxisDetection [static, protected] |
Definition at line 156 of file XnVSlider2D.h.
1.7.6.1