#include <mrpt/utils/CDynamicGrid.h>
Public Member Functions | |
CDynamicGrid (float x_min=-10.0f, float x_max=10.0f, float y_min=-10.0f, float y_max=10.0f, float resolution=0.10f) | |
Constructor. | |
virtual | ~CDynamicGrid () |
Destructor. | |
void | setSize (float x_min, float x_max, float y_min, float y_max, float resolution) |
Changes the size of the grid, ERASING all previous contents. | |
void | clear () |
Erase the contents of all the cells. | |
void | fill (const T &value) |
Fills all the cells with the same value. | |
virtual void | resize (float new_x_min, float new_x_max, float new_y_min, float new_y_max, const T &defaultValueNewCells, float additionalMarginMeters=2.0f) |
Changes the size of the grid, maintaining previous contents. | |
T * | cellByPos (float x, float y) |
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions. | |
const T * | cellByPos (float x, float y) const |
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions. | |
T * | cellByIndex (unsigned int cx, unsigned int cy) |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions. | |
const T * | cellByIndex (unsigned int cx, unsigned int cy) const |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions. | |
unsigned int | getSizeX () |
Returns the horizontal size of grid map in cells count. | |
unsigned int | getSizeY () |
Returns the vertical size of grid map in cells count. | |
float | getXMin () const |
Returns the "x" coordinate of left side of grid map. | |
float | getXMax () const |
Returns the "x" coordinate of right side of grid map. | |
float | getYMin () const |
Returns the "y" coordinate of top side of grid map. | |
float | getYMax () const |
Returns the "y" coordinate of bottom side of grid map. | |
float | getResolution () const |
Returns the resolution of the grid map. | |
virtual float | cell2float (const T &c) const |
The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value. | |
void | saveToTextFile (const std::string &fileName) const |
int | x2idx (float x) const |
Transform a coordinate values into cell indexes. | |
int | y2idx (float y) const |
int | xy2idx (float x, float y) const |
void | idx2cxcy (const int &idx, int &cx, int &cy) const |
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes. | |
float | idx2x (int cx) const |
Transform a cell index into a coordinate value. | |
float | idx2y (int cy) const |
int | x2idx (float x, float x_min) const |
Transform a coordinate value into a cell index, using a diferent "x_min" value. | |
int | y2idx (float y, float y_min) const |
Protected Member Functions | |
std::vector< T > & | m_map_castaway_const () const |
Used only from logically const method that really need to modify the. | |
Protected Attributes | |
std::vector< T > | m_map |
The cells. | |
float | m_x_min |
float | m_x_max |
float | m_y_min |
float | m_y_max |
float | m_resolution |
unsigned int | m_size_x |
unsigned int | m_size_y |
Definition at line 42 of file CDynamicGrid.h.
mrpt::utils::CDynamicGrid< T >::CDynamicGrid | ( | float | x_min = -10.0f , |
|
float | x_max = 10.0f , |
|||
float | y_min = -10.0f , |
|||
float | y_max = 10.0f , |
|||
float | resolution = 0.10f | |||
) | [inline] |
virtual mrpt::utils::CDynamicGrid< T >::~CDynamicGrid | ( | ) | [inline, virtual] |
virtual float mrpt::utils::CDynamicGrid< T >::cell2float | ( | const T & | c | ) | const [inline, virtual] |
The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value.
Definition at line 278 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::saveToTextFile().
const T* mrpt::utils::CDynamicGrid< T >::cellByIndex | ( | unsigned int | cx, | |
unsigned int | cy | |||
) | const [inline] |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.
Definition at line 242 of file CDynamicGrid.h.
T* mrpt::utils::CDynamicGrid< T >::cellByIndex | ( | unsigned int | cx, | |
unsigned int | cy | |||
) | [inline] |
Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the map extensions.
Definition at line 233 of file CDynamicGrid.h.
const T* mrpt::utils::CDynamicGrid< T >::cellByPos | ( | float | x, | |
float | y | |||
) | const [inline] |
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions.
Definition at line 220 of file CDynamicGrid.h.
T* mrpt::utils::CDynamicGrid< T >::cellByPos | ( | float | x, | |
float | y | |||
) | [inline] |
Returns a pointer to the contents of a cell given by its coordinates, or NULL if it is out of the map extensions.
Definition at line 207 of file CDynamicGrid.h.
void mrpt::utils::CDynamicGrid< T >::clear | ( | void | ) | [inline] |
Erase the contents of all the cells.
Reimplemented in mrpt::slam::CGasConcentrationGridMap2D, and mrpt::slam::CHeightGridMap2D.
Definition at line 106 of file CDynamicGrid.h.
void mrpt::utils::CDynamicGrid< T >::fill | ( | const T & | value | ) | [inline] |
float mrpt::utils::CDynamicGrid< T >::getResolution | ( | ) | const [inline] |
unsigned int mrpt::utils::CDynamicGrid< T >::getSizeX | ( | ) | [inline] |
Returns the horizontal size of grid map in cells count.
Definition at line 251 of file CDynamicGrid.h.
unsigned int mrpt::utils::CDynamicGrid< T >::getSizeY | ( | ) | [inline] |
Returns the vertical size of grid map in cells count.
Definition at line 255 of file CDynamicGrid.h.
float mrpt::utils::CDynamicGrid< T >::getXMax | ( | ) | const [inline] |
Returns the "x" coordinate of right side of grid map.
Definition at line 263 of file CDynamicGrid.h.
float mrpt::utils::CDynamicGrid< T >::getXMin | ( | ) | const [inline] |
float mrpt::utils::CDynamicGrid< T >::getYMax | ( | ) | const [inline] |
Returns the "y" coordinate of bottom side of grid map.
Definition at line 271 of file CDynamicGrid.h.
float mrpt::utils::CDynamicGrid< T >::getYMin | ( | ) | const [inline] |
void mrpt::utils::CDynamicGrid< T >::idx2cxcy | ( | const int & | idx, | |
int & | cx, | |||
int & | cy | |||
) | const [inline] |
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes.
Definition at line 303 of file CDynamicGrid.h.
float mrpt::utils::CDynamicGrid< T >::idx2x | ( | int | cx | ) | const [inline] |
float mrpt::utils::CDynamicGrid< T >::idx2y | ( | int | cy | ) | const [inline] |
Definition at line 312 of file CDynamicGrid.h.
std::vector<T>& mrpt::utils::CDynamicGrid< T >::m_map_castaway_const | ( | ) | const [inline, protected] |
Used only from logically const method that really need to modify the.
Definition at line 50 of file CDynamicGrid.h.
virtual void mrpt::utils::CDynamicGrid< T >::resize | ( | float | new_x_min, | |
float | new_x_max, | |||
float | new_y_min, | |||
float | new_y_max, | |||
const T & | defaultValueNewCells, | |||
float | additionalMarginMeters = 2.0f | |||
) | [inline, virtual] |
Changes the size of the grid, maintaining previous contents.
Definition at line 123 of file CDynamicGrid.h.
void mrpt::utils::CDynamicGrid< T >::saveToTextFile | ( | const std::string & | fileName | ) | const [inline] |
Definition at line 283 of file CDynamicGrid.h.
void mrpt::utils::CDynamicGrid< T >::setSize | ( | float | x_min, | |
float | x_max, | |||
float | y_min, | |||
float | y_max, | |||
float | resolution | |||
) | [inline] |
Changes the size of the grid, ERASING all previous contents.
Definition at line 81 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::CDynamicGrid().
int mrpt::utils::CDynamicGrid< T >::x2idx | ( | float | x, | |
float | x_min | |||
) | const [inline] |
Transform a coordinate value into a cell index, using a diferent "x_min" value.
Definition at line 316 of file CDynamicGrid.h.
int mrpt::utils::CDynamicGrid< T >::x2idx | ( | float | x | ) | const [inline] |
Transform a coordinate values into cell indexes.
Definition at line 298 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByPos(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::xy2idx().
int mrpt::utils::CDynamicGrid< T >::xy2idx | ( | float | x, | |
float | y | |||
) | const [inline] |
Definition at line 300 of file CDynamicGrid.h.
int mrpt::utils::CDynamicGrid< T >::y2idx | ( | float | y, | |
float | y_min | |||
) | const [inline] |
Definition at line 317 of file CDynamicGrid.h.
int mrpt::utils::CDynamicGrid< T >::y2idx | ( | float | y | ) | const [inline] |
Definition at line 299 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByPos(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::xy2idx().
std::vector<T> mrpt::utils::CDynamicGrid< T >::m_map [protected] |
The cells.
Definition at line 47 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByIndex(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByPos(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::clear(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::fill(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::m_map_castaway_const(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::saveToTextFile(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize().
float mrpt::utils::CDynamicGrid< T >::m_resolution [protected] |
Definition at line 53 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getResolution(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::idx2x(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::idx2y(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::x2idx(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::y2idx().
unsigned int mrpt::utils::CDynamicGrid< T >::m_size_x [protected] |
Definition at line 54 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByIndex(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByPos(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::clear(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getSizeX(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::idx2cxcy(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::saveToTextFile(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::xy2idx().
unsigned int mrpt::utils::CDynamicGrid< T >::m_size_y [protected] |
Definition at line 54 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByIndex(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::cellByPos(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::clear(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getSizeY(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::saveToTextFile(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize().
float mrpt::utils::CDynamicGrid< T >::m_x_max [protected] |
Definition at line 52 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getXMax(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize().
float mrpt::utils::CDynamicGrid< T >::m_x_min [protected] |
Definition at line 52 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getXMin(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::idx2x(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::x2idx().
float mrpt::utils::CDynamicGrid< T >::m_y_max [protected] |
Definition at line 52 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getYMax(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize().
float mrpt::utils::CDynamicGrid< T >::m_y_min [protected] |
Definition at line 52 of file CDynamicGrid.h.
Referenced by mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::getYMin(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::idx2y(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::resize(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::setSize(), and mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::y2idx().
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:18:33 EST 2009 |