libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
TwoDCell.hpp
1 #ifndef TWODCELL_HPP
2 #define TWODCELL_HPP
3 
4 #include <Eigen/Core>
5 
6 #include "API/Grids/BaseCell.hpp"
7 
8 namespace API
9 {
10  class TwoDGrid;
19  class TwoDCell : public BaseCell
20  {
21  public:
22  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 
24  TwoDCell();
25  TwoDCell(int i, Eigen::Vector2d corner, TwoDGrid* grid);
26  virtual ~TwoDCell();
27 
28  bool isInsideCell(Eigen::Vector2d point);
29 
30  Eigen::Vector2d getCenter();
31  Eigen::Vector2d getCorner() { return _corner; }
32  Eigen::Vector2d getRandomPoint();
33  Eigen::Vector2d getCellSize();
34 
35  int getIndex() { return _index; }
36 
37  virtual void draw();
38 
39  bool operator==( TwoDCell otherCell) { return ((otherCell._index) == (this->_index)); }
40 
41  protected:
42  int _index;
43  Eigen::Vector2d _corner;
44  TwoDGrid* _grid;
45  };
46 
47 }
48 
49 #endif // TWODCELL_HPP
Eigen::Vector2d getRandomPoint()
Random Point In ThreeDCell.
Definition: TwoDCell.cpp:84
Definition: TwoDCell.hpp:19
Definition: BaseCell.hpp:11
EIGEN_MAKE_ALIGNED_OPERATOR_NEW TwoDCell()
Constructor of cell.
Definition: TwoDCell.cpp:24
Definition: TwoDGrid.hpp:25
Eigen::Vector2d getCenter()
Function to get the center of the cell.
Definition: TwoDCell.cpp:67
Eigen::Vector2d getCellSize()
Gets the cell size.
Definition: TwoDCell.cpp:106
virtual ~TwoDCell()
Constructor of cell.
Definition: TwoDCell.cpp:46
bool isInsideCell(Eigen::Vector2d point)
Function is inside cell.
Definition: TwoDCell.cpp:56