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
lvr2::BigGridKdTree::insert
void insert(size_t numPoints, BaseVecT pos)
lvr2::BigGridKdTree::getBB
BoundingBox< BaseVecT > & getBB()
Definition: BigGridKdTree.hpp:91
lvr2::BigGridKdTree::getNumPoints
size_t getNumPoints()
Definition: BigGridKdTree.hpp:86
lvr2::BigGridKdTree::m_numPoints
size_t m_numPoints
Definition: BigGridKdTree.hpp:96
lvr2::BigGridKdTree::~BigGridKdTree
virtual ~BigGridKdTree()
lvr2::BigGridKdTree::m_bb
BoundingBox< BaseVecT > m_bb
Definition: BigGridKdTree.hpp:94
lvr2::BigGridKdTree
Definition: BigGridKdTree.hpp:47
lvr2::BigGridKdTree::s_nodes
static std::vector< BigGridKdTree * > s_nodes
Definition: BigGridKdTree.hpp:113
BigGrid.hpp
lvr2::BigGridKdTree::BigGridKdTree
BigGridKdTree(BoundingBox< BaseVecT > &bb, size_t maxNodePoints, BigGrid< BaseVecT > *grid, float voxelsize, size_t numPoints=0)
lvr2::BigGridKdTree::m_children
std::vector< BigGridKdTree * > m_children
Definition: BigGridKdTree.hpp:101
lvr2::BoundingBox
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
lvr2::BigGridKdTree::fitsInBox
bool fitsInBox(BaseVecT &pos)
Definition: BigGridKdTree.hpp:132
lvr2::BigGridKdTree::s_voxelsize
static float s_voxelsize
Definition: BigGridKdTree.hpp:115
lvr2::BigGridKdTree::getLeafs
static std::vector< BigGridKdTree * > getLeafs()
lvr2::BigGridKdTree::getNodes
static std::vector< BigGridKdTree * > getNodes()
Definition: BigGridKdTree.hpp:81
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::BigGridKdTree::s_maxNodePoints
static size_t s_maxNodePoints
Definition: BigGridKdTree.hpp:120
lvr2::BigGridKdTree::m_grid
static BigGrid< BaseVecT > * m_grid
Definition: BigGridKdTree.hpp:125
lvr2::BigGrid
Definition: BigGrid.hpp:71
BoundingBox.hpp


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 Wed Mar 2 2022 00:37:22