FlowVis 1.0
|
Rederer. More...
#include <RenderWidget.h>
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. | |
Streamline * | calculateStreamline (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 |
LayerRenderable * | testLayer |
LayerRenderable * | testarrowLayer |
GLuint | testTransferTexture |
int | textureSize |
int | textureWidth |
int | textureHeight |
int | arrowCount |
QVector< LayerRenderable * > | layers |
QVector< Shader * > | shaders |
GLuint * | textures |
int | channelCount |
GLuint * | disp_lists |
Shader * | simple |
Shader * | arrows |
Shader * | slines |
Shader * | sltexture |
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 |
Rederer.
This Widget handles the import, processing and rendering of the data. That means: Everything except GUI.
Definition at line 27 of file RenderWidget.h.
Streamline * RenderWidget::calculateStreamline | ( | vec3 * | seed, |
int | gridWidth, | ||
int | gridHeight, | ||
vector< vec3 > ** | grid | ||
) | [private] |
Calculates a streamline starting from seed point seed.
seed | the seed point |
gridWidth | the grid width |
gridHeight | the grid height |
grid | the grid for evenly spaced streamlines |
Definition at line 301 of file RenderWidget.cpp.
void RenderWidget::computeStreamlines | ( | ) | [private] |
Computes evenly spaced streamlines.
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.
channels | number of channels in the loaded dataset |
Checks whether the distance between the two points is greater than d_test.
from | first point |
to | second point |
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.
value | new value - [0,100] |
slider | slider corresponding to the changed parameter |
void RenderWidget::generateGlyphStreamlineList | ( | ) | [private] |
Generates the streamline display list for glyph mapping.
Definition at line 847 of file RenderWidget.cpp.
void RenderWidget::generateNormalStreamlineList | ( | ) | [private] |
Generates the streamline display list.
Definition at line 729 of file RenderWidget.cpp.
void RenderWidget::generateTaperingStreamlineList | ( | ) | [private] |
Generates the streamline display list for tapering.
Definition at line 776 of file RenderWidget.cpp.
void RenderWidget::generateTextureStreamlineList | ( | ) | [private] |
Generates the streamline display list for texture generation.
Definition at line 895 of file RenderWidget.cpp.
Returns the next position using Euler integration.
sample_point | the starting point for the integration |
backward | a flag for going forward or backward |
Definition at line 505 of file RenderWidget.cpp.
Returns the next position using RungeKutta2 integration.
sample_point | the starting point for the integration |
backward | a flag for going forward or backward |
Definition at line 519 of file RenderWidget.cpp.
Returns the next position using RungeKutta4 integration.
sample_point | the starting point for the integration |
backward | a flag for going forward or backward |
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.
rank | the rank for which the texture function should be evaluated |
function_type | defines which function is used for texture generation. [0, 1] |
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.
grid | the grid for evenly spaced streamlines |
gridwidth | the grid width |
gridheight | the grid height |
pos | the 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.
grid | the grid for evenly spaced streamlines |
gridwidth | the grid width |
gridheight | the grid height |
pos | the position for which the grid should be checked |
lastones | the list of last few points of this streamline |
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.
w | width |
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.
n | number of arrows on each side (with respect to the whole viewport) |
aspect | aspect ratio of the dataset |
Definition at line 699 of file RenderWidget.cpp.
void RenderWidget::initGlew | ( | ) | [private] |
Initializes GLEW.
This functions initializes the extension loading.
Definition at line 987 of file RenderWidget.cpp.
void RenderWidget::initializeGL | ( | ) | [protected] |
Initializes OpenGL.
This functions calls the required functions for OpenGL initilization.
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.
layer | index |
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.
channel | new channel |
layer | the 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.
layer | index |
newPos | new 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.
layer | index |
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.
image | new transfer function image |
layer | the 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.
channel | new channel |
layer | the 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.
dataset | the 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.
filename | filename 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.
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.
grid | the grid for evenly spaced streamlines |
gridwidth | the grid width |
gridheight | the grid height |
pos | the position for which the grid should be checked |
lastones | the list of last few points of this streamline |
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.
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.
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.
w | new widget width |
h | new 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.
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.
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.
value | new value - [0,100] |
slider | the 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.
value | new 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.
value | new streamline mode |
Definition at line 1129 of file RenderWidget.cpp.