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 00029 class XNV_NITE_API XnVMultiProcessFlowServer : 00030 public XnVPointControl, 00031 public XnVSessionListener 00032 { 00033 public: 00040 XnVMultiProcessFlowServer(const XnChar* strSectionName, const XnChar* strName = "XnVMultiProcessFlowServer"); 00041 ~XnVMultiProcessFlowServer(); 00042 00049 XnStatus Initialize(); 00050 00057 void Reset(); 00058 00064 void Update(const XnVMultipleHands& hands); 00065 protected: 00066 00067 XnStatus WriteState(); 00068 00069 void OnPointCreate(const XnVHandPointContext* pContext); 00070 void OnPointUpdate(const XnVHandPointContext* pContext); 00071 void OnPointDestroy(XnUInt32 nID); 00072 void OnPrimaryPointCreate(const XnVHandPointContext* pContext, const XnPoint3D& ptSessionStarter); 00073 void OnPrimaryPointUpdate(const XnVHandPointContext* pContext); 00074 void OnPrimaryPointDestroy(XnUInt32 nID); 00075 00076 void OnSessionStart(const XnPoint3D& ptPosition); 00077 void OnSessionEnd(); 00078 void OnFocusStartDetected(const XnChar* strFocus, const XnPoint3D& ptPosition, XnFloat fProgress); 00079 private: 00080 void CheckSessionStarted(); 00081 00082 XnUInt32 m_nWriteCount; 00083 XnVMultiprocessWriteSynchronizer* m_pWritingLock; 00084 XnVNiteMultiprocessData* m_pCurrentState; 00085 XnVIntHash m_IdToIndex; 00086 XnBool m_bFocusStartSinceUpdate; 00087 00088 const XnVMultipleHands* m_pCurrentHands; 00089 }; 00090 00091 #endif // _XNV_POINT_SERVER_H_