VTK-m  2.0
CleanGrid.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_filter_clean_grid_CleanGrid_h
11 #define vtk_m_filter_clean_grid_CleanGrid_h
12 
14 #include <vtkm/filter/clean_grid/vtkm_filter_clean_grid_export.h>
15 
16 namespace vtkm
17 {
18 namespace filter
19 {
20 
21 // Forward declaration for stateful Worklets
22 namespace clean_grid
23 {
24 struct SharedStates;
25 
40 class VTKM_FILTER_CLEAN_GRID_EXPORT CleanGrid : public vtkm::filter::FilterField
41 {
42 public:
46  VTKM_CONT bool GetCompactPointFields() const { return this->CompactPointFields; }
47  VTKM_CONT void SetCompactPointFields(bool flag) { this->CompactPointFields = flag; }
48 
53  VTKM_CONT bool GetMergePoints() const { return this->MergePoints; }
54  VTKM_CONT void SetMergePoints(bool flag) { this->MergePoints = flag; }
55 
60  VTKM_CONT vtkm::Float64 GetTolerance() const { return this->Tolerance; }
61  VTKM_CONT void SetTolerance(vtkm::Float64 tolerance) { this->Tolerance = tolerance; }
62 
67  VTKM_CONT bool GetToleranceIsAbsolute() const { return this->ToleranceIsAbsolute; }
68  VTKM_CONT void SetToleranceIsAbsolute(bool flag) { this->ToleranceIsAbsolute = flag; }
69 
73  VTKM_CONT bool GetRemoveDegenerateCells() const { return this->RemoveDegenerateCells; }
74  VTKM_CONT void SetRemoveDegenerateCells(bool flag) { this->RemoveDegenerateCells = flag; }
75 
80  VTKM_CONT bool GetFastMerge() const { return this->FastMerge; }
81  VTKM_CONT void SetFastMerge(bool flag) { this->FastMerge = flag; }
82 
83 private:
84  VTKM_CONT
85  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData) override;
86 
87  VTKM_CONT vtkm::cont::DataSet GenerateOutput(const vtkm::cont::DataSet& inData,
88  vtkm::cont::CellSetExplicit<>& outputCellSet,
89  clean_grid::SharedStates& worklets);
90 
91  bool CompactPointFields = true;
92  bool MergePoints = true;
93  vtkm::Float64 Tolerance = 1.0e-6;
94  bool ToleranceIsAbsolute = false;
95  bool RemoveDegenerateCells = true;
96  bool FastMerge = true;
97 };
98 } // namespace clean_grid
99 
100 } // namespace filter
101 } // namespace vtkm
102 
103 #endif //vtk_m_filter_clean_grid_CleanGrid_h
vtkm::filter::clean_grid::CleanGrid::SetCompactPointFields
VTKM_CONT void SetCompactPointFields(bool flag)
Definition: CleanGrid.h:47
vtkm::filter::clean_grid::CleanGrid::SetToleranceIsAbsolute
VTKM_CONT void SetToleranceIsAbsolute(bool flag)
Definition: CleanGrid.h:68
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::clean_grid::CleanGrid::GetMergePoints
VTKM_CONT bool GetMergePoints() const
When the MergePoints flag is true, the filter will identify any coincident points and merge them toge...
Definition: CleanGrid.h:53
vtkm::filter::clean_grid::CleanGrid::SetRemoveDegenerateCells
VTKM_CONT void SetRemoveDegenerateCells(bool flag)
Definition: CleanGrid.h:74
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::clean_grid::CleanGrid::SetFastMerge
VTKM_CONT void SetFastMerge(bool flag)
Definition: CleanGrid.h:81
vtkm::filter::clean_grid::CleanGrid::SetMergePoints
VTKM_CONT void SetMergePoints(bool flag)
Definition: CleanGrid.h:54
vtkm::filter::clean_grid::CleanGrid::GetFastMerge
VTKM_CONT bool GetFastMerge() const
When FastMerge is true (the default), some corners are cut when computing coincident points.
Definition: CleanGrid.h:80
FilterField.h
vtkm::filter::clean_grid::CleanGrid::GetToleranceIsAbsolute
VTKM_CONT bool GetToleranceIsAbsolute() const
When ToleranceIsAbsolute is false (the default) then the tolerance is scaled by the diagonal of the b...
Definition: CleanGrid.h:67
vtkm::filter::FilterField
Definition: FilterField.h:21
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::clean_grid::CleanGrid::SetTolerance
VTKM_CONT void SetTolerance(vtkm::Float64 tolerance)
Definition: CleanGrid.h:61
vtkm::filter::clean_grid::CleanGrid
Clean a mesh to an unstructured grid.
Definition: CleanGrid.h:40
vtkm::filter::clean_grid::CleanGrid::GetTolerance
VTKM_CONT vtkm::Float64 GetTolerance() const
Defines the tolerance used when determining whether two points are considered coincident.
Definition: CleanGrid.h:60
vtkm::cont::CellSetExplicit
Definition: CastAndCall.h:36
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::filter::clean_grid::CleanGrid::GetRemoveDegenerateCells
VTKM_CONT bool GetRemoveDegenerateCells() const
Determine whether a cell is degenerate (that is, has repeated points that drops its dimensionalit) an...
Definition: CleanGrid.h:73
vtkm::filter::clean_grid::CleanGrid::GetCompactPointFields
VTKM_CONT bool GetCompactPointFields() const
When the CompactPointFields flag is true, the filter will identify any points that are not used by th...
Definition: CleanGrid.h:46