libmove3d
3.13.0
|
00001 #ifndef __DPGGRID_H__ 00002 #define __DPGGRID_H__ 00003 #include "P3d-pkg.h" 00004 #include "DpgCell.h" 00005 #include <vector> 00006 #include "ThreeDGrid.h" 00007 00008 class DpgGrid : public API::ThreeDGrid{ 00009 public: 00010 //constructors and destructors 00011 DpgGrid(p3d_env* env); 00012 virtual ~DpgGrid(); 00013 00014 //setters and getters 00015 inline int getNbCells(void){return _nbCells;} 00016 inline int getNbCellsOverX(void){return _nbCellsX;} 00017 inline int getNbCellsOverY(void){return _nbCellsY;} 00018 inline int getNbCellsOverZ(void){return _nbCellsZ;} 00019 00020 //functions 00021 void init(void); 00022 void updateRobotOccupationCells(p3d_rob* robot); 00023 std::vector<DpgCell*> getCellListForObject(p3d_obj* obj, p3d_matrix4 pointTransform); 00024 void unvalidObjectCells(p3d_obj* obj); 00025 void draw(); 00026 protected: 00027 virtual API::ThreeDCell* createNewCell(unsigned int index, unsigned int x, unsigned int y, unsigned int z ); 00028 private: 00029 p3d_env* _env; 00030 //The position of the origin of the grid regarding th eorigin of the world 00031 int _nbMaxCells; //the number of cell along the longest axis of the environment 00032 int _nbCells; 00033 }; 00034 00035 #endif