Map.h
Go to the documentation of this file.
1 
7 #include <string>
8 #include <vector>
9 
10 #include "Geom.h"
11 
12 
13 #ifndef ORCA_MAP_H
14 #define ORCA_MAP_H
15 
16 
36 class Map
37 {
38  public:
42  Map();
43 
51  Map(float cellSize, std::vector<std::vector<int>> &grid, std::vector<std::vector<Point>> &obstacles);
52 
57  Map(const Map &obj);
58 
62  ~Map();
63 
70  bool CellIsObstacle(int i, int j) const;
71 
78  bool CellOnGrid(int i, int j) const;
79 
86  bool CellIsTraversable(int i, int j) const;
87 
92  unsigned int GetHeight() const;
93 
98  unsigned int GetWidth() const;
99 
104  float GetCellSize() const;
105 
110  const std::vector<std::vector<ObstacleSegment>>& GetObstacles() const;
111 
117  Node GetClosestNode(const Point &point) const;
118 
124  Point GetPoint(const Node &node) const;
125 
131  Map & operator = (const Map &obj);
132 
133  private:
135  float cellSize;
136  unsigned int height;
137  unsigned int width;
138  std::vector<std::vector<int>> *grid;
139  std::vector<std::vector<ObstacleSegment>> *obstacles;
141 };
142 
143 
144 #endif //ORCA_MAP_H
unsigned int GetWidth() const
Return width of grid.
Definition: Map.cpp:127
The Node class defines a cell of grid (see Map class)
Definition: Geom.h:21
bool CellIsTraversable(int i, int j) const
Check Cell (i,j) is traversable.
Definition: Map.cpp:109
File contains Node, Point, Line, Vertex, ObstacleSegment classes and some methods and functions imple...
bool CellOnGrid(int i, int j) const
Check Cell (i,j) is inside grid.
Definition: Map.cpp:115
float GetCellSize() const
Return size of cell side.
Definition: Map.cpp:133
The Point class defines a position (or euclidean vector from (0,0)) in 2D space.
Definition: Geom.h:61
~Map()
Map destructor.
Definition: Map.cpp:87
const std::vector< std::vector< ObstacleSegment > > & GetObstacles() const
Return obstacles in form of polygons.
Definition: Map.cpp:171
Point GetPoint(const Node &node) const
Return center of grid cell in orthogonal coordinates.
Definition: Map.cpp:166
bool CellIsObstacle(int i, int j) const
Check Cell (i,j) is obstacle.
Definition: Map.cpp:103
Map class describes static environment.
Definition: Map.h:36
Map & operator=(const Map &obj)
Assignment operator.
Definition: Map.cpp:176
Map()
Map default constructor.
Definition: Map.cpp:9
Node GetClosestNode(const Point &point) const
Return cell to which point in orthogonal coordinates belong.
Definition: Map.cpp:139
unsigned int GetHeight() const
Return height of grid.
Definition: Map.cpp:121


ORCAStar
Author(s): Stepan Drgachev
autogenerated on Wed Jul 15 2020 16:13:14