GLWidget Class Reference

#include <glwidget.h>

List of all members.

Public Slots

void setBackgroundColors ()
void setArrowColors ()
void setStreamlineColors ()
void setDrawBackground (bool state)
void setBackgroundColorChannel (int channel)
void setDrawArrows (bool state)
void setArrowQuantity (int quantity)
void setArrowColorChannel (int channel)
void setDrawStreamlines (bool state)
void setStreamlineMode (int mode)
void setStreamlineDtest (int newDtest)
void setStreamlineDsep (int newDsep)
void setStreamlineDt (int newDt)
void setStreamlinePeriod (int Period)
void setStreamlineLineMode (int mode)
void setStreamlineColorChannel (int channel)

Public Member Functions

 GLWidget (QWidget *parent=0)
QSize minimumSizeHint () const
QSize sizeHint () const
void setFlowData (FlowData *newFlowData)
void setBackgroundColorsPtr (QRgb *colorsPtr)
void setArrowColorsPtr (QRgb *colorsPtr)
void setStreamlineColorsPtr (QRgb *colorsPtr)

Protected Member Functions

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

Private Member Functions

void draw ()
void normalizeAngle (int *angle)
char * file2string (const std::string &strFilename)
GLuint loadShader (const std::string &strFilename)
void printLog (GLuint obj)
void drawArrowPlot (const int xScaler, const int yScaler)
void calcEuler (float x, float y)
void calcRunge (float x, float y)
void calculateBackground ()
void drawStreamline (int mode)
bool testRange (vec3 point)
bool testCell (int cellx, int celly, vec3 point)
float getTapering (vec3 point, vector< vec3 > line, unsigned int i)
float testCellTapering (int cellx, int celly, vec3 point, vector< vec3 > line, unsigned int i)
bool testSLDist (vec3 point, vector< vec3 > line, unsigned int i)
void calculateEvenStreamlines ()
void addPoint2Grid (vec3 point)
void calcStartCandidates (vec3 pos)
void initStreamlines ()
void removeLastPointfromCell (vec3 point)


Detailed Description

Sets up a Qt OpenGl Canvas Widget.

Constructor & Destructor Documentation

GLWidget::GLWidget ( QWidget *  parent = 0  ) 

Sets up a Qt OpenGl Canvas.

Parameters:
parent is the parent window of the canvas.


Member Function Documentation

QSize GLWidget::minimumSizeHint (  )  const

Returns:
The minimum size for the Widget.

QSize GLWidget::sizeHint (  )  const

Returns:
The size hint for the Widget.

void GLWidget::setFlowData ( FlowData newFlowData  ) 

Sets up the Canvas for a new Flowdata object.

Parameters:
newFlowData is the new Flowdata.

void GLWidget::setBackgroundColorsPtr ( QRgb *  colorsPtr  ) 

Initializes the pointer to the background transferfunction array.

Parameters:
colorsPtr is the pointer to the new array.

void GLWidget::setArrowColorsPtr ( QRgb *  colorsPtr  ) 

Initializes the pointer to the arrow transferfunction array.

Parameters:
colorsPtr is the pointer to the new array.

void GLWidget::setStreamlineColorsPtr ( QRgb *  colorsPtr  ) 

Initializes the pointer to the streamline transferfunction array.

Parameters:
colorsPtr is the pointer to the new array.

void GLWidget::setBackgroundColors (  )  [slot]

Notifies that the background transferfunction has changed and redraws the scene.

void GLWidget::setArrowColors (  )  [slot]

Notifies that the arrow transferfunction has changed and redraws the scene.

void GLWidget::setStreamlineColors (  )  [slot]

Notifies that the streamline transferfunction has changed and redraws the scene.

void GLWidget::setDrawBackground ( bool  state  )  [slot]

Sets the current background Rendermode.

Parameters:
state holds if the backround should be drawn or not.

void GLWidget::setBackgroundColorChannel ( int  channel  )  [slot]

Sets the current FlowChannel for the background transferfunction.

Parameters:
channel the new Channel.

void GLWidget::setDrawArrows ( bool  state  )  [slot]

Sets the current arrow Rendermode.

Parameters:
state holds if the backround should be drawn or not.

void GLWidget::setArrowQuantity ( int  quantity  )  [slot]

Sets the current arrow quantity.

Parameters:
quantity holds how many arrows should be drawn.

void GLWidget::setArrowColorChannel ( int  channel  )  [slot]

Sets the current FlowChannel for the arrow transferfunction.

Parameters:
channel the new Channel.

void GLWidget::setDrawStreamlines ( bool  state  )  [slot]

Sets the current streamline Rendermode.

Parameters:
state holds if the backround should be drawn or not.

void GLWidget::setStreamlineMode ( int  mode  )  [slot]

Sets the current streamline integrationmode.

Parameters:
mode holds the integrationmode.

void GLWidget::setStreamlineDtest ( int  newDtest  )  [slot]

Sets the relation of the dtest to the dsep parameter for the streamline algorithm.

Parameters:
newDtest new dtest relation parameter.

void GLWidget::setStreamlineDsep ( int  newDsep  )  [slot]

Sets the relation of the dsep parameter to the shorter dimension of the dataset.

Parameters:
newDsep new dsep relation parameter.

void GLWidget::setStreamlineDt ( int  newDt  )  [slot]

Sets the relation of the dt to the dtest parameter for the streamline algorithm.

Parameters:
newDt new dt relation parameter.

void GLWidget::setStreamlinePeriod ( int  newPeriod  )  [slot]

Sets length of the period for the streamline texture visualization mode.

Parameters:
newPeriod new period length.

void GLWidget::setStreamlineLineMode ( int  mode  )  [slot]

Sets the current streamline visualization style.

Parameters:
mode holds the streamline visualization style.

void GLWidget::setStreamlineColorChannel ( int  channel  )  [slot]

Sets the current FlowChannel for the streamline transferfunction.

Parameters:
channel the new Channel.

void GLWidget::initializeGL (  )  [protected]

Initialzes the OpenGl environment including antialiasing.

void GLWidget::paintGL (  )  [protected]

Applys affine transformations and starts the drawing of the frame.

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

Handles resizing of the OpenGl canvas.

Parameters:
width is the new width of the canvas.
height is the new height of the canvas.

void GLWidget::mousePressEvent ( QMouseEvent *  event  )  [protected]

Reduces the stepsize of the raycastingshader and initialises volume rotations.

Parameters:
event is the mousePressEvent.

void GLWidget::mouseReleaseEvent ( QMouseEvent *  event  )  [protected]

Increases the stepsize of the raycastingshader after finished volume rotations.

Parameters:
event is the mouseReleaseEvent.

void GLWidget::mouseMoveEvent ( QMouseEvent *  event  )  [protected]

Handles mouse dragging and rotation of the volume.

Parameters:
event is the mouseMoveEvent.

void GLWidget::wheelEvent ( QWheelEvent *  event  )  [protected]

Handles mouseWheelEvents.

Parameters:
event is the mouseWheelEvent.

void GLWidget::draw (  )  [private]

Draws texture, arrow and streamline layers (if activated).

void GLWidget::normalizeAngle ( int *  angle  )  [private]

Keeps angle within [0 360] interval.

Parameters:
angle is the pointer to the angle.

char * GLWidget::file2string ( const std::string &  strFilename  )  [private]

Loads a binary file into a Charpointer.

Parameters:
strFilename ist the filename of the file to load.
Returns:
The Charpointer with the content of the file.

GLuint GLWidget::loadShader ( const std::string &  strFilename  )  [private]

Handels loading, compiling and attaching of a vertex-, fragmentshader pair to a shader program. * Loading requires 2 glsl shader files with "<filepath>.vert" and "<filepath>.frag" extension to be successful.

Parameters:
strFilename is the filepath of the shaders without extension.
Returns:
The id of the new shaderprogram.

void GLWidget::printLog ( GLuint  obj  )  [private]

Prints the shaderobject debug log.

Parameters:
obj specifies the shaderobject.

void GLWidget::drawArrowPlot ( const int  xScaler,
const int  yScaler 
) [private]

Draws the Arrowlayer.

Parameters:
xScaler density of arrows in x-direction.
yScaler density of arrows in y-direction.

void GLWidget::calcEuler ( float  x,
float  y 
) [private]

Calculates a streamline in both directions of the given point using the Euler integration method.

Parameters:
x component of the startpoint.
y component of the startpoint.

void GLWidget::calcRunge ( float  x,
float  y 
) [private]

Calculates a streamline in both directions of the given point using the Runge-Kutta integration method.

Parameters:
x component of the startpoint.
y component of the startpoint.

void GLWidget::calculateBackground (  )  [private]

Creates the background texture layer.

void GLWidget::drawStreamline ( int  mode  )  [private]

Draws the streamline layer with the given visualization mode.

Parameters:
mode line draw mode (0: normal | 1: tapered | 2: glyphs | 3: texture)

bool GLWidget::testRange ( vec3  point  )  [private]

Tests if the given point is within dtest range to an already existing point.

Parameters:
point point to test.

bool GLWidget::testCell ( int  cellx,
int  celly,
vec3  point 
) [private]

Tests if the given point is within dtest range to a point in the specified cell.

Parameters:
cellx x-coordinate of the cell.
celly y-coordinate of the cell.
point point to test.

float GLWidget::getTapering ( vec3  point,
vector< vec3 line,
unsigned int  i 
) [private]

Tests if the given point is within dsep range to an already existing point and returns tapering thickness.

Parameters:
point point to test.
line the line containing the testpoint.
i index of the testpoint within the line (to prevent getting hits from neighbours).

float GLWidget::testCellTapering ( int  cellx,
int  celly,
vec3  point,
vector< vec3 line,
unsigned int  i 
) [private]

Tests if the given point is within dsep range to a point in the specified cell and returns distance to the nearest point.

Parameters:
cellx x-coordinate of the cell.
celly y-coordinate of the cell.
point point to test.
line the line containing the testpoint.
i index of the testpoint within the line (to prevent getting hits from neighbours)

bool GLWidget::testSLDist ( vec3  point,
vector< vec3 line,
unsigned int  i 
) [private]

Tests if the given point is member of the given line and at least ceil(dsep/dt) indices away from i.

Parameters:
point point to test.
line the line containing the testpoint.
i index of the testpoint within the line.

void GLWidget::calculateEvenStreamlines (  )  [private]

Calculates evenly-spaced streamlines according to the method of Bruno Jobard and Wilfrid Lefer.

void GLWidget::addPoint2Grid ( vec3  point  )  [private]

Adds the given point to the correct cell of the grid.

Parameters:
point point to add.

void GLWidget::calcStartCandidates ( vec3  pos  )  [private]

Calculates two new startpoints from the origin, validates and adds them to the startCandidates queue.

Parameters:
pos origin point.

void GLWidget::initStreamlines (  )  [private]

Sets up the environment to recalculate the streamlines.

void GLWidget::removeLastPointfromCell ( vec3  point  )  [private]

Removes the last added point from the cell of the given point.

Parameters:
point reference to the cell.


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

Generated on Mon Jan 19 03:19:32 2009 by  doxygen 1.5.6