GLWidget Class Reference

Display widget for the volume dataset. More...

List of all members.

Public Slots

Public Member Functions

Protected Slots

Protected Member Functions


Detailed Description

Provides the widget that takes care of all the rendering of the volume data. Most of the work happens here. Includes both the 2d (slicing) and 3d (direct volume rendering) processes.


Constructor & Destructor Documentation

GLWidget::GLWidget ( int  timerInterval = 0,
QWidget *  parent = 0 
)

Constructor.

Parameters:
timerInterval The interval (in milliseconds) the widget uses to redraw.
parent This widget's parent widget.
See also:
~GLWidget()
GLWidget::~GLWidget (  ) 

Default destructor.

Deletes all the generated textures.

See also:
GLWidget()

Member Function Documentation

QSize GLWidget::sizeHint (  )  const

Tells Qt which size this widget prefers to have.

Overwritten from Widget.

void GLWidget::loadDataSet ( std::string  fileName  ) 

Loads a volume dataset.

Also generates the texture containing the dataset (3d if supported by hardware, 2d otherwise).

Parameters:
fileName The filename of the volume data (.dat).
void GLWidget::check_gl_error ( std::string  from  ) 

Utility function for debugging.

Outputs the last occurring OpenGL error (at the time of the function call) as well as a custom label to indicate where in the code this function call is.

Parameters:
from The custom label indicating where in the code a function call occurrs.
TFTexture* GLWidget::transferFunction (  ) 

Access function for the transfer function.

Returns:
The transfer function used by this widget.
void GLWidget::toggleArrowPlot ( bool  enabled  )  [slot]

Slot that enables/disables the arrow plot.

Parameters:
enabled Whether to enable (true) or disable (false) the arrow plot.
void GLWidget::toggleArrowScale ( bool  enabled  )  [slot]

Slot that enables/disables scaling of the arrow plot.

Parameters:
enabled Whether to enable (true) or disable (false) scaling of the arrow plot.
void GLWidget::setNumArrows ( int  num  )  [slot]

Slot to set the number of arrows for the arrow plot.

Parameters:
num The new number of arrows (rows and colums) for the arrow plot.
void GLWidget::toggleStreamlines ( bool  enabled  )  [slot]

Slot that enables/disables the streamlines.

Parameters:
enabled Whether to enable (true) or disable (false) the streamlines.
void GLWidget::setRK ( bool  enabled  )  [slot]

Slot that toggles the algorithm used for approximating the streamlines.

This switches between Euler's method and the Runge-Kutta second order algorithm.

Parameters:
enabled True to switch to Runge-Kutta, false to use Euler's method.
void GLWidget::setNumLines ( int  num  )  [slot]

Slot to set the number of streamlines.

Parameters:
num The new number of streamlines (rows and colums).
void GLWidget::setNumSteps ( int  num  )  [slot]

Slot to set the number of iteration steps for the streamlines.

Parameters:
num The new number of iteration steps for the streamlines.
void GLWidget::setStepSize ( double  step  )  [slot]

Slot to set the size of each iteration step for the streamlines.

Parameters:
step The new size of each iteration step for the streamlines.
void GLWidget::lockStepSize ( bool  enabled  )  [slot]

Slot that locks/unlocks the ratio of step size to number of steps.

Parameters:
enabled Whether to lock (true) or unlock (false) the step size to the number of iteration steps.
void GLWidget::togglePong ( bool  enabled  )  [slot]

Slot that enables/disables the Pong game.

Also disables the cursor and enables mouse tracking when the game is enabled and vice versa.

Parameters:
enabled Whether to enable (true) or disable (false) the Pong game.
void GLWidget::resetPong (  )  [slot]

Slot that resets the Pong game.

This sets the ball at a random position within the display widget and resets its velocity to 0.

void GLWidget::initializeGL ( void   )  [protected]

Initialises OpenGL.

Overwritten from QGLWidget. Initialises GLEW and GLSL. Most of the actual initialisation happens in setShaders().

See also:
setShaders(), paintGL(), resizeGL()
void GLWidget::resizeGL ( int  width,
int  height 
) [protected]

Resizes the GL viewport on widget resize.

Overwritten from QGLWidget.

Parameters:
width New viewport width.
height New viewport height.
See also:
initializeGL(), paintGL()
void GLWidget::paintGL (  )  [protected]

Renders the scene.

Most of the work happens here. Displays any of the chosen functions, including an arrow plot, streamlines, and the Pong game.

See also:
drawBoundingBox(), initializeGL(), resizeGL()
void GLWidget::timeOut (  )  [protected]

Calls for update of the widget.

Is called whenever the timer sends a signal to timeOutSlot(). Calls updateGL(), which in turn automatically calls for a redraw via paintGL().

See also:
timeOutSlot(), paintGL()
void GLWidget::mouseMoveEvent ( QMouseEvent *  event  )  [protected]

Handles mouse movement inside the widget.

Is called whenever the mouse moves inside the widget. If the Pong game is enabled and unpaused, this makes sure the Player is always at the cursor positon.

Parameters:
event The mouse event.
void GLWidget::mousePressEvent ( QMouseEvent *  event  )  [protected]

Handles mouse clicks inside the widget.

Is called whenever a mouse button is clicked inside the widget. If the Pong game is enabled and unpaused, this switches to attraction mode when the left mouse button is pressed and repulsion mode when the right mouse button is pressed.

Parameters:
event The mouse event.
void GLWidget::mouseReleaseEvent ( QMouseEvent *  event  )  [protected]

Handles when a mouse button is released inside the widget.

Is called whenever a mouse button is released inside the widget. If the Pong game is enabled and unpaused, this switches to neutral mode when no mouse buttons are pressed anymore.

Parameters:
event The mouse event.
void GLWidget::timeOutSlot (  )  [protected, slot]

Slot for the peroidic timer signal.

Calls timeOut(), which in turn calls for a redraw of this widget. /sa timeOut(), paintGL()


Generated on Thu Jan 21 00:31:55 2010 for simpleVIS by  doxygen 1.6.1