KINECT STATS GENERATOR FOR SPORTS VISUALISATION
1.0
|
To visualize depth data. More...
#include <DepthDebugVisualization.h>
Public Member Functions | |
DepthDebugVisualization (QWidget *_parent) | |
Constructor for DepthDebugVisualization. | |
~DepthDebugVisualization () | |
Protected Member Functions | |
void | initializeGL () |
The following methods must be implimented in the sub class this is called when the window is created. | |
void | resizeGL (const int _w, const int _h) |
this is called whenever the window is re-sized | |
void | paintGL () |
this is the main gl drawing routine which is called whenever the window needs to | |
Private Member Functions | |
void | mouseMoveEvent (QMouseEvent *_event) |
this method is called every time a mouse is moved | |
void | mousePressEvent (QMouseEvent *_event) |
this method is called everytime the mouse button is pressed inherited from QObject and overridden here. | |
void | mouseReleaseEvent (QMouseEvent *_event) |
this method is called everytime the mouse button is released inherited from QObject and overridden here. | |
void | timerEvent (QTimerEvent *_event) |
called when the timer is triggered | |
Private Attributes | |
cv::Mat | m_depth |
Depth buffer. | |
QTime | m_timer |
timer to call paintgl | |
ScreenQuad * | m_screen |
quad pasting rendered called using this instance |
To visualize depth data.
Definition at line 25 of file DepthDebugVisualization.h.
DepthDebugVisualization::DepthDebugVisualization | ( | QWidget * | _parent | ) |
Constructor for DepthDebugVisualization.
[in] | _parent | the parent window to create the GL context in |
Definition at line 19 of file DepthDebugVisualization.cpp.
References m_depth.
: QGLWidget( new CreateCoreGLContext(QGLFormat::defaultFormat()), _parent ) { // set this widget to have the initial keyboard focus // setFocus(); // re-size the widget to that of the parent (in this case the GLFrame passed in on construction) this->resize(_parent->size()); startTimer(20); m_depth = cvCreateMat(480,640,CV_8UC1); }
Definition at line 129 of file DepthDebugVisualization.cpp.
References m_screen.
void DepthDebugVisualization::initializeGL | ( | ) | [protected] |
The following methods must be implimented in the sub class this is called when the window is created.
Definition at line 37 of file DepthDebugVisualization.cpp.
References m_screen, and ScreenQuad::setTextureMode().
{ // ngl::NGLInit *Init = ngl::NGLInit::instance(); Init->initGlew(); // now we have valid GL can create shaders etc ngl::ShaderLib *shader = ngl::ShaderLib::instance(); shader->createShaderProgram("TextureDepth"); shader->attachShader("TextureVertex",ngl::VERTEX); shader->attachShader("TextureFragment",ngl::FRAGMENT); shader->loadShaderSource("TextureVertex","shaders/TextureVert.glsl"); shader->loadShaderSource("TextureFragment","shaders/LumFrag.glsl"); shader->compileShader("TextureVertex"); shader->compileShader("TextureFragment"); shader->attachShaderToProgram("TextureDepth","TextureVertex"); shader->attachShaderToProgram("TextureDepth","TextureFragment"); shader->linkProgramObject("TextureDepth"); (*shader)["TextureDepth"]->use(); shader->setShaderParam1i("tex",0); m_screen = new ScreenQuad(640,480,"TextureDepth"); // set this to draw depth textures m_screen->setTextureMode(GL_DEPTH_COMPONENT ); //frame rate GUNDU //m_text=new ngl::Text(QFont("Arial",14)); //currentTime = currentTime.currentTime(); }
void DepthDebugVisualization::mouseMoveEvent | ( | QMouseEvent * | _event | ) | [private] |
this method is called every time a mouse is moved
_event | the Qt Event structure |
Definition at line 99 of file DepthDebugVisualization.cpp.
{ Q_UNUSED(_event); }
void DepthDebugVisualization::mousePressEvent | ( | QMouseEvent * | _event | ) | [private] |
this method is called everytime the mouse button is pressed inherited from QObject and overridden here.
_event | the Qt Event structure |
Definition at line 106 of file DepthDebugVisualization.cpp.
{ Q_UNUSED(_event); }
void DepthDebugVisualization::mouseReleaseEvent | ( | QMouseEvent * | _event | ) | [private] |
this method is called everytime the mouse button is released inherited from QObject and overridden here.
_event | the Qt Event structure |
Definition at line 113 of file DepthDebugVisualization.cpp.
{ // this event is called when the mouse button is released // we then set Rotate to false Q_UNUSED(_event); }
void DepthDebugVisualization::paintGL | ( | ) | [protected] |
this is the main gl drawing routine which is called whenever the window needs to
Definition at line 86 of file DepthDebugVisualization.cpp.
References ScreenQuad::draw(), KinectInterface::getDepthSliced(), KinectInterface::instance(), m_depth, and m_screen.
{ //int temp = 0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); KinectInterface *kinect=KinectInterface::instance(); // this is the raw data will need to be processed kinect->getDepthSliced(m_depth); m_screen->draw(&m_depth); }
void DepthDebugVisualization::resizeGL | ( | const int | _w, |
const int | _h | ||
) | [protected] |
this is called whenever the window is re-sized
[in] | _w | the width of the resized window |
[in] | _h | the height of the resized window |
Definition at line 73 of file DepthDebugVisualization.cpp.
{
glViewport(0,0,_w,_h);
//m_text->setScreenSize(_w,_h);
}
void DepthDebugVisualization::timerEvent | ( | QTimerEvent * | _event | ) | [private] |
called when the timer is triggered
Definition at line 121 of file DepthDebugVisualization.cpp.
{
Q_UNUSED(_event);
// re-draw GL
updateGL();
}
cv::Mat DepthDebugVisualization::m_depth [private] |
Depth buffer.
Definition at line 42 of file DepthDebugVisualization.h.
ScreenQuad* DepthDebugVisualization::m_screen [private] |
quad pasting rendered called using this instance
Definition at line 52 of file DepthDebugVisualization.h.
QTime DepthDebugVisualization::m_timer [private] |
timer to call paintgl
Definition at line 47 of file DepthDebugVisualization.h.