VTK  9.1.0
vtkThresholdPoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkThresholdPoints.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
137 #ifndef vtkThresholdPoints_h
138 #define vtkThresholdPoints_h
139 
140 #include "vtkFiltersCoreModule.h" // For export macro
141 #include "vtkPolyDataAlgorithm.h"
142 
143 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
144 {
145 public:
148  void PrintSelf(ostream& os, vtkIndent indent) override;
149 
153  void ThresholdByLower(double lower);
154 
158  void ThresholdByUpper(double upper);
159 
164  void ThresholdBetween(double lower, double upper);
165 
167 
170  vtkSetMacro(UpperThreshold, double);
171  vtkGetMacro(UpperThreshold, double);
173 
175 
178  vtkSetMacro(LowerThreshold, double);
179  vtkGetMacro(LowerThreshold, double);
181 
183 
187  vtkSetMacro(InputArrayComponent, int);
188  vtkGetMacro(InputArrayComponent, int);
190 
192 
197  vtkSetMacro(OutputPointsPrecision, int);
198  vtkGetMacro(OutputPointsPrecision, int);
200 
201 protected:
203  ~vtkThresholdPoints() override = default;
204 
205  // Usual data generation method
207 
209 
214 
215  int (vtkThresholdPoints::*ThresholdFunction)(double s);
216 
217  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
218  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
219  int Between(double s)
220  {
221  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
222  }
223 
224 private:
225  vtkThresholdPoints(const vtkThresholdPoints&) = delete;
226  void operator=(const vtkThresholdPoints&) = delete;
227 };
228 
229 #endif
vtkThresholdPoints::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkThresholdPoints.h:213
vtkThresholdPoints::New
static vtkThresholdPoints * New()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkThresholdPoints::vtkThresholdPoints
vtkThresholdPoints()
vtkThresholdPoints::Lower
int Lower(double s)
Definition: vtkThresholdPoints.h:217
vtkThresholdPoints::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkThresholdPoints::Between
int Between(double s)
Definition: vtkThresholdPoints.h:219
vtkPolyDataAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkThresholdPoints::UpperThreshold
double UpperThreshold
Definition: vtkThresholdPoints.h:211
vtkThresholdPoints::InputArrayComponent
int InputArrayComponent
Definition: vtkThresholdPoints.h:212
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkThresholdPoints::ThresholdByLower
void ThresholdByLower(double lower)
Criterion is cells whose scalars are less or equal to lower threshold.
vtkThresholdPoints
extracts points whose scalar value satisfies threshold criterion
Definition: vtkThresholdPoints.h:144
vtkThresholdPoints::~vtkThresholdPoints
~vtkThresholdPoints() override=default
vtkThresholdPoints::LowerThreshold
double LowerThreshold
Definition: vtkThresholdPoints.h:210
vtkThresholdPoints::Upper
int Upper(double s)
Definition: vtkThresholdPoints.h:218
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkThresholdPoints::ThresholdByUpper
void ThresholdByUpper(double upper)
Criterion is cells whose scalars are greater or equal to upper threshold.
vtkThresholdPoints::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkThresholdPoints::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151
vtkThresholdPoints::ThresholdBetween
void ThresholdBetween(double lower, double upper)
Criterion is cells whose scalars are between lower and upper thresholds (inclusive of the end values)...