VTK-m  2.2
Threshold.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 
11 #ifndef vtk_m_filter_entity_extraction_Threshold_h
12 #define vtk_m_filter_entity_extraction_Threshold_h
13 
14 #include <vtkm/filter/Filter.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace entity_extraction
22 {
23 
41 {
42 public:
45  VTKM_CONT void SetLowerThreshold(vtkm::Float64 value) { this->LowerValue = value; }
48  VTKM_CONT void SetUpperThreshold(vtkm::Float64 value) { this->UpperValue = value; }
49 
51  VTKM_CONT vtkm::Float64 GetLowerThreshold() const { return this->LowerValue; }
53  VTKM_CONT vtkm::Float64 GetUpperThreshold() const { return this->UpperValue; }
54 
56  VTKM_CONT void SetThresholdBelow(vtkm::Float64 value);
57 
59  VTKM_CONT void SetThresholdAbove(vtkm::Float64 value);
60 
65  VTKM_CONT void SetThresholdBetween(vtkm::Float64 value1, vtkm::Float64 value2);
66 
74  {
75  this->ComponentMode = Component::Selected;
76  this->SelectedComponent = component;
77  }
82  VTKM_CONT void SetComponentToTestToAny() { this->ComponentMode = Component::Any; }
87  VTKM_CONT void SetComponentToTestToAll() { this->ComponentMode = Component::All; }
88 
96  VTKM_CONT void SetAllInRange(bool value) { this->AllInRange = value; }
98  VTKM_CONT bool GetAllInRange() const { return this->AllInRange; }
99 
105  VTKM_CONT void SetInvert(bool value) { this->Invert = value; }
107  VTKM_CONT bool GetInvert() const { return this->Invert; }
108 
109 private:
110  VTKM_CONT
111  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
112 
113  double LowerValue = 0;
114  double UpperValue = 0;
115 
116  enum struct Component
117  {
118  Any,
119  All,
120  Selected
121  };
122 
123  Component ComponentMode = Component::Selected;
124  vtkm::IdComponent SelectedComponent = 0;
125 
126  bool AllInRange = false;
127  bool Invert = false;
128 };
129 } // namespace entity_extraction
130 } // namespace filter
131 } // namespace vtkm
132 
133 #endif // vtk_m_filter_entity_extraction_Threshold_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::filter::entity_extraction::Threshold::SetComponentToTestToAll
void SetComponentToTestToAll()
Specifies that the threshold criteria should be applied to a specific vector component.
Definition: Threshold.h:87
VTKM_FILTER_ENTITY_EXTRACTION_EXPORT
#define VTKM_FILTER_ENTITY_EXTRACTION_EXPORT
Definition: vtkm_filter_entity_extraction_export.h:44
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::filter::entity_extraction::Threshold::SetLowerThreshold
void SetLowerThreshold(vtkm::Float64 value)
Specifies the lower scalar value.
Definition: Threshold.h:45
vtkm::filter::entity_extraction::Threshold::SetAllInRange
void SetAllInRange(bool value)
Specify criteria for cells that have some points matching.
Definition: Threshold.h:96
vtkm::filter::entity_extraction::Threshold::SetComponentToTest
void SetComponentToTest(vtkm::IdComponent component)
Specifies that the threshold criteria should be applied to a specific vector component.
Definition: Threshold.h:73
vtkm::filter::entity_extraction::Threshold::SetUpperThreshold
void SetUpperThreshold(vtkm::Float64 value)
Specifies the upper scalar value.
Definition: Threshold.h:48
vtkm::filter::entity_extraction::Threshold::GetAllInRange
bool GetAllInRange() const
Specify criteria for cells that have some points matching.
Definition: Threshold.h:98
vtkm::filter::entity_extraction::Threshold
Extracts cells that satisfy a threshold criterion.
Definition: Threshold.h:40
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::entity_extraction::Threshold::SetComponentToTestToAny
void SetComponentToTestToAny()
Specifies that the threshold criteria should be applied to a specific vector component.
Definition: Threshold.h:82
vtkm::filter::entity_extraction::Threshold::Component
Component
Definition: Threshold.h:116
vtkm_filter_entity_extraction_export.h
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::filter::entity_extraction::Threshold::GetUpperThreshold
vtkm::Float64 GetUpperThreshold() const
Specifies the upper scalar value.
Definition: Threshold.h:53
vtkm::filter::entity_extraction::Threshold::SetInvert
void SetInvert(bool value)
Inverts the threshold result.
Definition: Threshold.h:105
vtkm::filter::entity_extraction::Threshold::GetInvert
bool GetInvert() const
Inverts the threshold result.
Definition: Threshold.h:107
vtkm::filter::entity_extraction::Threshold::GetLowerThreshold
vtkm::Float64 GetLowerThreshold() const
Specifies the lower scalar value.
Definition: Threshold.h:51
Filter.h