17#ifndef GAZEBO_PHYSISCS_MAPSHAPE_HH_
18#define GAZEBO_PHYSISCS_MAPSHAPE_HH_
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);
79 public:
void SetScale(
const ignition::math::Vector3d &_scale);
83 public:
virtual ignition::math::Vector3d
Scale()
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;
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;
196 public: std::deque<QuadNode*> children;
199 public:
bool occupied;
common
Definition FuelModelDatabase.hh:37
Encapsulates an image.
Definition Image.hh:66
Creates box extrusions based on an image.
Definition MapShape.hh:46
double GetHeight() const
Returns height of this geometry.
std::string GetURI() const
Returns the image URI for this geometry.
int GetThreshold() const
Returns image threshold for this geometry.
virtual ~MapShape()
Destructor.
virtual void Init()
Init the map.
int GetGranularity() const
Returns granularity of this geometry.
virtual void Load(sdf::ElementPtr _sdf)
Load the map.
virtual ignition::math::Vector3d Scale() const
Returns scaling factor for this geometry.
void Update()
Update function.
MapShape(CollisionPtr _parent)
Constructor.
virtual void ProcessMsg(const msgs::Geometry &_msg)
\TODO: Implement this function.
void FillMsg(msgs::Geometry &_msg)
Fills out a msgs::Geometry message containing information about this map geometry object.
void SetScale(const ignition::math::Vector3d &_scale)
Set the scale of the map shape.
Base class for all shapes.
Definition Shape.hh:40
boost::shared_ptr< Collision > CollisionPtr
Definition PhysicsTypes.hh:113
Forward declarations for the common classes.
Definition Animation.hh:27