VTK  9.7.0
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
18
19#ifndef vtkThresholdPoints_h
20#define vtkThresholdPoints_h
21
22#include "vtkDeprecation.h"
23#include "vtkFiltersCoreModule.h" // For export macro
25#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26
27VTK_ABI_NAMESPACE_BEGIN
28class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkThresholdPoints : public vtkPolyDataAlgorithm
29{
30public:
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
42 {
46 };
47
49
52 void SetThresholdFunction(int function);
55
59 VTK_DEPRECATED_IN_9_6_0("Use 'SetLowerThreshold' and 'SetThresholdFunction' instead.")
60 void ThresholdByLower(double lower);
61
65 VTK_DEPRECATED_IN_9_6_0("Use 'SetUpperThreshold' and 'SetThresholdFunction' instead.")
66 void ThresholdByUpper(double upper);
67
73 "Use 'SetLowerThreshold', 'SetUpperThreshold' and 'SetThresholdFunction' instead.")
74 void ThresholdBetween(double lower, double upper);
75
77
81 vtkSetMacro(UpperThreshold, double);
82 vtkGetMacro(UpperThreshold, double);
83 vtkSetMacro(LowerThreshold, double);
84 vtkGetMacro(LowerThreshold, double);
86
88
92 vtkSetMacro(InputArrayComponent, int);
93 vtkGetMacro(InputArrayComponent, int);
95
97
102 vtkSetMacro(OutputPointsPrecision, int);
103 vtkGetMacro(OutputPointsPrecision, int);
105
106protected:
108 ~vtkThresholdPoints() override = default;
109
110 // Usual data generation method
112
113 int FillInputPortInformation(int port, vtkInformation* info) override;
114
115 double LowerThreshold = -std::numeric_limits<double>::infinity();
116 double UpperThreshold = std::numeric_limits<double>::infinity();
119
121
122 int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
123 int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
124 int Between(double s)
125 {
126 return ((s >= this->LowerThreshold && s <= this->UpperThreshold) ? 1 : 0);
127 }
128
129private:
130 vtkThresholdPoints(const vtkThresholdPoints&) = delete;
131 void operator=(const vtkThresholdPoints&) = delete;
132};
133
134VTK_ABI_NAMESPACE_END
135#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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.
int(vtkThresholdPoints::*) ThresholdFunction(double s)
void ThresholdByLower(double lower)
Criterion is cells whose scalars are less or equal to lower threshold.
int FillInputPortInformation(int port, vtkInformation *info) override
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