OctreeReduction.hpp
Go to the documentation of this file.
1 #ifndef __OCTREE_REDUCTION__
2 #define __OCTREE_REDUCTION__
3 
40 #include "lvr2/io/PointBuffer.hpp"
41 #include "lvr2/io/Timestamp.hpp"
42 
43 #include <vector>
44 
45 namespace lvr2
46 {
47 
49 {
50 public:
51  OctreeReduction(PointBufferPtr& pointBuffer, const double& voxelSize, const size_t& minPointsPerVoxel);
52  OctreeReduction(Vector3f* points, const size_t& n, const double& voxelSize, const size_t& minPointsPerVoxel);
53 
55  void getReducedPoints(Vector3f& points, size_t& n);
56 
57  ~OctreeReduction() { delete[] m_flags;}
58 
59 private:
60  template<typename T>
61  void createOctree(T* points, const int& n, bool* flagged, const T& min, const T& max, const int& level);
62 
63  template<typename T>
64  size_t splitPoints(T* points, const size_t& n, const int axis, const double& splitValue);
65 
66  template<typename T>
67  void createOctree(lvr2::PointBufferPtr& points, size_t s, size_t n, bool* flagged, const lvr2::Vector3<T>& min, const lvr2::Vector3<T>& max, const int& level);
68 
69  template<typename T>
70  size_t splitPoints(lvr2::PointBufferPtr& points, size_t s, size_t n, const int axis, const double& splitValue);
71 
72  template<typename T>
73  void swapAllChannelsOfType(lvr2::PointBufferPtr& points, const size_t& l, const size_t& r);
74 
75  template<typename T>
76  void swapInChannel(lvr2::Channel<T>& ch, const size_t& l, const size_t& r);
77 
78  double m_voxelSize;
80  size_t m_numPoints;
81  bool* m_flags;
82 
85 };
86 
87 } // namespace lvr2
88 
89 #include "lvr2/registration/OctreeReduction.tcc"
90 
91 #endif
lvr2::OctreeReduction::splitPoints
size_t splitPoints(T *points, const size_t &n, const int axis, const double &splitValue)
lvr2::OctreeReduction::m_minPointsPerVoxel
size_t m_minPointsPerVoxel
Definition: OctreeReduction.hpp:79
lvr2::OctreeReduction::OctreeReduction
OctreeReduction(PointBufferPtr &pointBuffer, const double &voxelSize, const size_t &minPointsPerVoxel)
Definition: OctreeReduction.cpp:10
lvr2::PointBufferPtr
std::shared_ptr< PointBuffer > PointBufferPtr
Definition: PointBuffer.hpp:130
lvr2::OctreeReduction::swapAllChannelsOfType
void swapAllChannelsOfType(lvr2::PointBufferPtr &points, const size_t &l, const size_t &r)
lvr2::OctreeReduction::m_flags
bool * m_flags
Definition: OctreeReduction.hpp:81
lvr2::OctreeReduction::swapInChannel
void swapInChannel(lvr2::Channel< T > &ch, const size_t &l, const size_t &r)
lvr2::OctreeReduction
Definition: OctreeReduction.hpp:48
lvr2::OctreeReduction::m_points
Vector3f m_points
Definition: OctreeReduction.hpp:84
PointBuffer.hpp
lvr2::Vector3f
Eigen::Vector3f Vector3f
Eigen 3D vector, single precision.
Definition: MatrixTypes.hpp:118
lvr2::OctreeReduction::m_numPoints
size_t m_numPoints
Definition: OctreeReduction.hpp:80
MatrixTypes.hpp
lvr2::Vector3
Eigen::Matrix< T, 3, 1 > Vector3
Eigen 3D vector.
Definition: MatrixTypes.hpp:115
lvr2::OctreeReduction::createOctree
void createOctree(T *points, const int &n, bool *flagged, const T &min, const T &max, const int &level)
lvr2::Channel
Definition: Channel.hpp:42
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::OctreeReduction::m_pointBuffer
PointBufferPtr m_pointBuffer
Definition: OctreeReduction.hpp:83
Timestamp.hpp
lvr2::OctreeReduction::m_voxelSize
double m_voxelSize
Definition: OctreeReduction.hpp:78
lvr2::OctreeReduction::getReducedPoints
PointBufferPtr getReducedPoints()
Definition: OctreeReduction.cpp:58
lvr2::OctreeReduction::~OctreeReduction
~OctreeReduction()
Definition: OctreeReduction.hpp:57


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:24