Representation of a grid where cells keep track of how many neighbors they have.
More...
Public Types |
typedef Grid< _T >::Cell | BaseCell |
| Datatype for cell in base class.
|
typedef Grid< _T >::CellArray | BaseCellArray |
| Datatype for array of cells in base class.
|
typedef Grid< _T >::Coord | Coord |
| Datatype for cell coordinates.
|
typedef std::vector< Cell * > | CellArray |
| The datatype for arrays of cells.
|
typedef std::vector< int > | Coord |
| Definition of a coordinate within this grid.
|
typedef std::vector< Cell * > | CellArray |
| The datatype for arrays of cells.
|
typedef CoordHash::const_iterator | iterator |
| We only allow const iterators.
|
Public Member Functions |
| GridN (unsigned int dimension) |
| The constructor takes the dimension of the grid as argument.
|
void | setDimension (unsigned int dimension) |
void | setBounds (const Coord &low, const Coord &up) |
void | setInteriorCellNeighborLimit (unsigned int count) |
Cell * | getCell (const Coord &coord) const |
| Get the cell at a specified coordinate.
|
void | neighbors (const Cell *cell, CellArray &list) const |
| Get the list of neighbors for a given cell.
|
void | neighbors (const Coord &coord, CellArray &list) const |
| Get the list of neighbors for a given coordinate.
|
void | neighbors (Coord &coord, CellArray &list) const |
| Get the list of neighbors for a given coordinate.
|
virtual BaseCell * | createCell (const Coord &coord, BaseCellArray *nbh=NULL) |
virtual bool | remove (BaseCell *cell) |
void | getCells (CellArray &cells) const |
| Get the set of instantiated cells in the grid.
|
| Grid (unsigned int dimension) |
| The constructor takes the dimension of the grid as argument.
|
virtual | ~Grid (void) |
| Destructor.
|
virtual void | clear (void) |
| Clear all cells in the grid.
|
unsigned int | getDimension (void) const |
| Return the dimension of the grid.
|
bool | has (const Coord &coord) const |
| Check if a cell exists at the specified coordinate.
|
std::vector< std::vector< Cell * > > | components (void) const |
| Get the connected components formed by the cells in this grid (based on neighboring relation)
|
virtual void | add (Cell *cell) |
| Add an instantiated cell to the grid.
|
virtual void | destroyCell (Cell *cell) const |
| Clear the memory occupied by a cell; do not call this function unless remove() was called first.
|
void | getContent (std::vector< _T > &content) const |
| Get the data stored in the cells we are aware of.
|
void | getCoordinates (std::vector< Coord * > &coords) const |
| Get the set of coordinates where there are cells.
|
void | printCoord (Coord &coord, std::ostream &out=std::cout) const |
| Print the value of a coordinate to a stream.
|
bool | empty (void) const |
| Check if the grid is empty.
|
unsigned int | size (void) const |
| Check the size of the grid.
|
virtual void | status (std::ostream &out=std::cout) const |
| Print information about the data in this grid structure.
|
iterator | begin (void) const |
| Return the begin() iterator for the grid.
|
iterator | end (void) const |
| Return the end() iterator for the grid.
|
template<typename _T>
class ompl::GridN< _T >
Representation of a grid where cells keep track of how many neighbors they have.
Definition at line 47 of file GridN.h.
If bounds for the grid need to be considered, we can set them here. When the number of neighbors are counted, whether the Space is bounded matters, in the sense that if a cell is on the boundary, we know some of its neighbors cannot exist. In order to allow such a cell to reflect the fact it has Achieved its maximal number of neighbors, the boundary is counted as the number of neighbors it prevents from existing.
Definition at line 115 of file GridN.h.