Map class describes static environment. More...
#include <Map.h>
Public Member Functions | |
bool | CellIsObstacle (int i, int j) const |
Check Cell (i,j) is obstacle. More... | |
bool | CellIsTraversable (int i, int j) const |
Check Cell (i,j) is traversable. More... | |
bool | CellOnGrid (int i, int j) const |
Check Cell (i,j) is inside grid. More... | |
float | GetCellSize () const |
Return size of cell side. More... | |
Node | GetClosestNode (const Point &point) const |
Return cell to which point in orthogonal coordinates belong. More... | |
unsigned int | GetHeight () const |
Return height of grid. More... | |
const std::vector< std::vector< ObstacleSegment > > & | GetObstacles () const |
Return obstacles in form of polygons. More... | |
Point | GetPoint (const Node &node) const |
Return center of grid cell in orthogonal coordinates. More... | |
unsigned int | GetWidth () const |
Return width of grid. More... | |
Map () | |
Map default constructor. More... | |
Map (float cellSize, std::vector< std::vector< int >> &grid, std::vector< std::vector< Point >> &obstacles) | |
Map constructor with parameters. More... | |
Map (const Map &obj) | |
Map copy constructor. More... | |
Map & | operator= (const Map &obj) |
Assignment operator. More... | |
~Map () | |
Map destructor. More... | |
Map class describes static environment.
This class contains main information about static environment. The map is set in the form of a grid, are also described in the form of polygons. The grid is a rectangular matrix of square cells, each cell can be traversable or not. The size of cell side is set by the value of cellSize. The address of each cell on the grid is specified by a pair (i, j), where i is the row number of the matrix, j is the column number of the matrix The environment description is specified in the orthogonal coordinates. Every obstacle in form of polygon is vector of points in orthogonal coordinates. Vertices of the simple obstacle shold be listed in counterclockwise order, vertices of boundary in clockwise order. An illustration of the environment is presented in the figure below.
Map::Map | ( | float | cellSize, |
std::vector< std::vector< int >> & | grid, | ||
std::vector< std::vector< Point >> & | obstacles | ||
) |
Map constructor with parameters.
cellSize | Size of cell side. |
grid | Matrix of traversability of environment. Every cell can be 0 (traversable) or 1 (obstacle). |
obstacles | Vector of obstacles in form of polygons. Every obstacle is vector of points in orthogonal coordinates. Vertices of the simple obstacle shold be listed in counterclockwise order, vertices of boundary in clockwise order. |
Map::Map | ( | const Map & | obj | ) |
bool Map::CellIsObstacle | ( | int | i, |
int | j | ||
) | const |
bool Map::CellIsTraversable | ( | int | i, |
int | j | ||
) | const |
bool Map::CellOnGrid | ( | int | i, |
int | j | ||
) | const |
float Map::GetCellSize | ( | ) | const |
unsigned int Map::GetHeight | ( | ) | const |
const std::vector< std::vector< ObstacleSegment > > & Map::GetObstacles | ( | ) | const |
unsigned int Map::GetWidth | ( | ) | const |