17 #ifndef GAZEBO_PHYSISCS_MAPSHAPE_HH_
18 #define GAZEBO_PHYSISCS_MAPSHAPE_HH_
55 public:
void Update();
59 public:
virtual void Load(sdf::ElementPtr _sdf);
62 public:
virtual void Init();
67 public:
void FillMsg(msgs::Geometry &_msg);
71 public:
virtual void ProcessMsg(
const msgs::Geometry &_msg);
75 public: std::string GetURI()
const;
79 public:
void SetScale(
const ignition::math::Vector3d &_scale);
88 public:
virtual ignition::math::Vector3d Scale()
const;
94 public:
int GetThreshold()
const;
100 public:
double GetHeight()
const;
105 public:
int GetGranularity()
const;
109 private:
void BuildTree(
QuadNode *_node);
118 private:
void GetPixelCount(
unsigned int _xStart,
unsigned int _yStart,
119 unsigned int _width,
unsigned int _height,
120 unsigned int &_freePixels,
121 unsigned int &_occPixels);
125 private:
void ReduceTree(
QuadNode *_node);
133 private:
void CreateBox();
137 private:
void CreateBoxes(
QuadNode *_node);
146 private:
bool merged;
150 private:
static unsigned int collisionCounter;
161 : x(0), y(0), width(0), height(0)
172 std::deque<QuadNode*>::iterator iter;
173 for (iter = children.begin(); iter != children.end(); ++iter)
179 public:
void Print(std::string _space)
181 std::deque<QuadNode*>::iterator iter;
183 printf(
"%sXY[%d %d] WH[%d %d] O[%d] L[%d] V[%d]\n",
184 _space.c_str(), x, y, width, height, occupied, leaf, valid);
186 for (iter = children.begin(); iter != children.end(); ++iter)
187 if ((*iter)->occupied)
188 (*iter)->Print(_space);
192 public: uint32_t x, y;
195 public: uint32_t width, height;
201 public: std::deque<QuadNode*> children;
204 public:
bool occupied;
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
Base class for all shapes.
Definition: Shape.hh:45
Creates box extrusions based on an image.
Definition: MapShape.hh:45
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
Encapsulates an image.
Definition: Image.hh:74
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113