NITE 1.4.1 - API Reference
|
#include <XnVMultiItemHysteresis1D.h>
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_ItemSelectCBs |
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:
A hysteresis ratio is used to 'enlarge' the current item.
Definition at line 25 of file XnVMultiItemHysteresis1D.h.
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.
XnVMultiItemHysteresis1D::XnVMultiItemHysteresis1D | ( | XnInt32 | nItemCount, |
XnFloat | fBorderWidth = 0 , |
||
XnFloat | fHysteresisRatio = ms_fDefaultHysteresisRatio |
||
) |
Constructor
[in] | nItemCount | Number of items |
[in] | fBorderWidth | Size to disregard from either side |
[in] | fHysteresisRatio | Additional size (from either side) it takes to exit a specific item. |
XnVMultiItemHysteresis1D::~XnVMultiItemHysteresis1D | ( | ) |
void XnVMultiItemHysteresis1D::CalculateMinAndMax | ( | ) | [protected] |
XnFloat XnVMultiItemHysteresis1D::GetBorderWidth | ( | ) | const |
Get the border width - the space on either side that isn't part of any item.
XnFloat XnVMultiItemHysteresis1D::GetHysteresisRatio | ( | ) | const |
Get the ratio for an item selection to change.
XnUInt32 XnVMultiItemHysteresis1D::GetItemCount | ( | ) | const |
Get the current number of items.
XnFloat XnVMultiItemHysteresis1D::GetMaxValue | ( | ) | const |
Get the maximal value the hysteresis expects.
XnFloat XnVMultiItemHysteresis1D::GetMinValue | ( | ) | const |
Get the minimal value the hysteresis expects.
bool XnVMultiItemHysteresis1D::IsValueInRange | ( | XnFloat | Value | ) | [protected] |
void XnVMultiItemHysteresis1D::ItemSelect | ( | XnInt32 | nItemIndex | ) |
Invoke the selection event
[in] | nItemIndex | The 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] | cxt | User's context |
[in] | pCB | The Callback to call when the event is invoked. |
XnStatus XnVMultiItemHysteresis1D::SetBorderWidth | ( | XnFloat | fWidth | ) |
Change the border width
[in] | fWidth | The new border width |
void XnVMultiItemHysteresis1D::SetHysteresisRatio | ( | XnFloat | fRatio | ) |
Change the hysteresis ratio
[in] | fRatio | New hysteresis ratio |
void XnVMultiItemHysteresis1D::SetItemCount | ( | XnUInt32 | nCount | ) |
Change the current number of items
[in] | nCount | New number of items |
void XnVMultiItemHysteresis1D::UnregisterItemSelect | ( | XnCallbackHandle | handle | ) |
Unregister from the selection event
[in] | handle | The 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.
XnFloat XnVMultiItemHysteresis1D::m_fBorderWidth [protected] |
Definition at line 141 of file XnVMultiItemHysteresis1D.h.
XnFloat XnVMultiItemHysteresis1D::m_fHysteresisRatio [protected] |
Definition at line 142 of file XnVMultiItemHysteresis1D.h.
XnFloat XnVMultiItemHysteresis1D::m_fMaxValue [protected] |
Definition at line 137 of file XnVMultiItemHysteresis1D.h.
XnFloat XnVMultiItemHysteresis1D::m_fMinValue [protected] |
Definition at line 136 of file XnVMultiItemHysteresis1D.h.
XnVIntSpecificEvent XnVMultiItemHysteresis1D::m_ItemSelectCBs [protected] |
Definition at line 144 of file XnVMultiItemHysteresis1D.h.
XnUInt32 XnVMultiItemHysteresis1D::m_nItemCount [protected] |
Definition at line 135 of file XnVMultiItemHysteresis1D.h.
XnInt32 XnVMultiItemHysteresis1D::m_nLastSelectedIndex [protected] |
Definition at line 139 of file XnVMultiItemHysteresis1D.h.
const XnFloat XnVMultiItemHysteresis1D::ms_fDefaultHysteresisRatio [static] |
Definition at line 129 of file XnVMultiItemHysteresis1D.h.