VTK  9.5.20251015
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 "vtkDeprecation.h"
132#include "vtkFiltersCoreModule.h" // For export macro
133#include "vtkPolyDataAlgorithm.h"
134#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
135
136VTK_ABI_NAMESPACE_BEGIN
137class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkThresholdPoints : public vtkPolyDataAlgorithm
138{
139public:
142 void PrintSelf(ostream& os, vtkIndent indent) override;
143
151 {
152 THRESHOLD_BETWEEN = 0,
154 THRESHOLD_UPPER
155 };
156
158
161 void SetThresholdFunction(int function);
164
168 VTK_DEPRECATED_IN_9_5_0("Use 'SetLowerThreshold' and 'SetThresholdFunction' instead.")
169 void ThresholdByLower(double lower);
170
174 VTK_DEPRECATED_IN_9_5_0("Use 'SetUpperThreshold' and 'SetThresholdFunction' instead.")
175 void ThresholdByUpper(double upper);
176
182 "Use 'SetLowerThreshold', 'SetUpperThreshold' and 'SetThresholdFunction' instead.")
183 void ThresholdBetween(double lower, double upper);
184
186
190 vtkSetMacro(UpperThreshold, double);
191 vtkGetMacro(UpperThreshold, double);
192 vtkSetMacro(LowerThreshold, double);
193 vtkGetMacro(LowerThreshold, double);
195
197
201 vtkSetMacro(InputArrayComponent, int);
202 vtkGetMacro(InputArrayComponent, int);
204
206
211 vtkSetMacro(OutputPointsPrecision, int);
212 vtkGetMacro(OutputPointsPrecision, int);
214
215protected:
217 ~vtkThresholdPoints() override = default;
218
219 // Usual data generation method
221
222 int FillInputPortInformation(int port, vtkInformation* info) override;
223
224 double LowerThreshold = -std::numeric_limits<double>::infinity();
225 double UpperThreshold = std::numeric_limits<double>::infinity();
226 int InputArrayComponent = 0;
227 int OutputPointsPrecision = DEFAULT_PRECISION;
228
229 int (vtkThresholdPoints::*ThresholdFunction)(double s) = &vtkThresholdPoints::Between;
230
231 int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
232 int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
233 int Between(double s)
234 {
235 return ((s >= this->LowerThreshold && s <= this->UpperThreshold) ? 1 : 0);
236 }
237
238private:
239 vtkThresholdPoints(const vtkThresholdPoints&) = delete;
240 void operator=(const vtkThresholdPoints&) = delete;
241};
242
243VTK_ABI_NAMESPACE_END
244#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.
static vtkThresholdPoints * New()
int GetThresholdFunction()
Set/Get the threshold method.
void SetThresholdFunction(int function)
Set/Get the threshold method.
ThresholdType
Possible values for the threshold function:
#define VTK_DEPRECATED_IN_9_5_0(reason)
#define VTK_MARSHALAUTO