Mercurial > hg > Game > Kinect
changeset 1:2afd5c6cc8d2
Class definition export to KinectTrack.h
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 31 Jan 2011 03:49:24 +0900 |
parents | 1478aad947a6 |
children | 3b5465899da9 |
files | KinectTrack.h main.cc |
diffstat | 2 files changed, 16 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KinectTrack.h Mon Jan 31 03:49:24 2011 +0900 @@ -0,0 +1,14 @@ +typedef enum { + IN_SESSION, + NOT_IN_SESSION, + QUICK_REFOCUS +} SessionState; + +class NIState { +public: + static SessionState gSessionState; + static void XN_CALLBACK_TYPE sessionStarting(const XnPoint3D &ptPosition, void *userCxt); + static void XN_CALLBACK_TYPE sessionEnding(void *userCxt); + static void XN_CALLBACK_TYPE focusProgress(const XnChar *strFocus, const XnPoint3D &ptPosition, + XnFloat fProgress, void *userCxt); +};
--- a/main.cc Mon Jan 31 03:46:10 2011 +0900 +++ b/main.cc Mon Jan 31 03:49:24 2011 +0900 @@ -3,13 +3,9 @@ #include <XnCppWrapper.h> #include <XnVNite.h> -#define INIT_XML_PATH "./kinect.xml" +#include "KinectTrack.h" -typedef enum { - IN_SESSION, - NOT_IN_SESSION, - QUICK_REFOCUS -} SessionState; +#define INIT_XML_PATH "./kinect.xml" void checkRC(const XnStatus &rc, const char *what) { if (rc != XN_STATUS_OK) { @@ -25,14 +21,6 @@ } } -class NIState { -public: - static SessionState gSessionState; - static void XN_CALLBACK_TYPE sessionStarting(const XnPoint3D &ptPosition, void *userCxt); - static void XN_CALLBACK_TYPE sessionEnding(void *userCxt); - static void XN_CALLBACK_TYPE focusProgress(const XnChar *strFocus, const XnPoint3D &ptPosition, - XnFloat fProgress, void *userCxt); -}; SessionState NIState::gSessionState = NOT_IN_SESSION; void NIState::XN_CALLBACK_TYPE sessionStarting(const XnPoint3D &ptPosition, void *userCxt) { printf("Session start: (%f, %f, %f)\n)", ptPosition.X, ptPosition.Y, ptPosition.Z);