DMCReconstruction.hpp
Go to the documentation of this file.
1 
28  /*
29  * DMCReconstruction.hpp
30  *
31  * Created on: 18.01.2019
32  * Author: Benedikt Schumacher
33  */
34 
35 #ifndef DMCReconstruction_HPP_
36 #define DMCReconstruction_HPP_
37 
44 #include "lvr2/io/Progress.hpp"
45 #include "DMCVecPointHandle.hpp"
46 
47 #include "Octree.hpp"
48 #include "DualOctree.hpp"
49 #include "Location.hh"
51 
52 namespace lvr2
53 {
54 
55 struct my_dummy
56 {
58  int next = -1;
59 };
60 
66 template<typename BaseVecT, typename BoxT>
67 class DMCReconstruction : public FastReconstructionBase<BaseVecT>, public PointsetMeshGenerator<BaseVecT>
68 {
69 public:
70 
83  bool dual,
84  int maxLevel,
85  float maxError);
86 
90  virtual ~DMCReconstruction();
91 
97  virtual void getMesh(BaseMesh<BaseVecT> &mesh);
98 
99  virtual void getMesh(
100  BaseMesh<BaseVecT>& mesh,
102  vector<unsigned int>& duplicates,
103  float comparePrecision
104  );
105 
106 protected:
107 
116  DualLeaf<BaseVecT, BoxT>* getDualLeaf(
117  CellHandle &cell,
118  int cells,
120  char pos);
121 
131  void buildTree(
133  int levels,
134  bool dual);
135 
142  void traverseTree(BaseMesh<BaseVecT> &mesh,
144 
156  void detectVertexForDualCell(
158  CellHandle ch,
159  int cells,
160  float max_bb_width,
161  uint pos,
162  int onEdge,
163  BaseVecT &feature);
164 
173  void getRotationMatrix(
174  float matrix[9],
175  BaseVecT v1,
176  BaseVecT v2,
177  BaseVecT v3);
178 
187  float getDistance(BaseVecT p,
188  BaseVecT v1,
189  BaseVecT v2,
190  BaseVecT v3);
191 
199  float getDistance(BaseVecT p,
200  BaseVecT v1,
201  BaseVecT v2);
202 
209  float getDistance(BaseVecT v1,
210  BaseVecT v2);
211 
219  float edgeEquation(BaseVecT p,
220  BaseVecT v1,
221  BaseVecT v2);
222 
229  void matrixDotVector(float* matrix,
230  BaseVecT* vector);
231 
239  void getSurface(BaseMesh<BaseVecT> &mesh,
241  int cells,
242  short level);
243 
249  void drawOctree(C_Octree<BaseVecT, BoxT, my_dummy> &parent);
250 
251  // Indicator whether the point fitting shoulb be done on dual cells
252  bool m_dual;
253 
254  // The maximum allowed level for the octree
256 
257  // The max allowed arror between points and surfaces
258  float m_maxError;
259 
260  // Sizes of Boundig Box
261  BaseVecT bb_min;
262  BaseVecT bb_max;
263  float bb_size[3];
265 
266  // Center of the bounding box.
268 
269  // Count of the octree leaves.
271 
272  // Global progress bar.
274 
275  // Pointer to the new Octree
277 
278  // PointHandler
279  unique_ptr<DMCPointHandle<BaseVecT>> m_pointHandler;
280 
281  // just for visualization
282  std::vector< BaseVecT > dualVertices;
283 };
284 } // namespace lvr2
285 
286 #include "DMCReconstruction.tcc"
287 
288 #endif /* DMCReconstruction_HPP_ */
unique_ptr< DMCPointHandle< BaseVecT > > m_pointHandler
HalfEdgeMesh< Vec > mesh
Interface class for surface reconstruction algorithms that generate triangle meshes from point set su...
A surface reconstruction object that implements the standard marching cubes algorithm using a octree ...
Interface for triangle-meshes with adjacency information.
Definition: BaseMesh.hpp:140
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
std::vector< BaseVecT > dualVertices
SharedPointer p
C_Octree< BaseVecT, BoxT, my_dummy > * octree
unsigned int uint
Definition: Model.hpp:46
std::shared_ptr< PointsetSurface< BaseVecT > > PointsetSurfacePtr


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