NITE 1.4.1 - API Reference
|
#include <XnVMultiProcessFlowServer.h>
Public Member Functions | |
XnVMultiProcessFlowServer (const XnChar *strSectionName, const XnChar *strName="XnVMultiProcessFlowServer") | |
~XnVMultiProcessFlowServer () | |
XnStatus | Initialize () |
void | Reset () |
void | Update (const XnVMultipleHands &hands) |
Protected Member Functions | |
XnStatus | WriteState () |
void | OnPointCreate (const XnVHandPointContext *pContext) |
void | OnPointUpdate (const XnVHandPointContext *pContext) |
void | OnPointDestroy (XnUInt32 nID) |
void | OnPrimaryPointCreate (const XnVHandPointContext *pContext, const XnPoint3D &ptSessionStarter) |
void | OnPrimaryPointUpdate (const XnVHandPointContext *pContext) |
void | OnPrimaryPointDestroy (XnUInt32 nID) |
void | OnSessionStart (const XnPoint3D &ptPosition) |
void | OnSessionEnd () |
void | OnFocusStartDetected (const XnChar *strFocus, const XnPoint3D &ptPosition, XnFloat fProgress) |
Private Member Functions | |
void | CheckSessionStarted () |
Private Attributes | |
XnUInt32 | m_nWriteCount |
XnVMultiprocessWriteSynchronizer * | m_pWritingLock |
XnVNiteMultiprocessData * | m_pCurrentState |
XnVIntHash | m_IdToIndex |
XnBool | m_bFocusStartSinceUpdate |
const XnVMultipleHands * | m_pCurrentHands |
XnVMultiProcessFlowServer is both a XnVPointControl and a SessionListener. When placed into a NITE flow it stores the latest state it has according to events that arrive (PointCreate/Update/Destroy, SessionCreate/SessionDestroy, etc.) and calls WriteState. When WriteState() is called, it publishes the current state into a shared memory section. Clients (XnVMultiProcessFlowClient objects) which read the published state can then trigger the same events in different processes. NOTE: The object is NOT thread-safe, meaning, the WriteState and Reset methods must be called from the same thread that XnVPointListener::Update() is called on the point-listener which is connected to the server
Definition at line 29 of file XnVMultiProcessFlowServer.h.
XnVMultiProcessFlowServer::XnVMultiProcessFlowServer | ( | const XnChar * | strSectionName, |
const XnChar * | strName = "XnVMultiProcessFlowServer" |
||
) |
Create a XnVMultiProcessFlowServer
[in] | strSectionName | The name of the Shared Memory section to which we will write |
[in] | strName | Name of the control, for log purposes. |
XnVMultiProcessFlowServer::~XnVMultiProcessFlowServer | ( | ) |
void XnVMultiProcessFlowServer::CheckSessionStarted | ( | ) | [private] |
XnStatus XnVMultiProcessFlowServer::Initialize | ( | ) |
Initialize the shared-memory Must be called before the first call to WriteState.
void XnVMultiProcessFlowServer::OnFocusStartDetected | ( | const XnChar * | strFocus, |
const XnPoint3D & | ptPosition, | ||
XnFloat | fProgress | ||
) | [protected, virtual] |
Implements XnVSessionListener.
void XnVMultiProcessFlowServer::OnPointCreate | ( | const XnVHandPointContext * | pContext | ) | [protected, virtual] |
Handle a new Point Create event
[in] | pContext | The context of the new Point |
Reimplemented from XnVPointControl.
void XnVMultiProcessFlowServer::OnPointDestroy | ( | XnUInt32 | nID | ) | [protected, virtual] |
Handle a existing Point Destroy event
[in] | nID | The ID of the destroyed Point |
Reimplemented from XnVPointControl.
void XnVMultiProcessFlowServer::OnPointUpdate | ( | const XnVHandPointContext * | pContext | ) | [protected, virtual] |
Handle an existing Point Update event
[in] | pContext | The context of the Point |
Reimplemented from XnVPointControl.
void XnVMultiProcessFlowServer::OnPrimaryPointCreate | ( | const XnVHandPointContext * | pContext, |
const XnPoint3D & | ptSessionStarter | ||
) | [protected, virtual] |
Handle the primary point create
[in] | pContext | The context of the primary point |
[in] | ptSessionStarter | The point in which the session started |
Reimplemented from XnVPointControl.
void XnVMultiProcessFlowServer::OnPrimaryPointDestroy | ( | XnUInt32 | nID | ) | [protected, virtual] |
Handle the primary point destruction
[in] | nID | The ID of the last primary point |
Reimplemented from XnVPointControl.
void XnVMultiProcessFlowServer::OnPrimaryPointUpdate | ( | const XnVHandPointContext * | pContext | ) | [protected, virtual] |
Handle an update of the Primary Point
[in] | pContext | The context of the primary point |
Reimplemented from XnVPointControl.
void XnVMultiProcessFlowServer::OnSessionEnd | ( | ) | [protected, virtual] |
Implements XnVSessionListener.
void XnVMultiProcessFlowServer::OnSessionStart | ( | const XnPoint3D & | ptPosition | ) | [protected, virtual] |
Implements XnVSessionListener.
void XnVMultiProcessFlowServer::Reset | ( | ) |
Reset stored state. Does not publish the state to clients. Calling WriteState() directly after calling this method will destroy the session and all points in clients. NOTE: Reset MUST be called before re-connecting a Server into a Nite flow, or undefined behavior will occur due to stale state data inside the server
void XnVMultiProcessFlowServer::Update | ( | const XnVMultipleHands & | hands | ) | [virtual] |
Handle new hands batch. Write to internal state, to be written to the shared memory.
[in] | hands | The current state of the hands |
Reimplemented from XnVPointControl.
XnStatus XnVMultiProcessFlowServer::WriteState | ( | ) | [protected] |
XnBool XnVMultiProcessFlowServer::m_bFocusStartSinceUpdate [private] |
Definition at line 86 of file XnVMultiProcessFlowServer.h.
XnVIntHash XnVMultiProcessFlowServer::m_IdToIndex [private] |
Definition at line 85 of file XnVMultiProcessFlowServer.h.
XnUInt32 XnVMultiProcessFlowServer::m_nWriteCount [private] |
Definition at line 82 of file XnVMultiProcessFlowServer.h.
const XnVMultipleHands* XnVMultiProcessFlowServer::m_pCurrentHands [private] |
Definition at line 88 of file XnVMultiProcessFlowServer.h.
XnVNiteMultiprocessData* XnVMultiProcessFlowServer::m_pCurrentState [private] |
Definition at line 84 of file XnVMultiProcessFlowServer.h.
XnVMultiprocessWriteSynchronizer* XnVMultiProcessFlowServer::m_pWritingLock [private] |
Definition at line 83 of file XnVMultiProcessFlowServer.h.