#include <Streamlines.h>
Public Member Functions | |
Streamlines (flowData *f) | |
~Streamlines (void) | |
void | draw () |
void | updateStreamlines () |
void | setDt (int dt) |
void | setDTest (int dtest) |
void | setDSep (int dsep) |
double | getDTest () |
double | getDSep () |
void | setSeedMode (int seedMode) |
void | setIntegrationMode (int integrationMode) |
void | makeNewLine (double x, double y) |
void | toggleTapering () |
void | toggleGlyphs () |
void | toggleTexturing () |
Static Public Attributes | |
static const int | euler = 100 |
static const int | rungekutta = 101 |
static const int | manual = 200 |
static const int | evenly = 201 |
static const int | exclude = 300 |
static const int | alone = 301 |
static const int | maxLoopCount = 5000 |
Private Member Functions | |
Streamline * | createStreamline (double start_x, double start_y) |
bool | getNewSeedPoint (Streamline *activeStreamline, double *result_x, double *result_y) |
bool | inBorders (vector3f v) |
double | getMinDistance (vector3f v, int streamlineId, int mode) |
void | addStreamlineToMap (Streamline *sl) |
void | addSamplePointToMap (SamplePoint sp) |
void | clearStreamlines () |
void | drawGlyphs () |
void | drawTapering () |
void | drawNormal () |
Streamlines::Streamlines | ( | flowData * | f | ) |
constructor
*f | flowData where the information about the grid and the stream is stored |
Streamlines::~Streamlines | ( | void | ) |
destructor
void Streamlines::draw | ( | ) |
Draws the streamlines in the desired mode (with or without texturing, glyphs, ... )
void Streamlines::updateStreamlines | ( | ) |
Function which clears all existing streamlines and calculates them from new.
This function is for example called when a new dataset is loaded.
void Streamlines::setDt | ( | int | dt | ) |
This function is to set dt, which is responsible for the distance between two sample points.
dt | the new value for m_dt |
void Streamlines::setDTest | ( | int | dtest | ) |
This function is called to set dTest, it is called if the user moves the slider.
dtest | new dtest value |
void Streamlines::setDSep | ( | int | dsep | ) |
This function is called to set dSep, it is called if the user moves the slider.
dtest | new dSep value |
double Streamlines::getDTest | ( | ) |
Returns the current value for dTest.
double Streamlines::getDSep | ( | ) |
Returns the current value for dSep.
void Streamlines::setSeedMode | ( | int | seedMode | ) |
Function to set the seedMode for the streamlines.
This can be either 'evenly spaced' or 'manual'.
id | of the seed mode (static variables) |
void Streamlines::setIntegrationMode | ( | int | integrationMode | ) |
Function to set the integration Mode for the streamlines.
This can bei either 'Runge-Kutta' or 'Euler'.
id | of the integration mode (static variables) |
void Streamlines::makeNewLine | ( | double | x, | |
double | y | |||
) |
Function with makes a new streamline at specific coordinates.
x | x Coordinate of the desired streamline | |
y | y Coordinate of the desired streamline |
void Streamlines::toggleTapering | ( | ) |
Function which is called when the user enables or disables tapering.
void Streamlines::toggleGlyphs | ( | ) |
Function which is called when the user enables or disables the rendering of glyphs.
void Streamlines::toggleTexturing | ( | ) |
Function which is called when the user enables or disables texturing for the streamlines.
Streamline* Streamlines::createStreamline | ( | double | start_x, | |
double | start_y | |||
) | [private] |
Function which creates a new streamline at specific coordinates and returns the created streamline.
start_x | xposition of the new streamline | |
start_y | yposition of the new streamline |
bool Streamlines::getNewSeedPoint | ( | Streamline * | activeStreamline, | |
double * | result_x, | |||
double * | result_y | |||
) | [private] |
Function to search for new seed points along a streamline. It checks first on the "left" side of the streamline.
If it finds no valid seed point there it continues on the other side.
If it cannot find an seedpoint on the actual streamline it continues on the next streamline.
When a valid seedpoint is found it coordinates are saved in result_x and result_y
*activeStreamline | the active streamline | |
*result_x | the coordinate of the valid seespoint on the x axis | |
*result_y | the coordinate of the valid seespoint on the y axis |
bool Streamlines::inBorders | ( | vector3f | v | ) | [private] |
This function checks if the vector is within the grid grid borders.
the | vector of which the position should be checked |
double Streamlines::getMinDistance | ( | vector3f | v, | |
int | streamlineId, | |||
int | mode | |||
) | [private] |
This function checks the minimal distance between one point and the points of the other (or the own) streamlines.
the | vector of which the position should be checked | |
streamlineId | the id of the actual streamline | |
mode | can be exclude or alone, either if the points of the other streamlines should be considerd or those from the own streamline |
void Streamlines::addStreamlineToMap | ( | Streamline * | sl | ) | [private] |
This function adds points from one streamline to the map where all points from all streamlines are stored
*sl | streamline of which the points are added to the map |
void Streamlines::addSamplePointToMap | ( | SamplePoint | sp | ) | [private] |
This function adds one point to the map where all points from all streamlines are stored
sp | A sample point which should be stored in the map. |
void Streamlines::clearStreamlines | ( | ) | [private] |
Function clears all streamlines. This means that all streamlines are removed. This function is called when a new dataset is loaded, or a different seed mode is chosen.
void Streamlines::drawGlyphs | ( | ) | [private] |
Function which draws the streamlines in form of glyphs.
void Streamlines::drawTapering | ( | ) | [private] |
Function which is called when the user wants to render with tapering.
void Streamlines::drawNormal | ( | ) | [private] |
Function which draws the streamlines without tapering or glyphs.
const int Streamlines::euler = 100 [static] |
const int Streamlines::rungekutta = 101 [static] |
id of the euler integration mode
const int Streamlines::manual = 200 [static] |
id of the runge kutta integration mode
const int Streamlines::evenly = 201 [static] |
manual seeding mode id
const int Streamlines::exclude = 300 [static] |
evenly spaced streamlines id
const int Streamlines::alone = 301 [static] |
tells if checkMinDistance should consider the actual streamline too
const int Streamlines::maxLoopCount = 5000 [static] |
tells if checkMinDistance should consider the actual streamline too