proland::FlowTile Class Reference
[terrain]

Computes the velocity of a flow at a given point. More...

#include <FlowTile.h>

List of all members.

Public Types

enum  DATATYPE
 

Determines the type of data at a point.

More...

Public Member Functions

 FlowTile (float ox, float oy, float size)
 Creates a new FlowTile.
virtual ~FlowTile ()
 Deletes this FlowTile.
virtual int getType (vec2d &pos)
 Returns a defined type for a given position in the tile.
virtual void getVelocity (vec2d &pos, vec2d &velocity, int &type)=0
 Returns the velocity at a given point, depending on the data contained in this FlowTile.
virtual void getDataType (vec2d &pos, int &type)
 Returns the data type at a given point.
bool contains (float x, float y)
 Returns true if the given point is inside this FlowTile's viewport.

Protected Attributes

float ox
 The x coordinate of the lower left corner of this Tile.
float oy
 The y coordinate of the lower left corner of this Tile.
float size
 Width of this Tile.

Detailed Description

Computes the velocity of a flow at a given point.

Can be used for any moving elements. In this class, the word Tile will refer to a 2D region on a terrain. It may correspond to a TileProducer Tiles, but can also be completely independent from that. You just need to define the considered region on that terrain.

Author:
Antoine Begault

Member Enumeration Documentation

Determines the type of data at a point.


Constructor & Destructor Documentation

proland::FlowTile::FlowTile ( float  ox,
float  oy,
float  size 
)

Creates a new FlowTile.

Parameters:
ox the x coordinate of the lower left corner of this Tile.
oy the y coordinate of the lower left corner of this Tile.
size width of this Tile.
virtual proland::FlowTile::~FlowTile (  )  [virtual]

Deletes this FlowTile.


Member Function Documentation

bool proland::FlowTile::contains ( float  x,
float  y 
)

Returns true if the given point is inside this FlowTile's viewport.

Parameters:
x x coordinate.
y y coordinate.
virtual void proland::FlowTile::getDataType ( vec2d &  pos,
int &  type 
) [virtual]

Returns the data type at a given point.

Simplified version of getVelocity().

Parameters:
pos a XY position inside the viewport of this FlowTile.
[out] type type of data at given coordinates. See dataType.
virtual int proland::FlowTile::getType ( vec2d &  pos  )  [virtual]

Returns a defined type for a given position in the tile.

Parameters:
pos a position inside the tile's viewport.
virtual void proland::FlowTile::getVelocity ( vec2d &  pos,
vec2d &  velocity,
int &  type 
) [pure virtual]

Returns the velocity at a given point, depending on the data contained in this FlowTile.

Parameters:
pos a XY position inside the viewport of this FlowTile.
[out] velocity a vec2f containing the 2D velocity at given coordinates.
[out] type type of data at given coordinates. See dataType

Member Data Documentation

float proland::FlowTile::ox [protected]

The x coordinate of the lower left corner of this Tile.

float proland::FlowTile::oy [protected]

The y coordinate of the lower left corner of this Tile.

float proland::FlowTile::size [protected]

Width of this Tile.


Generated on Sat May 12 09:41:37 2012 for proland by  doxygen 1.6.1