Viskores  1.0
ThresholdPoints.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 
19 #ifndef viskores_filter_entity_extraction_ThresholdPoints_h
20 #define viskores_filter_entity_extraction_ThresholdPoints_h
21 
22 #include <viskores/filter/Filter.h>
24 
25 namespace viskores
26 {
27 namespace filter
28 {
29 namespace entity_extraction
30 {
31 class VISKORES_FILTER_ENTITY_EXTRACTION_EXPORT ThresholdPoints : public viskores::filter::Filter
32 {
33 public:
34  // When CompactPoints is set, instead of copying the points and point fields
35  // from the input, the filter will create new compact fields without the unused elements
37  bool GetCompactPoints() const { return this->CompactPoints; }
39  void SetCompactPoints(bool value) { this->CompactPoints = value; }
40 
42  viskores::Float64 GetLowerThreshold() const { return this->LowerValue; }
44  void SetLowerThreshold(viskores::Float64 value) { this->LowerValue = value; }
45 
47  viskores::Float64 GetUpperThreshold() const { return this->UpperValue; }
49  void SetUpperThreshold(viskores::Float64 value) { this->UpperValue = value; }
50 
52  void SetThresholdBelow(viskores::Float64 value);
54  void SetThresholdAbove(viskores::Float64 value);
56  void SetThresholdBetween(viskores::Float64 value1, viskores::Float64 value2);
57 
58 private:
60  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
61 
62  constexpr static int THRESHOLD_BELOW = 0;
63  constexpr static int THRESHOLD_ABOVE = 1;
64  constexpr static int THRESHOLD_BETWEEN = 2;
65 
66  double LowerValue = 0;
67  double UpperValue = 0;
68  int ThresholdType = THRESHOLD_BETWEEN;
69 
70  bool CompactPoints = false;
71 };
72 } // namespace entity_extraction
73 } // namespace filter
74 } // namespace viskores
75 
76 #endif // viskores_filter_entity_extraction_ThresholdPoints_h
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::entity_extraction::ThresholdPoints::SetCompactPoints
void SetCompactPoints(bool value)
Definition: ThresholdPoints.h:39
viskores::filter::entity_extraction::ThresholdPoints::SetLowerThreshold
void SetLowerThreshold(viskores::Float64 value)
Definition: ThresholdPoints.h:44
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::entity_extraction::ThresholdPoints::SetUpperThreshold
void SetUpperThreshold(viskores::Float64 value)
Definition: ThresholdPoints.h:49
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores::filter::entity_extraction::ThresholdPoints::GetUpperThreshold
viskores::Float64 GetUpperThreshold() const
Definition: ThresholdPoints.h:47
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores_filter_entity_extraction_export.h
viskores::filter::entity_extraction::ThresholdPoints::GetLowerThreshold
viskores::Float64 GetLowerThreshold() const
Definition: ThresholdPoints.h:42
viskores::filter::entity_extraction::ThresholdPoints::GetCompactPoints
bool GetCompactPoints() const
Definition: ThresholdPoints.h:37
viskores::filter::entity_extraction::ThresholdPoints
Definition: ThresholdPoints.h:31
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
Filter.h