orca-robotics


INTRODUCTION
Overview
Download and Install
Documentation

REPOSITORY
Interfaces
Drivers
Libraries
Utilities
Software Map

DEVELOPER
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

hydroogmap::GenericMap< T > Class Template Reference

#include <genericmap.h>

List of all members.

Public Member Functions

int numCellsX () const
 Returns the number of cells along the x-axis.
int numCellsY () const
 Returns the number of cells along the y-axis.
double worldSizeX () const
 Returns the size of the world, in metres, along the x-axis.
double worldSizeY () const
 Returns the size of the world, in metres, along the y-axis.
Frame2d & offset ()
 Set the offset (global coordinates of the bottom-left corner of the bottom-left cell).
const Frame2d & offset () const
 Get the offset (global coordinates of the bottom-left corner of the bottom-left cell).
void setMetresPerCellX (double mx)
 Set the size of each cell, in the x dimension.
double metresPerCellX () const
 Get the size of each cell, in the x dimension.
void setMetresPerCellY (double my)
 Set the size of each cell, in the y dimension.
double metresPerCellY () const
 Get the size of each cell, in the y dimension.
T * data ()
 Set values.
const T * data () const
 Get values.
double worldXCoord (int gridX) const
double worldYCoord (int gridY) const
void getWorldCoords (int gridX, int gridY, double &worldX, double &worldY) const
void getCellIndices (double worldX, double worldY, int &gridX, int &gridY) const
T & gridCell (int indX, int indY)
const T & gridCell (int indX, int indY) const
T & worldCell (double worldX, double worldY)
const T & worldCell (double worldX, double worldY) const
bool tryGridCell (int indX, int indY, T &cell) const
 Tries to get a cell (bounds check performed). Returns TRUE if successful, FALSE if the cell is outside the map.
bool tryWorldCell (double worldX, double worldY, T &cell) const
 Tries to get a cell (bounds check performed). Returns TRUE if successful, FALSE if the cell is outside the map.
int worldToIndexX (double worldX) const
 translate a world coord to a map coord
void reallocate (int numCellsX, int numCellsY)
 Change the size of the map.
void fill (const T &cellValue)
 Fill the map with the given value.
bool coordsWithinMap (double worldX, double worldY) const
 Are the world coordinates within the map?
bool cellWithinMap (double gridX, double gridY) const
 Is the grid cell within the map?


Detailed Description

template<typename T>
class hydroogmap::GenericMap< T >

A (spatial) map of values: posit a 2D grid of cells over the world, with a value stored at each cell.


Member Function Documentation

template<typename T>
void hydroogmap::GenericMap< T >::getCellIndices double  worldX,
double  worldY,
int &  gridX,
int &  gridY
const [inline]
 

Get the grid cell indices of a point in the world worldX and worldY don't have to be within the map bounds.

template<typename T>
void hydroogmap::GenericMap< T >::getWorldCoords int  gridX,
int  gridY,
double &  worldX,
double &  worldY
const [inline]
 

Get the world coordinates of a grid cell. (Returns the coords of the centre of the cell) gridX and gridY don't have to be within the map bounds.

template<typename T>
const T& hydroogmap::GenericMap< T >::gridCell int  indX,
int  indY
const [inline]
 

Get a cell, indexed by map coords (no bounds checking is performed)

template<typename T>
T& hydroogmap::GenericMap< T >::gridCell int  indX,
int  indY
[inline]
 

Set a cell indexed by map coords (no bounds checking is performed)

template<typename T>
const T& hydroogmap::GenericMap< T >::worldCell double  worldX,
double  worldY
const [inline]
 

Get a cell, indexed by world coords (no bounds checking is performed)

template<typename T>
T& hydroogmap::GenericMap< T >::worldCell double  worldX,
double  worldY
[inline]
 

Set a cell indexed by world coords (no bounds checking is performed)

template<typename T>
double hydroogmap::GenericMap< T >::worldXCoord int  gridX  )  const [inline]
 

Get the x world coord of a grid cell. (Returns the coords of the centre of the cell) gridX doesn't have to be within the map bounds.

template<typename T>
double hydroogmap::GenericMap< T >::worldYCoord int  gridY  )  const [inline]
 

Get the y world coord of a grid cell. (Returns the coords of the centre of the cell) gridY doesn't have to be within the map bounds.


The documentation for this class was generated from the following file:
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5