KINECT STATS GENERATOR FOR SPORTS VISUALISATION  1.0
QKinectProcessEvents Class Reference

this is the process event thread class it needs to be a class so we can use the Qt thread system More...

#include <KinectInterface.h>

List of all members.

Public Member Functions

 QKinectProcessEvents (freenect_context *_ctx)
 ctor where we pass in the context of the kinect
void setActive ()
 sets the thread active this will loop the run thread with a while(m_active) setting this will end the thread loop
void setInActive ()
 sets the thread active must call QThread::start again to make this work if the thread has been de-activated

Protected Member Functions

void run ()
 the actual thread main loop, this is not callable and the QThread::start method of QThread must be called to activate the loop

Private Attributes

bool m_active
 a flag to indicate if the loop is to be active set true in the ctor
freenect_context * m_ctx
 the context of the kinect device, this must be set before the thread is run with QThread::start

Detailed Description

this is the process event thread class it needs to be a class so we can use the Qt thread system

Author:
Jonathan Macey
Version:
1.0
Date:
20/12/10 Inital commit

Definition at line 53 of file KinectInterface.h.


Constructor & Destructor Documentation

QKinectProcessEvents::QKinectProcessEvents ( freenect_context *  _ctx) [inline]

ctor where we pass in the context of the kinect

Parameters:
[in]_ctxthe context of the current kinect device

Definition at line 60 of file KinectInterface.h.

References m_ctx.

                                                            {m_ctx=_ctx;}

Member Function Documentation

void QKinectProcessEvents::run ( ) [protected]

the actual thread main loop, this is not callable and the QThread::start method of QThread must be called to activate the loop

Definition at line 48 of file KinectInterface.cpp.

References m_active, and m_ctx.

{
    // loop while we are active and process the kinect event queue
    while(m_active)
    {
        //qDebug()<<"process thread\n";
        if(freenect_process_events(m_ctx) < 0)
        {
            throw std::runtime_error("Cannot process freenect events");
        }
    }
}

sets the thread active this will loop the run thread with a while(m_active) setting this will end the thread loop

Definition at line 68 of file KinectInterface.h.

References m_active.

{m_active=true;}

+ Here is the caller graph for this function:

sets the thread active must call QThread::start again to make this work if the thread has been de-activated

Definition at line 73 of file KinectInterface.h.

References m_active.

{m_active=false;}

+ Here is the caller graph for this function:


Member Data Documentation

a flag to indicate if the loop is to be active set true in the ctor

Definition at line 86 of file KinectInterface.h.

freenect_context* QKinectProcessEvents::m_ctx [private]

the context of the kinect device, this must be set before the thread is run with QThread::start

Definition at line 91 of file KinectInterface.h.


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