#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:
A hysteresis ratio is used to 'enlarge' the current item.
Definition at line 28 of file XnVMultiItemHysteresis2D.h.
Member Typedef Documentation
Constructor & Destructor Documentation
| XnVMultiItemHysteresis2D::XnVMultiItemHysteresis2D |
( |
XnInt32 |
nItemXCount, |
|
|
XnInt32 |
nItemYCount, |
|
|
XnFloat |
fBorderWidth = 0, |
|
|
XnFloat |
fHysteresisRatio = ms_fDefaultHysteresisRatio | |
|
) |
| | |
Constructor
- Parameters:
-
| [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. |
| 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] | 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
- Parameters:
-
| [in] | cxt | User's context |
| [in] | pCB | The 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] | 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
- Parameters:
-
| [in] | nItemXCount | New number of rows |
| [in] | nItemYCount | New number of columns |
| void XnVMultiItemHysteresis2D::SetItemXCount |
( |
XnUInt32 |
nItemXCount |
) |
|
Change the current number of items rows
- Parameters:
-
| [in] | nItemXCount | New number of rows |
| void XnVMultiItemHysteresis2D::SetItemYCount |
( |
XnUInt32 |
nItemYCount |
) |
|
Change the current number of items columns
- Parameters:
-
| [in] | nItemYCount | New number of columns |
| void XnVMultiItemHysteresis2D::UnregisterItemSelect |
( |
XnCallbackHandle |
handle |
) |
|
Unregister from the selection event
- Parameters:
-
| [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.
Member Data Documentation
The documentation for this class was generated from the following file: