arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

BasicQGL Class Reference

#include <BasicQGL.h>

Inheritance diagram for BasicQGL:

RenderableQGL SimianQGL TFGL List of all members.

Detailed Description

Basic QGL class.

Definition at line 51 of file BasicQGL.h.

Camera/Manip Set/Get

virtual gutz::CameraSP getCamera () const
virtual void setCamera (gutz::CameraSP c)
virtual gutz::ManipSP getManip () const
virtual void setManip (gutz::ManipSP m)

Performance Timer on/off

void perfTimerOn (bool onoff)
bool perfTimerOn () const

Redraw Timer (event callback timer)

virtual void endTimer ()
 Stop (all) timers.

virtual void setTimer (int ms_time)
 Start the render timer, updates every ms_time miliseconds.


Framebuffer Readback/Write & size:

gutz::vec2ui getScreenDims () const
bool readFrameBuffer (void *dataPtr, int size, GLenum format=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE)
 pre intialized data buffer, with size elements, desired format for read, false = success, true = failure

bool writeFrameBuffer (void *dataPtr, int x, int y, GLenum format=GL_RGBA, GLenum type=GL_UNSIGNED_BYTE)

gutz::Signals

gutz::Signal drawDone
 signal: drawDone(), called after the draw event completes.


Public Types

typedef KeyCmdQt< BasicQGLKeyCmdType
typedef gutz::SmartPtr< KeyCmdTypeKeyCmdSPType

Signals

void cameraChanged (gutz::CameraSP c)
 These are about to be depricated... moving to gutz::Signal.

void manipChanged (gutz::ManipSP m)
 These are about to be depricated... moving to gutz::Signal.

void drawFinished ()
 These are about to be depricated...


Public Member Functions

 BasicQGL (QWidget *parent=0, const char *name=0)
virtual ~BasicQGL ()
virtual void update ()
void setKeyCmd (char key, KeyCmdType *cmd)

Protected Types

typedef std::map< char, KeyCmdSPType,
ltchar
KeyMapType
 A quick and dirty keyboard command/callback helper :).


Protected Member Functions

virtual void mouseMoveEvent (QMouseEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
virtual void mouseDoubleClickEvent (QMouseEvent *e)
virtual void keyPressEvent (QKeyEvent *e)
virtual void keyReleaseEvent (QKeyEvent *e)
virtual void handleKeyCmd (QKeyEvent *e)
virtual void initializeGL ()
virtual void resizeGL (int width, int height)
virtual void paintGL ()
virtual void timerEvent (QTimerEvent *)
virtual void draw ()
 overide this draw function

virtual void initManipulators ()
 init Camera and Manip


Protected Attributes

gutz::CameraSP _cam
gutz::ManipSP _manip
bool _mouseDown
KeyMapType _keyMap
Timer _time
 performance timer

bool _timeOn
 performance timer on?


Member Typedef Documentation

typedef gutz::SmartPtr< KeyCmdType > BasicQGL::KeyCmdSPType
 

Definition at line 96 of file BasicQGL.h.

Referenced by setKeyCmd().

typedef KeyCmdQt<BasicQGL> BasicQGL::KeyCmdType
 

Definition at line 95 of file BasicQGL.h.

typedef std::map<char, KeyCmdSPType , ltchar> BasicQGL::KeyMapType [protected]
 

A quick and dirty keyboard command/callback helper :).

Definition at line 189 of file BasicQGL.h.


Constructor & Destructor Documentation

BasicQGL::BasicQGL QWidget *  parent = 0,
const char *  name = 0
 

Definition at line 51 of file BasicQGL.cpp.

References _cam, _manip, initManipulators(), and name.

BasicQGL::~BasicQGL  )  [virtual]
 

Definition at line 64 of file BasicQGL.cpp.


Member Function Documentation

void BasicQGL::cameraChanged gutz::CameraSP  c  )  [signal]
 

These are about to be depricated... moving to gutz::Signal.

Referenced by mouseMoveEvent().

void BasicQGL::draw  )  [protected, virtual]
 

overide this draw function

TODO: remove QT signals for simian events, use gutz::Signal

Reimplemented in RenderableQGL.

Definition at line 145 of file BasicQGL.cpp.

References _cam, drawDone, drawFinished(), GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_MODELVIEW, GL_PROJECTION, GL_QUADS, glBegin(), glClear(), glColor4f(), glEnd(), glLoadMatrixf(), glMatrixMode(), glPopMatrix(), glPushMatrix(), and glVertex3f().

Referenced by paintGL().

void BasicQGL::drawFinished  )  [signal]
 

These are about to be depricated...

moving to gutz::Signal signal called after complete raw

Referenced by RenderableQGL::draw(), and draw().

virtual void BasicQGL::endTimer  )  [inline, virtual]
 

Stop (all) timers.

Definition at line 83 of file BasicQGL.h.

virtual gutz::CameraSP BasicQGL::getCamera  )  const [inline, virtual]
 

Definition at line 63 of file BasicQGL.h.

References _cam.

virtual gutz::ManipSP BasicQGL::getManip  )  const [inline, virtual]
 

Definition at line 65 of file BasicQGL.h.

References _manip.

gutz::vec2ui BasicQGL::getScreenDims  )  const [inline]
 

Definition at line 106 of file BasicQGL.h.

References _cam.

void BasicQGL::handleKeyCmd QKeyEvent *  e  )  [protected, virtual]
 

Definition at line 321 of file BasicQGL.cpp.

References _keyMap.

Referenced by keyPressEvent().

void BasicQGL::initializeGL  )  [protected, virtual]
 

Definition at line 73 of file BasicQGL.cpp.

References GL_AMBIENT, GL_COLOR_MATERIAL, GL_CULL_FACE, GL_DEPTH_TEST, GL_DIFFUSE, GL_FALSE, GL_FRONT_AND_BACK, GL_LEQUAL, GL_LIGHT0, GL_LIGHT_MODEL_AMBIENT, GL_LIGHT_MODEL_TWO_SIDE, GL_LIGHTING, GL_POSITION, GL_SHININESS, GL_SMOOTH, GL_SPECULAR, glClearColor(), glDepthFunc(), glDisable(), glEnable(), glewInit(), glLightfv(), glLightModelfv(), glMaterialfv(), and glShadeModel().

void BasicQGL::initManipulators  )  [protected, virtual]
 

init Camera and Manip

Definition at line 341 of file BasicQGL.cpp.

References _cam, _manip, gutz::CAM_DOLLY, gutz::CAM_ROT, gutz::CAM_SWIVEL, gutz::CAM_TRANS_XY, gutz::CAM_TRANS_XZ, gutz::CAM_TRANS_ZY, gutz::CAM_ZOOM, gutz::GUTZ_CTRL, gutz::GUTZ_DOWN_ARROW, gutz::GUTZ_LEFT_MOUSE, gutz::GUTZ_MIDDLE_MOUSE, gutz::GUTZ_RIGHT_MOUSE, gutz::GUTZ_SHIFT, gutz::GUTZ_UP_ARROW, and gutz::vec3f.

Referenced by BasicQGL(), and RenderableQGL::RenderableQGL().

void BasicQGL::keyPressEvent QKeyEvent *  e  )  [protected, virtual]
 

Let's be a nice interface and only use the key if we want it

Definition at line 281 of file BasicQGL.cpp.

References handleKeyCmd(), and s.

void BasicQGL::keyReleaseEvent QKeyEvent *  e  )  [protected, virtual]
 

Definition at line 311 of file BasicQGL.cpp.

void BasicQGL::manipChanged gutz::ManipSP  m  )  [signal]
 

These are about to be depricated... moving to gutz::Signal.

Referenced by mouseMoveEvent().

void BasicQGL::mouseDoubleClickEvent QMouseEvent *  e  )  [protected, virtual]
 

Reimplemented in RenderableQGL.

Definition at line 200 of file BasicQGL.cpp.

References _cam, _manip, _mouseDown, qt2GutzMouse(), and update().

Referenced by RenderableQGL::mouseDoubleClickEvent().

void BasicQGL::mouseMoveEvent QMouseEvent *  e  )  [protected, virtual]
 

update the current move event's position

Reimplemented in RenderableQGL.

Definition at line 243 of file BasicQGL.cpp.

References _cam, _manip, _mouseDown, cameraChanged(), manipChanged(), qt2GutzMouse(), update(), and gutz::vec3f.

Referenced by RenderableQGL::mouseMoveEvent().

void BasicQGL::mousePressEvent QMouseEvent *  e  )  [protected, virtual]
 

Reimplemented in RenderableQGL.

Definition at line 178 of file BasicQGL.cpp.

References _cam, _manip, _mouseDown, qt2GutzMouse(), and update().

Referenced by RenderableQGL::mousePressEvent().

void BasicQGL::mouseReleaseEvent QMouseEvent *  e  )  [protected, virtual]
 

Reimplemented in RenderableQGL.

Definition at line 221 of file BasicQGL.cpp.

References _cam, _manip, _mouseDown, gutz::GUTZ_BUTTON_NONE, and update().

Referenced by RenderableQGL::mouseReleaseEvent().

virtual void BasicQGL::paintGL  )  [inline, protected, virtual]
 

Definition at line 159 of file BasicQGL.h.

References draw().

bool BasicQGL::perfTimerOn  )  const [inline]
 

Definition at line 74 of file BasicQGL.h.

References _timeOn.

void BasicQGL::perfTimerOn bool  onoff  )  [inline]
 

Definition at line 73 of file BasicQGL.h.

References _time, _timeOn, and Timer::start().

bool BasicQGL::readFrameBuffer void *  dataPtr,
int  size,
GLenum  format = GL_RGBA,
GLenum  type = GL_UNSIGNED_BYTE
 

pre intialized data buffer, with size elements, desired format for read, false = success, true = failure

Definition at line 370 of file BasicQGL.cpp.

References _cam, format, GL_BGR_EXT, GL_BGRA_EXT, GL_RGB, GL_RGBA, glErr(), glReadPixels(), size, and type.

void BasicQGL::resizeGL int  w,
int  h
[protected, virtual]
 

had to change this to respect the users settings for perspective/ortho

Definition at line 122 of file BasicQGL.cpp.

References _cam, GL_MODELVIEW, GL_PROJECTION, glLoadMatrixf(), glMatrixMode(), GLsizei, glViewport(), and w.

virtual void BasicQGL::setCamera gutz::CameraSP  c  )  [inline, virtual]
 

Definition at line 64 of file BasicQGL.h.

References _cam, and update().

void BasicQGL::setKeyCmd char  key,
KeyCmdType cmd
[inline]
 

Definition at line 97 of file BasicQGL.h.

References _keyMap, and KeyCmdSPType.

virtual void BasicQGL::setManip gutz::ManipSP  m  )  [inline, virtual]
 

Definition at line 66 of file BasicQGL.h.

References _manip, and update().

virtual void BasicQGL::setTimer int  ms_time  )  [inline, virtual]
 

Start the render timer, updates every ms_time miliseconds.

Definition at line 85 of file BasicQGL.h.

virtual void BasicQGL::timerEvent QTimerEvent *   )  [inline, protected, virtual]
 

Definition at line 161 of file BasicQGL.h.

References _cam, _manip, _mouseDown, and update().

virtual void BasicQGL::update  )  [inline, virtual]
 

Definition at line 58 of file BasicQGL.h.

Referenced by mouseDoubleClickEvent(), RenderableQGL::mouseMoveEvent(), mouseMoveEvent(), RenderableQGL::mousePressEvent(), mousePressEvent(), mouseReleaseEvent(), setCamera(), setManip(), and timerEvent().

bool BasicQGL::writeFrameBuffer void *  dataPtr,
int  x,
int  y,
GLenum  format = GL_RGBA,
GLenum  type = GL_UNSIGNED_BYTE
 

Definition at line 401 of file BasicQGL.cpp.

References format, glDrawPixels(), glErr(), and type.


Member Data Documentation

gutz::CameraSP BasicQGL::_cam [protected]
 

Definition at line 181 of file BasicQGL.h.

Referenced by BasicQGL(), RenderableQGL::draw(), draw(), RenderableQGL::drawRenderables(), getCamera(), SimianQGL::getLastCenter(), getScreenDims(), initManipulators(), mouseDoubleClickEvent(), RenderableQGL::mouseMoveEvent(), mouseMoveEvent(), RenderableQGL::mousePressEvent(), mousePressEvent(), RenderableQGL::mouseReleaseEvent(), mouseReleaseEvent(), readFrameBuffer(), RenderableQGL::RenderableQGL(), resizeGL(), setCamera(), TFGL::TFGL(), and timerEvent().

KeyMapType BasicQGL::_keyMap [protected]
 

Definition at line 190 of file BasicQGL.h.

Referenced by handleKeyCmd(), and setKeyCmd().

gutz::ManipSP BasicQGL::_manip [protected]
 

Definition at line 182 of file BasicQGL.h.

Referenced by BasicQGL(), RenderableQGL::drawRenderables(), SimianQGL::getLastCenter(), getManip(), initManipulators(), mouseDoubleClickEvent(), RenderableQGL::mouseMoveEvent(), mouseMoveEvent(), RenderableQGL::mousePressEvent(), mousePressEvent(), RenderableQGL::mouseReleaseEvent(), mouseReleaseEvent(), RenderableQGL::RenderableQGL(), setManip(), TFGL::TFGL(), and timerEvent().

bool BasicQGL::_mouseDown [protected]
 

Definition at line 184 of file BasicQGL.h.

Referenced by mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and timerEvent().

Timer BasicQGL::_time [protected]
 

performance timer

Definition at line 192 of file BasicQGL.h.

Referenced by RenderableQGL::draw(), perfTimerOn(), and RenderableQGL::RenderableQGL().

bool BasicQGL::_timeOn [protected]
 

performance timer on?

Definition at line 193 of file BasicQGL.h.

Referenced by RenderableQGL::draw(), and perfTimerOn().

gutz::Signal BasicQGL::drawDone
 

signal: drawDone(), called after the draw event completes.

Definition at line 125 of file BasicQGL.h.

Referenced by RenderableQGL::draw(), and draw().


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk