NITE 1.5.1 - API Reference

XnVPointArea.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_AREA_H_
00010 #define _XNV_POINT_AREA_H_
00011 
00012 #include "XnVPointFilter.h"
00013 #include "XnVSessionGenerator.h"
00014 #include "XnVPointTracker.h"
00015 
00016 class XnVUintSpecificEvent;
00017 class XnVIntHash;
00018 
00024 class XNV_NITE_API XnVPointArea :
00025     public XnVPointFilter
00026 {
00027 public:
00031     typedef void (XN_CALLBACK_TYPE*PointSilencedCB)(XnUInt32 nID, void* cxt);
00035     typedef void (XN_CALLBACK_TYPE*PointRevivedCB)(XnUInt32 nID, void* cxt);
00039     typedef void (XN_CALLBACK_TYPE*SilentPointRemovedCB)(XnUInt32 nID, void* cxt);
00040 
00048     XnVPointArea(const XnBoundingBox3D& bbArea, XnBool bRelative = false, const XnChar* strName = "XnVPointArea");
00057     XnVPointArea(const XnPoint3D& ptMins, const XnPoint3D& ptMaxs, XnBool bRelative = false, const XnChar* strName = "XnVPointArea");
00058 
00062     virtual ~XnVPointArea();
00069     void ChangeArea(const XnBoundingBox3D& bbArea, XnBool bRelative = false);
00077     void ChangeArea(const XnPoint3D& ptMins, const XnPoint3D& ptMaxs, XnBool bRelative = false);
00078 
00084     void Update(XnVMessage* pMessage);
00090     void Update(const XnVMultipleHands& hands);
00091 
00100     XnCallbackHandle RegisterPointSilenced(void* cxt, PointSilencedCB CB);
00109     XnCallbackHandle RegisterPointRevived(void* cxt, PointRevivedCB CB);
00118     XnCallbackHandle RegisterSilentPointRemoved(void* cxt, SilentPointRemovedCB CB);
00119 
00125     void UnregisterPointSilenced(XnCallbackHandle hCB);
00131     void UnregisterPointRevived(XnCallbackHandle hCB);
00137     void UnregisterSilentPointRemoved(XnCallbackHandle hCB);
00138 
00145     void RemoveSilent(XnUInt64 nDelay, XnVSessionGenerator* pGenerator);
00152     void RemoveSilent(XnUInt64 nDelay, XnVPointTracker* pTracker);
00153 
00154 protected:
00155     XnBool InBoundingBox(const XnPoint3D& pt) const;
00156 
00157     XnBool IsSilent(XnUInt32 nID) const;
00158 
00159     void SilencePoint(XnUInt32 nID, XnFloat fTime);
00160     void RevivePoint(XnUInt32 nID);
00161     XnStatus CheckDelay(XnUInt32 nID, XnFloat fTime);
00162 
00163     void ChangeConstantArea(const XnBoundingBox3D& bbArea);
00164     void ChangeRelativeArea(const XnBoundingBox3D& bbArea);
00165 
00166     XnVMultipleHands m_FilteredHands;
00167     XnBoundingBox3D m_bbArea;
00168 
00169     XnBool m_bRelative;
00170     XnBoundingBox3D m_bbRelativeArea;
00171 
00172     XnVIntHash* m_pSilentPoints;
00173 
00174     XnVUintSpecificEvent* m_pPointSilencedCBs;
00175     XnVUintSpecificEvent* m_pPointRevivedCBs;
00176     XnVUintSpecificEvent* m_pSilentPointRemovedCBs;
00177 
00178     XnBool m_bRemoveByGenerator;
00179     XnBool m_bRemoveByTracker;
00180     XnVPointTracker* m_pRemovingTracker;
00181     XnVSessionGenerator* m_pRemovingGenerator;
00182     XnUInt64 m_nRemovalDelay;
00183 };
00184 
00185 
00186 #endif // _XNV_POINT_AREA_H_