VolVis::Gui::RenderWidget Class Reference

#include <RenderWidget.h>


Detailed Description

This widget inherits the GLWidget of QT and is used for rendering OpenGL-data. It sets up the camera and provides methods for the mouse events for transforming the scene.


Public Slots

void changeView (bool enablePerspective)

Public Member Functions

void bindRenderMode (VolumeRendering::Rendering *rendering)
const Util::CameragetCamera () const
void render (bool prepare=true, bool render=true) const
 RenderWidget (QWidget *parent=0)
void resetTransformations ()
void rotate (double angle, const Eigen::Vector3d &axis)
void saveScreenshot (std::string &path)
void scale (double factor)
void setupCamera () const
void translate (const Eigen::Vector2d &t)
 ~RenderWidget ()

Protected Member Functions

void initializeGL ()
void mouseMoveEvent (QMouseEvent *event)
void mousePressEvent (QMouseEvent *event)
void mouseReleaseEvent (QMouseEvent *event)
void paintGL ()
void resizeGL (int width, int height)


Constructor & Destructor Documentation

VolVis::Gui::RenderWidget::RenderWidget ( QWidget *  parent = 0  ) 

Constructor. Sets up a new QGLWidget.

Parameters:
parent parent widget of this one.

VolVis::Gui::RenderWidget::~RenderWidget (  ) 

Destructor.


Member Function Documentation

void VolVis::Gui::RenderWidget::bindRenderMode ( VolumeRendering::Rendering rendering  ) 

Binds a render mode (e.g. Slicing) to the widget. When rendering the widget, the render-method of the render mode will be called.

Parameters:
rendering the active render mode which should be used at rendering

void VolVis::Gui::RenderWidget::changeView ( bool  enablePerspective  )  [slot]

Sets the view to perspective or orthographic projection.

Parameters:
enablePerspective if true, perspective projection is enabled, otherwise orthographic projection.

const Util::Camera* VolVis::Gui::RenderWidget::getCamera (  )  const

Returns the camera used for setting up the projection matrix

Returns:
camera which defines the view of the scene

void VolVis::Gui::RenderWidget::initializeGL (  )  [protected]

Implements all necessary operations for initializing OpenGL.

void VolVis::Gui::RenderWidget::mouseMoveEvent ( QMouseEvent *  event  )  [protected]

This method is inherited from QWidget and is called when the mouse is pressed and moved over the widget. The transformation of the scene is changed due to which mousebutton has been pressed.

Parameters:
event contains the parameters of the mouse event (e.g. which button has been used)

void VolVis::Gui::RenderWidget::mousePressEvent ( QMouseEvent *  event  )  [protected]

This method is inherited from QWidget and is called when a mouse button is pressed. It is needed to change the quality of rendering before the scene is transformed.

Parameters:
event contains the parameters of the mouse event (e.g. which button has been used)

void VolVis::Gui::RenderWidget::mouseReleaseEvent ( QMouseEvent *  event  )  [protected]

This method is inherited from QWidget and is called when a pressed mousebutton is released. This method is needed for changing the quality of rendering after the scene transformation has been finished.

Parameters:
event contains the parameters of the mouse event (e.g. which button has been used)

void VolVis::Gui::RenderWidget::paintGL (  )  [protected]

This method is called by the slot updateGL() from the base class QGLWidget. This is needed for the openGL callback. It calls render(true, true).

void VolVis::Gui::RenderWidget::render ( bool  prepare = true,
bool  render = true 
) const

This renders the loaded volume with the selected render mode. Before it assigns the transformations defined by mouse interaction. Sometimes it's useful to only prepare for rendering or only to render and use the preparation of the last frame (e.g. when rendering a high resolution image).

Parameters:
prepare Calls the prepareForRender method of the render mode
render Calls the render method of the render mode

void VolVis::Gui::RenderWidget::resetTransformations (  ) 

Resets the rotation and translation which have been set by rotate/translate.

void VolVis::Gui::RenderWidget::resizeGL ( int  width,
int  height 
) [protected]

This method is called when the size of the widget is changed.

Parameters:
width new width of the widget
height new height of the widget

void VolVis::Gui::RenderWidget::rotate ( double  angle,
const Eigen::Vector3d &  axis 
)

Rotates all objects drawn in the GL area

Parameters:
angle rotation angle
axis rotation axis

void VolVis::Gui::RenderWidget::saveScreenshot ( std::string &  path  ) 

The current content of the render widget will be saved as an image.

Parameters:
path path to the file where the image should be stored

void VolVis::Gui::RenderWidget::scale ( double  factor  ) 

Scales the objects in the GL area by the given factor.

Parameters:
factor factor with which the scene is scaled

void VolVis::Gui::RenderWidget::setupCamera (  )  const

Redefines the projection matrix with the camera attached to this render widget.

void VolVis::Gui::RenderWidget::translate ( const Eigen::Vector2d &  t  ) 

Translates all objects in the GL area in x and y translation

Parameters:
t contains the translation in x and y directions


The documentation for this class was generated from the following file:
Generated on Wed Dec 5 12:27:31 2007 for VolVis by  doxygen 1.5.1-p1