3#if defined(ENABLE_OPENNI) || defined(ENABLE_OPENNI2)
13#include "RingBuffer.h"
20 #pragma comment(lib, "OpenNI2.lib")
21 #pragma comment(lib, "NiTE2.lib")
24 #pragma comment(lib, "OpenNI64.lib")
25 #pragma comment(lib, "XnVNITE64_1_5_2.lib")
27 #pragma comment(lib, "OpenNI.lib")
28 #pragma comment(lib, "XnVNITE_1_5_2.lib")
39class COpenNiWin :
public COpenNiTool
43 COpenNiWin(NiSDK_Lib lib);
44 virtual ~COpenNiWin(
void) { free();}
78 double m_ground_level;
82 ExCmnHead* pDepthData;
93 CString get_err_message(
void);
97 void deleteDevice(
void) { delete_Device();}
98 void clearJointsData(
void);
99 void clearAvatarDetected(
void);
100 BOOL checkAvatarDetected(
void);
102 BOOL openUSBDevice(
void) {
return open_USBDevice();}
103 void closeUSBDevice(
void) { close_USBDevice();}
104 void setLEDColor(
int col) {
if (m_use_led) set_LEDColor(col);}
105 void setTiltMotor(
int ang);
107 void setMirroring(BOOL mirror);
111 BOOL startDetection(
void);
112 BOOL stopDetection(
void);
113 BOOL restartDetection(
void);
115 unsigned int getTrackingUser(
void) {
return get_TrackingUser();}
116 void setDenyTrackingSearch(
unsigned int user) { set_DenyTrackingSearch(user);}
119 void getJointsPosData(
unsigned int uid);
120 void getJointsRotData(
unsigned int uid);
123 void makeDisplayImage(
void);
124 void makeDisplayDepth(CExView* pview);
125 BOOL trackingJoints(BOOL use_rot_data);
128 BOOL detectShadow(
void);
129 void paintShadow(
void);
130 void drawSkeleton(
int col,
int line);
131 void drawJointConnection(
int j1,
int j2,
int col,
int line);
132 void set2DCoordinate(
void);
135 BOOL initRingBuffer(
void);
136 void freeRingBuffer(
void);
137 void clearRingBuffer(
void);
138 void backup2RingBuffer(
void);
146 BOOL initSpeech(
void);
147 BOOL createSpeech(LPCTSTR lang, LPCTSTR grfile);
148 BOOL startSpeech(
double confidence);
149 void stopSpeech(
void);
150 void deleteSpeech(BOOL rls=TRUE);
152 void setSpeechConfidence(
double confd) {
if (speech!=NULL) speech->setConfidence(confd);}
154 virtual CNiSpeech* makeSpeech(
void) { CNiSpeech* spch =
new CNiSpeech();
return spch;}
157 virtual void saveJointsData(
void) {}
158 virtual void loggingJointsData(
void) {}
160 virtual void checkBoneLength(
void) {}
161 virtual void checkGroundLevel(
void) {}
163 virtual void convertJointsData(
void) {}
164 virtual void drawAddition(
int col,
int line) {}
166 virtual void lostTrackingUser(
int uid) {}
167 virtual void detectTrackingUser(
int uid) {}
171 Vector<double> startPos;
172 Vector<double> currentPos;
174 Vector<double> posVect[OPENNI_JOINT_NUM];
175 Vector<int> crdVect[OPENNI_JOINT_NUM];
176 Quaternion<double> rotQuat[OPENNI_JOINT_NUM];
178 double jntAngl[OPENNI_JOINT_NUM];
180 CRingBuffer posRing[OPENNI_JOINT_NUM];
181 CRingBuffer rotRing[OPENNI_JOINT_NUM];