Point Cloud Library (PCL)  1.11.0
orr_octree.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2012, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  *
37  */
38 
39 /*
40  * orr_octree.h
41  *
42  * Created on: Oct 23, 2012
43  * Author: papazov
44  */
45 
46 #pragma once
47 
48 #include "auxiliary.h"
49 #include <pcl/point_types.h>
50 #include <pcl/point_cloud.h>
51 #include <pcl/pcl_exports.h>
52 #include <cstdlib>
53 #include <ctime>
54 #include <vector>
55 #include <list>
56 #include <set>
57 
58 //#define PCL_REC_ORR_OCTREE_VERBOSE
59 
60 namespace pcl
61 {
62  namespace recognition
63  {
64  /** \brief That's a very specialized and simple octree class. That's the way it is intended to
65  * be, that's why no templates and stuff like this.
66  *
67  * \author Chavdar Papazov
68  * \ingroup recognition
69  */
71  {
72  public:
76 
77  class Node
78  {
79  public:
80  class Data
81  {
82  public:
83  Data (int id_x, int id_y, int id_z, int lin_id, void* user_data = nullptr)
84  : id_x_ (id_x),
85  id_y_ (id_y),
86  id_z_ (id_z),
87  lin_id_ (lin_id),
88  num_points_ (0),
89  user_data_ (user_data)
90  {
91  n_[0] = n_[1] = n_[2] = p_[0] = p_[1] = p_[2] = 0.0f;
92  }
93 
94  virtual~ Data (){}
95 
96  inline void
97  addToPoint (float x, float y, float z)
98  {
99  p_[0] += x; p_[1] += y; p_[2] += z;
100  ++num_points_;
101  }
102 
103  inline void
105  {
106  if ( num_points_ < 2 )
107  return;
108 
109  aux::mult3 (p_, 1.0f/static_cast<float> (num_points_));
110  num_points_ = 1;
111  }
112 
113  inline void
114  addToNormal (float x, float y, float z) { n_[0] += x; n_[1] += y; n_[2] += z;}
115 
116  inline const float*
117  getPoint () const { return p_;}
118 
119  inline float*
120  getPoint (){ return p_;}
121 
122  inline const float*
123  getNormal () const { return n_;}
124 
125  inline float*
126  getNormal (){ return n_;}
127 
128  inline void
129  get3dId (int id[3]) const
130  {
131  id[0] = id_x_;
132  id[1] = id_y_;
133  id[2] = id_z_;
134  }
135 
136  inline int
137  get3dIdX () const {return id_x_;}
138 
139  inline int
140  get3dIdY () const {return id_y_;}
141 
142  inline int
143  get3dIdZ () const {return id_z_;}
144 
145  inline int
146  getLinearId () const { return lin_id_;}
147 
148  inline void
149  setUserData (void* user_data){ user_data_ = user_data;}
150 
151  inline void*
152  getUserData () const { return user_data_;}
153 
154  inline void
155  insertNeighbor (Node* node){ neighbors_.insert (node);}
156 
157  inline const std::set<Node*>&
158  getNeighbors () const { return (neighbors_);}
159 
160  protected:
161  float n_[3], p_[3];
162  int id_x_, id_y_, id_z_, lin_id_, num_points_;
163  std::set<Node*> neighbors_;
164  void *user_data_;
165  };
166 
167  Node ()
168  : data_ (nullptr),
169  parent_ (nullptr),
170  children_(nullptr)
171  {}
172 
173  virtual~ Node ()
174  {
175  this->deleteChildren ();
176  this->deleteData ();
177  }
178 
179  inline void
180  setCenter(const float *c) { center_[0] = c[0]; center_[1] = c[1]; center_[2] = c[2];}
181 
182  inline void
183  setBounds(const float *b) { bounds_[0] = b[0]; bounds_[1] = b[1]; bounds_[2] = b[2]; bounds_[3] = b[3]; bounds_[4] = b[4]; bounds_[5] = b[5];}
184 
185  inline void
186  setParent(Node* parent) { parent_ = parent;}
187 
188  inline void
189  setData(Node::Data* data) { data_ = data;}
190 
191  /** \brief Computes the "radius" of the node which is half the diagonal length. */
192  inline void
194  {
195  float v[3] = {0.5f*(bounds_[1]-bounds_[0]), 0.5f*(bounds_[3]-bounds_[2]), 0.5f*(bounds_[5]-bounds_[4])};
196  radius_ = static_cast<float> (aux::length3 (v));
197  }
198 
199  inline const float*
200  getCenter() const { return center_;}
201 
202  inline const float*
203  getBounds() const { return bounds_;}
204 
205  inline void
206  getBounds(float b[6]) const
207  {
208  memcpy (b, bounds_, 6*sizeof (float));
209  }
210 
211  inline Node*
212  getChild (int id) { return &children_[id];}
213 
214  inline Node*
215  getChildren () { return children_;}
216 
217  inline Node::Data*
218  getData (){ return data_;}
219 
220  inline const Node::Data*
221  getData () const { return data_;}
222 
223  inline void
224  setUserData (void* user_data){ data_->setUserData (user_data);}
225 
226  inline Node*
227  getParent (){ return parent_;}
228 
229  inline bool
230  hasData (){ return static_cast<bool> (data_);}
231 
232  inline bool
233  hasChildren (){ return static_cast<bool> (children_);}
234 
235  /** \brief Computes the "radius" of the node which is half the diagonal length. */
236  inline float
237  getRadius () const{ return radius_;}
238 
239  bool
240  createChildren ();
241 
242  inline void
244  {
245  delete[] children_;
246  children_ = nullptr;
247  }
248 
249  inline void
251  {
252  delete data_;
253  data_ = nullptr;
254  }
255 
256  /** \brief Make this and 'node' neighbors by inserting each node in the others node neighbor set. Nothing happens
257  * of either of the nodes has no data. */
258  inline void
260  {
261  if ( !this->getData () || !node->getData () )
262  return;
263 
264  this->getData ()->insertNeighbor (node);
265  node->getData ()->insertNeighbor (this);
266  }
267 
268  protected:
270  float center_[3], bounds_[6], radius_;
271  Node *parent_, *children_;
272  };
273 
274  ORROctree ();
275  virtual ~ORROctree (){ this->clear ();}
276 
277  void
278  clear ();
279 
280  /** \brief Creates an octree which encloses 'points' and with leaf size equal to 'voxel_size'.
281  * 'enlarge_bounds' makes sure that no points from the input will lie on the octree boundary
282  * by enlarging the bounds by that factor. For example, enlarge_bounds = 1 means that the
283  * bounds will be enlarged by 100%. The default value is fine. */
284  void
285  build (const PointCloudIn& points, float voxel_size, const PointCloudN* normals = nullptr, float enlarge_bounds = 0.00001f);
286 
287  /** \brief Creates an empty octree with bounds at least as large as the ones provided as input and with leaf
288  * size equal to 'voxel_size'. */
289  void
290  build (const float* bounds, float voxel_size);
291 
292  /** \brief Creates the leaf containing p = (x, y, z) and returns a pointer to it, however, only if p lies within
293  * the octree bounds! A more general version which allows p to be out of bounds is not implemented yet. The method
294  * returns NULL if p is not within the root bounds. If the leaf containing p already exists nothing happens and
295  * method just returns a pointer to the leaf. */
296  inline ORROctree::Node*
297  createLeaf (float x, float y, float z)
298  {
299  // Make sure that the input point is within the octree bounds
300  if ( x < bounds_[0] || x > bounds_[1] ||
301  y < bounds_[2] || y > bounds_[3] ||
302  z < bounds_[4] || z > bounds_[5] )
303  {
304  return (nullptr);
305  }
306 
307  ORROctree::Node* node = root_;
308  const float *c;
309  int id;
310 
311  // Go down to the right leaf
312  for ( int l = 0 ; l < tree_levels_ ; ++l )
313  {
314  node->createChildren ();
315  c = node->getCenter ();
316  id = 0;
317 
318  if ( x >= c[0] ) id |= 4;
319  if ( y >= c[1] ) id |= 2;
320  if ( z >= c[2] ) id |= 1;
321 
322  node = node->getChild (id);
323  }
324 
325  if ( !node->getData () )
326  {
327  Node::Data* data = new Node::Data (
328  static_cast<int> ((node->getCenter ()[0] - bounds_[0])/voxel_size_),
329  static_cast<int> ((node->getCenter ()[1] - bounds_[2])/voxel_size_),
330  static_cast<int> ((node->getCenter ()[2] - bounds_[4])/voxel_size_),
331  static_cast<int> (full_leaves_.size ()));
332 
333  node->setData (data);
334  this->insertNeighbors (node);
335  full_leaves_.push_back (node);
336  }
337 
338  return (node);
339  }
340 
341  /** \brief This method returns a super set of the full leavess which are intersected by the sphere
342  * with radius 'radius' and centered at 'p'. Pointers to the intersected full leaves are saved in
343  * 'out'. The method computes a super set in the sense that in general not all leaves saved in 'out'
344  * are really intersected by the sphere. The intersection test is based on the leaf radius (since
345  * its faster than checking all leaf corners and sides), so we report more leaves than we should,
346  * but still, this is a fair approximation. */
347  void
348  getFullLeavesIntersectedBySphere (const float* p, float radius, std::list<ORROctree::Node*>& out) const;
349 
350  /** \brief Randomly chooses and returns a full leaf that is intersected by the sphere with center 'p'
351  * and 'radius'. Returns NULL if no leaf is intersected by that sphere. */
353  getRandomFullLeafOnSphere (const float* p, float radius) const;
354 
355  /** \brief Since the leaves are aligned in a rectilinear grid, each leaf has a unique id. The method returns the leaf
356  * with id [i, j, k] or NULL is no such leaf exists. */
358  getLeaf (int i, int j, int k)
359  {
360  float offset = 0.5f*voxel_size_;
361  float p[3] = {bounds_[0] + offset + static_cast<float> (i)*voxel_size_,
362  bounds_[2] + offset + static_cast<float> (j)*voxel_size_,
363  bounds_[4] + offset + static_cast<float> (k)*voxel_size_};
364 
365  return (this->getLeaf (p[0], p[1], p[2]));
366  }
367 
368  /** \brief Returns a pointer to the leaf containing p = (x, y, z) or NULL if no such leaf exists. */
369  inline ORROctree::Node*
370  getLeaf (float x, float y, float z)
371  {
372  // Make sure that the input point is within the octree bounds
373  if ( x < bounds_[0] || x > bounds_[1] ||
374  y < bounds_[2] || y > bounds_[3] ||
375  z < bounds_[4] || z > bounds_[5] )
376  {
377  return (nullptr);
378  }
379 
380  ORROctree::Node* node = root_;
381  const float *c;
382  int id;
383 
384  // Go down to the right leaf
385  for ( int l = 0 ; l < tree_levels_ ; ++l )
386  {
387  if ( !node->hasChildren () )
388  return (nullptr);
389 
390  c = node->getCenter ();
391  id = 0;
392 
393  if ( x >= c[0] ) id |= 4;
394  if ( y >= c[1] ) id |= 2;
395  if ( z >= c[2] ) id |= 1;
396 
397  node = node->getChild (id);
398  }
399 
400  return (node);
401  }
402 
403  /** \brief Deletes the branch 'node' is part of. */
404  void
405  deleteBranch (Node* node);
406 
407  /** \brief Returns a vector with all octree leaves which contain at least one point. */
408  inline std::vector<ORROctree::Node*>&
409  getFullLeaves () { return full_leaves_;}
410 
411  inline const std::vector<ORROctree::Node*>&
412  getFullLeaves () const { return full_leaves_;}
413 
414  void
415  getFullLeavesPoints (PointCloudOut& out) const;
416 
417  void
418  getNormalsOfFullLeaves (PointCloudN& out) const;
419 
420  inline ORROctree::Node*
421  getRoot (){ return root_;}
422 
423  inline const float*
424  getBounds () const
425  {
426  return (bounds_);
427  }
428 
429  inline void
430  getBounds (float b[6]) const
431  {
432  memcpy (b, bounds_, 6*sizeof (float));
433  }
434 
435  inline float
436  getVoxelSize () const { return voxel_size_;}
437 
438  inline void
440  {
441  const float* c = node->getCenter ();
442  float s = 0.5f*voxel_size_;
443  Node *neigh;
444 
445  neigh = this->getLeaf (c[0]+s, c[1]+s, c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
446  neigh = this->getLeaf (c[0]+s, c[1]+s, c[2] ); if ( neigh ) node->makeNeighbors (neigh);
447  neigh = this->getLeaf (c[0]+s, c[1]+s, c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
448  neigh = this->getLeaf (c[0]+s, c[1] , c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
449  neigh = this->getLeaf (c[0]+s, c[1] , c[2] ); if ( neigh ) node->makeNeighbors (neigh);
450  neigh = this->getLeaf (c[0]+s, c[1] , c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
451  neigh = this->getLeaf (c[0]+s, c[1]-s, c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
452  neigh = this->getLeaf (c[0]+s, c[1]-s, c[2] ); if ( neigh ) node->makeNeighbors (neigh);
453  neigh = this->getLeaf (c[0]+s, c[1]-s, c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
454 
455  neigh = this->getLeaf (c[0] , c[1]+s, c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
456  neigh = this->getLeaf (c[0] , c[1]+s, c[2] ); if ( neigh ) node->makeNeighbors (neigh);
457  neigh = this->getLeaf (c[0] , c[1]+s, c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
458  neigh = this->getLeaf (c[0] , c[1] , c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
459  //neigh = this->getLeaf (c[0] , c[1] , c[2] ); if ( neigh ) node->makeNeighbors (neigh);
460  neigh = this->getLeaf (c[0] , c[1] , c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
461  neigh = this->getLeaf (c[0] , c[1]-s, c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
462  neigh = this->getLeaf (c[0] , c[1]-s, c[2] ); if ( neigh ) node->makeNeighbors (neigh);
463  neigh = this->getLeaf (c[0] , c[1]-s, c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
464 
465  neigh = this->getLeaf (c[0]-s, c[1]+s, c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
466  neigh = this->getLeaf (c[0]-s, c[1]+s, c[2] ); if ( neigh ) node->makeNeighbors (neigh);
467  neigh = this->getLeaf (c[0]-s, c[1]+s, c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
468  neigh = this->getLeaf (c[0]-s, c[1] , c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
469  neigh = this->getLeaf (c[0]-s, c[1] , c[2] ); if ( neigh ) node->makeNeighbors (neigh);
470  neigh = this->getLeaf (c[0]-s, c[1] , c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
471  neigh = this->getLeaf (c[0]-s, c[1]-s, c[2]+s); if ( neigh ) node->makeNeighbors (neigh);
472  neigh = this->getLeaf (c[0]-s, c[1]-s, c[2] ); if ( neigh ) node->makeNeighbors (neigh);
473  neigh = this->getLeaf (c[0]-s, c[1]-s, c[2]-s); if ( neigh ) node->makeNeighbors (neigh);
474  }
475 
476  protected:
477  float voxel_size_, bounds_[6];
480  std::vector<Node*> full_leaves_;
481  };
482  } // namespace recognition
483 } // namespace pcl
pcl::recognition::ORROctree::getFullLeaves
std::vector< ORROctree::Node * > & getFullLeaves()
Returns a vector with all octree leaves which contain at least one point.
Definition: orr_octree.h:409
pcl
Definition: convolution.h:46
point_types.h
pcl::recognition::ORROctree::Node::Data::~ Data
virtual ~ Data()
Definition: orr_octree.h:94
pcl::recognition::ORROctree::Node::Node
Node()
Definition: orr_octree.h:167
pcl::recognition::ORROctree::voxel_size_
float voxel_size_
Definition: orr_octree.h:477
pcl::recognition::ORROctree::Node::Data::user_data_
void * user_data_
Definition: orr_octree.h:164
pcl::recognition::ORROctree::Node::getBounds
void getBounds(float b[6]) const
Definition: orr_octree.h:206
pcl::recognition::ORROctree::Node::Data::Data
Data(int id_x, int id_y, int id_z, int lin_id, void *user_data=nullptr)
Definition: orr_octree.h:83
pcl::recognition::ORROctree::getBounds
const float * getBounds() const
Definition: orr_octree.h:424
pcl::recognition::ORROctree::Node::setCenter
void setCenter(const float *c)
Definition: orr_octree.h:180
pcl::recognition::ORROctree::Node::getChild
Node * getChild(int id)
Definition: orr_octree.h:212
pcl::recognition::ORROctree::Node::~ Node
virtual ~ Node()
Definition: orr_octree.h:173
pcl::recognition::ORROctree::Node::Data::getLinearId
int getLinearId() const
Definition: orr_octree.h:146
pcl::recognition::aux::mult3
void mult3(T *v, T scalar)
v = scalar*v.
Definition: auxiliary.h:222
pcl::recognition::ORROctree::Node::Data
Definition: orr_octree.h:80
pcl::recognition::ORROctree::root_
Node * root_
Definition: orr_octree.h:479
pcl::recognition::ORROctree::Node::getChildren
Node * getChildren()
Definition: orr_octree.h:215
pcl::recognition::ORROctree::insertNeighbors
void insertNeighbors(Node *node)
Definition: orr_octree.h:439
pcl::recognition::ORROctree::getRoot
ORROctree::Node * getRoot()
Definition: orr_octree.h:421
pcl::recognition::ORROctree::Node
Definition: orr_octree.h:77
pcl::PointCloud< pcl::PointXYZ >
pcl::recognition::ORROctree::Node::makeNeighbors
void makeNeighbors(Node *node)
Make this and 'node' neighbors by inserting each node in the others node neighbor set.
Definition: orr_octree.h:259
pcl::recognition::ORROctree::Node::Data::getPoint
const float * getPoint() const
Definition: orr_octree.h:117
pcl::recognition::ORROctree::Node::deleteData
void deleteData()
Definition: orr_octree.h:250
pcl::recognition::ORROctree::getVoxelSize
float getVoxelSize() const
Definition: orr_octree.h:436
pcl::recognition::ORROctree::Node::radius_
float radius_
Definition: orr_octree.h:270
pcl::recognition::ORROctree::Node::setParent
void setParent(Node *parent)
Definition: orr_octree.h:186
pcl::recognition::ORROctree::Node::Data::getPoint
float * getPoint()
Definition: orr_octree.h:120
pcl::recognition::ORROctree::Node::Data::get3dIdX
int get3dIdX() const
Definition: orr_octree.h:137
pcl::recognition::ORROctree::Node::Data::get3dIdY
int get3dIdY() const
Definition: orr_octree.h:140
pcl::recognition::ORROctree::Node::setBounds
void setBounds(const float *b)
Definition: orr_octree.h:183
pcl::recognition::ORROctree::~ORROctree
virtual ~ORROctree()
Definition: orr_octree.h:275
pcl::recognition::ORROctree::Node::Data::get3dIdZ
int get3dIdZ() const
Definition: orr_octree.h:143
pcl::recognition::ORROctree::Node::getData
const Node::Data * getData() const
Definition: orr_octree.h:221
pcl::recognition::ORROctree::Node::Data::get3dId
void get3dId(int id[3]) const
Definition: orr_octree.h:129
pcl::recognition::ORROctree::Node::hasChildren
bool hasChildren()
Definition: orr_octree.h:233
pcl::recognition::ORROctree::full_leaves_
std::vector< Node * > full_leaves_
Definition: orr_octree.h:480
pcl::recognition::ORROctree::Node::Data::getUserData
void * getUserData() const
Definition: orr_octree.h:152
pcl::recognition::ORROctree::getBounds
void getBounds(float b[6]) const
Definition: orr_octree.h:430
pcl::recognition::ORROctree::Node::data_
Node::Data * data_
Definition: orr_octree.h:269
pcl::recognition::ORROctree::Node::getData
Node::Data * getData()
Definition: orr_octree.h:218
pcl::recognition::ORROctree::Node::parent_
Node * parent_
Definition: orr_octree.h:271
pcl::recognition::ORROctree::createLeaf
ORROctree::Node * createLeaf(float x, float y, float z)
Creates the leaf containing p = (x, y, z) and returns a pointer to it, however, only if p lies within...
Definition: orr_octree.h:297
pcl::recognition::ORROctree::Node::getParent
Node * getParent()
Definition: orr_octree.h:227
pcl::recognition::ORROctree::getFullLeaves
const std::vector< ORROctree::Node * > & getFullLeaves() const
Definition: orr_octree.h:412
pcl::recognition::ORROctree::Node::Data::setUserData
void setUserData(void *user_data)
Definition: orr_octree.h:149
pcl::recognition::ORROctree::Node::Data::getNeighbors
const std::set< Node * > & getNeighbors() const
Definition: orr_octree.h:158
pcl::recognition::ORROctree
That's a very specialized and simple octree class.
Definition: orr_octree.h:70
pcl::recognition::ORROctree::Node::Data::num_points_
int num_points_
Definition: orr_octree.h:162
pcl::recognition::ORROctree::Node::setData
void setData(Node::Data *data)
Definition: orr_octree.h:189
pcl::recognition::ORROctree::getLeaf
ORROctree::Node * getLeaf(float x, float y, float z)
Returns a pointer to the leaf containing p = (x, y, z) or NULL if no such leaf exists.
Definition: orr_octree.h:370
pcl::recognition::ORROctree::Node::hasData
bool hasData()
Definition: orr_octree.h:230
pcl::recognition::ORROctree::Node::Data::computeAveragePoint
void computeAveragePoint()
Definition: orr_octree.h:104
pcl::recognition::ORROctree::Node::createChildren
bool createChildren()
pcl::recognition::ORROctree::getLeaf
ORROctree::Node * getLeaf(int i, int j, int k)
Since the leaves are aligned in a rectilinear grid, each leaf has a unique id.
Definition: orr_octree.h:358
pcl::recognition::ORROctree::Node::computeRadius
void computeRadius()
Computes the "radius" of the node which is half the diagonal length.
Definition: orr_octree.h:193
pcl::recognition::aux::length3
T length3(const T v[3])
Returns the length of v.
Definition: auxiliary.h:186
pcl::recognition::ORROctree::Node::getCenter
const float * getCenter() const
Definition: orr_octree.h:200
pcl::recognition::ORROctree::Node::Data::getNormal
float * getNormal()
Definition: orr_octree.h:126
pcl::recognition::ORROctree::Node::Data::addToNormal
void addToNormal(float x, float y, float z)
Definition: orr_octree.h:114
pcl::recognition::ORROctree::Node::getRadius
float getRadius() const
Computes the "radius" of the node which is half the diagonal length.
Definition: orr_octree.h:237
pcl::recognition::ORROctree::Node::Data::neighbors_
std::set< Node * > neighbors_
Definition: orr_octree.h:163
pcl::recognition::ORROctree::Node::Data::addToPoint
void addToPoint(float x, float y, float z)
Definition: orr_octree.h:97
pcl::recognition::ORROctree::tree_levels_
int tree_levels_
Definition: orr_octree.h:478
PCL_EXPORTS
#define PCL_EXPORTS
Definition: pcl_macros.h:331
pcl::recognition::ORROctree::Node::Data::insertNeighbor
void insertNeighbor(Node *node)
Definition: orr_octree.h:155
pcl::recognition::ORROctree::Node::getBounds
const float * getBounds() const
Definition: orr_octree.h:203
pcl::recognition::ORROctree::Node::setUserData
void setUserData(void *user_data)
Definition: orr_octree.h:224
pcl::recognition::ORROctree::Node::Data::getNormal
const float * getNormal() const
Definition: orr_octree.h:123
pcl::recognition::ORROctree::Node::deleteChildren
void deleteChildren()
Definition: orr_octree.h:243