NITE 1.5.1 - API Reference

XnVMultiItemHysteresis2D Class Reference

#include <XnVMultiItemHysteresis2D.h>

List of all members.

Public Types

typedef void(XN_CALLBACK_TYPE * ItemSelectCB )(XnInt32 ItemXIndex, XnInt32 ItemYIndex, void *pUserCxt)

Public Member Functions

 XnVMultiItemHysteresis2D (XnInt32 nItemXCount, XnInt32 nItemYCount, XnFloat fBorderWidth=0, XnFloat fHysteresisRatio=ms_fDefaultHysteresisRatio)
 ~XnVMultiItemHysteresis2D ()
XnStatus Update (XnFloat fXValue, XnFloat fYValue)
void LostPoint ()
void ItemSelected (XnInt32 nItemXIndex, XnInt32 nItemYIndex)
XnCallbackHandle RegisterItemSelect (void *cxt, ItemSelectCB pCB)
void UnregisterItemSelect (XnCallbackHandle handle)
XnUInt32 GetItemXCount () const
void SetItemXCount (XnUInt32 nItemXCount)
XnUInt32 GetItemYCount () const
void SetItemYCount (XnUInt32 nItemYCount)
void SetItemCount (XnUInt32 nItemXCount, XnUInt32 nItemYCount)
XnFloat GetMinXValue () const
XnFloat GetMinYValue () const
XnFloat GetMaxYValue () const
XnFloat GetMaxXValue () const
XnFloat GetBorderWidth () const
XnStatus SetBorderWidth (XnFloat fWidth)
XnFloat GetHysteresisRatio () const
void SetHysteresisRatio (XnFloat fRatio)

Static Public Attributes

static const XnFloat ms_fDefaultHysteresisRatio

Protected Member Functions

void CalculateMinAndMax ()
XnBool IsValueInRange (XnFloat fXValue, XnFloat fYValue)

Protected Attributes

XnUInt32 m_nItemXCount
XnUInt32 m_nItemYCount
XnFloat m_fMinXValue
XnFloat m_fMaxXValue
XnFloat m_fMinYValue
XnFloat m_fMaxYValue
XnInt32 m_nLastSelectedXIndex
XnInt32 m_nLastSelectedYIndex
XnFloat m_fBorderWidth
XnFloat m_fHysteresisRatio
XnVIntIntSpecificEvent * m_pItemSelectCBs

Detailed Description

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

  • An item was selected

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

Definition at line 28 of file XnVMultiItemHysteresis2D.h.


Member Typedef Documentation

typedef void(XN_CALLBACK_TYPE * XnVMultiItemHysteresis2D::ItemSelectCB)(XnInt32 ItemXIndex, XnInt32 ItemYIndex, void *pUserCxt)

Type for the selection event callback

Definition at line 34 of file XnVMultiItemHysteresis2D.h.


Constructor & Destructor Documentation

XnVMultiItemHysteresis2D::XnVMultiItemHysteresis2D ( XnInt32  nItemXCount,
XnInt32  nItemYCount,
XnFloat  fBorderWidth = 0,
XnFloat  fHysteresisRatio = ms_fDefaultHysteresisRatio 
)

Constructor

Parameters:
[in]nItemXCountHorizontal items
[in]nItemYCountVertical items
[in]fBorderWidthSize from all sides to disregard
[in]fHysteresisRatioAdditional size (from any side) it takes to exit a specific item.
XnVMultiItemHysteresis2D::~XnVMultiItemHysteresis2D ( )

Member Function Documentation

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

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

Returns:
The current border width
XnFloat XnVMultiItemHysteresis2D::GetHysteresisRatio ( ) const

Get the ratio for an item selection to change.

Returns:
The ratio
XnUInt32 XnVMultiItemHysteresis2D::GetItemXCount ( ) const

Get the current number of item rows

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

Get the current number of item columns

Returns:
The current number of columns
XnFloat XnVMultiItemHysteresis2D::GetMaxXValue ( ) const

Get the maximal value the hysteresis expects in the Y-coordinate

Returns:
The maximal value
XnFloat XnVMultiItemHysteresis2D::GetMaxYValue ( ) const

Get the maximal value the hysteresis expects in the X-coordinate

Returns:
The maximal value
XnFloat XnVMultiItemHysteresis2D::GetMinXValue ( ) const

Get the minimal value the hysteresis expects in the X-coordinate

Returns:
The minimal value
XnFloat XnVMultiItemHysteresis2D::GetMinYValue ( ) const

Get the minimal value the hysteresis expects in the Y-coordinate

Returns:
The minimal value
XnBool XnVMultiItemHysteresis2D::IsValueInRange ( XnFloat  fXValue,
XnFloat  fYValue 
) [protected]
void XnVMultiItemHysteresis2D::ItemSelected ( XnInt32  nItemXIndex,
XnInt32  nItemYIndex 
)

Invoke the selection event

Parameters:
[in]nItemXIndexThe X-coordinate of the item that is selected
[in]nItemYIndexThe Y-coordinate of the item that is selected
void XnVMultiItemHysteresis2D::LostPoint ( )

Lose the point. Clear internal buffer.

XnCallbackHandle XnVMultiItemHysteresis2D::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.
XnStatus XnVMultiItemHysteresis2D::SetBorderWidth ( XnFloat  fWidth)

Change the border width

Parameters:
[in]fWidthThe new border width
void XnVMultiItemHysteresis2D::SetHysteresisRatio ( XnFloat  fRatio)
void XnVMultiItemHysteresis2D::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 XnVMultiItemHysteresis2D::SetItemXCount ( XnUInt32  nItemXCount)

Change the current number of items rows

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

Change the current number of items columns

Parameters:
[in]nItemYCountNew number of columns
void XnVMultiItemHysteresis2D::UnregisterItemSelect ( XnCallbackHandle  handle)

Unregister from the selection event

Parameters:
[in]handleThe handle provided on registration.
XnStatus XnVMultiItemHysteresis2D::Update ( XnFloat  fXValue,
XnFloat  fYValue 
)

Update a value between 0 and 1 for each axis, which will be translated into an indices of the current cell.


Member Data Documentation

Definition at line 179 of file XnVMultiItemHysteresis2D.h.

Definition at line 181 of file XnVMultiItemHysteresis2D.h.

Definition at line 173 of file XnVMultiItemHysteresis2D.h.

Definition at line 174 of file XnVMultiItemHysteresis2D.h.

Definition at line 173 of file XnVMultiItemHysteresis2D.h.

Definition at line 174 of file XnVMultiItemHysteresis2D.h.

Definition at line 170 of file XnVMultiItemHysteresis2D.h.

Definition at line 171 of file XnVMultiItemHysteresis2D.h.

Definition at line 176 of file XnVMultiItemHysteresis2D.h.

Definition at line 177 of file XnVMultiItemHysteresis2D.h.

XnVIntIntSpecificEvent* XnVMultiItemHysteresis2D::m_pItemSelectCBs [protected]

Definition at line 183 of file XnVMultiItemHysteresis2D.h.

Definition at line 164 of file XnVMultiItemHysteresis2D.h.


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