NITE 1.5.1 - API Reference

XnVSlider2D Class Reference

#include <XnVSlider2D.h>

List of all members.

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

Detailed Description

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:

  • Its values have changed
  • A movement in the z-coordinate was detected.

Definition at line 26 of file XnVSlider2D.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

XnVSlider2D::XnVSlider2D ( const XnPoint3D &  ptMin,
const XnPoint3D &  ptMax 
)

Creation. It receives 2 points, defining the x-y 2D space.

Parameters:
[in]ptMinOne edge of the 2D space
[in]ptMaxOther edge of the 2D space
XnVSlider2D::XnVSlider2D ( const XnPoint3D &  ptInitialPosition,
XnFloat  fSliderXLength,
XnFloat  fSliderYLength,
XnFloat  fInitialXValue,
XnFloat  fInitialYValue 
)

Creation.

Parameters:
[in]ptInitialPositionThe initial point within the slider
[in]fSliderXLengthThe length of the slider in the x-coordinate
[in]fSliderYLengthThe length of the slider in the y-coordinate
[in]fInitialXValueThe initial value to consider the initial point in the x-coordindate
[in]fInitialYValueThe initial value to consider the initial point in the y-coordindate
XnVSlider2D::~XnVSlider2D ( )

Member Function Documentation

XnInt32 XnVSlider2D::CheckForOffAxisMovement ( const XnPoint3D &  pt,
XnFloat  fTime 
) [protected]
XnFloat XnVSlider2D::GetOffAxisDetectionAngle ( ) const

Get the minimum angle to consider Off Axis movement

Returns:
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

Returns:
The timespan in which an off axis movement should be identified.
XnFloat XnVSlider2D::GetOffAxisDetectionVelocity ( ) const

Get the minimum velocity to consider Off Axis movement

Returns:
The minimum velocity to consider OffAxis 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

Parameters:
[in]cxtUser's context
[in]CBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
XnCallbackHandle XnVSlider2D::RegisterValueChange ( void *  cxt,
ValueChangeCB  CB 
)

Register for the value change event

Parameters:
[in]cxtUser's context
[in]CBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
void XnVSlider2D::SetOffAxisDetectionAngle ( XnFloat  fAngle)

Change the minimum angle to consider Off Axis movement, in degrees. Default is 60

Parameters:
[in]fAngleNew 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

Parameters:
[in]nTimeNew time span
void XnVSlider2D::SetOffAxisDetectionVelocity ( XnFloat  fVelocity)

Change the minimum velocity to consider Off Axis movement, in m/s. Default is 0.15m/s

Parameters:
[in]fVelocityNew minimum velocity
void XnVSlider2D::UnregisterOffAxisMovement ( XnCallbackHandle  hCB)

Unregister from the off-axis event

Parameters:
[in]hCBThe handle provided on registration.
void XnVSlider2D::UnregisterValueChange ( XnCallbackHandle  hCB)

Unregister from the value change event

Parameters:
[in]hCBThe 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.

Parameters:
[in]ptThe point to check in the slider.
[in]fTimeThe timestamp (in seconds) for the update
[in]bCheckOffAxisshould check for OffAxis
void XnVSlider2D::ValueChange ( XnFloat  fXValue,
XnFloat  fYValue 
) [protected]

Member Data Documentation

Definition at line 159 of file XnVSlider2D.h.

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.

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.


The documentation for this class was generated from the following file: