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()
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. |
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] |
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:
-
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:
-
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:
-
void GLWidget::timeOutSlot |
( |
|
) |
[protected, slot] |