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;
100 private:
void BuildTree(QuadNode *_node);
109 private:
void GetPixelCount(
unsigned int _xStart,
unsigned int _yStart,
110 unsigned int _width,
unsigned int _height,
111 unsigned int &_freePixels,
112 unsigned int &_occPixels);
116 private:
void ReduceTree(QuadNode *_node);
121 private:
void Merge(QuadNode *_nodeA, QuadNode *_nodeB);
124 private:
void CreateBox();
128 private:
void CreateBoxes(QuadNode *_node);
134 private: QuadNode *root;
137 private:
bool merged;
141 private:
static unsigned int collisionCounter;
150 public: QuadNode(QuadNode *_parent)
151 : x(0), y(0), width(0), height(0)
162 std::deque<QuadNode*>::iterator iter;
163 for (iter = children.begin(); iter != children.end(); ++iter)
169 public:
void Print(std::string _space)
171 std::deque<QuadNode*>::iterator iter;
173 printf(
"%sXY[%d %d] WH[%d %d] O[%d] L[%d] V[%d]\n",
174 _space.c_str(), x, y, width, height, occupied, leaf, valid);
176 for (iter = children.begin(); iter != children.end(); ++iter)
177 if ((*iter)->occupied)
178 (*iter)->Print(_space);
182 public: uint32_t x, y;
185 public: uint32_t width, height;
188 public: QuadNode *parent;
191 public: std::deque<QuadNode*> children;
194 public:
bool occupied;