libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
ThreeDCell.hpp
1 #ifndef CELL_HPP
2 #define CELL_HPP
3 
4 
5 
6 #include <Eigen/Core>
7 
8 #include "API/Grids/BaseCell.hpp"
9 
10 #include <libxml/parser.h>
11 
20 namespace API
21 {
22  class ThreeDGrid;
23 
24 
25  class ThreeDCell : public BaseCell
26  {
27  public:
28  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
29 
30  ThreeDCell();
31  ThreeDCell(int i, ThreeDGrid* grid);
32  ThreeDCell(int i, Eigen::Vector3d corner, ThreeDGrid* grid);
33 
34  virtual ~ThreeDCell();
35 
36  virtual double getCost() { return 0; };
37 
38  bool isInsideCell(Eigen::Vector3d point);
39 
40  Eigen::Vector3d getCenter();
41  Eigen::Vector3d getCorner() { return _corner; }
42  Eigen::Vector3d getRandomPoint();
43  Eigen::Vector3d getCellSize();
44 
45  int getIndex() { return _index; }
46 
47  void setCorner(const Eigen::Vector3d& corner) { _corner = corner; }
48  void setGrid( ThreeDGrid* grid ) { _grid = grid; }
49  ThreeDGrid* getGrid () {return _grid;}
50 
51  virtual void draw();
52  void drawColorGradient( double value, double min, double max , bool inverse = false );
53 
54  bool writeToXml(xmlNodePtr cur);
55  bool readCellFromXml(xmlNodePtr cur);
56 
57  bool operator==( ThreeDCell otherCell) { return ((otherCell._index) == (this->_index)); }
58 
59  protected:
60  int _index;
61  Eigen::Vector3d _corner;
62  ThreeDGrid* _grid;
63  };
64 
65 }
66 #endif // CELL_HPP
Eigen::Vector3d getRandomPoint()
Random Point In ThreeDCell.
Definition: ThreeDCell.cpp:97
Definition: ThreeDGrid.hpp:24
bool isInsideCell(Eigen::Vector3d point)
Function is inside cell.
Definition: ThreeDCell.cpp:67
Definition: BaseCell.hpp:11
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ThreeDCell()
Constructor of cell.
Definition: ThreeDCell.cpp:24
virtual ~ThreeDCell()
Constructor of cell.
Definition: ThreeDCell.cpp:57
Eigen::Vector3d getCenter()
Function to get the center of the cell.
Definition: ThreeDCell.cpp:78
Definition: ThreeDCell.hpp:25
Eigen::Vector3d getCellSize()
Gets the cell size.
Definition: ThreeDCell.cpp:119
void drawColorGradient(double value, double min, double max, bool inverse=false)
should be between min and max the min value that value can take the max value that value can take ...
Definition: ThreeDCell.cpp:232