NITE 1.5.1 - API Reference

XnVMultiItemHysteresis1D Class Reference

#include <XnVMultiItemHysteresis1D.h>

List of all members.

Public Types

typedef void(XN_CALLBACK_TYPE * ItemSelectedCB )(XnInt32 ItemIndex, void *pUserCxt)

Public Member Functions

 XnVMultiItemHysteresis1D (XnInt32 nItemCount, XnFloat fBorderWidth=0, XnFloat fHysteresisRatio=ms_fDefaultHysteresisRatio)
 ~XnVMultiItemHysteresis1D ()
XnStatus Update (XnFloat Value)
void LostPoint ()
void ItemSelect (XnInt32 nItemIndex)
XnCallbackHandle RegisterItemSelect (void *cxt, ItemSelectedCB pCB)
void UnregisterItemSelect (XnCallbackHandle handle)
XnFloat GetBorderWidth () const
XnStatus SetBorderWidth (XnFloat fWidth)
XnUInt32 GetItemCount () const
void SetItemCount (XnUInt32 nCount)
XnFloat GetMinValue () const
XnFloat GetMaxValue () const
XnFloat GetHysteresisRatio () const
void SetHysteresisRatio (XnFloat fRatio)

Static Public Attributes

static const XnFloat ms_fDefaultHysteresisRatio

Protected Member Functions

void CalculateMinAndMax ()
bool IsValueInRange (XnFloat Value)

Protected Attributes

XnUInt32 m_nItemCount
XnFloat m_fMinValue
XnFloat m_fMaxValue
XnInt32 m_nLastSelectedIndex
XnFloat m_fBorderWidth
XnFloat m_fHysteresisRatio
XnVIntSpecificEvent * m_pItemSelectCBs

Detailed Description

The multi item hysteresis is initialized with a number of items, and sends a select event when moving between them. On update it gets a number between 0 and 1, and sees which cell that translates into. Selection here means being over the item. The XnVMultiItemHysteresis1D defines one events:

  • An item was selected

A hysteresis ratio is used to 'enlarge' the current item.

Definition at line 25 of file XnVMultiItemHysteresis1D.h.

Member Typedef Documentation

typedef void(XN_CALLBACK_TYPE * XnVMultiItemHysteresis1D::ItemSelectedCB)(XnInt32 ItemIndex, void *pUserCxt)

Type for the selection event callback

Definition at line 31 of file XnVMultiItemHysteresis1D.h.

Constructor & Destructor Documentation

XnVMultiItemHysteresis1D::XnVMultiItemHysteresis1D ( XnInt32  nItemCount,
XnFloat  fBorderWidth = 0,
XnFloat  fHysteresisRatio = ms_fDefaultHysteresisRatio 


[in]nItemCountNumber of items
[in]fBorderWidthSize to disregard from either side
[in]fHysteresisRatioAdditional size (from either side) it takes to exit a specific item.
XnVMultiItemHysteresis1D::~XnVMultiItemHysteresis1D ( )

Member Function Documentation

void XnVMultiItemHysteresis1D::CalculateMinAndMax ( ) [protected]
XnFloat XnVMultiItemHysteresis1D::GetBorderWidth ( ) const

Get the border width - the space on either side that isn't part of any item.

The current border width
XnFloat XnVMultiItemHysteresis1D::GetHysteresisRatio ( ) const

Get the ratio for an item selection to change.

The ratio
XnUInt32 XnVMultiItemHysteresis1D::GetItemCount ( ) const

Get the current number of items.

The current number of items
XnFloat XnVMultiItemHysteresis1D::GetMaxValue ( ) const

Get the maximal value the hysteresis expects.

The maximal value
XnFloat XnVMultiItemHysteresis1D::GetMinValue ( ) const

Get the minimal value the hysteresis expects.

The minimal value
bool XnVMultiItemHysteresis1D::IsValueInRange ( XnFloat  Value) [protected]
void XnVMultiItemHysteresis1D::ItemSelect ( XnInt32  nItemIndex)

Invoke the selection event

[in]nItemIndexThe item that is selected
void XnVMultiItemHysteresis1D::LostPoint ( )

Lose the point. Clear internal buffer.

XnCallbackHandle XnVMultiItemHysteresis1D::RegisterItemSelect ( void *  cxt,
ItemSelectedCB  pCB 

Register for the selection event

[in]cxtUser's context
[in]pCBThe Callback to call when the event is invoked.
A handle, to allow unregistration.
XnStatus XnVMultiItemHysteresis1D::SetBorderWidth ( XnFloat  fWidth)

Change the border width

[in]fWidthThe new border width
void XnVMultiItemHysteresis1D::SetHysteresisRatio ( XnFloat  fRatio)

Change the hysteresis ratio

[in]fRatioNew hysteresis ratio
void XnVMultiItemHysteresis1D::SetItemCount ( XnUInt32  nCount)

Change the current number of items

[in]nCountNew number of items
void XnVMultiItemHysteresis1D::UnregisterItemSelect ( XnCallbackHandle  handle)

Unregister from the selection event

[in]handleThe handle provided on registration.
XnStatus XnVMultiItemHysteresis1D::Update ( XnFloat  Value)

Update a value between 0 and 1, which will be translated into an index of the current cell.

Member Data Documentation

Definition at line 141 of file XnVMultiItemHysteresis1D.h.

Definition at line 142 of file XnVMultiItemHysteresis1D.h.

Definition at line 137 of file XnVMultiItemHysteresis1D.h.

Definition at line 136 of file XnVMultiItemHysteresis1D.h.

Definition at line 135 of file XnVMultiItemHysteresis1D.h.

Definition at line 139 of file XnVMultiItemHysteresis1D.h.

XnVIntSpecificEvent* XnVMultiItemHysteresis1D::m_pItemSelectCBs [protected]

Definition at line 144 of file XnVMultiItemHysteresis1D.h.

Definition at line 129 of file XnVMultiItemHysteresis1D.h.

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