#include <flowvis_data.h>
Public Member Functions | |
FlowVisData () | |
Standard Constructor. | |
~FlowVisData () | |
Empty Destructor. | |
void | LoadFromFile (const char *filename) |
Load the dataset specified trough it's .gri file. | |
VertexData_T | GetVertexData () |
Creates a vertex list depending on the currently loaded grid. | |
ColorData_T | GetColorData (int time, int dataset) |
IndexData_T | GetIndexData () |
Creates an Index list, that organized the Vertex Data into cells. | |
void | NormalizeVelocity () |
Normalize the velocity vectors of all timesteps. | |
int | GetWidth () |
Get the current data dimension. | |
int | GetHeight () |
Get the current data dimension. | |
int | GetNrSets () |
Return the number of available additional data channels. | |
vec3 | GetVelocityAt (const float x, const float y) |
Return the (non normalized) velocity vector at a given location (specified within an -1 ... +1 dimension). | |
Public Attributes | |
vec3 | m_grid_min |
The smallest available grid values - per dimension. | |
vec3 | m_grid_max |
The largest available grid values - per dimension. | |
vec3 | m_grid_cell_min |
Widht or height of the smallest cell specified in the grid as 3 dimensional structur. | |
float | m_grid_cell_min_x |
Widht of the smallest cell specified in the grid. | |
float | m_grid_cell_min_y |
Height of the smallest cell specified in the grid. | |
std::vector< float > | m_data_min |
Smallest existing data value for the given data channel. | |
std::vector< float > | m_data_max |
Largest existing data value for the given data channel. | |
float | m_max_velocity_length |
Get the length of the longest velocity vector found. | |
Private Member Functions | |
void | LoadGrid (const char *filename) |
Load and store the specified .gri file. | |
void | LoadData (const char *filename, int time_index) |
Load and store the specified .dat file. | |
void | BuildGridLookup () |
Create helper objects to speed up the velocity lookup. | |
Private Attributes | |
Grid_T | m_grid |
2 Dim vector containing the grid pos and the corresponding data value(s) | |
int | m_x |
Size of x dimension. | |
int | m_y |
Size of y dimension. | |
int | m_z |
Size of z dimension. | |
int | m_sets |
Number of datasets. | |
int | m_timestamps |
Number of available timestamps. | |
float | m_interval |
Interval between timestamps. | |
std::vector< float > | m_grid_x |
The grids sampling steps in horizontal direction (rectangular grids only). | |
std::vector< float > | m_grid_y |
The grids sampling steps in vertical direction (rectangular grids only). | |
bool | m_swaped |
Dimensions are swaped. | |
TimeVec_T | m_time |
Vector of all available timesteps (current implentation allows only a single timestep). |
Definition at line 35 of file flowvis_data.h.
FlowVisData::FlowVisData | ( | ) |
FlowVisData::~FlowVisData | ( | ) | [inline] |
void FlowVisData::LoadFromFile | ( | const char * | filename | ) |
Load the dataset specified trough it's .gri file.
Definition at line 127 of file flowvis_data.cpp.
References LoadData(), LoadGrid(), and m_timestamps.
VertexData_T FlowVisData::GetVertexData | ( | ) |
Creates a vertex list depending on the currently loaded grid.
Definition at line 49 of file flowvis_data.cpp.
References m_grid, m_grid_max, m_grid_min, m_x, m_y, x, and y.
ColorData_T FlowVisData::GetColorData | ( | int | time, | |
int | dataset | |||
) |
Creates a color list, encoding a single channel at a single time into color data (not yet mapped to transfer function)
Definition at line 80 of file flowvis_data.cpp.
References m_data_max, m_data_min, m_time, m_x, m_y, x, and y.
IndexData_T FlowVisData::GetIndexData | ( | ) |
void FlowVisData::NormalizeVelocity | ( | ) |
Normalize the velocity vectors of all timesteps.
Definition at line 287 of file flowvis_data.cpp.
References m_max_velocity_length, and m_time.
int FlowVisData::GetWidth | ( | ) | [inline] |
int FlowVisData::GetHeight | ( | ) | [inline] |
int FlowVisData::GetNrSets | ( | ) | [inline] |
Return the number of available additional data channels.
Definition at line 77 of file flowvis_data.h.
References m_sets.
vec3 FlowVisData::GetVelocityAt | ( | const float | x, | |
const float | y | |||
) |
Return the (non normalized) velocity vector at a given location (specified within an -1 ... +1 dimension).
Definition at line 16 of file flowvis_data.cpp.
References m_grid_max, m_grid_min, m_grid_x, m_grid_y, and m_time.
Referenced by VelocityFunctor::operator()().
void FlowVisData::LoadGrid | ( | const char * | filename | ) | [private] |
Load and store the specified .gri file.
Definition at line 141 of file flowvis_data.cpp.
References m_data_max, m_data_min, m_grid, m_grid_cell_min_x, m_grid_cell_min_y, m_grid_max, m_grid_min, m_grid_x, m_grid_y, m_interval, m_max_velocity_length, m_sets, m_swaped, m_timestamps, m_x, m_y, m_z, x, and y.
Referenced by LoadFromFile().
void FlowVisData::LoadData | ( | const char * | filename, | |
int | time_index | |||
) | [private] |
Load and store the specified .dat file.
Definition at line 236 of file flowvis_data.cpp.
References Time_S::data, m_data_max, m_data_min, m_max_velocity_length, m_sets, m_swaped, m_time, m_x, m_y, m_z, Time_S::velocity, x, and y.
Referenced by LoadFromFile().
void FlowVisData::BuildGridLookup | ( | ) | [private] |
Create helper objects to speed up the velocity lookup.
Definition at line 317 of file flowvis_data.cpp.
The smallest available grid values - per dimension.
Definition at line 63 of file flowvis_data.h.
Referenced by GetVelocityAt(), GetVertexData(), and LoadGrid().
The largest available grid values - per dimension.
Definition at line 66 of file flowvis_data.h.
Referenced by GetVelocityAt(), GetVertexData(), and LoadGrid().
Widht or height of the smallest cell specified in the grid as 3 dimensional structur.
Definition at line 68 of file flowvis_data.h.
Widht of the smallest cell specified in the grid.
Definition at line 70 of file flowvis_data.h.
Referenced by LoadGrid().
Height of the smallest cell specified in the grid.
Definition at line 71 of file flowvis_data.h.
Referenced by LoadGrid().
std::vector<float> FlowVisData::m_data_min |
Smallest existing data value for the given data channel.
Definition at line 73 of file flowvis_data.h.
Referenced by GetColorData(), LoadData(), and LoadGrid().
std::vector<float> FlowVisData::m_data_max |
Largest existing data value for the given data channel.
Definition at line 74 of file flowvis_data.h.
Referenced by GetColorData(), LoadData(), and LoadGrid().
Get the length of the longest velocity vector found.
Definition at line 83 of file flowvis_data.h.
Referenced by LoadData(), LoadGrid(), and NormalizeVelocity().
Grid_T FlowVisData::m_grid [private] |
2 Dim vector containing the grid pos and the corresponding data value(s)
Definition at line 96 of file flowvis_data.h.
Referenced by GetVertexData(), and LoadGrid().
int FlowVisData::m_x [private] |
Size of x dimension.
Definition at line 98 of file flowvis_data.h.
Referenced by GetColorData(), GetIndexData(), GetVertexData(), GetWidth(), LoadData(), and LoadGrid().
int FlowVisData::m_y [private] |
Size of y dimension.
Definition at line 100 of file flowvis_data.h.
Referenced by GetColorData(), GetIndexData(), GetVertexData(), LoadData(), and LoadGrid().
int FlowVisData::m_z [private] |
Size of z dimension.
Definition at line 102 of file flowvis_data.h.
Referenced by LoadData(), and LoadGrid().
int FlowVisData::m_sets [private] |
Number of datasets.
Definition at line 104 of file flowvis_data.h.
Referenced by GetNrSets(), LoadData(), and LoadGrid().
int FlowVisData::m_timestamps [private] |
Number of available timestamps.
Definition at line 106 of file flowvis_data.h.
Referenced by LoadFromFile(), and LoadGrid().
float FlowVisData::m_interval [private] |
Interval between timestamps.
Definition at line 108 of file flowvis_data.h.
Referenced by LoadGrid().
std::vector<float> FlowVisData::m_grid_x [private] |
The grids sampling steps in horizontal direction (rectangular grids only).
Definition at line 111 of file flowvis_data.h.
Referenced by GetVelocityAt(), and LoadGrid().
std::vector<float> FlowVisData::m_grid_y [private] |
The grids sampling steps in vertical direction (rectangular grids only).
Definition at line 114 of file flowvis_data.h.
Referenced by GetVelocityAt(), and LoadGrid().
bool FlowVisData::m_swaped [private] |
Dimensions are swaped.
Definition at line 117 of file flowvis_data.h.
Referenced by LoadData(), and LoadGrid().
TimeVec_T FlowVisData::m_time [private] |
Vector of all available timesteps (current implentation allows only a single timestep).
Definition at line 120 of file flowvis_data.h.
Referenced by GetColorData(), GetVelocityAt(), LoadData(), and NormalizeVelocity().