-
Notifications
You must be signed in to change notification settings - Fork 0
/
PointCloudView.h
47 lines (39 loc) · 1.05 KB
/
PointCloudView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef POINTCLOUDVIEW_H
#define POINTCLOUDVIEW_H
#include <opencv2/opencv.hpp>
//#include <gl/glew.h>
#include <qglviewer.h>
#include <QMouseEvent>
#include "NiUserTracker.h"
#include <QMapIterator>
using namespace cv;
class PointCloudViewer : public QGLViewer
{
Q_OBJECT
public:
PointCloudViewer(Mat *rgb, Mat *cloud, QMap<unsigned int, Skelton> *skeltons)
: rgbImg(rgb), pointCloud(cloud), userSkeltons(skeltons) {}
~PointCloudViewer();
protected:
virtual void draw();
virtual void init();
virtual void animate();
virtual void mouseMoveEvent(QMouseEvent *event);
signals:
void debugTextChanged(QString text);
private:
GLuint texid, background;
GLuint buffers[2];
float *texcoord;
Mat *rgbImg, *pointCloud;
QMap<unsigned int, Skelton> *userSkeltons;
qglviewer::Vec cursorPos;
QString cursorText, cameraPosText;
void initBackground();
void initLights();
void initBuffers();
void constructDebugText();
void drawPointCloud();
void drawUserSkeltons();
};
#endif // POINTCLOUDVIEW_H