|
NITE 1.5.1 - API Reference
|
#include <XnVMultiItemHysteresis2D.h>
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 |
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:
A hysteresis ratio is used to 'enlarge' the current item.
Definition at line 28 of file XnVMultiItemHysteresis2D.h.
| 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.
| XnVMultiItemHysteresis2D::XnVMultiItemHysteresis2D | ( | XnInt32 | nItemXCount, |
| XnInt32 | nItemYCount, | ||
| XnFloat | fBorderWidth = 0, |
||
| XnFloat | fHysteresisRatio = ms_fDefaultHysteresisRatio |
||
| ) |
Constructor
| [in] | nItemXCount | Horizontal items |
| [in] | nItemYCount | Vertical items |
| [in] | fBorderWidth | Size from all sides to disregard |
| [in] | fHysteresisRatio | Additional size (from any side) it takes to exit a specific item. |
| void XnVMultiItemHysteresis2D::CalculateMinAndMax | ( | ) | [protected] |
| XnFloat XnVMultiItemHysteresis2D::GetBorderWidth | ( | ) | const |
Get the border width - the space on either side that isn't part of any item.
| XnFloat XnVMultiItemHysteresis2D::GetHysteresisRatio | ( | ) | const |
Get the ratio for an item selection to change.
| XnUInt32 XnVMultiItemHysteresis2D::GetItemXCount | ( | ) | const |
Get the current number of item rows
| XnUInt32 XnVMultiItemHysteresis2D::GetItemYCount | ( | ) | const |
Get the current number of item columns
| XnFloat XnVMultiItemHysteresis2D::GetMaxXValue | ( | ) | const |
Get the maximal value the hysteresis expects in the Y-coordinate
| XnFloat XnVMultiItemHysteresis2D::GetMaxYValue | ( | ) | const |
Get the maximal value the hysteresis expects in the X-coordinate
| XnFloat XnVMultiItemHysteresis2D::GetMinXValue | ( | ) | const |
Get the minimal value the hysteresis expects in the X-coordinate
| XnFloat XnVMultiItemHysteresis2D::GetMinYValue | ( | ) | const |
Get the minimal value the hysteresis expects in the Y-coordinate
| XnBool XnVMultiItemHysteresis2D::IsValueInRange | ( | XnFloat | fXValue, |
| XnFloat | fYValue | ||
| ) | [protected] |
| void XnVMultiItemHysteresis2D::ItemSelected | ( | XnInt32 | nItemXIndex, |
| XnInt32 | nItemYIndex | ||
| ) |
Invoke the selection event
| [in] | nItemXIndex | The X-coordinate of the item that is selected |
| [in] | nItemYIndex | The 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
| [in] | cxt | User's context |
| [in] | pCB | The Callback to call when the event is invoked. |
| XnStatus XnVMultiItemHysteresis2D::SetBorderWidth | ( | XnFloat | fWidth | ) |
Change the border width
| [in] | fWidth | The new border width |
| void XnVMultiItemHysteresis2D::SetHysteresisRatio | ( | XnFloat | fRatio | ) |
| void XnVMultiItemHysteresis2D::SetItemCount | ( | XnUInt32 | nItemXCount, |
| XnUInt32 | nItemYCount | ||
| ) |
Change the current number of items rows and columns
| [in] | nItemXCount | New number of rows |
| [in] | nItemYCount | New number of columns |
| void XnVMultiItemHysteresis2D::SetItemXCount | ( | XnUInt32 | nItemXCount | ) |
Change the current number of items rows
| [in] | nItemXCount | New number of rows |
| void XnVMultiItemHysteresis2D::SetItemYCount | ( | XnUInt32 | nItemYCount | ) |
Change the current number of items columns
| [in] | nItemYCount | New number of columns |
| void XnVMultiItemHysteresis2D::UnregisterItemSelect | ( | XnCallbackHandle | handle | ) |
Unregister from the selection event
| [in] | handle | The 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.
XnFloat XnVMultiItemHysteresis2D::m_fBorderWidth [protected] |
Definition at line 179 of file XnVMultiItemHysteresis2D.h.
XnFloat XnVMultiItemHysteresis2D::m_fHysteresisRatio [protected] |
Definition at line 181 of file XnVMultiItemHysteresis2D.h.
XnFloat XnVMultiItemHysteresis2D::m_fMaxXValue [protected] |
Definition at line 173 of file XnVMultiItemHysteresis2D.h.
XnFloat XnVMultiItemHysteresis2D::m_fMaxYValue [protected] |
Definition at line 174 of file XnVMultiItemHysteresis2D.h.
XnFloat XnVMultiItemHysteresis2D::m_fMinXValue [protected] |
Definition at line 173 of file XnVMultiItemHysteresis2D.h.
XnFloat XnVMultiItemHysteresis2D::m_fMinYValue [protected] |
Definition at line 174 of file XnVMultiItemHysteresis2D.h.
XnUInt32 XnVMultiItemHysteresis2D::m_nItemXCount [protected] |
Definition at line 170 of file XnVMultiItemHysteresis2D.h.
XnUInt32 XnVMultiItemHysteresis2D::m_nItemYCount [protected] |
Definition at line 171 of file XnVMultiItemHysteresis2D.h.
XnInt32 XnVMultiItemHysteresis2D::m_nLastSelectedXIndex [protected] |
Definition at line 176 of file XnVMultiItemHysteresis2D.h.
XnInt32 XnVMultiItemHysteresis2D::m_nLastSelectedYIndex [protected] |
Definition at line 177 of file XnVMultiItemHysteresis2D.h.
XnVIntIntSpecificEvent* XnVMultiItemHysteresis2D::m_pItemSelectCBs [protected] |
Definition at line 183 of file XnVMultiItemHysteresis2D.h.
const XnFloat XnVMultiItemHysteresis2D::ms_fDefaultHysteresisRatio [static] |
Definition at line 164 of file XnVMultiItemHysteresis2D.h.
1.7.6.1