VTK  9.3.1
vtkThresholdPoints.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkThresholdPoints_h
20 #define vtkThresholdPoints_h
21 
22 #include "vtkFiltersCoreModule.h" // For export macro
23 #include "vtkPolyDataAlgorithm.h"
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
27 {
28 public:
29  static vtkThresholdPoints* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
36  void ThresholdByLower(double lower);
37 
41  void ThresholdByUpper(double upper);
42 
47  void ThresholdBetween(double lower, double upper);
48 
50 
53  vtkSetMacro(UpperThreshold, double);
54  vtkGetMacro(UpperThreshold, double);
56 
58 
61  vtkSetMacro(LowerThreshold, double);
62  vtkGetMacro(LowerThreshold, double);
64 
66 
70  vtkSetMacro(InputArrayComponent, int);
71  vtkGetMacro(InputArrayComponent, int);
73 
75 
80  vtkSetMacro(OutputPointsPrecision, int);
81  vtkGetMacro(OutputPointsPrecision, int);
83 
84 protected:
86  ~vtkThresholdPoints() override = default;
87 
88  // Usual data generation method
90 
92 
97 
98  int (vtkThresholdPoints::*ThresholdFunction)(double s);
99 
100  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
101  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
102  int Between(double s)
103  {
104  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
105  }
106 
107 private:
108  vtkThresholdPoints(const vtkThresholdPoints&) = delete;
109  void operator=(const vtkThresholdPoints&) = delete;
110 };
111 
112 VTK_ABI_NAMESPACE_END
113 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
extracts points whose scalar value satisfies threshold criterion
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.