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);
83 public:
virtual ignition::math::Vector3d Scale()
const;
89 public:
int GetThreshold()
const;
95 public:
double GetHeight()
const;
100 public:
int GetGranularity()
const;
104 private:
void BuildTree(
QuadNode *_node);
113 private:
void GetPixelCount(
unsigned int _xStart,
unsigned int _yStart,
114 unsigned int _width,
unsigned int _height,
115 unsigned int &_freePixels,
116 unsigned int &_occPixels);
120 private:
void ReduceTree(
QuadNode *_node);
128 private:
void CreateBox();
132 private:
void CreateBoxes(
QuadNode *_node);
141 private:
bool merged;
145 private:
static unsigned int collisionCounter;
151 class GZ_PHYSICS_VISIBLE QuadNode
155 public:
explicit QuadNode(QuadNode *_parent)
156 : x(0), y(0), width(0), height(0)
167 std::deque<QuadNode*>::iterator iter;
168 for (iter = children.begin(); iter != children.end(); ++iter)
174 public:
void Print(std::string _space)
176 std::deque<QuadNode*>::iterator iter;
178 printf(
"%sXY[%d %d] WH[%d %d] O[%d] L[%d] V[%d]\n",
179 _space.c_str(), x, y, width, height, occupied, leaf, valid);
181 for (iter = children.begin(); iter != children.end(); ++iter)
182 if ((*iter)->occupied)
183 (*iter)->Print(_space);
187 public: uint32_t x, y;
190 public: uint32_t width, height;
193 public: QuadNode *parent;
196 public: std::deque<QuadNode*> children;
199 public:
bool occupied;
Forward declarations for the common classes.
Definition: Animation.hh:26
Base class for all shapes.
Definition: Shape.hh:45
Creates box extrusions based on an image.
Definition: MapShape.hh:45
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