12#include "RingBuffer.h"
18 #pragma comment(lib, "XnVNITE64_1_5_2.lib")
19 #pragma comment(lib, "OpenNI64.lib")
21 #pragma comment(lib, "XnVNITE_1_5_2.lib")
22 #pragma comment(lib, "OpenNI.lib")
30class COpenNiWin :
public COpenNiTool
34 virtual ~COpenNiWin(
void) { free();}
65 double m_ground_level;
69 ExCmnHead* pDepthData;
80 CString get_err_message(
void);
84 void deleteDevice(
void) { delete_Device();}
85 void clearJointsData(
void);
86 void clearAvatarDetected(
void);
87 BOOL checkAvatarDetected(
void);
90 BOOL openUSBDevice(
void) {
return open_USB_Device();}
91 void closeUSBDevice(
void) { close_USB_Device();}
92 void setLEDColor(
int col) {
if (m_use_led) set_LED_Color(col);}
93 void setTiltMotor(
int ang);
95 void setMirroring(BOOL mirror);
96 int getDevState(
void) {
return m_state;}
98 BOOL startDetection(BOOL force_pose);
99 BOOL stopDetection(
void);
100 BOOL restartDetection(
void);
102 int getTrackingUser(
void) {
return get_TrackingUser();}
103 void setDenyTrackingSearch(XnUserID user) { set_DenyTrackingSearch(user);}
106 void getJointsPosData(XnUserID uid);
107 void getJointsRotData(XnUserID uid);
110 void makeDisplayImage(
void);
111 void makeDisplayDepth(CExView* pview);
112 BOOL trackingJoints(BOOL use_rot_data);
115 BOOL detectShadow(
void);
116 void paintShadow(
void);
117 void drawSkeleton(
int col,
int line);
118 void drawJointConnection(
int j1,
int j2,
int col,
int line);
119 void set2DCoordinate(
void);
122 BOOL initRingBuffer(
void);
123 void freeRingBuffer(
void);
124 void clearRingBuffer(
void);
125 void backup2RingBuffer(
void);
133 BOOL initSpeech(
void);
134 BOOL createSpeech(LPCTSTR lang, LPCTSTR grfile);
135 BOOL startSpeech(
float confidence);
136 void stopSpeech(
void);
137 void deleteSpeech(BOOL rls=TRUE);
139 void setSpeechConfidence(
float confd) {
if (speech!=NULL) speech->setConfidence(confd);}
141 virtual CNiSpeech* makeSpeech(
void) { CNiSpeech* spch =
new CNiSpeech();
return spch;}
144 virtual void saveJointsData(
void) {}
145 virtual void loggingJointsData(
void) {}
147 virtual void checkBoneLength(
void) {}
148 virtual void checkGroundLevel(
void) {}
150 virtual void convertJointsData(
void) {}
151 virtual void drawAddition(
int col,
int line) {}
153 virtual void lostTrackingUser(
int uid) {}
154 virtual void detectTrackingUser(
int uid) {}
157 void setDevState(
int state) { m_state = state;}
161 Vector<double> startPos;
162 Vector<double> currentPos;
164 Vector<double> posVect[OPENNI_JOINT_NUM];
165 Quaternion rotQuat[OPENNI_JOINT_NUM];
166 Vector<int> crdVect[OPENNI_JOINT_NUM];
168 double jntAngl[OPENNI_JOINT_NUM];
170 CRingBuffer posRing[OPENNI_JOINT_NUM];
171 CRingBuffer rotRing[OPENNI_JOINT_NUM];