Mercurial > hg > Game > Kinect
comparison KinectTrack.h @ 2:3b5465899da9
add KinectTrack.cc
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 01 Feb 2011 03:01:22 +0900 |
parents | 2afd5c6cc8d2 |
children | 7e112b536f0a |
comparison
equal
deleted
inserted
replaced
1:2afd5c6cc8d2 | 2:3b5465899da9 |
---|---|
1 #include <map> | |
2 #include <list> | |
3 #include <XnCppWrapper.h> | |
4 #include <XnVPointControl.h> | |
5 | |
1 typedef enum { | 6 typedef enum { |
2 IN_SESSION, | 7 IN_SESSION, |
3 NOT_IN_SESSION, | 8 NOT_IN_SESSION, |
4 QUICK_REFOCUS | 9 QUICK_REFOCUS |
5 } SessionState; | 10 } SessionState; |
6 | 11 |
7 class NIState { | 12 class NIState { |
8 public: | 13 public: |
9 static SessionState gSessionState; | 14 static SessionState gSessionState; |
15 static XnBool gBDrawDepthMap; | |
10 static void XN_CALLBACK_TYPE sessionStarting(const XnPoint3D &ptPosition, void *userCxt); | 16 static void XN_CALLBACK_TYPE sessionStarting(const XnPoint3D &ptPosition, void *userCxt); |
11 static void XN_CALLBACK_TYPE sessionEnding(void *userCxt); | 17 static void XN_CALLBACK_TYPE sessionEnding(void *userCxt); |
12 static void XN_CALLBACK_TYPE focusProgress(const XnChar *strFocus, const XnPoint3D &ptPosition, | 18 static void XN_CALLBACK_TYPE focusProgress(const XnChar *strFocus, const XnPoint3D &ptPosition, |
13 XnFloat fProgress, void *userCxt); | 19 XnFloat fProgress, void *userCxt); |
20 static void XN_CALLBACK_TYPE noHands(void *UserCxt); | |
14 }; | 21 }; |
22 | |
23 class XnVPointDrawer : public XnVPointControl { | |
24 public: | |
25 XnVPointDrawer(XnUInt32 nHistorySize, xn::DepthGenerator depthGenerator); | |
26 virtual ~XnVPointDrawer(); | |
27 void update(XnVMessage *pMessage); | |
28 void onPointCreate(const XnVHandPointContext *cxt); | |
29 void onPointUpdate(const XnVHandPointContext *cxt); | |
30 void onPointDestroy(XnUInt32 nID); | |
31 void draw() const; | |
32 void setDepthMap(XnBool bDrawDM); | |
33 void setFrameID(XnBool bFrameID); | |
34 protected: | |
35 XnUInt32 mNHistorySize; | |
36 std::map<XnUInt32, std::list<XnPoint3D> > mHistory; | |
37 xn::DepthGenerator mDepthGenerator; | |
38 XnFloat *mPFPositionBuffer; | |
39 XnBool mBDrawDM; | |
40 XnBool mBFrameID; | |
41 }; |