BigGridKdTree.hpp
Go to the documentation of this file.
1 
28 /*
29  * BigGridKdTree.hpp
30  *
31  * Created on: Aug 30, 2017
32  * Author: Isaak Mitschke
33  */
34 
35 #ifndef LAS_VEGAS_BIGGRIDKDTREE_H
36 #define LAS_VEGAS_BIGGRIDKDTREE_H
37 #include "BigGrid.hpp"
39 
40 #include <memory>
41 #include <vector>
42 
43 namespace lvr2
44 {
45 
46 template <typename BaseVecT>
48 {
49  public:
59  size_t maxNodePoints,
60  BigGrid<BaseVecT>* grid,
61  float voxelsize,
62  size_t numPoints = 0);
63  virtual ~BigGridKdTree();
64 
70  void insert(size_t numPoints, BaseVecT pos);
76  static std::vector<BigGridKdTree*> getLeafs();
81  static std::vector<BigGridKdTree*> getNodes() { return s_nodes; }
86  inline size_t getNumPoints() { return m_numPoints; }
91  inline BoundingBox<BaseVecT>& getBB() { return m_bb; }
92 
93  private:
95 
96  size_t m_numPoints;
97 
101  std::vector<BigGridKdTree*> m_children;
102 
108  BigGridKdTree(BoundingBox<BaseVecT>& bb, size_t numPoints = 0);
109 
113  static std::vector<BigGridKdTree*> s_nodes;
114 
115  static float s_voxelsize;
116 
120  static size_t s_maxNodePoints;
121 
126 
132  inline bool fitsInBox(BaseVecT& pos)
133  {
134  return pos.x > m_bb.getMin().x && pos.y > m_bb.getMin().y && pos.z > m_bb.getMin().z &&
135  pos.x < m_bb.getMax().x && pos.y < m_bb.getMax().y && pos.z < m_bb.getMax().z;
136  }
137 };
138 
139 } // namespace lvr2
140 
141 #include "lvr2/reconstruction/BigGridKdTree.tcc"
142 
143 #endif // LAS_VEGAS_BIGGRIDKDTREE_H
BoundingBox< BaseVecT > & getBB()
BaseVecT getMin() const
Returns the lower left coordinates.
BigGridKdTree(BoundingBox< BaseVecT > &bb, size_t maxNodePoints, BigGrid< BaseVecT > *grid, float voxelsize, size_t numPoints=0)
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
static std::vector< BigGridKdTree * > getNodes()
BoundingBox< BaseVecT > m_bb
std::vector< BigGridKdTree * > m_children
static std::vector< BigGridKdTree * > s_nodes
bool fitsInBox(BaseVecT &pos)
void insert(size_t numPoints, BaseVecT pos)
static size_t s_maxNodePoints
BaseVecT getMax() const
Returns the upper right coordinates.
virtual ~BigGridKdTree()
static std::vector< BigGridKdTree * > getLeafs()
static BigGrid< BaseVecT > * m_grid
static float s_voxelsize


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06