FlowVis 1.0

RenderWidget Class Reference

Rederer. More...

#include <RenderWidget.h>

List of all members.

Public Slots

void loadDataFile ()
 Slot to invoke data file loading.
void layerChannelChanged (int channel, int layer)
 Slot to update channel number a layer.
void layerTypeChanged (int type, int layer)
 Slot to update type of a layer.
void layerTransferImageChanged (const QImage &image, int layer)
 Slot to update transfer function of a layer.
void layerAdd (int layer)
 Slot to add a layer.
void layerMove (int layer, int newPos)
 Slot to move a layer.
void layerRemove (int layer)
 Slot to remove a layer.
void settingsSliderChanged (int value, int slider)
 Slot to update parameters.
void settingsSLModeChanged (int value)
 Slot to update the streamline mode.
void settingsSLCompute ()
 Slot to invoke streamline computation.
void settingsSLInverpolationChanged (int value)
 Slot to update the streamline interpolation mode.
void settingsEmitSliderValue (int slider)
 Slot to invoke update of the gui slider values.

Signals

void dataLoaded (int channels)
 Signals that new data has been loaded.
void emitSettingValues (int value, int slider)
 Signals required update of the GUI slider.

Public Member Functions

 RenderWidget (QWidget *parent=NULL)
int heightForWidth (int w) const
 Returns aspect ratio.

Protected Member Functions

void initializeGL ()
 Initializes OpenGL.
void resizeGL (int w, int h)
 Resize widget.
void paintGL ()
 Render function.

Private Member Functions

void initArrows (int n, float aspect)
 Generates Display List for the arrows.
void generateNormalStreamlineList ()
 Generates the streamline display list.
void generateTaperingStreamlineList ()
 Generates the streamline display list for tapering.
void generateGlyphStreamlineList ()
 Generates the streamline display list for glyph mapping.
void generateTextureStreamlineList ()
 Generates the streamline display list for texture generation.
float getSLIntensityForRank (int rank, int function_type)
 Calculates the intensity value for the given rank.
void initGlew ()
 Initializes GLEW.
void loadData (std::string filename)
 Loads Dataset.
void loadChannels (FlowData *dataset)
 Loads all channels of a dataset.
void computeStreamlines ()
 Computes evenly spaced streamlines.
StreamlinecalculateStreamline (vec3 *seed, int gridWidth, int gridHeight, vector< vec3 > **grid)
 Calculates a streamline starting from seed point seed.
void gridAddAt (vector< vec3 > *grid, int gridwidth, int gridheight, vec3 pos)
 Adds the point pos at its position in the grid.
bool gridAroundOkay (vector< vec3 > *grid, int gridwidth, int gridheight, vec3 pos, queue< vec3 > *lastones)
 Checks whether it is ok to add the point pos at its position in the grid.
float minGridDistance (vector< vec3 > *grid, int gridwidth, int gridheight, vec3 pos, queue< vec3 > *lastones)
 Returns the distance to the closest point to pos.
bool distanceOkay (vec3 from, vec3 to)
 Checks whether the distance between the two points is greater than d_test.
vec3 getNextEulerPoint (vec3 sample_point, bool backward)
 Returns the next position using Euler integration.
vec3 getNextRungeKutta2Point (vec3 sample_point, bool backward)
 Returns the next position using RungeKutta2 integration.
vec3 getNextRungeKutta4Point (vec3 sample_point, bool backward)
 Returns the next position using RungeKutta4 integration.
void printGLError ()
 Prints OpenGL Errors.

Private Attributes

const double PI
float * xdata
float * ydata
LayerRenderabletestLayer
LayerRenderabletestarrowLayer
GLuint testTransferTexture
int textureSize
int textureWidth
int textureHeight
int arrowCount
QVector< LayerRenderable * > layers
QVector< Shader * > shaders
GLuint * textures
int channelCount
GLuint * disp_lists
Shadersimple
Shaderarrows
Shaderslines
Shadersltexture
float arrowSize
float d_sep_val
float d_sep
float d_test_val
float d_test
float dt
int sl_num_samples
vector< Streamline * > streamlines
int integration_mode
int streamline_mode

Static Private Attributes

static const int EULER = 0
static const int RK2 = 1
static const int RK4 = 2
static const int NORMAL = 0
static const int TAPERING = 1
static const int GLYPH = 2
static const int TEXTURE = 3

Detailed Description

Rederer.

This Widget handles the import, processing and rendering of the data. That means: Everything except GUI.

Date:
15.01.2011

Definition at line 27 of file RenderWidget.h.


Member Function Documentation

Streamline * RenderWidget::calculateStreamline ( vec3 seed,
int  gridWidth,
int  gridHeight,
vector< vec3 > **  grid 
) [private]

Calculates a streamline starting from seed point seed.

Date:
15.01.2011
Parameters:
seedthe seed point
gridWidththe grid width
gridHeightthe grid height
gridthe grid for evenly spaced streamlines
Returns:
a pointer to the new streamline.

Definition at line 301 of file RenderWidget.cpp.

void RenderWidget::computeStreamlines ( ) [private]

Computes evenly spaced streamlines.

Date:
15.01.2011

Definition at line 195 of file RenderWidget.cpp.

void RenderWidget::dataLoaded ( int  channels) [signal]

Signals that new data has been loaded.

This functions signals that new data has been loaded.

Date:
15.01.2011
Parameters:
channelsnumber of channels in the loaded dataset
bool RenderWidget::distanceOkay ( vec3  from,
vec3  to 
) [private]

Checks whether the distance between the two points is greater than d_test.

Date:
15.01.2011
Parameters:
fromfirst point
tosecond point
Returns:
true if the distance is above d_test, false otherwise.

Definition at line 500 of file RenderWidget.cpp.

void RenderWidget::emitSettingValues ( int  value,
int  slider 
) [signal]

Signals required update of the GUI slider.

This functions signals that parameters have changed and need to be updated in the gui.

Date:
15.01.2011
Parameters:
valuenew value - [0,100]
sliderslider corresponding to the changed parameter
void RenderWidget::generateGlyphStreamlineList ( ) [private]

Generates the streamline display list for glyph mapping.

Date:
15.01.2011

Definition at line 847 of file RenderWidget.cpp.

void RenderWidget::generateNormalStreamlineList ( ) [private]

Generates the streamline display list.

Date:
15.01.2011

Definition at line 729 of file RenderWidget.cpp.

void RenderWidget::generateTaperingStreamlineList ( ) [private]

Generates the streamline display list for tapering.

Date:
15.01.2011

Definition at line 776 of file RenderWidget.cpp.

void RenderWidget::generateTextureStreamlineList ( ) [private]

Generates the streamline display list for texture generation.

Date:
15.01.2011

Definition at line 895 of file RenderWidget.cpp.

vec3 RenderWidget::getNextEulerPoint ( vec3  sample_point,
bool  backward 
) [private]

Returns the next position using Euler integration.

Date:
15.01.2011
Parameters:
sample_pointthe starting point for the integration
backwarda flag for going forward or backward
Returns:
the next position using Euler integration.

Definition at line 505 of file RenderWidget.cpp.

vec3 RenderWidget::getNextRungeKutta2Point ( vec3  sample_point,
bool  backward 
) [private]

Returns the next position using RungeKutta2 integration.

Date:
15.01.2011
Parameters:
sample_pointthe starting point for the integration
backwarda flag for going forward or backward
Returns:
the next position using RungeKutta2 integration.

Definition at line 519 of file RenderWidget.cpp.

vec3 RenderWidget::getNextRungeKutta4Point ( vec3  sample_point,
bool  backward 
) [private]

Returns the next position using RungeKutta4 integration.

Date:
15.01.2011
Parameters:
sample_pointthe starting point for the integration
backwarda flag for going forward or backward
Returns:
the next position using RungeKutta4 integration.

Definition at line 543 of file RenderWidget.cpp.

float RenderWidget::getSLIntensityForRank ( int  rank,
int  function_type 
) [private]

Calculates the intensity value for the given rank.

Date:
15.01.2011
Parameters:
rankthe rank for which the texture function should be evaluated
function_typedefines which function is used for texture generation. [0, 1]
Returns:
the value for the given rank and the given function.

Definition at line 953 of file RenderWidget.cpp.

void RenderWidget::gridAddAt ( vector< vec3 > *  grid,
int  gridwidth,
int  gridheight,
vec3  pos 
) [private]

Adds the point pos at its position in the grid.

Date:
15.01.2011
Parameters:
gridthe grid for evenly spaced streamlines
gridwidththe grid width
gridheightthe grid height
posthe point to be added

Definition at line 417 of file RenderWidget.cpp.

bool RenderWidget::gridAroundOkay ( vector< vec3 > *  grid,
int  gridwidth,
int  gridheight,
vec3  pos,
queue< vec3 > *  lastones 
) [private]

Checks whether it is ok to add the point pos at its position in the grid.

Date:
15.01.2011
Parameters:
gridthe grid for evenly spaced streamlines
gridwidththe grid width
gridheightthe grid height
posthe position for which the grid should be checked
lastonesthe list of last few points of this streamline
Returns:
true if it is ok to add the point here, false otherwise.

Definition at line 426 of file RenderWidget.cpp.

void RenderWidget::heightForWidth ( int  w) const

Returns aspect ratio.

This functions is used to maintain the aspect ration of the widget. This is not working.

Date:
15.01.2011
Parameters:
wwidth
Returns:
height for width ratio

Definition at line 1002 of file RenderWidget.cpp.

void RenderWidget::initArrows ( int  n,
float  aspect 
) [private]

Generates Display List for the arrows.

This functions generates a new display list for the rendering of the arrows.

Date:
15.01.2011
Parameters:
nnumber of arrows on each side (with respect to the whole viewport)
aspectaspect ratio of the dataset

Definition at line 699 of file RenderWidget.cpp.

void RenderWidget::initGlew ( ) [private]

Initializes GLEW.

This functions initializes the extension loading.

Date:
15.01.2011

Definition at line 987 of file RenderWidget.cpp.

void RenderWidget::initializeGL ( ) [protected]

Initializes OpenGL.

This functions calls the required functions for OpenGL initilization.

Date:
15.01.2011

Definition at line 616 of file RenderWidget.cpp.

void RenderWidget::layerAdd ( int  layer) [slot]

Slot to add a layer.

This function adds a layer with the specified index.

Date:
15.01.2011
Parameters:
layerindex

Definition at line 1032 of file RenderWidget.cpp.

void RenderWidget::layerChannelChanged ( int  channel,
int  layer 
) [slot]

Slot to update channel number a layer.

This function updates the channel number of the specified layer.

Date:
15.01.2011
Parameters:
channelnew channel
layerthe specified layer

Definition at line 1007 of file RenderWidget.cpp.

void RenderWidget::layerMove ( int  layer,
int  newPos 
) [slot]

Slot to move a layer.

This function moves a layer with the specified index to a new position.

Date:
15.01.2011
Parameters:
layerindex
newPosnew position

Definition at line 1039 of file RenderWidget.cpp.

void RenderWidget::layerRemove ( int  layer) [slot]

Slot to remove a layer.

This function removes a layer with the specified index.

Date:
15.01.2011
Parameters:
layerindex

Definition at line 1049 of file RenderWidget.cpp.

void RenderWidget::layerTransferImageChanged ( const QImage &  image,
int  layer 
) [slot]

Slot to update transfer function of a layer.

This function updates the transfer function 1D image of the specified layer.

Date:
15.01.2011
Parameters:
imagenew transfer function image
layerthe specified layer

Definition at line 1024 of file RenderWidget.cpp.

void RenderWidget::layerTypeChanged ( int  type,
int  layer 
) [slot]

Slot to update type of a layer.

This function updates the type of the specified layer.

Date:
15.01.2011
Parameters:
channelnew channel
layerthe specified layer

Definition at line 1016 of file RenderWidget.cpp.

void RenderWidget::loadChannels ( FlowData dataset) [private]

Loads all channels of a dataset.

This functions loads all channels of a dataset. This includes all preprocessing steps necessary and the generation of the displaylists and textures used for rendering.

Date:
15.01.2011
Parameters:
datasetthe dataset which is processed

Definition at line 57 of file RenderWidget.cpp.

void RenderWidget::loadData ( std::string  filename) [private]

Loads Dataset.

This functions loads a new dataset. This includes all preprocessing steps necessary.

Date:
15.01.2011
Parameters:
filenamefilename of the dataset

Definition at line 600 of file RenderWidget.cpp.

void RenderWidget::loadDataFile ( ) [slot]

Slot to invoke data file loading.

This functions is used to invoke data file loading.

Date:
15.01.2011

Definition at line 1189 of file RenderWidget.cpp.

float RenderWidget::minGridDistance ( vector< vec3 > *  grid,
int  gridwidth,
int  gridheight,
vec3  pos,
queue< vec3 > *  lastones 
) [private]

Returns the distance to the closest point to pos.

Date:
15.01.2011
Parameters:
gridthe grid for evenly spaced streamlines
gridwidththe grid width
gridheightthe grid height
posthe position for which the grid should be checked
lastonesthe list of last few points of this streamline
Returns:
the distance to the closest point to pos, or d_sep if there is no closer point.

Definition at line 461 of file RenderWidget.cpp.

void RenderWidget::paintGL ( ) [protected]

Render function.

This functions is called when the updateGL() function is called. All rendering is done here.

Date:
15.01.2011

Definition at line 974 of file RenderWidget.cpp.

void RenderWidget::printGLError ( ) [private]

Prints OpenGL Errors.

This functions is used to print OpenGL Errors to the console.

Date:
15.01.2011

Definition at line 590 of file RenderWidget.cpp.

void RenderWidget::resizeGL ( int  w,
int  h 
) [protected]

Resize widget.

This functions is called when the window is resized. It sets the new viewport and updates viewport dependent parameters.

Date:
15.01.2011
Parameters:
wnew widget width
hnew widget height

Definition at line 964 of file RenderWidget.cpp.

void RenderWidget::settingsEmitSliderValue ( int  slider) [slot]

Slot to invoke update of the gui slider values.

This function invokes the update of the gui slider values.

Date:
15.01.2011

Definition at line 1098 of file RenderWidget.cpp.

void RenderWidget::settingsSLCompute ( ) [slot]

Slot to invoke streamline computation.

This function invokes the streamline computation. This is used after new streamline parameters have been set.

Date:
15.01.2011

Definition at line 1159 of file RenderWidget.cpp.

void RenderWidget::settingsSliderChanged ( int  value,
int  slider 
) [slot]

Slot to update parameters.

This function updates the parameter corresponding to the specified slider.

Date:
15.01.2011
Parameters:
valuenew value - [0,100]
sliderthe specified slider

Definition at line 1058 of file RenderWidget.cpp.

void RenderWidget::settingsSLInverpolationChanged ( int  value) [slot]

Slot to update the streamline interpolation mode.

This function updates the streamline interpolation mode.

Date:
15.01.2011
Parameters:
valuenew streamline interpolation mode

Definition at line 1168 of file RenderWidget.cpp.

void RenderWidget::settingsSLModeChanged ( int  value) [slot]

Slot to update the streamline mode.

This function updates the streamline mode.

Date:
15.01.2011
Parameters:
valuenew streamline mode

Definition at line 1129 of file RenderWidget.cpp.


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