VTK-m  2.0
ThresholdPoints.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_ThresholdPoints_h
12 #define vtk_m_filter_entity_extraction_ThresholdPoints_h
13 
15 #include <vtkm/filter/entity_extraction/vtkm_filter_entity_extraction_export.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace entity_extraction
22 {
23 class VTKM_FILTER_ENTITY_EXTRACTION_EXPORT ThresholdPoints : public vtkm::filter::FilterField
24 {
25 public:
26  // When CompactPoints is set, instead of copying the points and point fields
27  // from the input, the filter will create new compact fields without the unused elements
28  VTKM_CONT
29  bool GetCompactPoints() const { return this->CompactPoints; }
30  VTKM_CONT
31  void SetCompactPoints(bool value) { this->CompactPoints = value; }
32 
33  VTKM_CONT
34  vtkm::Float64 GetLowerThreshold() const { return this->LowerValue; }
35  VTKM_CONT
36  void SetLowerThreshold(vtkm::Float64 value) { this->LowerValue = value; }
37 
38  VTKM_CONT
39  vtkm::Float64 GetUpperThreshold() const { return this->UpperValue; }
40  VTKM_CONT
41  void SetUpperThreshold(vtkm::Float64 value) { this->UpperValue = value; }
42 
43  VTKM_CONT
44  void SetThresholdBelow(vtkm::Float64 value);
45  VTKM_CONT
46  void SetThresholdAbove(vtkm::Float64 value);
47  VTKM_CONT
48  void SetThresholdBetween(vtkm::Float64 value1, vtkm::Float64 value2);
49 
50 private:
51  VTKM_CONT
52  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
53 
54  constexpr static int THRESHOLD_BELOW = 0;
55  constexpr static int THRESHOLD_ABOVE = 1;
56  constexpr static int THRESHOLD_BETWEEN = 2;
57 
58  double LowerValue = 0;
59  double UpperValue = 0;
60  int ThresholdType = THRESHOLD_BETWEEN;
61 
62  bool CompactPoints = false;
63 };
64 } // namespace entity_extraction
65 } // namespace filter
66 } // namespace vtkm
67 
68 #endif // vtk_m_filter_entity_extraction_ThresholdPoints_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::entity_extraction::ThresholdPoints::SetLowerThreshold
VTKM_CONT void SetLowerThreshold(vtkm::Float64 value)
Definition: ThresholdPoints.h:36
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::entity_extraction::ThresholdPoints::GetCompactPoints
VTKM_CONT bool GetCompactPoints() const
Definition: ThresholdPoints.h:29
vtkm::filter::entity_extraction::ThresholdPoints
Definition: ThresholdPoints.h:23
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::entity_extraction::ThresholdPoints::SetCompactPoints
VTKM_CONT void SetCompactPoints(bool value)
Definition: ThresholdPoints.h:31
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::entity_extraction::ThresholdPoints::GetUpperThreshold
VTKM_CONT vtkm::Float64 GetUpperThreshold() const
Definition: ThresholdPoints.h:39
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::filter::entity_extraction::ThresholdPoints::GetLowerThreshold
VTKM_CONT vtkm::Float64 GetLowerThreshold() const
Definition: ThresholdPoints.h:34
vtkm::filter::entity_extraction::ThresholdPoints::SetUpperThreshold
VTKM_CONT void SetUpperThreshold(vtkm::Float64 value)
Definition: ThresholdPoints.h:41