VTK  9.5.2
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 "vtkFiltersCoreModule.h" // For export macro
132#include "vtkPolyDataAlgorithm.h"
133
134VTK_ABI_NAMESPACE_BEGIN
135class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
136{
137public:
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
193protected:
195 ~vtkThresholdPoints() override = default;
196
197 // Usual data generation method
199
200 int FillInputPortInformation(int port, vtkInformation* info) override;
201
206
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
216private:
217 vtkThresholdPoints(const vtkThresholdPoints&) = delete;
218 void operator=(const vtkThresholdPoints&) = delete;
219};
220
221VTK_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.
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
int FillInputPortInformation(int port, vtkInformation *info) override
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()
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.