VTK  9.3.20240328
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
128 #ifndef vtkThresholdPoints_h
129 #define vtkThresholdPoints_h
130 
131 #include "vtkFiltersCoreModule.h" // For export macro
132 #include "vtkPolyDataAlgorithm.h"
133 
134 VTK_ABI_NAMESPACE_BEGIN
135 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
136 {
137 public:
140  void PrintSelf(ostream& os, vtkIndent indent) override;
141 
145  void ThresholdByLower(double lower);
146 
150  void ThresholdByUpper(double upper);
151 
156  void ThresholdBetween(double lower, double upper);
157 
159 
162  vtkSetMacro(UpperThreshold, double);
163  vtkGetMacro(UpperThreshold, double);
165 
167 
170  vtkSetMacro(LowerThreshold, double);
171  vtkGetMacro(LowerThreshold, double);
173 
175 
179  vtkSetMacro(InputArrayComponent, int);
180  vtkGetMacro(InputArrayComponent, int);
182 
184 
189  vtkSetMacro(OutputPointsPrecision, int);
190  vtkGetMacro(OutputPointsPrecision, int);
192 
193 protected:
195  ~vtkThresholdPoints() override = default;
196 
197  // Usual data generation method
199 
201 
206 
207  int (vtkThresholdPoints::*ThresholdFunction)(double s);
208 
209  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
210  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
211  int Between(double s)
212  {
213  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
214  }
215 
216 private:
217  vtkThresholdPoints(const vtkThresholdPoints&) = delete;
218  void operator=(const vtkThresholdPoints&) = delete;
219 };
220 
221 VTK_ABI_NAMESPACE_END
222 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
extracts points whose scalar value satisfies threshold criterion
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ThresholdByLower(double lower)
Criterion is cells whose scalars are less or equal to lower threshold.
~vtkThresholdPoints() override=default
static vtkThresholdPoints * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void ThresholdBetween(double lower, double upper)
Criterion is cells whose scalars are between lower and upper thresholds (inclusive of the end values)...
void ThresholdByUpper(double upper)
Criterion is cells whose scalars are greater or equal to upper threshold.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447