NITE 1.5.1 - API Reference

XnVSelectableSlider2D Class Reference

#include <XnVSelectableSlider2D.h>

Inheritance diagram for XnVSelectableSlider2D:
Collaboration diagram for XnVSelectableSlider2D:

List of all members.

Public Types

typedef void(XN_CALLBACK_TYPE * ItemHoverCB )(XnInt32 nXIndex, XnInt32 nYIndex, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * ItemSelectCB )(XnInt32 nXIndex, XnInt32 nYIndex, XnVDirection eDir, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * OffAxisMovementCB )(XnVDirection eDir, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * ValueChangeCB )(XnFloat fXValue, XnFloat fYValue, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * ScrollCB )(XnFloat fXValue, XnFloat fYValue, void *pUserCxt)

Public Member Functions

 XnVSelectableSlider2D (XnInt32 nXItems, XnInt32 nYItems, XnFloat fSliderSizeX=ms_fDefaultSliderSize, XnFloat fSliderSizeY=ms_fDefaultSliderSize, XnFloat fBorderWidth=0, const XnChar *strName="XnVSelectableSlider2D")
virtual ~XnVSelectableSlider2D ()
void OnPrimaryPointCreate (const XnVHandPointContext *pContext, const XnPoint3D &ptFocus)
void OnPrimaryPointUpdate (const XnVHandPointContext *pContext)
void OnPrimaryPointDestroy (XnUInt32 nID)
XnCallbackHandle RegisterItemHover (void *cxt, ItemHoverCB CB)
XnCallbackHandle RegisterScroll (void *cxt, ScrollCB CB)
XnCallbackHandle RegisterValueChange (void *cxt, ValueChangeCB CB)
XnCallbackHandle RegisterItemSelect (void *cxt, ItemSelectCB CB)
XnCallbackHandle RegisterOffAxisMovement (void *cxt, OffAxisMovementCB CB)
void UnregisterItemHover (XnCallbackHandle hCB)
void UnregisterScroll (XnCallbackHandle hCB)
void UnregisterValueChange (XnCallbackHandle hCB)
void UnregisterItemSelect (XnCallbackHandle hCB)
void UnregisterOffAxisMovement (XnCallbackHandle hCB)
void Reposition (const XnPoint3D &ptCenter)
void GetCenter (XnPoint3D &ptCenter) const
void GetSliderSize (XnFloat &fSliderXSize, XnFloat &fSliderYSize) const
void SetSliderSize (XnFloat fSliderXSize, XnFloat fSliderYSize)
XnUInt32 GetItemXCount () const
XnUInt32 GetItemYCount () const
void SetItemCount (XnUInt32 nItemXCount, XnUInt32 nItemYCount)
void SetItemXCount (XnUInt32 nItemXCount)
void SetItemYCount (XnUInt32 nItemYCount)
void SetValueChangeOnOffAxis (XnBool bReport)
XnBool GetValueChangeOnOffAxis () const
XnFloat GetBorderWidth () const
XnStatus SetBorderWidth (XnFloat fWidth)
void SetHysteresisRatio (XnFloat fRatio)
XnFloat GetHysteresisRatio () const

Static Public Attributes

static const XnFloat ms_fDefaultSliderSize

Protected Member Functions

void UpdateSlider (XnFloat fXValue, XnFloat fYValue)
void PointDeleted (XnBool bReason)
void PointMoved (const XnPoint3D &pt, XnFloat fTime)
void ItemHover (XnInt32 nXIndex, XnInt32 nYIndex)
void Scroll (XnFloat fXValue, XnFloat fYValue)
void ValueChange (XnFloat fXValue, XnFloat fYValue)
void ItemSelect (XnVDirection eDir)
void OffAxisMovement (XnVDirection eDir)

Static Protected Member Functions

static void XN_CALLBACK_TYPE Slider_ValueChange (XnFloat fXValue, XnFloat fYValue, void *pContext)
static void XN_CALLBACK_TYPE Slider_OffAxis (XnVDirection eDir, void *cxt)
static void XN_CALLBACK_TYPE Hysteresis_ItemSelected (XnInt32 nXItem, XnInt32 nYItem, void *pContext)
static void XN_CALLBACK_TYPE Scroller2D_Scrolled (XnFloat fXValue, XnFloat fYValue, void *pContext)
static void XN_CALLBACK_TYPE SecondarySlider_OffAxisMovement (XnVDirection eDir, void *cxt)
static void XN_CALLBACK_TYPE SecondarySlider_ValueChange (XnFloat fValue, void *cxt)
static void XN_CALLBACK_TYPE OffAxisHysteresis_ItemSelected (XnInt32 nItem, void *cxt)

Protected Attributes

XnBool m_bValueChangeWithoutBorders
XnBool m_bPositioned
XnInt32 m_nXItems
XnInt32 m_nYItems
XnBool m_bValueChangeOnOffAxis
XnFloat m_fSliderSizeX
XnFloat m_fSliderSizeY
XnFloat m_fBorderWidth
XnVSlider2Dm_pSlider
XnVMultiItemHysteresis2Dm_pHysteresis
XnVBorderScrollController2D * m_pScroller
XnBool m_bInOffAxis
XnVSlider1Dm_pSecondarySlider
XnVMultiItemHysteresis1Dm_pOffAxisHysteresis
XnPoint3D m_ptCenter
XnInt32 m_nXLastHover
XnInt32 m_nYLastHover
XnCallbackHandle m_hHysteresisItemSelect
XnCallbackHandle m_hScrollerScroll
XnCallbackHandle m_hSliderValueChange
XnCallbackHandle m_hSliderOffAxis
XnCallbackHandle m_hOffAxisHysteresisItemSelect
XnCallbackHandle m_hSecondarySliderValueChange
XnCallbackHandle m_hSecondarySliderOffAxis
XnVIntIntSpecificEvent * m_pItemHoverCBs
XnVFloatFloatSpecificEvent * m_pScrollCBs
XnVFloatFloatSpecificEvent * m_pValueChangeCBs
XnVItemSelectSpecificEvent * m_pItemSelectCBs
XnVDirectionSpecificEvent * m_pOffAxisMovementCBs

Static Protected Attributes

static const XnFloat ms_fSecondarySliderSize

Detailed Description

A Selectable slider 2D is a 2D slider (on the x/y plane) with a number of cells and borders in both axis, where the items can be selected by moving off axis (in the z axis).

Item (0,0) is the bottom-left one.

Definition at line 34 of file XnVSelectableSlider2D.h.


Member Typedef Documentation

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider2D::ItemHoverCB)(XnInt32 nXIndex, XnInt32 nYIndex, void *pUserCxt)

Type for hover event callback. Receives the 2 indices of the hovered item

Definition at line 41 of file XnVSelectableSlider2D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider2D::ItemSelectCB)(XnInt32 nXIndex, XnInt32 nYIndex, XnVDirection eDir, void *pUserCxt)

Type for select event callback. Receives the 2 indices of the selected item and the direction of the selection.

Definition at line 45 of file XnVSelectableSlider2D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider2D::OffAxisMovementCB)(XnVDirection eDir, void *pUserCxt)

Type for off axis event callback. Receives the direction of the off axis movement

Definition at line 49 of file XnVSelectableSlider2D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider2D::ScrollCB)(XnFloat fXValue, XnFloat fYValue, void *pUserCxt)

Type for scroll event callback. Receives the number between -1 and 1 in each axis, indicating where in the border the point is

Definition at line 59 of file XnVSelectableSlider2D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider2D::ValueChangeCB)(XnFloat fXValue, XnFloat fYValue, void *pUserCxt)

Type for value change event callback. Receives a number between 0 and 1 for each axis, indicating where in the slider the point is

Definition at line 54 of file XnVSelectableSlider2D.h.


Constructor & Destructor Documentation

XnVSelectableSlider2D::XnVSelectableSlider2D ( XnInt32  nXItems,
XnInt32  nYItems,
XnFloat  fSliderSizeX = ms_fDefaultSliderSize,
XnFloat  fSliderSizeY = ms_fDefaultSliderSize,
XnFloat  fBorderWidth = 0,
const XnChar *  strName = "XnVSelectableSlider2D" 
)

Creation. Gets the number of items in each axis for the slider, the width of the border (on all sides), its axis, and more.

Parameters:
[in]nXItemsNumber of item rows in the slider
[in]nYItemsNumber of item columns in the slider
[in]fSliderSizeXSize of the slider in the x-coordinate (in mm)
[in]fSliderSizeYSize of the slider in the y-coordinate (in mm)
[in]fBorderWidthSize reserved from the slider for scrolling
[in]strNameName of the control, for log purposes.
virtual XnVSelectableSlider2D::~XnVSelectableSlider2D ( ) [virtual]

Member Function Documentation

XnFloat XnVSelectableSlider2D::GetBorderWidth ( ) const

Get the current border width

Returns:
Current border width
void XnVSelectableSlider2D::GetCenter ( XnPoint3D &  ptCenter) const
XnFloat XnVSelectableSlider2D::GetHysteresisRatio ( ) const

Get current hysteresis ratio

Returns:
Current hysteresis ratio
XnUInt32 XnVSelectableSlider2D::GetItemXCount ( ) const

Get the current number of item rows

Returns:
The current number of rows
XnUInt32 XnVSelectableSlider2D::GetItemYCount ( ) const

Get the current number of item columns

Returns:
The current number of columns
void XnVSelectableSlider2D::GetSliderSize ( XnFloat &  fSliderXSize,
XnFloat &  fSliderYSize 
) const

Get the slider sizes

Parameters:
[out]fSliderXSizeThe size of the X-Slider
[out]fSliderYSizeThe size of the Y-Slider
XnBool XnVSelectableSlider2D::GetValueChangeOnOffAxis ( ) const

Get current behavior

static void XN_CALLBACK_TYPE XnVSelectableSlider2D::Hysteresis_ItemSelected ( XnInt32  nXItem,
XnInt32  nYItem,
void *  pContext 
) [static, protected]
void XnVSelectableSlider2D::ItemHover ( XnInt32  nXIndex,
XnInt32  nYIndex 
) [protected]
void XnVSelectableSlider2D::ItemSelect ( XnVDirection  eDir) [protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider2D::OffAxisHysteresis_ItemSelected ( XnInt32  nItem,
void *  cxt 
) [static, protected]
void XnVSelectableSlider2D::OffAxisMovement ( XnVDirection  eDir) [protected]
void XnVSelectableSlider2D::OnPrimaryPointCreate ( const XnVHandPointContext pContext,
const XnPoint3D &  ptFocus 
) [virtual]

Called when the primary point is created.

Parameters:
[in]pContextThe hand context of the newly created primary point
[in]ptFocusThe point in which the session has started.

Reimplemented from XnVPointControl.

void XnVSelectableSlider2D::OnPrimaryPointDestroy ( XnUInt32  nID) [virtual]

Called when the primary point is destroyed.

Parameters:
[in]nIDthe ID of the last primary point

Reimplemented from XnVPointControl.

void XnVSelectableSlider2D::OnPrimaryPointUpdate ( const XnVHandPointContext pContext) [virtual]

Called when the primary point is updated. This will cause the algorithm to manage the slider.

Parameters:
[in]pContextThe hand context of the updated primary point

Reimplemented from XnVPointControl.

void XnVSelectableSlider2D::PointDeleted ( XnBool  bReason) [protected]
void XnVSelectableSlider2D::PointMoved ( const XnPoint3D &  pt,
XnFloat  fTime 
) [protected]
XnCallbackHandle XnVSelectableSlider2D::RegisterItemHover ( void *  cxt,
ItemHoverCB  CB 
)

Register for the hover event

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

Register for the selection event

Parameters:
[in]cxtUser's context
[in]CBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
XnCallbackHandle XnVSelectableSlider2D::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 XnVSelectableSlider2D::RegisterScroll ( void *  cxt,
ScrollCB  CB 
)

Register for the scroll event

Parameters:
[in]cxtUser's context
[in]CBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
XnCallbackHandle XnVSelectableSlider2D::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 XnVSelectableSlider2D::Reposition ( const XnPoint3D &  ptCenter)

Reposition the slider

Parameters:
[in]ptCenterThe new center point for the slider.
void XnVSelectableSlider2D::Scroll ( XnFloat  fXValue,
XnFloat  fYValue 
) [protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider2D::Scroller2D_Scrolled ( XnFloat  fXValue,
XnFloat  fYValue,
void *  pContext 
) [static, protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider2D::SecondarySlider_OffAxisMovement ( XnVDirection  eDir,
void *  cxt 
) [static, protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider2D::SecondarySlider_ValueChange ( XnFloat  fValue,
void *  cxt 
) [static, protected]
XnStatus XnVSelectableSlider2D::SetBorderWidth ( XnFloat  fWidth)

Change the border width

Parameters:
[in]fWidthNew border width
void XnVSelectableSlider2D::SetHysteresisRatio ( XnFloat  fRatio)

Change the hysteresis ratio, to pass from one item to another. Units are the width of the cell.

Parameters:
[in]fRatioThe new hysteresis ratio. 0 means no ratio, 0.5 means additional half width
void XnVSelectableSlider2D::SetItemCount ( XnUInt32  nItemXCount,
XnUInt32  nItemYCount 
)

Change the current number of items rows and columns

Parameters:
[in]nItemXCountNew number of rows
[in]nItemYCountNew number of columns
void XnVSelectableSlider2D::SetItemXCount ( XnUInt32  nItemXCount)

Change the current number of items rows

Parameters:
[in]nItemXCountNew number of rows
void XnVSelectableSlider2D::SetItemYCount ( XnUInt32  nItemYCount)

Change the current number of items columns

Parameters:
[in]nItemYCountNew number of columns
void XnVSelectableSlider2D::SetSliderSize ( XnFloat  fSliderXSize,
XnFloat  fSliderYSize 
)

Change the slider sizes

Parameters:
[in]fSliderXSizeThe new size of the X-Slider
[in]fSliderYSizeThe new size of the Y-Slider
void XnVSelectableSlider2D::SetValueChangeOnOffAxis ( XnBool  bReport)

Change behavior: Should the SelectableSlider keep sending ValueChange events when checking OffAxis

Parameters:
[in]bReportNew mode. default is off
static void XN_CALLBACK_TYPE XnVSelectableSlider2D::Slider_OffAxis ( XnVDirection  eDir,
void *  cxt 
) [static, protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider2D::Slider_ValueChange ( XnFloat  fXValue,
XnFloat  fYValue,
void *  pContext 
) [static, protected]
void XnVSelectableSlider2D::UnregisterItemHover ( XnCallbackHandle  hCB)

Unregister from the hover event

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

Unregister from the selection event

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

Unregister from the off-axis event

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

Unregister from the scroll event

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

Unregister from the value change event

Parameters:
[in]hCBThe handle provided on registration.
void XnVSelectableSlider2D::UpdateSlider ( XnFloat  fXValue,
XnFloat  fYValue 
) [protected]
void XnVSelectableSlider2D::ValueChange ( XnFloat  fXValue,
XnFloat  fYValue 
) [protected]

Member Data Documentation

Definition at line 306 of file XnVSelectableSlider2D.h.

Definition at line 294 of file XnVSelectableSlider2D.h.

Definition at line 297 of file XnVSelectableSlider2D.h.

Definition at line 301 of file XnVSelectableSlider2D.h.

Definition at line 299 of file XnVSelectableSlider2D.h.

Definition at line 300 of file XnVSelectableSlider2D.h.

XnCallbackHandle XnVSelectableSlider2D::m_hHysteresisItemSelect [protected]

Definition at line 314 of file XnVSelectableSlider2D.h.

Definition at line 319 of file XnVSelectableSlider2D.h.

XnCallbackHandle XnVSelectableSlider2D::m_hScrollerScroll [protected]

Definition at line 315 of file XnVSelectableSlider2D.h.

Definition at line 321 of file XnVSelectableSlider2D.h.

Definition at line 320 of file XnVSelectableSlider2D.h.

XnCallbackHandle XnVSelectableSlider2D::m_hSliderOffAxis [protected]

Definition at line 317 of file XnVSelectableSlider2D.h.

XnCallbackHandle XnVSelectableSlider2D::m_hSliderValueChange [protected]

Definition at line 316 of file XnVSelectableSlider2D.h.

XnInt32 XnVSelectableSlider2D::m_nXItems [protected]

Definition at line 295 of file XnVSelectableSlider2D.h.

Definition at line 312 of file XnVSelectableSlider2D.h.

XnInt32 XnVSelectableSlider2D::m_nYItems [protected]

Definition at line 295 of file XnVSelectableSlider2D.h.

Definition at line 312 of file XnVSelectableSlider2D.h.

XnVIntIntSpecificEvent* XnVSelectableSlider2D::m_pItemHoverCBs [protected]

Definition at line 323 of file XnVSelectableSlider2D.h.

XnVItemSelectSpecificEvent* XnVSelectableSlider2D::m_pItemSelectCBs [protected]

Definition at line 326 of file XnVSelectableSlider2D.h.

XnVDirectionSpecificEvent* XnVSelectableSlider2D::m_pOffAxisMovementCBs [protected]

Definition at line 327 of file XnVSelectableSlider2D.h.

XnVFloatFloatSpecificEvent* XnVSelectableSlider2D::m_pScrollCBs [protected]

Definition at line 324 of file XnVSelectableSlider2D.h.

XnVBorderScrollController2D* XnVSelectableSlider2D::m_pScroller [protected]

Definition at line 304 of file XnVSelectableSlider2D.h.

Definition at line 302 of file XnVSelectableSlider2D.h.

XnPoint3D XnVSelectableSlider2D::m_ptCenter [protected]

Definition at line 310 of file XnVSelectableSlider2D.h.

XnVFloatFloatSpecificEvent* XnVSelectableSlider2D::m_pValueChangeCBs [protected]

Definition at line 325 of file XnVSelectableSlider2D.h.

Definition at line 175 of file XnVSelectableSlider2D.h.

const XnFloat XnVSelectableSlider2D::ms_fSecondarySliderSize [static, protected]

Definition at line 291 of file XnVSelectableSlider2D.h.


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