Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
Tucano::QtTrackballWidget Class Reference

A widget with a trackball iteration for a single mesh and a single light source. Extends QGLWidget class to include common methods for using ShaderLib this widget already has a default camera and light trackball and associated mouse methods. More...

#include <qttrackballwidget.hpp>

Inheritance diagram for Tucano::QtTrackballWidget:
Tucano::QtGlewInitializer

Public Member Functions

 QtTrackballWidget (QWidget *parent)
 Default constructor. More...
 
 ~QtTrackballWidget ()
 Default destructor. More...
 
virtual void initializeGL (void)
 Initializes openGL and GLEW. More...
 
virtual void resizeGL (void)
 Resize callback for the widget. More...
 
void initialize (void)
 Initializes the trackball and the mesh with a given filename. More...
 
virtual void openMesh (string filename)
 Opens a mesh from file. More...
 
- Public Member Functions inherited from Tucano::QtGlewInitializer
 QtGlewInitializer (QWidget *parent)
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event)
 Callback for key press event. More...
 
void mousePressEvent (QMouseEvent *event)
 Callback for mouse press event. More...
 
void mouseMoveEvent (QMouseEvent *event)
 Callback for mouse move event. More...
 
void mouseReleaseEvent (QMouseEvent *event)
 Callback for mouse release event. More...
 
void wheelEvent (QWheelEvent *event)
 Callback for mouse wheel event. More...
 

Protected Attributes

Mesh mesh
 Triangle mesh. More...
 
Trackball camera
 Trackball for manipulating the camera. More...
 
Trackball light_trackball
 Trackball for manipulating the light position. More...
 

Detailed Description

A widget with a trackball iteration for a single mesh and a single light source. Extends QGLWidget class to include common methods for using ShaderLib this widget already has a default camera and light trackball and associated mouse methods.

Constructor & Destructor Documentation

Tucano::QtTrackballWidget::QtTrackballWidget ( QWidget *  parent)
inlineexplicit

Default constructor.

Parameters
parentParent widget.
Tucano::QtTrackballWidget::~QtTrackballWidget ( )
inline

Default destructor.

Member Function Documentation

void Tucano::QtTrackballWidget::initialize ( void  )
inline

Initializes the trackball and the mesh with a given filename.

virtual void Tucano::QtTrackballWidget::initializeGL ( void  )
inlinevirtual

Initializes openGL and GLEW.

void Tucano::QtTrackballWidget::keyPressEvent ( QKeyEvent *  event)
inlineprotected

Callback for key press event.

Parameters
eventThe key event that triggered the callback.
void Tucano::QtTrackballWidget::mouseMoveEvent ( QMouseEvent *  event)
inlineprotected

Callback for mouse move event.

If rotating or translating, this method updates the trackball position.

Parameters
eventThe mouse event that triggered the callback.
void Tucano::QtTrackballWidget::mousePressEvent ( QMouseEvent *  event)
inlineprotected

Callback for mouse press event.

The mouse press starts a rotation or a translation if Shift is pressed.

Parameters
eventThe mouse event that triggered the callback.
void Tucano::QtTrackballWidget::mouseReleaseEvent ( QMouseEvent *  event)
inlineprotected

Callback for mouse release event.

Stops rotation or translation.

Parameters
eventThe mouse event that triggered the callback.
virtual void Tucano::QtTrackballWidget::openMesh ( string  filename)
inlinevirtual

Opens a mesh from file.

Parameters
filenameGiven mesh file.
virtual void Tucano::QtTrackballWidget::resizeGL ( void  )
inlinevirtual

Resize callback for the widget.

void Tucano::QtTrackballWidget::wheelEvent ( QWheelEvent *  event)
inlineprotected

Callback for mouse wheel event.

Changes the camera zoom, or the camera FOV is Shift is pressed.

Parameters
eventThe mouse event that triggered the callback.

Member Data Documentation

Trackball Tucano::QtTrackballWidget::camera
protected

Trackball for manipulating the camera.

Trackball Tucano::QtTrackballWidget::light_trackball
protected

Trackball for manipulating the light position.

Mesh Tucano::QtTrackballWidget::mesh
protected

Triangle mesh.


The documentation for this class was generated from the following file: