Public Slots | Signals | Public Member Functions | Protected Member Functions

GLWidget Class Reference

#include <GLWidget.hpp>

List of all members.

Public Slots

void updateSlice (int _value)
void setSliceDirection (int _dir)
void setRenderMode (int _mode)
void setVolumeRenderMode (int _mode)
void setLight (int _state)
void setStepSize (double _stepSize)
void setCompositingMode (bool _f2b)
void setProjection (int _proj)
void setXPlane (int _xPlane)
void setYPlane (int _yPlane)
void setZPlane (int _zPlane)
void resetSettings ()

Signals

void rangeChanged (int _min, int _max)

Public Member Functions

 GLWidget (QWidget *parent=0)
virtual ~GLWidget ()
void loadData (const std::string &strFilename)
void saveScreenshot ()
void setTransferValues (float *_values)

Protected Member Functions

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

Detailed Description

Class which represents the OpenGL rendering window. In this Class all needed functions for handling the volume and slice rendering are implemented.

Author:
Christian Hirsch
Clemens Roegner

Constructor & Destructor Documentation

GLWidget::GLWidget ( QWidget *  parent = 0 )

Constructor. This constructor creates a new OpenGL render window.

Parameters:
parentParent QWidget element.
GLWidget::~GLWidget (  ) [virtual]

Destructor. Releases all the needed (graphics) memory.


Member Function Documentation

void GLWidget::initializeGL (  ) [protected]

Initializes all data needed for rendering (including devil + glut).

void GLWidget::loadData ( const std::string &  strFilename )

Loads new volume data.

Parameters:
_pathString to the path of the volume data.
void GLWidget::mouseMoveEvent ( QMouseEvent *  event ) [protected]

Sets variables needed for rotation.

Parameters:
eventEvent which calls this function.
void GLWidget::mousePressEvent ( QMouseEvent *  event ) [protected]

Saves the current mouse position, for handling rotation.

Parameters:
eventEvent which calls this funtion.
void GLWidget::paintGL (  ) [protected]

Render function. Renders either the slices or the full volume data.

void GLWidget::rangeChanged ( int  _min,
int  _max 
) [signal]

Signal which is emitted, when the slice range changes.

Parameters:
_minThe new minimum value.
_maxThe new maximum value.
void GLWidget::resetSettings (  ) [slot]

Resets the settings to standard volume rendering (compositing - front to back, with perspective projection and without shading.

void GLWidget::resizeGL ( int  width,
int  height 
) [protected]

Initializes the OpenGL render window when the window is resized.

Parameters:
widthThe new width of the render window.
heightThe new height of the render window.
void GLWidget::saveScreenshot (  )

This function saves a screenhot in the programs folder. The file name is created automatically.

void GLWidget::setCompositingMode ( bool  _f2b ) [slot]

Sets the mode for compositing rendering.

Parameters:
_f2bIf true, then front to back rendering is used, otherwise back to front is used.
void GLWidget::setLight ( int  _state ) [slot]

Sets the shader mode.

Parameters:
_stateIf Qt::Checked then shading is applyed, otherwise shading isn't applyed.
void GLWidget::setProjection ( int  _proj ) [slot]

Stets the projection mode.

Parameters:
_projIf Qt::checked, perpective projection is used, otherwise orthogonal projection is used.
void GLWidget::setRenderMode ( int  _mode ) [slot]

Sets the render mode (slice/volume rendering).

Parameters:
_modeThe new mode which should be used. 0 = slice, 1 = volume
void GLWidget::setSliceDirection ( int  _dir ) [slot]

Sets the new slice direction.

Parameters:
_dirThe new direction which should be rendered. 0 = x, 1 = y, 2 = z
void GLWidget::setStepSize ( double  _stepSize ) [slot]

Sets the new step size.

Parameters:
_stepSizeThe new step size which is used.
void GLWidget::setTransferValues ( float *  _values )

Sets the new transfer values and updates the 1D texture.

Parameters:
_valuePointer to the location of the transfer values.
void GLWidget::setVolumeRenderMode ( int  _mode ) [slot]

Sets the new volume render mode.

Parameters:
_modeThe new mode which should be used. 0 = compositing, 1 = MIP, 2 = averaging
void GLWidget::setXPlane ( int  _xPlane ) [slot]

Sets the position of the x-plane.

Parameters:
_xPlanePosition of the x plane. If positive, then the plane will be on the left side, otherwise on the right side.
void GLWidget::setYPlane ( int  _yPlane ) [slot]

Sets the position of the y-plane.

Parameters:
_yPlanePosition of the y plane. If positive, then the plane will be on the bottom, otherwise on the top.
void GLWidget::setZPlane ( int  _zPlane ) [slot]

Sets the position of the z-plane.

Parameters:
_zPlanePosition of the z plane. If positive, then the plane will be on the bottom, otherwise on the top.
void GLWidget::updateSlice ( int  _value ) [slot]

Renders a slice.

Parameters:
_valueNumber of slice, which should be rendered.

The documentation for this class was generated from the following files:
 All Classes Functions