#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_ValueChangeCBs |
XnVDirectionSpecificEvent | m_OffAxisMovementCBs |
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 25 of file XnVSlider2D.h.
Member Typedef Documentation
Type for the off axis movement event callback. It receives a direction of the off-axis movement.
Definition at line 35 of file XnVSlider2D.h.
Type for the value change event callback. The values are between 0 and 1 in each axis
Definition at line 31 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] | 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.
- Parameters:
-
[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 |
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] |
void XnVSlider2D::OffAxisMovement |
( |
XnVDirection |
eDir |
) |
[protected] |
XnCallbackHandle XnVSlider2D::RegisterOffAxisMovement |
( |
void * |
cxt, |
|
|
OffAxisMovementCB |
CB | |
|
) |
| | |
Register for the off-axis event
- Parameters:
-
[in] | cxt | User's context |
[in] | CB | The 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] | cxt | User's context |
[in] | CB | The 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] | 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
- Parameters:
-
void XnVSlider2D::SetOffAxisDetectionVelocity |
( |
XnFloat |
fVelocity |
) |
|
Change the minimum velocity to consider Off Axis movement, in m/s. Default is 0.15m/s
- Parameters:
-
[in] | fVelocity | New minimum velocity |
void XnVSlider2D::UnregisterOffAxisMovement |
( |
XnCallbackHandle |
hCB |
) |
|
Unregister from the off-axis event
- Parameters:
-
[in] | hCB | The handle provided on registration. |
void XnVSlider2D::UnregisterValueChange |
( |
XnCallbackHandle |
hCB |
) |
|
Unregister from the value change event
- Parameters:
-
[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.
- Parameters:
-
[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] |
Member Data Documentation
The documentation for this class was generated from the following file: