FlowVis.Data.FlowGeometry Class Reference

Contains the definition of the grid. For each grid cell the real position is stored. This allows the use of an arbitrary structured grid. More...

List of all members.

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.


Detailed Description

Contains the definition of the grid. For each grid cell the real position is stored. This allows the use of an arbitrary structured grid.


Constructor & Destructor Documentation

FlowVis.Data.FlowGeometry.FlowGeometry (  ) 

Constructor defines some default values.


Member Function Documentation

bool FlowVis.Data.FlowGeometry.IsInside ( Math.Vector3f  pos  ) 

Checks if a given position is within the boundary of the grid.

Parameters:
pos Position given in the real positions defined by the grid
Returns:
true if the grid contains the given position

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.

Parameters:
id id of a grid cell
Returns:
the position stored at the id

Math.Vector3f FlowVis.Data.FlowGeometry.GetPos ( Math.Vector2i  coordinates  ) 

Returns the position stored at the grid position (x,y).

Parameters:
coordinates coordinate of grid cell
Returns:
position stored the grid cell defined with the coordinates

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.

Parameters:
coordinates coordinates of a grid cell
Returns:
id of the grid cell

Math.Vector2i FlowVis.Data.FlowGeometry.GetCoordinates ( int  id  ) 

Retrieves the (x,y)-coordinates to the given id.

Parameters:
id grid cell id
Returns:
(x,y)-coordinates

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.

Parameters:
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
Returns:
false if point doesn't lie within this grid

int FlowVis.Data.FlowGeometry.GetNearestId ( Math.Vector3f  position  ) 

Searches for the nearest grid cell to the specified position.

Parameters:
position queried position
Returns:
id of the nearest grid cell

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.

Parameters:
position denormalized position containing the real values stored in the grid
Returns:
normalized position

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.

Parameters:
position normalized position
Returns:
denormalized position

bool FlowVis.Data.FlowGeometry.LoadFromFile ( String  filename  ) 

Loads a grid-file. Retrieves the header and the grid data of a file.

Parameters:
filename filename with file ending
Returns:
true if loading was successful

void FlowVis.Data.FlowGeometry.DrawGridQuads (  ) 

draws the grid cells


Property Documentation

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.


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 16:09:36 2008 for FlowVis by  doxygen 1.5.1-p1