Tucano  0.1
A library for rapid prototyping with modern OpenGL and GLSL
Tucano::QtFlycameraWidget 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 Tucano this widget already has a default camera and light trackball and associated mouse methods. More...

#include <qtflycamerawidget.hpp>

Inheritance diagram for Tucano::QtFlycameraWidget:
Tucano::QtGlewFlycameraInitializer Tucano::QtFreecameraWidget

Public Member Functions

 QtFlycameraWidget (QWidget *parent)
 Default constructor. More...
 
 ~QtFlycameraWidget ()
 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::QtGlewFlycameraInitializer
 QtGlewFlycameraInitializer (QWidget *parent)
 

Protected Member Functions

virtual 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...
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 Callback for mouse release event. More...
 

Protected Attributes

Mesh mesh
 Triangle mesh. More...
 
Flycameracamera
 Flycamera. 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 Tucano this widget already has a default camera and light trackball and associated mouse methods.

Constructor & Destructor Documentation

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

Default constructor.

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

Default destructor.

Member Function Documentation

void Tucano::QtFlycameraWidget::initialize ( void  )
inline

Initializes the trackball and the mesh with a given filename.

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

Initializes openGL and GLEW.

virtual void Tucano::QtFlycameraWidget::keyPressEvent ( QKeyEvent *  event)
inlineprotectedvirtual

Callback for key press event.

Parameters
eventThe key event that triggered the callback.
void Tucano::QtFlycameraWidget::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::QtFlycameraWidget::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.
virtual void Tucano::QtFlycameraWidget::mouseReleaseEvent ( QMouseEvent *  event)
inlineprotectedvirtual

Callback for mouse release event.

Stops rotation or translation.

Parameters
eventThe mouse event that triggered the callback.

Reimplemented in Tucano::QtFreecameraWidget.

virtual void Tucano::QtFlycameraWidget::openMesh ( string  filename)
inlinevirtual

Opens a mesh from file.

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

Resize callback for the widget.

Member Data Documentation

Flycamera* Tucano::QtFlycameraWidget::camera
protected
Trackball Tucano::QtFlycameraWidget::light_trackball
protected

Trackball for manipulating the light position.

Mesh Tucano::QtFlycameraWidget::mesh
protected

Triangle mesh.


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