#include <XnVSelectableSlider1D.h>
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 | |
XnVMultiItemHysteresis1D * | m_pHysteresis |
XnVMultiItemHysteresis1D * | m_pOffAxisHysteresis |
XnVBorderScrollController1D * | m_pScroller |
XnBool | m_bPositioned |
XnBool | m_bRecenter |
XnBool | m_bValueChangeOnOffAxis |
XnVSlider1D * | m_pSlider |
XnVSlider1D * | m_pPrimarySlider |
XnVSlider1D * | m_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_ItemHoverCBs |
XnVIntDirectionSpecificEvent | m_ItemSelectCBs |
XnVFloatSpecificEvent | m_ScrollCBs |
XnVFloatSpecificEvent | m_ValueChangeCBs |
XnVDirectionSpecificEvent | m_OffAxisMovementCBs |
Static Protected Attributes | |
static const XnFloat | ms_fSecondarySliderSize |
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 24 of file XnVSelectableSlider1D.h.
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 31 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 35 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 49 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 40 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 45 of file XnVSelectableSlider1D.h.
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.
[in] | nCount | Number of items in the slider |
[in] | fBorderWidth | Size reserved from the slider for scrolling |
[in] | eAxis | The axis in which the slider works |
[in] | bRecenter | Use point of local activation as center (FALSE for the focus point) |
[in] | fHysteresisRatio | Additional size (from either side) it takes to exit a specific item. |
[in] | fPrimarySliderSize | Size of the slider (in mm) |
[in] | fFirstValue | Initial value when switching to the slider |
[in] | strName | Name of the control, for log purposes. |
XnVSelectableSlider1D::~XnVSelectableSlider1D | ( | ) |
XnFloat XnVSelectableSlider1D::GetBorderWidth | ( | ) | const |
Get the current border width
void XnVSelectableSlider1D::GetCenter | ( | XnPoint3D & | ptCenter | ) | const |
XnFloat XnVSelectableSlider1D::GetFirstValue | ( | ) | const [protected] |
XnFloat XnVSelectableSlider1D::GetHysteresisRatio | ( | ) | const |
Get current hysteresis ratio
XnUInt32 XnVSelectableSlider1D::GetItemCount | ( | ) | const |
Get the current number of items
XnFloat XnVSelectableSlider1D::GetLeftScrollRegionEnd | ( | ) | const [protected] |
XnFloat XnVSelectableSlider1D::GetRightScrollRegionEnd | ( | ) | const [protected] |
XnFloat XnVSelectableSlider1D::GetSliderSize | ( | ) | const |
Get the 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
[in] | nItemIndex | The item that is hover |
void XnVSelectableSlider1D::ItemSelect | ( | XnVDirection | nDirection | ) |
Invoke the selection event
[in] | nDirection | The 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.
[in] | pContext | The hand context of the newly created primary point |
[in] | ptFocus | The point in which the session has started. |
Reimplemented from XnVPointControl.
void XnVSelectableSlider1D::OnPrimaryPointDestroy | ( | XnUInt32 | nID | ) | [virtual] |
Called when the primary point is destroyed.
[in] | nID | the 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.
[in] | pContext | The 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
[in] | cxt | User's context |
[in] | pCB | The Callback to call when the event is invoked. |
XnCallbackHandle XnVSelectableSlider1D::RegisterItemSelect | ( | void * | cxt, | |
ItemSelectCB | pCB | |||
) |
Register for the selection event
[in] | cxt | User's context |
[in] | pCB | The Callback to call when the event is invoked. |
XnCallbackHandle XnVSelectableSlider1D::RegisterOffAxisMovement | ( | void * | cxt, | |
OffAxisMovementCB | pCB | |||
) |
Register for the off-axis event
[in] | cxt | User's context |
[in] | pCB | The Callback to call when the event is invoked. |
XnCallbackHandle XnVSelectableSlider1D::RegisterScroll | ( | void * | cxt, | |
ScrollCB | pCB | |||
) |
Register for the scroll event
[in] | cxt | User's context |
[in] | pCB | The Callback to call when the event is invoked. |
XnCallbackHandle XnVSelectableSlider1D::RegisterValueChange | ( | void * | cxt, | |
ValueChangeCB | pCB | |||
) |
Register for the value change event
[in] | cxt | User's context |
[in] | pCB | The Callback to call when the event is invoked. |
void XnVSelectableSlider1D::Reposition | ( | const XnPoint3D & | ptCenter | ) |
Reposition the slider
[in] | ptCenter | The new center point for the slider. |
void XnVSelectableSlider1D::Scroll | ( | XnFloat | fScrollValue | ) |
Invoke the scroll event
[in] | fScrollValue | The 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
[in] | fWidth | New 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.
[in] | fRatio | The new hysteresis ratio. 0 means no ratio, 0.5 means additional half width |
void XnVSelectableSlider1D::SetItemCount | ( | XnUInt32 | nItems | ) |
Change the number of items
[in] | nItems | The new number of items |
void XnVSelectableSlider1D::SetSliderSize | ( | XnFloat | fSliderSize | ) |
Change the size of the slider
[in] | fSliderSize | The new size of the slider |
void XnVSelectableSlider1D::SetValueChangeOnOffAxis | ( | XnBool | bReport | ) |
Change behavior: Should the SelectableSlider keep sending ValueChange events when checking OffAxis
[in] | bReport | New mode. default is off |
void XnVSelectableSlider1D::UnregisterItemHover | ( | XnCallbackHandle | handle | ) |
Unregister from the hover event
[in] | handle | The handle provided on registration. |
void XnVSelectableSlider1D::UnregisterItemSelect | ( | XnCallbackHandle | handle | ) |
Unregister from the selection event
[in] | handle | The handle provided on registration. |
void XnVSelectableSlider1D::UnregisterOffAxisMovement | ( | XnCallbackHandle | handle | ) |
Unregister from the off-axis event
[in] | handle | The handle provided on registration. |
void XnVSelectableSlider1D::UnregisterScroll | ( | XnCallbackHandle | handle | ) |
Unregister from the scroll event
[in] | handle | The handle provided on registration. |
void XnVSelectableSlider1D::UnregisterValueChange | ( | XnCallbackHandle | handle | ) |
Unregister from the value change event
[in] | handle | The handle provided on registration. |
void XnVSelectableSlider1D::UpdatePrimarySlider | ( | XnFloat | fVal | ) | [protected] |
void XnVSelectableSlider1D::UpdateSecondarySlider | ( | XnFloat | fVal | ) | [protected] |
void XnVSelectableSlider1D::ValueChange | ( | XnFloat | fValue | ) | [protected] |
XnBool XnVSelectableSlider1D::m_bFirstPointCreated [protected] |
Definition at line 317 of file XnVSelectableSlider1D.h.
XnBool XnVSelectableSlider1D::m_bPositioned [protected] |
Definition at line 300 of file XnVSelectableSlider1D.h.
XnBool XnVSelectableSlider1D::m_bRecenter [protected] |
Definition at line 301 of file XnVSelectableSlider1D.h.
XnBool XnVSelectableSlider1D::m_bValueChangeOnOffAxis [protected] |
Definition at line 303 of file XnVSelectableSlider1D.h.
Definition at line 319 of file XnVSelectableSlider1D.h.
XnFloat XnVSelectableSlider1D::m_fFirstValue [protected] |
Definition at line 316 of file XnVSelectableSlider1D.h.
XnFloat XnVSelectableSlider1D::m_fPrimarySliderSize [protected] |
Definition at line 313 of file XnVSelectableSlider1D.h.
XnFloat XnVSelectableSlider1D::m_fPrimarySliderValueAtChange [protected] |
Definition at line 314 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hPrimaryHysteresisItemSelect [protected] |
Definition at line 326 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hPrimarySliderOffAxis [protected] |
Definition at line 330 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hPrimarySliderValueChange [protected] |
Definition at line 331 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hScrollerScroll [protected] |
Definition at line 328 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hSecondaryHysteresisItemSelect [protected] |
Definition at line 327 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hSecondarySliderOffAxis [protected] |
Definition at line 332 of file XnVSelectableSlider1D.h.
XnCallbackHandle XnVSelectableSlider1D::m_hSecondarySliderValueChange [protected] |
Definition at line 333 of file XnVSelectableSlider1D.h.
XnVIntSpecificEvent XnVSelectableSlider1D::m_ItemHoverCBs [protected] |
Definition at line 335 of file XnVSelectableSlider1D.h.
XnVIntDirectionSpecificEvent XnVSelectableSlider1D::m_ItemSelectCBs [protected] |
Definition at line 336 of file XnVSelectableSlider1D.h.
XnUInt32 XnVSelectableSlider1D::m_nItemCount [protected] |
Definition at line 320 of file XnVSelectableSlider1D.h.
XnInt32 XnVSelectableSlider1D::m_nLastHover [protected] |
Definition at line 322 of file XnVSelectableSlider1D.h.
XnUInt32 XnVSelectableSlider1D::m_nOffAxisHandle [protected] |
Definition at line 310 of file XnVSelectableSlider1D.h.
XnUInt32 XnVSelectableSlider1D::m_nValueChangeHandle [protected] |
Definition at line 311 of file XnVSelectableSlider1D.h.
XnVDirectionSpecificEvent XnVSelectableSlider1D::m_OffAxisMovementCBs [protected] |
Definition at line 338 of file XnVSelectableSlider1D.h.
Definition at line 296 of file XnVSelectableSlider1D.h.
Definition at line 297 of file XnVSelectableSlider1D.h.
XnVSlider1D* XnVSelectableSlider1D::m_pPrimarySlider [protected] |
Definition at line 306 of file XnVSelectableSlider1D.h.
XnVBorderScrollController1D* XnVSelectableSlider1D::m_pScroller [protected] |
Definition at line 298 of file XnVSelectableSlider1D.h.
XnVSlider1D* XnVSelectableSlider1D::m_pSecondarySlider [protected] |
Definition at line 307 of file XnVSelectableSlider1D.h.
XnVSlider1D* XnVSelectableSlider1D::m_pSlider [protected] |
Definition at line 305 of file XnVSelectableSlider1D.h.
XnPoint3D XnVSelectableSlider1D::m_ptCenter [protected] |
Definition at line 324 of file XnVSelectableSlider1D.h.
XnVFloatSpecificEvent XnVSelectableSlider1D::m_ScrollCBs [protected] |
Definition at line 337 of file XnVSelectableSlider1D.h.
XnVFloatSpecificEvent XnVSelectableSlider1D::m_ValueChangeCBs [protected] |
Definition at line 337 of file XnVSelectableSlider1D.h.
const XnFloat XnVSelectableSlider1D::ms_fDefaultPrimarySliderSize [static] |
Definition at line 93 of file XnVSelectableSlider1D.h.
const XnFloat XnVSelectableSlider1D::ms_fSecondarySliderSize [static, protected] |
Definition at line 294 of file XnVSelectableSlider1D.h.