PointsetSurface.hpp
Go to the documentation of this file.
1 
35 #ifndef LVR2_RECONSTRUCTION_POINTSETSURFACE_HPP_
36 #define LVR2_RECONSTRUCTION_POINTSETSURFACE_HPP_
37 
38 #include <memory>
39 #include <utility>
40 
41 #include "lvr2/geometry/Normal.hpp"
42 #include "lvr2/io/PointBuffer.hpp"
45 
46 using std::pair;
47 
48 namespace lvr2
49 {
50 
51 
60 template<typename BaseVecT>
62 {
63 public:
64 
74  virtual pair<typename BaseVecT::CoordType, typename BaseVecT::CoordType>
75  distance(BaseVecT v) const = 0;
81  virtual void calculateSurfaceNormals() = 0;
82 
83 
84 
91  virtual Normal<float> getInterpolatedNormal(const BaseVecT& position) const;
92 
98  virtual PointBufferPtr pointBuffer() const;
99 
103  std::shared_ptr<SearchTree<BaseVecT>> searchTree() const;
104 
108  const BoundingBox<BaseVecT>& getBoundingBox() const;
109 
114  void setKi(int k) { m_ki = k; }
115 
120  void setKn(int k) { m_kn = k; }
121 
128  void setKd(int k) { m_kd = k; }
129 
130 protected:
131 
137  PointsetSurface(PointBufferPtr pointcloud);
138 
140 
143 
145  std::shared_ptr<SearchTree<BaseVecT>> m_searchTree;
146 
149 
151  int m_kn;
152 
154  int m_ki;
155 
157  int m_kd;
158 };
159 
160 template <typename BaseVecT>
161 using PointsetSurfacePtr = std::shared_ptr<PointsetSurface<BaseVecT>>;
162 
163 } // namespace lvr2
164 
165 #include "PointsetSurface.tcc"
166 
167 #endif /* LVR2_RECONSTRUCTION_POINTSETSURFACE_HPP_ */
void setKi(int k)
If k is > 0, each normal will be averaged with its k neighbors.
void setKn(int k)
Sets the size of the k-neighborhood that is used for normal estimation.
virtual PointBufferPtr pointBuffer() const
Returns the internal point buffer. After a call of calculateSurfaceNormals the buffer will contain no...
PointBufferPtr m_pointBuffer
The point cloud used for surface approximation.
An interface class to wrap all functionality that is needed to generate a surface approximation from ...
int m_ki
The number of points used for normal interpolation.
int m_kn
The number of points used for normal estimation.
void setKd(int k)
Sets the number of points that is used for distance evaluation, i.e. an average of the distance to th...
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
int m_kd
The number of points used for distance function evaluation.
virtual Normal< float > getInterpolatedNormal(const BaseVecT &position) const
Interpolates a surface normal at the given position.
std::shared_ptr< SearchTree< BaseVecT > > m_searchTree
The search tree that is built from the point cloud data.
virtual pair< typename BaseVecT::CoordType, typename BaseVecT::CoordType > distance(BaseVecT v) const =0
Returns the distance of vertex v from the nearest tangent plane.
BoundingBox< BaseVecT > m_boundingBox
The bounding box of the point cloud.
std::shared_ptr< PointsetSurface< BaseVecT > > PointsetSurfacePtr
const BoundingBox< BaseVecT > & getBoundingBox() const
Returns the bounding box of the point set.
virtual void calculateSurfaceNormals()=0
Calculates surface normals for each data point in the given PointBuffeer. If the buffer alreay contai...
std::shared_ptr< SearchTree< BaseVecT > > searchTree() const
Returns a pointer to the search tree.


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