KINECT STATS GENERATOR FOR SPORTS VISUALISATION
1.0
|
00001 #ifndef __GL_WINDOW_H__ 00002 #define __GL_WINDOW_H__ 00003 00004 00005 #include "ngl/Camera.h" 00006 #include "ngl/Colour.h" 00007 #include "ngl/TransformStack.h" 00008 // must be included after our stuff becuase GLEW needs to be first 00009 #include <QtOpenGL> 00010 #include <QTime> 00011 #include "libfreenect.hpp" 00012 #include "Kinect.h" 00013 #include <QTime> 00024 class GLWindow : public QGLWidget 00025 { 00026 Q_OBJECT // must include this if you use Qt signals/slots 00027 public : 00030 GLWindow( 00031 QWidget *_parent 00032 ); 00033 ~GLWindow(); 00034 // inline Kinect* getDevice(){return device;} 00035 void incrementAngle(); 00036 void decrementAngle(); 00037 void zeroAngle(); 00038 private : 00039 00041 int m_spinXFace; 00043 int m_spinYFace; 00045 bool m_rotate; 00047 int m_origX; 00049 int m_origY; 00050 void LoadVertexMatrix(); 00051 void LoadRGBMatrix(); 00052 void drawPointCloud(); 00053 // @brief Our Camera 00054 ngl::Camera *m_cam; 00055 ngl::Camera *m_pcam; 00056 00057 std::vector<uint8_t> depth; 00058 std::vector<uint8_t> rgb; 00060 int m_fpsTimer; 00062 int m_fps; 00063 int m_frames; 00064 QTime m_timer; 00066 ngl::TransformStack m_transformStack; 00067 00068 float m_angle; 00069 GLuint gl_depth_tex; 00070 GLuint gl_rgb_tex; 00071 00072 //Freenect::Freenect<Kinect> freenect; 00073 // Kinect* device; 00074 00075 protected: 00076 00081 void initializeGL(); 00082 00088 void resizeGL( 00089 const int _w, 00090 const int _h 00091 ); 00093 // be re-drawn 00094 void paintGL(); 00095 00096 private : 00101 00102 void mouseMoveEvent ( 00103 QMouseEvent * _event 00104 ); 00110 00111 void mousePressEvent ( 00112 QMouseEvent *_event 00113 ); 00114 00120 void mouseReleaseEvent ( 00121 QMouseEvent *_event 00122 ); 00124 00125 void timerEvent( 00126 QTimerEvent *_event 00127 ); 00128 00129 00130 }; 00131 00132 #endif