VTK  9.5.20251208
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
127
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
156
158
161 void SetThresholdFunction(int function);
164
168 VTK_DEPRECATED_IN_9_6_0("Use 'SetLowerThreshold' and 'SetThresholdFunction' instead.")
169 void ThresholdByLower(double lower);
170
174 VTK_DEPRECATED_IN_9_6_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();
228
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.
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.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int(vtkThresholdPoints::* ThresholdFunction)(double s)
void ThresholdBetween(double lower, double upper)
Criterion is cells whose scalars are between lower and upper thresholds (inclusive of the end values)...
static vtkThresholdPoints * New()
int GetThresholdFunction()
Set/Get the threshold method.
void ThresholdByUpper(double upper)
Criterion is cells whose scalars are greater or equal to upper threshold.
void SetThresholdFunction(int function)
Set/Get the threshold method.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
ThresholdType
Possible values for the threshold function:
#define VTK_DEPRECATED_IN_9_6_0(reason)
#define VTK_MARSHALAUTO