KINECT STATS GENERATOR FOR SPORTS VISUALISATION  1.0
DepthDebugVisualization Class Reference

To visualize depth data. More...

#include <DepthDebugVisualization.h>

+ Collaboration diagram for DepthDebugVisualization:

List of all members.

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
ScreenQuadm_screen
 quad pasting rendered called using this instance

Detailed Description

To visualize depth data.

Definition at line 25 of file DepthDebugVisualization.h.


Constructor & Destructor Documentation

Constructor for DepthDebugVisualization.

Parameters:
[in]_parentthe 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.

{
    if(m_screen)
    {
        delete m_screen;
    }
}

Member Function Documentation

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();
}

+ Here is the call graph for this function:

void DepthDebugVisualization::mouseMoveEvent ( QMouseEvent *  _event) [private]

this method is called every time a mouse is moved

Parameters:
_eventthe 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.

Parameters:
_eventthe 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.

Parameters:
_eventthe 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);
}

+ Here is the call graph for this function:

void DepthDebugVisualization::resizeGL ( const int  _w,
const int  _h 
) [protected]

this is called whenever the window is re-sized

Parameters:
[in]_wthe width of the resized window
[in]_hthe 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();

}

Member Data Documentation

Depth buffer.

Definition at line 42 of file DepthDebugVisualization.h.

quad pasting rendered called using this instance

Definition at line 52 of file DepthDebugVisualization.h.

timer to call paintgl

Definition at line 47 of file DepthDebugVisualization.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator