iMSTK
Interactive Medical Simulation Toolkit
imstkCleanMesh.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkGeometryAlgorithm.h"
10 
11 namespace imstk
12 {
13 class SurfaceMesh;
14 
23 {
24 public:
25  CleanMesh();
26  ~CleanMesh() override = default;
27 
28  std::shared_ptr<SurfaceMesh> getOutputMesh() const;
29 
33  void setInputMesh(std::shared_ptr<SurfaceMesh> inputMesh);
34 
35  imstkGetMacro(UseAbsolute, bool);
36 
40  void setTolerance(const double tolerance)
41  {
42  this->m_Tolerance = tolerance;
43  m_UseAbsolute = false;
44  }
45 
46  imstkGetMacro(Tolerance, double);
48 
49  void setAbsoluteTolerance(const double tolerance)
50  {
51  this->m_AbsoluteTolerance = tolerance;
52  m_UseAbsolute = true;
53  }
54 
55  imstkGetMacro(AbsoluteTolerance, double);
56 
57 protected:
58  void requestUpdate() override;
59 
60 private:
61  double m_Tolerance = 0.0;
62  double m_AbsoluteTolerance = 1.0;
63  bool m_UseAbsolute = false;
64 };
65 } // namespace imstk
Compound Geometry.
void setInputMesh(std::shared_ptr< SurfaceMesh > inputMesh)
Required input, port 0.
void requestUpdate() override
Users can implement this for the logic to be run.
void setTolerance(const double tolerance)
Get/Set the tolerance for point merging, fraction of bounding box length.
Abstract base class for geometry algorithms. GeometryAlgorithms take N input geometries and produce N...
This filter can merge duplicate points and cells, it only works with LineMesh and SurfaceMesh...