Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _XNV_CLICKABLE_VIRTUAL_PLANE_H_
00010 #define _XNV_CLICKABLE_VIRTUAL_PLANE_H_
00011
00012 #include "XnVVirtualCoordinates.h"
00013
00014 class XnVClickableVirtualPlane;
00015 class XnVIntPointHash;
00016 class XnVIntIDHash;
00017 class XnVUintPointSpecificEvent;
00018
00019 struct XnVClickableID
00020 {
00021 XnVClickableID(const XnVHandPointContext* cxt, XnVClickableVirtualPlane* pPlane) :
00022 pCxt(cxt), pCVP(pPlane)
00023 {}
00024
00025 const XnVHandPointContext* pCxt;
00026 XnVClickableVirtualPlane* pCVP;
00027 };
00028
00032 class XNV_NITE_API XnVClickableVirtualPlane :
00033 public XnVVirtualCoordinates
00034 {
00035 public:
00039 typedef void (XN_CALLBACK_TYPE* ClickCB)(XnUInt32 nID, const XnPoint3D& ptPosition, void* cxt);
00040
00047 XnVClickableVirtualPlane(const XnChar* strINI, const XnChar* strName = "XnVClickableVirtualPlane");
00048 ~XnVClickableVirtualPlane();
00049
00058 XnCallbackHandle RegisterClick(void* cxt, ClickCB CB);
00064 void UnregisterClick(XnCallbackHandle hCB);
00065
00071 void Click(XnUInt32, const XnPoint3D& ptPosition);
00072
00078 void OnPointCreate(const XnVHandPointContext* pContext);
00084 void OnPointDestroy(XnUInt32 nID);
00085
00092 void FreezeCoordinates(XnUInt32 nID, const XnPoint3D& ptPosition);
00098 void UnfreezeCoordinates(XnUInt32 nID);
00106 XnBool IsFrozen(XnUInt32 nID) const;
00107 protected:
00108 void UpdateVirtualPoint(XnVVirtualCoordinatesInternal* pVC, const XnVHandPointContext* pContext, XnVHandPointContext* pLocalContext);
00109
00110 XnVIntPointHash* m_pFrozenPoints;
00111 XnVIntIDHash* m_pIDContexts;
00112
00113 XnVUintPointSpecificEvent* m_pClickCBs;
00114 };
00115
00116 #endif // _XNV_CLICKABLE_VIRTUAL_PLANE_H_