Viskores  1.0
CleanGrid.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_filter_clean_grid_CleanGrid_h
19 #define viskores_filter_clean_grid_CleanGrid_h
20 
21 #include <viskores/filter/Filter.h>
23 
24 namespace viskores
25 {
26 namespace filter
27 {
28 
29 // Forward declaration for stateful Worklets
30 namespace clean_grid
31 {
32 struct SharedStates;
33 
50 class VISKORES_FILTER_CLEAN_GRID_EXPORT CleanGrid : public viskores::filter::Filter
51 {
52 public:
56  VISKORES_CONT bool GetCompactPointFields() const { return this->CompactPointFields; }
58  VISKORES_CONT void SetCompactPointFields(bool flag) { this->CompactPointFields = flag; }
59 
64  VISKORES_CONT bool GetMergePoints() const { return this->MergePoints; }
66  VISKORES_CONT void SetMergePoints(bool flag) { this->MergePoints = flag; }
67 
75  VISKORES_CONT viskores::Float64 GetTolerance() const { return this->Tolerance; }
77  VISKORES_CONT void SetTolerance(viskores::Float64 tolerance) { this->Tolerance = tolerance; }
78 
83  VISKORES_CONT bool GetToleranceIsAbsolute() const { return this->ToleranceIsAbsolute; }
85  VISKORES_CONT void SetToleranceIsAbsolute(bool flag) { this->ToleranceIsAbsolute = flag; }
86 
92  VISKORES_CONT bool GetRemoveDegenerateCells() const { return this->RemoveDegenerateCells; }
94  VISKORES_CONT void SetRemoveDegenerateCells(bool flag) { this->RemoveDegenerateCells = flag; }
95 
100  VISKORES_CONT bool GetFastMerge() const { return this->FastMerge; }
102  VISKORES_CONT void SetFastMerge(bool flag) { this->FastMerge = flag; }
103 
104 private:
106  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& inData) override;
107 
108  VISKORES_CONT viskores::cont::DataSet GenerateOutput(
109  const viskores::cont::DataSet& inData,
110  viskores::cont::CellSetExplicit<>& outputCellSet,
111  clean_grid::SharedStates& worklets);
112 
113  bool CompactPointFields = true;
114  bool MergePoints = true;
115  viskores::Float64 Tolerance = 1.0e-6;
116  bool ToleranceIsAbsolute = false;
117  bool RemoveDegenerateCells = true;
118  bool FastMerge = true;
119 };
120 } // namespace clean_grid
121 
122 } // namespace filter
123 } // namespace viskores
124 
125 #endif //viskores_filter_clean_grid_CleanGrid_h
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::clean_grid::CleanGrid::GetTolerance
viskores::Float64 GetTolerance() const
Defines the tolerance used when determining whether two points are considered coincident.
Definition: CleanGrid.h:75
viskores::filter::clean_grid::CleanGrid::GetCompactPointFields
bool GetCompactPointFields() const
When the CompactPointFields flag is true, the filter will identify and remove any points that are not...
Definition: CleanGrid.h:56
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::clean_grid::CleanGrid::SetToleranceIsAbsolute
void SetToleranceIsAbsolute(bool flag)
When ToleranceIsAbsolute is false (the default) then the tolerance is scaled by the diagonal of the b...
Definition: CleanGrid.h:85
viskores::filter::clean_grid::CleanGrid::GetMergePoints
bool GetMergePoints() const
When the MergePoints flag is true, the filter will identify any coincident points and merge them toge...
Definition: CleanGrid.h:64
viskores::filter::clean_grid::CleanGrid::GetToleranceIsAbsolute
bool GetToleranceIsAbsolute() const
When ToleranceIsAbsolute is false (the default) then the tolerance is scaled by the diagonal of the b...
Definition: CleanGrid.h:83
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores_filter_clean_grid_export.h
viskores::cont::CellSetExplicit
Defines an irregular collection of cells.
Definition: CastAndCall.h:44
viskores::filter::clean_grid::CleanGrid::SetMergePoints
void SetMergePoints(bool flag)
When the MergePoints flag is true, the filter will identify any coincident points and merge them toge...
Definition: CleanGrid.h:66
viskores::filter::clean_grid::CleanGrid::SetTolerance
void SetTolerance(viskores::Float64 tolerance)
Defines the tolerance used when determining whether two points are considered coincident.
Definition: CleanGrid.h:77
viskores::filter::clean_grid::CleanGrid::GetRemoveDegenerateCells
bool GetRemoveDegenerateCells() const
When RemoveDegenerateCells is true (the default), then CleanGrid will look for repeated points in cel...
Definition: CleanGrid.h:92
viskores::filter::clean_grid::CleanGrid::SetCompactPointFields
void SetCompactPointFields(bool flag)
When the CompactPointFields flag is true, the filter will identify and remove any points that are not...
Definition: CleanGrid.h:58
viskores::filter::clean_grid::CleanGrid::SetFastMerge
void SetFastMerge(bool flag)
When FastMerge is true (the default), some corners are cut when computing coincident points.
Definition: CleanGrid.h:102
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::filter::clean_grid::CleanGrid::GetFastMerge
bool GetFastMerge() const
When FastMerge is true (the default), some corners are cut when computing coincident points.
Definition: CleanGrid.h:100
viskores::filter::clean_grid::CleanGrid
Clean a mesh to an unstructured grid.
Definition: CleanGrid.h:50
viskores::filter::clean_grid::CleanGrid::SetRemoveDegenerateCells
void SetRemoveDegenerateCells(bool flag)
When RemoveDegenerateCells is true (the default), then CleanGrid will look for repeated points in cel...
Definition: CleanGrid.h:94
Filter.h