Public Member Functions | |
FlowGeometry () | |
Constructor defines some default values. | |
bool | IsInside (Math.Vector3f pos) |
Checks if a given position is within the boundary of the grid. | |
Math.Vector3f | GetPos (int id) |
Returns the position stored at the specified id. The id for a grid cell coordinate can be retrieved with GetId(Vector2i). It depends on how the grid is structured. | |
Math.Vector3f | GetPos (Math.Vector2i coordinates) |
Returns the position stored at the grid position (x,y). | |
int | GetId (Math.Vector2i coordinates) |
Converts the index given in (x,y)-coordinates into the id of the grid cell. Coordinates start at the top left corner. | |
Math.Vector2i | GetCoordinates (int id) |
Retrieves the (x,y)-coordinates to the given id. | |
bool | GetNeighbouredIds (Math.Vector3f position, out int tl, out int tr, out int bl, out int br, out float coef_tl, out float coef_tr, out float coef_bl, out float coef_br) |
Retrieves the four neighboured grid points of a specified position as well as their weighting coefficients based on their distance to the queried position. This method delivers the necessary data for linear interpolation. | |
int | GetNearestId (Math.Vector3f position) |
Searches for the nearest grid cell to the specified position. | |
Math.Vector3f | NormalizeCoords (Math.Vector3f position) |
Normalizes coordinates so that all positions of the grid would reach from (0,0) at the minimum position to (1,1) at the maximum position. | |
Math.Vector3f | DenormalizeCoords (Math.Vector3f position) |
Denormalizes coordinates. Normalized coordinates are between (0,0) and (1,1). The denormalized coordinates reach from the boundary minimum to the boundary maximum. | |
bool | LoadFromFile (String filename) |
Loads a grid-file. Retrieves the header and the grid data of a file. | |
void | DrawGridQuads () |
draws the grid cells | |
Properties | |
int | Width [get] |
Dimension in x direction. | |
int | Height [get] |
Dimension in y direction. | |
Math.Vector3f | BoundarySize [get] |
Distance between minimum position and maximum position. | |
Math.Vector3f | BoundaryMinimum [get] |
Minimum position stored in the grid. | |
Math.Vector3f | BoundaryMaximum [get] |
Maximum position stored in the grid. | |
Math.Vector3f | AspectRatio [get] |
Aspect ratio, the longest side has the length of 1. | |
int | ChannelCount [get] |
Number of channels (is stored in the grid file). | |
Math.Vector3f | Offsets [get] |
Returns the offset for the shorter side of the grid to position it in the center. The longer side of the grid is normalized to a length of 1. |
FlowVis.Data.FlowGeometry.FlowGeometry | ( | ) |
Constructor defines some default values.
bool FlowVis.Data.FlowGeometry.IsInside | ( | Math.Vector3f | pos | ) |
Checks if a given position is within the boundary of the grid.
pos | Position given in the real positions defined by the grid |
Math.Vector3f FlowVis.Data.FlowGeometry.GetPos | ( | int | id | ) |
Returns the position stored at the specified id. The id for a grid cell coordinate can be retrieved with GetId(Vector2i). It depends on how the grid is structured.
id | id of a grid cell |
Math.Vector3f FlowVis.Data.FlowGeometry.GetPos | ( | Math.Vector2i | coordinates | ) |
Returns the position stored at the grid position (x,y).
coordinates | coordinate of grid cell |
int FlowVis.Data.FlowGeometry.GetId | ( | Math.Vector2i | coordinates | ) |
Converts the index given in (x,y)-coordinates into the id of the grid cell. Coordinates start at the top left corner.
coordinates | coordinates of a grid cell |
Math.Vector2i FlowVis.Data.FlowGeometry.GetCoordinates | ( | int | id | ) |
Retrieves the (x,y)-coordinates to the given id.
id | grid cell id |
bool FlowVis.Data.FlowGeometry.GetNeighbouredIds | ( | Math.Vector3f | position, | |
out int | tl, | |||
out int | tr, | |||
out int | bl, | |||
out int | br, | |||
out float | coef_tl, | |||
out float | coef_tr, | |||
out float | coef_bl, | |||
out float | coef_br | |||
) |
Retrieves the four neighboured grid points of a specified position as well as their weighting coefficients based on their distance to the queried position. This method delivers the necessary data for linear interpolation.
position | Position for which the neighboured grid points are obtained | |
tl | top left grid position | |
tr | top right grid position | |
bl | bottom left grid position | |
br | bottom right grid position | |
coef_tl | weight coefficient for top left position | |
coef_tr | weight coefficient for top right position | |
coef_bl | weight coefficient for bottom left position | |
coef_br | weight coefficient for bottom right position |
int FlowVis.Data.FlowGeometry.GetNearestId | ( | Math.Vector3f | position | ) |
Searches for the nearest grid cell to the specified position.
position | queried position |
Math.Vector3f FlowVis.Data.FlowGeometry.NormalizeCoords | ( | Math.Vector3f | position | ) |
Normalizes coordinates so that all positions of the grid would reach from (0,0) at the minimum position to (1,1) at the maximum position.
position | denormalized position containing the real values stored in the grid |
Math.Vector3f FlowVis.Data.FlowGeometry.DenormalizeCoords | ( | Math.Vector3f | position | ) |
Denormalizes coordinates. Normalized coordinates are between (0,0) and (1,1). The denormalized coordinates reach from the boundary minimum to the boundary maximum.
position | normalized position |
bool FlowVis.Data.FlowGeometry.LoadFromFile | ( | String | filename | ) |
Loads a grid-file. Retrieves the header and the grid data of a file.
filename | filename with file ending |
void FlowVis.Data.FlowGeometry.DrawGridQuads | ( | ) |
draws the grid cells
int FlowVis.Data.FlowGeometry.Width [get] |
Dimension in x direction.
int FlowVis.Data.FlowGeometry.Height [get] |
Dimension in y direction.
Math.Vector3f FlowVis.Data.FlowGeometry.BoundarySize [get] |
Distance between minimum position and maximum position.
Math.Vector3f FlowVis.Data.FlowGeometry.BoundaryMinimum [get] |
Minimum position stored in the grid.
Math.Vector3f FlowVis.Data.FlowGeometry.BoundaryMaximum [get] |
Maximum position stored in the grid.
Math.Vector3f FlowVis.Data.FlowGeometry.AspectRatio [get] |
Aspect ratio, the longest side has the length of 1.
int FlowVis.Data.FlowGeometry.ChannelCount [get] |
Number of channels (is stored in the grid file).
Math.Vector3f FlowVis.Data.FlowGeometry.Offsets [get] |
Returns the offset for the shorter side of the grid to position it in the center. The longer side of the grid is normalized to a length of 1.