• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XnVMultipleHands.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_MULTIPLE_HANDS_H_
00010 #define _XNV_MULTIPLE_HANDS_H_
00011 
00012 #include "XnVHandPointContext.h"
00013 #include "XnVNiteEvents.h"
00014 
00020 class XNV_NITE_API XnVMultipleHands
00021 {
00022 public:
00026     XnVMultipleHands();
00032     XnVMultipleHands(const XnVMultipleHands& other);
00033     ~XnVMultipleHands();
00034 
00040     XnStatus Add(const XnVHandPointContext* pContext);
00048     XnStatus Remove(XnUInt32 nID);
00049 
00057     XnVHandPointContext* GetContext(XnUInt32 nID); 
00065     const XnVHandPointContext* GetContext(XnUInt32 nID) const;
00071     XnVHandPointContext* GetPrimaryContext();
00077     const XnVHandPointContext* GetPrimaryContext() const;
00078 
00084     void MarkNew(XnUInt32 nID);
00090     void MarkOld(XnUInt32 nID);
00096     void MarkActive(XnUInt32 nID);
00097 
00103     void RemoveNew(XnUInt32 nID);
00109     void RemoveOld(XnUInt32 nID);
00115     void RemoveActive(XnUInt32 nID);
00116 
00122     XnUInt32 NewEntries() const;
00128     XnUInt32 OldEntries() const;
00134     XnUInt32 ActiveEntries() const;
00135 
00141     void Clone(XnVMultipleHands& other) const;
00142 
00146     void Clear();
00150     void ClearLists();
00154     void ClearNewList();
00158     void ClearOldList();
00159 
00163     class XNV_NITE_API ConstIterator
00164     {
00165     public:
00166         friend class XnVMultipleHands;
00167 
00173         ConstIterator(const ConstIterator& other);
00174 
00180         ConstIterator& operator++();
00186         ConstIterator operator++(int);
00187 
00193         XnBool operator==(const ConstIterator& other) const;
00199         XnBool operator!=(const ConstIterator& other) const;
00200 
00206         const XnVHandPointContext* operator*() const;
00207 
00213         XnBool IsNew() const;
00219         XnBool IsActive() const;
00225         XnBool IsValid() const;
00226     protected:
00227         ConstIterator(const XnVMultipleHands* pHands);
00228         ConstIterator(const XnVMultipleHands* pHands, XnUInt32 nPosition);
00229 
00230         const XnVMultipleHands* m_pHands;
00231         XnUInt32 m_nPosition;
00232         XnBool m_bValid;
00233     };
00234 
00238     class XNV_NITE_API Iterator : public ConstIterator
00239     {
00240     public:
00241         friend class XnVMultipleHands;
00242 
00248         Iterator(const Iterator& other);
00249 
00255         Iterator& operator++();
00261         Iterator operator++(int);
00262 
00268         XnVHandPointContext* operator*() const;
00269     protected:
00270         Iterator(XnVMultipleHands* pHands);
00271         Iterator(XnVMultipleHands* pHands, XnUInt32 nPosition);
00272     };
00273 
00279     Iterator begin();
00285     ConstIterator begin() const;
00291     Iterator end();
00297     ConstIterator end() const;
00298 
00306     Iterator Find(XnUInt32 nID);
00314     ConstIterator Find(XnUInt32 nID) const;
00322     XnBool IsNew(XnUInt32 nID) const;
00330     XnBool IsOld(XnUInt32 nID) const;
00338     XnBool IsActive(XnUInt32 nID) const;
00339 
00345     XnVIntList::Iterator beginOld();
00351     XnVIntList::ConstIterator beginOld() const;
00357     XnVIntList::Iterator endOld();
00363     XnVIntList::ConstIterator endOld() const;
00364 
00368     void ReassignPrimary(XnUInt32 nHint = 0);
00369 
00375     void SetFocusPoint(const XnPoint3D& ptFocusPoint);
00381     const XnPoint3D& GetFocusPoint() const;
00382 private:
00383     XnVHandPointContext m_Hands[32];
00384     XnUInt32 m_nNextAvailable;
00385     XnUInt32 m_nAvailable;
00386     XnVIntHash m_Id2Position;
00387 
00388     XnVIntList m_ActiveIDs;
00389     XnVIntList m_NewIDs;
00390     XnVIntList m_OldIDs;
00391 
00392     XnUInt32 m_nPrimaryID;
00393 
00394     XnPoint3D m_ptFocusPoint;
00395 };
00396 
00397 #endif

Generated on Tue Jul 19 2011 20:22:59 for NITE 1.4.1 - API Reference by  doxygen 1.7.1