NITE 1.5.1 - API Reference

XnVMultiProcessFlowServer.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 *                                                                              *
00003 *   PrimeSense NITE 1.3                                                        *
00004 *   Copyright (C) 2010 PrimeSense Ltd.                                         *
00005 *                                                                              *
00006 *******************************************************************************/
00007 
00008 
00009 #ifndef _XNV_POINT_SERVER_H_
00010 #define _XNV_POINT_SERVER_H_
00011 
00012 #include "XnVPointControl.h"
00013 #include "XnVSessionListener.h"
00014 
00015 struct XnVNiteMultiprocessData;
00016 class XnVMultiprocessWriteSynchronizer;
00017 class XnVIntHash;
00018 
00030 class XNV_NITE_API XnVMultiProcessFlowServer :
00031     public XnVPointControl,
00032     public XnVSessionListener
00033 {
00034 public:
00041     XnVMultiProcessFlowServer(const XnChar* strSectionName, const XnChar* strName = "XnVMultiProcessFlowServer");
00042     ~XnVMultiProcessFlowServer();
00043 
00050     XnStatus Initialize();
00051 
00058     void Reset();
00059 
00065     void Update(const XnVMultipleHands& hands);
00066 protected:
00067 
00068     XnStatus WriteState();
00069 
00070     void OnPointCreate(const XnVHandPointContext* pContext);
00071     void OnPointUpdate(const XnVHandPointContext* pContext);
00072     void OnPointDestroy(XnUInt32 nID);
00073     void OnPrimaryPointCreate(const XnVHandPointContext* pContext, const XnPoint3D& ptSessionStarter);
00074     void OnPrimaryPointUpdate(const XnVHandPointContext* pContext);
00075     void OnPrimaryPointDestroy(XnUInt32 nID);
00076 
00077     void OnSessionStart(const XnPoint3D& ptPosition);
00078     void OnSessionEnd();
00079     void OnFocusStartDetected(const XnChar* strFocus, const XnPoint3D& ptPosition, XnFloat fProgress);
00080 private:
00081     void CheckSessionStarted();
00082 
00083     XnUInt32 m_nWriteCount;
00084     XnVMultiprocessWriteSynchronizer* m_pWritingLock;
00085     XnVNiteMultiprocessData* m_pCurrentState;
00086     XnVIntHash* m_pIdToIndex;
00087     XnBool m_bFocusStartSinceUpdate;
00088 
00089     const XnVMultipleHands* m_pCurrentHands;
00090 };
00091 
00092 #endif // _XNV_POINT_SERVER_H_