#include <Arrows.h>
Collaboration diagram for Arrows:
Public Member Functions | |
Arrows (flowData *f, ColorMapping *colorMap) | |
~Arrows (void) | |
void | init () |
void | createArrow () |
void | draw () |
void | changeDistance (int dist) |
void | changeScale (int scal) |
void | changeAlpha (int a) |
void | setSizeMode (int nm) |
void | setColorMode (int cm) |
Static Public Attributes | |
static const int | none = -1 |
static const int | velocityMode = 14 |
static const int | pressureMode = 15 |
static const int | vorticityMode = 16 |
Private Member Functions | |
void | setScaling (vector5f v) |
void | setColor (vector5f v) |
Private Attributes | |
ColorMapping * | m_colorMap |
int | displayMode |
int | colorMode |
flowData * | rawData |
GLfloat | arrowDistance |
GLfloat | arrowScale |
GLfloat | alpha |
GLuint | arrowId |
Arrows::Arrows | ( | flowData * | f, | |
ColorMapping * | colorMap | |||
) |
constructor
*f | flowData where the information about the grid and the stream is stored | |
*colorMap | the transferfunction for the color of the arrows |
Arrows::~Arrows | ( | void | ) |
destructor
void Arrows::init | ( | ) |
init method, the display list is called
c | CGcontext of the glwidget |
void Arrows::createArrow | ( | ) |
makes the displaylist for the arrow, defines its body
void Arrows::draw | ( | ) |
draws arrows for the stream in the desired distance with the right color, rotation and size
for every arrow the displaylist is called
void Arrows::changeDistance | ( | int | dist | ) |
Function to change the distance between the arrows.
It is called if the user moves the appropriate slider in the GUI.
The distance can be within 1 and 500, and is then multiplied with 0.001.
dist | the distance between the arrows in 'int' |
void Arrows::changeScale | ( | int | scal | ) |
Function to change the scaling of the arrows.
It is called when the user moves the appropriate slider in the GUI.
The value is then divided by 10.
scal | the new value for the scaling of the arrows. |
void Arrows::changeAlpha | ( | int | a | ) |
The User is able to change the alpha value of the arrows with a slider. The value can, of course, just be between 0 and 1. So the given int parameter is then divided by 100 and can be at most 100 and at least 0.
a | the new alpha value for the arrows |
void Arrows::setSizeMode | ( | int | nm | ) |
The size of the arrows is depending on the given scale factor and the velocity, pressure or vorticity of the of the point in the stream for the arrow.
The User can choose in the GUI which values should be considered for the size of the arrow.
nm | id of the mode (static variables) |
void Arrows::setColorMode | ( | int | cm | ) |
The color of the arrows is also depending on whether the velocity, pressure or vorticity. The user can this define through the GUI.
cm | id of the mode (static variables) |
void Arrows::setScaling | ( | vector5f | v | ) | [private] |
This method calculates and defines the scaling for each arrow depending from the size mode.
v | vector filled with the stream data for an arrow |
void Arrows::setColor | ( | vector5f | v | ) | [private] |
This method looks up the color for each arrow in the color bar, depending from the color mode.
v | vector filled with the stream data for an arrow |
const int Arrows::none = -1 [static] |
const int Arrows::velocityMode = 14 [static] |
if the arrows should be be similar in size or color
const int Arrows::pressureMode = 15 [static] |
if the velocity values should be pointed out
const int Arrows::vorticityMode = 16 [static] |
if the pressure values should be pointed out
ColorMapping* Arrows::m_colorMap [private] |
int Arrows::displayMode [private] |
color bar
int Arrows::colorMode [private] |
size mode, what should be pointed out by the size
flowData* Arrows::rawData [private] |
color mode, what should be pointed out by the color
GLfloat Arrows::arrowDistance [private] |
object with the data about the stream
GLfloat Arrows::arrowScale [private] |
distance between the arrows
GLfloat Arrows::alpha [private] |
scale value for the arrows
GLuint Arrows::arrowId [private] |
alpha value for the arrows