Representation of a simple grid. More...
#include <ompl/datastructures/Grid.h>

Classes | |
struct | Cell |
Definition of a cell in this grid. More... | |
struct | EqualCoordPtr |
Equality operator for coordinate pointers. More... | |
struct | HashFunCoordPtr |
struct | SortComponents |
Helper to sort components by size. More... | |
Public Types | |
using | Coord = Eigen::VectorXi |
Definition of a coordinate within this grid. More... | |
using | CellArray = std::vector< Cell * > |
The datatype for arrays of cells. More... | |
using | iterator = typename CoordHash::const_iterator |
We only allow const iterators. More... | |
Public Member Functions | |
Grid (unsigned int dimension) | |
The constructor takes the dimension of the grid as argument. More... | |
virtual | ~Grid () |
Destructor. More... | |
virtual void | clear () |
Clear all cells in the grid. More... | |
unsigned int | getDimension () const |
Return the dimension of the grid. More... | |
void | setDimension (unsigned int dimension) |
bool | has (const Coord &coord) const |
Check if a cell exists at the specified coordinate. More... | |
Cell * | getCell (const Coord &coord) const |
Get the cell at a specified coordinate. More... | |
void | neighbors (const Cell *cell, CellArray &list) const |
Get the list of neighbors for a given cell. More... | |
void | neighbors (const Coord &coord, CellArray &list) const |
Get the list of neighbors for a given coordinate. More... | |
void | neighbors (Coord &coord, CellArray &list) const |
Get the list of neighbors for a given coordinate. More... | |
std::vector< std::vector< Cell * > > | components () const |
Get the connected components formed by the cells in this grid (based on neighboring relation) More... | |
virtual Cell * | createCell (const Coord &coord, CellArray *nbh=nullptr) |
virtual bool | remove (Cell *cell) |
virtual void | add (Cell *cell) |
Add an instantiated cell to the grid. More... | |
virtual void | destroyCell (Cell *cell) const |
Clear the memory occupied by a cell; do not call this function unless remove() was called first. More... | |
void | getContent (std::vector< _T > &content) const |
Get the data stored in the cells we are aware of. More... | |
void | getCoordinates (std::vector< Coord * > &coords) const |
Get the set of coordinates where there are cells. More... | |
void | getCells (CellArray &cells) const |
Get the set of instantiated cells in the grid. More... | |
void | printCoord (Coord &coord, std::ostream &out=std::cout) const |
Print the value of a coordinate to a stream. More... | |
bool | empty () const |
Check if the grid is empty. More... | |
unsigned int | size () const |
Check the size of the grid. More... | |
virtual void | status (std::ostream &out=std::cout) const |
Print information about the data in this grid structure. More... | |
iterator | begin () const |
Return the begin() iterator for the grid. More... | |
iterator | end () const |
Return the end() iterator for the grid. More... | |
Protected Types | |
using | CoordHash = std::unordered_map< Coord *, Cell *, HashFunCoordPtr, EqualCoordPtr > |
Define the datatype for the used hash structure. More... | |
Protected Member Functions | |
void | freeMemory () |
Free the allocated memory. More... | |
Protected Attributes | |
unsigned int | dimension_ |
The dimension of the grid. More... | |
unsigned int | maxNeighbors_ |
The maximum number of neighbors a cell can have (2 * dimension) More... | |
CoordHash | hash_ |
The hash holding the cells. More... | |
Detailed Description
class ompl::Grid< _T >
Representation of a simple grid.
Member Typedef Documentation
◆ CellArray
using ompl::Grid< _T >::CellArray = std::vector<Cell *> |
◆ Coord
using ompl::Grid< _T >::Coord = Eigen::VectorXi |
◆ CoordHash
|
protected |
◆ iterator
using ompl::Grid< _T >::iterator = typename CoordHash::const_iterator |
Constructor & Destructor Documentation
◆ Grid()
|
inlineexplicit |
◆ ~Grid()
|
inlinevirtual |
Member Function Documentation
◆ add()
|
inlinevirtual |
◆ begin()
|
inline |
◆ clear()
|
inlinevirtual |
Clear all cells in the grid.
Reimplemented in ompl::GridB< _T, LessThanExternal, LessThanInternal >, and ompl::GridB< CellData *, OrderCellsByImportance >.
◆ components()
|
inline |
◆ createCell()
|
inlinevirtual |
Instantiate a new cell at given coordinates; optionally Return the list of future neighbors. Note: this call only creates the cell, but does not add it to the grid. It however updates the neighbor count for neighboring cells
Reimplemented in ompl::GridN< _T >, ompl::GridB< _T, LessThanExternal, LessThanInternal >, and ompl::GridB< CellData *, OrderCellsByImportance >.
◆ destroyCell()
|
inlinevirtual |
◆ empty()
|
inline |
◆ end()
|
inline |
◆ freeMemory()
|
inlineprotected |
◆ getCell()
|
inline |
◆ getCells()
|
inline |
◆ getContent()
|
inline |
◆ getCoordinates()
|
inline |
◆ getDimension()
|
inline |
◆ has()
|
inline |
◆ neighbors() [1/3]
|
inline |
◆ neighbors() [2/3]
|
inline |
◆ neighbors() [3/3]
|
inline |
◆ printCoord()
|
inline |
◆ remove()
|
inlinevirtual |
◆ setDimension()
|
inline |
◆ size()
|
inline |
◆ status()
|
inlinevirtual |
Print information about the data in this grid structure.
Reimplemented in ompl::GridB< _T, LessThanExternal, LessThanInternal >, and ompl::GridB< CellData *, OrderCellsByImportance >.
Member Data Documentation
◆ dimension_
|
protected |
◆ hash_
|
protected |
◆ maxNeighbors_
|
protected |
The documentation for this class was generated from the following file:
- ompl/datastructures/Grid.h