3#ifdef ENABLE_KINECT_SDK
11#include "RingBuffer.h"
25 virtual ~CKinectWin(
void);
28 CKinectDevice* device;
30#ifdef ENABLE_NI_SPEECH
60 NUI_TRANSFORM_SMOOTH_PARAMETERS smoothParam;
63 double m_ground_level;
70 ExCmnHead* pDepthData;
79 void deleteDevice(
void);
81 CString get_err_message(
void);
85 void clearJointsData(
void);
86 void clearAvatarDetected(
void);
87 BOOL checkAvatarDetected(
void);
89 BOOL openUSBDevice(
void) {
return TRUE;}
90 void closeUSBDevice(
void) {}
91 void setLEDColor(
int col) {}
92 void setTiltMotor(
int ang);
94 void setMirroring(BOOL mirror);
95 int getDevState(
void) {
if (device==NULL)
return NI_STATE_DETECT_STOPPED;
else return device->m_state;}
97 BOOL startDetection(
void);
98 BOOL stopDetection(
void);
99 BOOL restartDetection(
void);
101 int getTrackingUser(
void) {
if (device!=NULL)
return device->get_TrackingUser(tracking_deny);
else return 0;}
102 void setDenyTrackingSearch(
int user) { tracking_deny = user;}
105 Vector4 joint_PositionData(
int joint);
107 void getJointsPosData(
void);
108 void getJointsRotData(
void) {}
111 void makeDisplayImage(
void);
112 void makeDisplayDepth(CExView* pview);
113 BOOL trackingJoints(
void);
116 BOOL detectShadow(
void);
117 void paintShadow(
void);
118 void drawSkeleton(
int col,
int line);
119 void drawJointConnection(
int j1,
int j2,
int col,
int line);
120 void set2DCoordinate(
void);
123 BOOL initRingBuffer(
void);
124 void freeRingBuffer(
void);
125 void clearRingBuffer(
void);
126 void backup2RingBuffer(
void);
128 Vector4 jointPositionData(
int joint);
132 Quaternion<double> getFaceRotation(
void);
135#ifdef ENABLE_NI_SPEECH
137 BOOL initSpeech(
void);
138 BOOL createSpeech(LPCTSTR lang, LPCTSTR grfile);
139 BOOL startSpeech(
double confidence);
140 void stopSpeech(
void);
141 void deleteSpeech(BOOL rls=TRUE);
143 void setSpeechConfidence(
double confd) {
if (speech!=NULL) speech->setConfidence(confd);}
145 virtual CNiSpeech* makeSpeech(
void) { CNiSpeech* spch =
new CNiSpeech();
return spch;}
149 virtual void saveJointsData(
void) {}
150 virtual void loggingJointsData(
void) {}
152 virtual void checkBoneLength(
void) {}
153 virtual void checkGroundLevel(
void) {}
155 virtual void convertJointsData(
void) {}
156 virtual void drawAddition(
int col,
int line) {}
158 virtual void lostTrackingUser(
int uid) {}
159 virtual void detectTrackingUser(
int uid) {}
161 virtual void callback_status_changed(BOOL success,
const OLECHAR* instanceName,
const OLECHAR* deviceName);
164 void setDevState(
int state) {
if (device!=NULL) device->m_state = state;}
168 Vector<double> startPos;
169 Vector<double> currentPos;
171 Vector<double> posVect[KINECT_JOINT_NUM];
172 Quaternion<double> rotQuat[KINECT_JOINT_NUM];
173 Vector<int> crdVect[KINECT_JOINT_NUM];
175 double jntAngl[KINECT_JOINT_NUM];
177 CRingBuffer posRing[KINECT_JOINT_NUM];
178 CRingBuffer rotRing[KINECT_JOINT_NUM];
182 BOOL hasContext(
void) {
if (device!=NULL && device->context!=NULL)
return TRUE;
else return FALSE;}
183 BOOL hasImageGen(
void) {
if (device!=NULL && device->image!=NULL)
return TRUE;
else return FALSE;}
184 BOOL hasDepthGen(
void) {
if (device!=NULL && device->depth!=NULL)
return TRUE;
else return FALSE;}
186 BOOL createImage(
void) {
if (device!=NULL)
return device->create_Image();
else return FALSE;}
187 BOOL createDepth(
void) {
if (device!=NULL)
return device->create_Depth();
else return FALSE;}
188 void deleteImage(
void) {
if (device!=NULL) device->delete_Image();}
189 void deleteDepth(
void) {
if (device!=NULL) device->delete_Depth();}
192 BOOL waitImage(
void) {
if (device!=NULL)
return device->wait_Image();
else return FALSE;}
193 BOOL waitDepth(
void) {
if (device!=NULL)
return device->wait_Depth();
else return FALSE;}
196 BOOL faceDetect(FT_VECTOR3D* hint)
198 if (device!=NULL && device->face!=NULL)
return device->face->detect(hint);
202 void drawFaceRect(ExCmnHead* viewdata,
int scale, BOOL mirror,
int col,
int line)
204 if (device!=NULL && device->face!=NULL) {
205 device->face->drawFaceRect(pViewData, m_image_scale, m_is_mirroring, col, line);
210 int getXSize(
void) {
if (device!=NULL)
return device->m_xsize;
else return 0;}
211 int getYSize(
void) {
if (device!=NULL)
return device->m_ysize;
else return 0;}
212 int getFPS(
void) {
if (device!=NULL)
return device->m_nfps;
else return 0;}
221void CALLBACK KinectStatusProc(HRESULT hr,
const OLECHAR* instanceName,
const OLECHAR* deviceName,
void* pUserData);