NITE 1.5.1 - API Reference

XnVSelectableSlider1D Class Reference

#include <XnVSelectableSlider1D.h>

Inheritance diagram for XnVSelectableSlider1D:
Collaboration diagram for XnVSelectableSlider1D:

List of all members.

Public Types

typedef void(XN_CALLBACK_TYPE * ItemHoverCB )(XnInt32 nItemIndex, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * ItemSelectCB )(XnInt32 nItemIndex, XnVDirection nDirection, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * ScrollCB )(XnFloat fScrollValue, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * ValueChangeCB )(XnFloat fValue, void *pUserCxt)
typedef void(XN_CALLBACK_TYPE * OffAxisMovementCB )(XnVDirection dir, void *pUserCxt)

Public Member Functions

 XnVSelectableSlider1D (XnInt32 nCount, XnFloat fBorderWidth=0, XnVAxis eAxis=AXIS_X, XnBool bRecenter=TRUE, XnFloat fHysteresisRatio=XnVMultiItemHysteresis1D::ms_fDefaultHysteresisRatio, XnFloat fPrimarySliderSize=ms_fDefaultPrimarySliderSize, XnFloat fFirstValue=0.5, const XnChar *strName="XnVSelectableSlider1D")
 ~XnVSelectableSlider1D ()
void OnPrimaryPointCreate (const XnVHandPointContext *pContext, const XnPoint3D &ptFocus)
void OnPrimaryPointUpdate (const XnVHandPointContext *pContext)
void OnPrimaryPointDestroy (XnUInt32 nID)
XnCallbackHandle RegisterItemHover (void *cxt, ItemHoverCB pCB)
XnCallbackHandle RegisterItemSelect (void *cxt, ItemSelectCB pCB)
XnCallbackHandle RegisterScroll (void *cxt, ScrollCB pCB)
XnCallbackHandle RegisterValueChange (void *cxt, ValueChangeCB pCB)
XnCallbackHandle RegisterOffAxisMovement (void *cxt, OffAxisMovementCB pCB)
void UnregisterItemHover (XnCallbackHandle handle)
void UnregisterItemSelect (XnCallbackHandle handle)
void UnregisterScroll (XnCallbackHandle handle)
void UnregisterValueChange (XnCallbackHandle handle)
void UnregisterOffAxisMovement (XnCallbackHandle handle)
void ItemHover (XnInt32 nItemIndex)
void ItemSelect (XnVDirection nDirection)
void Scroll (XnFloat fScrollValue)
void Reposition (const XnPoint3D &ptCenter)
void GetCenter (XnPoint3D &ptCenter) const
XnUInt32 GetItemCount () const
void SetItemCount (XnUInt32 nItems)
XnFloat GetBorderWidth () const
XnStatus SetBorderWidth (XnFloat fWidth)
XnFloat GetSliderSize () const
void SetSliderSize (XnFloat fSliderSize)
void SetValueChangeOnOffAxis (XnBool bReport)
XnBool GetValueChangeOnOffAxis () const
void SetHysteresisRatio (XnFloat fRatio)
XnFloat GetHysteresisRatio () const

Static Public Attributes

static const XnFloat ms_fDefaultPrimarySliderSize

Protected Member Functions

XnFloat GetFirstValue () const
XnFloat GetLeftScrollRegionEnd () const
XnFloat GetRightScrollRegionEnd () const
void PointCreated (const XnPoint3D &ptPos)
void PointDeleted (XnBool bReason)
void PointMoved (const XnPoint3D &ptPos, XnFloat fTime)
void SetFirstValue (XnFloat fValue)
void InternalCreateSlider (XnBool bPrimaryAxis, XnVAxis eAxis, const XnPoint3D &ptInitialPoint, XnFloat fInitialValue)
void ValueChange (XnFloat fValue)
void OffAxisMovement (XnVDirection dir)
void PrimarySlider_OffAxisMovement (XnVDirection eDir)
void SecondarySlider_OffAxisMovement (XnVDirection eDir)
void UpdatePrimarySlider (XnFloat fVal)
void UpdateSecondarySlider (XnFloat fVal)
void OffAxisHysteresis_ItemSelected (XnInt32 nItem)

Static Protected Member Functions

static void XN_CALLBACK_TYPE PrimarySlider_OffAxisMovement (XnVDirection eDir, void *pContext)
static void XN_CALLBACK_TYPE PrimarySlider_ValueChange (XnFloat fValue, void *pContext)
static void XN_CALLBACK_TYPE SecondarySlider_OffAxisMovement (XnVDirection eDir, void *pContext)
static void XN_CALLBACK_TYPE SecondarySlider_ValueChange (XnFloat fValue, void *pContext)
static void XN_CALLBACK_TYPE Hysteresis_ItemSelected (XnInt32 nItem, void *pContext)
static void XN_CALLBACK_TYPE OffAxisHysteresis_ItemSelected (XnInt32 nItem, void *pContext)
static void XN_CALLBACK_TYPE Scroller_Scrolled (XnFloat fScrollValue, void *pContext)

Protected Attributes

XnVMultiItemHysteresis1Dm_pHysteresis
XnVMultiItemHysteresis1Dm_pOffAxisHysteresis
XnVBorderScrollController1D * m_pScroller
XnBool m_bPositioned
XnBool m_bRecenter
XnBool m_bValueChangeOnOffAxis
XnVSlider1Dm_pSlider
XnVSlider1Dm_pPrimarySlider
XnVSlider1Dm_pSecondarySlider
XnUInt32 m_nOffAxisHandle
XnUInt32 m_nValueChangeHandle
XnFloat m_fPrimarySliderSize
XnFloat m_fPrimarySliderValueAtChange
XnFloat m_fFirstValue
XnBool m_bFirstPointCreated
XnVAxis m_ePrimaryAxisDirection
XnUInt32 m_nItemCount
XnInt32 m_nLastHover
XnPoint3D m_ptCenter
XnCallbackHandle m_hPrimaryHysteresisItemSelect
XnCallbackHandle m_hSecondaryHysteresisItemSelect
XnCallbackHandle m_hScrollerScroll
XnCallbackHandle m_hPrimarySliderOffAxis
XnCallbackHandle m_hPrimarySliderValueChange
XnCallbackHandle m_hSecondarySliderOffAxis
XnCallbackHandle m_hSecondarySliderValueChange
XnVIntSpecificEvent * m_pItemHoverCBs
XnVIntDirectionSpecificEvent * m_pItemSelectCBs
XnVFloatSpecificEvent * m_pScrollCBs
XnVFloatSpecificEvent * m_pValueChangeCBs
XnVDirectionSpecificEvent * m_pOffAxisMovementCBs

Static Protected Attributes

static const XnFloat ms_fSecondarySliderSize

Detailed Description

A Selectable slider is a 1D slider (along any of the x, y or axes) with a number of cells and borders, where the items can be selected by moving off axis.

Item 0 is the leftmost when using AXIS_X, bottommost when using AXIS_Y and closest to the sensor when using AXIS_Z.

Definition at line 29 of file XnVSelectableSlider1D.h.


Member Typedef Documentation

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider1D::ItemHoverCB)(XnInt32 nItemIndex, void *pUserCxt)

Type for hover event callback. Receives the index of the hovered item

Definition at line 36 of file XnVSelectableSlider1D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider1D::ItemSelectCB)(XnInt32 nItemIndex, XnVDirection nDirection, void *pUserCxt)

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

Definition at line 40 of file XnVSelectableSlider1D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider1D::OffAxisMovementCB)(XnVDirection dir, void *pUserCxt)

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

Definition at line 54 of file XnVSelectableSlider1D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider1D::ScrollCB)(XnFloat fScrollValue, void *pUserCxt)

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

Definition at line 45 of file XnVSelectableSlider1D.h.

typedef void(XN_CALLBACK_TYPE * XnVSelectableSlider1D::ValueChangeCB)(XnFloat fValue, void *pUserCxt)

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

Definition at line 50 of file XnVSelectableSlider1D.h.


Constructor & Destructor Documentation

XnVSelectableSlider1D::XnVSelectableSlider1D ( XnInt32  nCount,
XnFloat  fBorderWidth = 0,
XnVAxis  eAxis = AXIS_X,
XnBool  bRecenter = TRUE,
XnFloat  fHysteresisRatio = XnVMultiItemHysteresis1D::ms_fDefaultHysteresisRatio,
XnFloat  fPrimarySliderSize = ms_fDefaultPrimarySliderSize,
XnFloat  fFirstValue = 0.5,
const XnChar *  strName = "XnVSelectableSlider1D" 
)

Creation. Gets the number of items in the slider, the width of the border (on either side), its axis, and more.

Parameters:
[in]nCountNumber of items in the slider
[in]fBorderWidthSize reserved from the slider for scrolling
[in]eAxisThe axis in which the slider works
[in]bRecenterUse point of local activation as center (FALSE for the focus point)
[in]fHysteresisRatioAdditional size (from either side) it takes to exit a specific item.
[in]fPrimarySliderSizeSize of the slider (in mm)
[in]fFirstValueInitial value when switching to the slider
[in]strNameName of the control, for log purposes.
XnVSelectableSlider1D::~XnVSelectableSlider1D ( )

Member Function Documentation

XnFloat XnVSelectableSlider1D::GetBorderWidth ( ) const

Get the current border width

Returns:
Current border width
void XnVSelectableSlider1D::GetCenter ( XnPoint3D &  ptCenter) const
XnFloat XnVSelectableSlider1D::GetFirstValue ( ) const [protected]
XnFloat XnVSelectableSlider1D::GetHysteresisRatio ( ) const

Get current hysteresis ratio

Returns:
Current hysteresis ratio
XnUInt32 XnVSelectableSlider1D::GetItemCount ( ) const

Get the current number of items

Returns:
The number of items
XnFloat XnVSelectableSlider1D::GetLeftScrollRegionEnd ( ) const [protected]
XnFloat XnVSelectableSlider1D::GetRightScrollRegionEnd ( ) const [protected]
XnFloat XnVSelectableSlider1D::GetSliderSize ( ) const

Get the size of the slider

Returns:
current size of the slider
XnBool XnVSelectableSlider1D::GetValueChangeOnOffAxis ( ) const

Get current behavior

static void XN_CALLBACK_TYPE XnVSelectableSlider1D::Hysteresis_ItemSelected ( XnInt32  nItem,
void *  pContext 
) [static, protected]
void XnVSelectableSlider1D::InternalCreateSlider ( XnBool  bPrimaryAxis,
XnVAxis  eAxis,
const XnPoint3D &  ptInitialPoint,
XnFloat  fInitialValue 
) [protected]
void XnVSelectableSlider1D::ItemHover ( XnInt32  nItemIndex)

Invoke the hover event

Parameters:
[in]nItemIndexThe item that is hover
void XnVSelectableSlider1D::ItemSelect ( XnVDirection  nDirection)

Invoke the selection event

Parameters:
[in]nDirectionThe direction of the selection
static void XN_CALLBACK_TYPE XnVSelectableSlider1D::OffAxisHysteresis_ItemSelected ( XnInt32  nItem,
void *  pContext 
) [static, protected]
void XnVSelectableSlider1D::OffAxisHysteresis_ItemSelected ( XnInt32  nItem) [protected]
void XnVSelectableSlider1D::OffAxisMovement ( XnVDirection  dir) [protected]
void XnVSelectableSlider1D::OnPrimaryPointCreate ( const XnVHandPointContext pContext,
const XnPoint3D &  ptFocus 
) [virtual]

Called when a 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 XnVSelectableSlider1D::OnPrimaryPointDestroy ( XnUInt32  nID) [virtual]

Called when the primary point is destroyed.

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

Reimplemented from XnVPointControl.

void XnVSelectableSlider1D::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 XnVSelectableSlider1D::PointCreated ( const XnPoint3D &  ptPos) [protected]
void XnVSelectableSlider1D::PointDeleted ( XnBool  bReason) [protected]
void XnVSelectableSlider1D::PointMoved ( const XnPoint3D &  ptPos,
XnFloat  fTime 
) [protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider1D::PrimarySlider_OffAxisMovement ( XnVDirection  eDir,
void *  pContext 
) [static, protected]
void XnVSelectableSlider1D::PrimarySlider_OffAxisMovement ( XnVDirection  eDir) [protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider1D::PrimarySlider_ValueChange ( XnFloat  fValue,
void *  pContext 
) [static, protected]
XnCallbackHandle XnVSelectableSlider1D::RegisterItemHover ( void *  cxt,
ItemHoverCB  pCB 
)

Register for the hover event

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

Register for the selection event

Parameters:
[in]cxtUser's context
[in]pCBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
XnCallbackHandle XnVSelectableSlider1D::RegisterOffAxisMovement ( void *  cxt,
OffAxisMovementCB  pCB 
)

Register for the off-axis event

Parameters:
[in]cxtUser's context
[in]pCBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
XnCallbackHandle XnVSelectableSlider1D::RegisterScroll ( void *  cxt,
ScrollCB  pCB 
)

Register for the scroll event

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

Register for the value change event

Parameters:
[in]cxtUser's context
[in]pCBThe Callback to call when the event is invoked.
Returns:
A handle, to allow unregistration.
void XnVSelectableSlider1D::Reposition ( const XnPoint3D &  ptCenter)

Reposition the slider

Parameters:
[in]ptCenterThe new center point for the slider.
void XnVSelectableSlider1D::Scroll ( XnFloat  fScrollValue)

Invoke the scroll event

Parameters:
[in]fScrollValueThe current scroll value
static void XN_CALLBACK_TYPE XnVSelectableSlider1D::Scroller_Scrolled ( XnFloat  fScrollValue,
void *  pContext 
) [static, protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider1D::SecondarySlider_OffAxisMovement ( XnVDirection  eDir,
void *  pContext 
) [static, protected]
void XnVSelectableSlider1D::SecondarySlider_OffAxisMovement ( XnVDirection  eDir) [protected]
static void XN_CALLBACK_TYPE XnVSelectableSlider1D::SecondarySlider_ValueChange ( XnFloat  fValue,
void *  pContext 
) [static, protected]
XnStatus XnVSelectableSlider1D::SetBorderWidth ( XnFloat  fWidth)

Change the border width

Parameters:
[in]fWidthNew border width
void XnVSelectableSlider1D::SetFirstValue ( XnFloat  fValue) [protected]
void XnVSelectableSlider1D::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 XnVSelectableSlider1D::SetItemCount ( XnUInt32  nItems)

Change the number of items

Parameters:
[in]nItemsThe new number of items
void XnVSelectableSlider1D::SetSliderSize ( XnFloat  fSliderSize)

Change the size of the slider

Parameters:
[in]fSliderSizeThe new size of the slider
void XnVSelectableSlider1D::SetValueChangeOnOffAxis ( XnBool  bReport)

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

Parameters:
[in]bReportNew mode. default is off
void XnVSelectableSlider1D::UnregisterItemHover ( XnCallbackHandle  handle)

Unregister from the hover event

Parameters:
[in]handleThe handle provided on registration.
void XnVSelectableSlider1D::UnregisterItemSelect ( XnCallbackHandle  handle)

Unregister from the selection event

Parameters:
[in]handleThe handle provided on registration.
void XnVSelectableSlider1D::UnregisterOffAxisMovement ( XnCallbackHandle  handle)

Unregister from the off-axis event

Parameters:
[in]handleThe handle provided on registration.
void XnVSelectableSlider1D::UnregisterScroll ( XnCallbackHandle  handle)

Unregister from the scroll event

Parameters:
[in]handleThe handle provided on registration.
void XnVSelectableSlider1D::UnregisterValueChange ( XnCallbackHandle  handle)

Unregister from the value change event

Parameters:
[in]handleThe handle provided on registration.
void XnVSelectableSlider1D::UpdatePrimarySlider ( XnFloat  fVal) [protected]
void XnVSelectableSlider1D::UpdateSecondarySlider ( XnFloat  fVal) [protected]
void XnVSelectableSlider1D::ValueChange ( XnFloat  fValue) [protected]

Member Data Documentation

Definition at line 322 of file XnVSelectableSlider1D.h.

Definition at line 305 of file XnVSelectableSlider1D.h.

Definition at line 306 of file XnVSelectableSlider1D.h.

Definition at line 308 of file XnVSelectableSlider1D.h.

Definition at line 321 of file XnVSelectableSlider1D.h.

Definition at line 318 of file XnVSelectableSlider1D.h.

Definition at line 319 of file XnVSelectableSlider1D.h.

Definition at line 331 of file XnVSelectableSlider1D.h.

XnCallbackHandle XnVSelectableSlider1D::m_hPrimarySliderOffAxis [protected]

Definition at line 335 of file XnVSelectableSlider1D.h.

Definition at line 336 of file XnVSelectableSlider1D.h.

XnCallbackHandle XnVSelectableSlider1D::m_hScrollerScroll [protected]

Definition at line 333 of file XnVSelectableSlider1D.h.

Definition at line 332 of file XnVSelectableSlider1D.h.

Definition at line 337 of file XnVSelectableSlider1D.h.

Definition at line 338 of file XnVSelectableSlider1D.h.

Definition at line 325 of file XnVSelectableSlider1D.h.

Definition at line 327 of file XnVSelectableSlider1D.h.

Definition at line 315 of file XnVSelectableSlider1D.h.

Definition at line 316 of file XnVSelectableSlider1D.h.

XnVIntSpecificEvent* XnVSelectableSlider1D::m_pItemHoverCBs [protected]

Definition at line 340 of file XnVSelectableSlider1D.h.

XnVIntDirectionSpecificEvent* XnVSelectableSlider1D::m_pItemSelectCBs [protected]

Definition at line 341 of file XnVSelectableSlider1D.h.

XnVDirectionSpecificEvent* XnVSelectableSlider1D::m_pOffAxisMovementCBs [protected]

Definition at line 344 of file XnVSelectableSlider1D.h.

XnVFloatSpecificEvent* XnVSelectableSlider1D::m_pScrollCBs [protected]

Definition at line 342 of file XnVSelectableSlider1D.h.

XnVBorderScrollController1D* XnVSelectableSlider1D::m_pScroller [protected]

Definition at line 303 of file XnVSelectableSlider1D.h.

Definition at line 310 of file XnVSelectableSlider1D.h.

XnPoint3D XnVSelectableSlider1D::m_ptCenter [protected]

Definition at line 329 of file XnVSelectableSlider1D.h.

XnVFloatSpecificEvent* XnVSelectableSlider1D::m_pValueChangeCBs [protected]

Definition at line 343 of file XnVSelectableSlider1D.h.

Definition at line 98 of file XnVSelectableSlider1D.h.

const XnFloat XnVSelectableSlider1D::ms_fSecondarySliderSize [static, protected]

Definition at line 299 of file XnVSelectableSlider1D.h.


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