VTK  9.2.6
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 =========================================================================*/
40 #ifndef vtkThresholdPoints_h
41 #define vtkThresholdPoints_h
42 
43 #include "vtkFiltersCoreModule.h" // For export macro
44 #include "vtkPolyDataAlgorithm.h"
45 
46 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  void ThresholdByLower(double lower);
57 
61  void ThresholdByUpper(double upper);
62 
67  void ThresholdBetween(double lower, double upper);
68 
70 
73  vtkSetMacro(UpperThreshold, double);
74  vtkGetMacro(UpperThreshold, double);
76 
78 
81  vtkSetMacro(LowerThreshold, double);
82  vtkGetMacro(LowerThreshold, double);
84 
86 
90  vtkSetMacro(InputArrayComponent, int);
91  vtkGetMacro(InputArrayComponent, int);
93 
95 
100  vtkSetMacro(OutputPointsPrecision, int);
101  vtkGetMacro(OutputPointsPrecision, int);
103 
104 protected:
106  ~vtkThresholdPoints() override = default;
107 
108  // Usual data generation method
110 
112 
117 
118  int (vtkThresholdPoints::*ThresholdFunction)(double s);
119 
120  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
121  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
122  int Between(double s)
123  {
124  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
125  }
126 
127 private:
128  vtkThresholdPoints(const vtkThresholdPoints&) = delete;
129  void operator=(const vtkThresholdPoints&) = delete;
130 };
131 
132 #endif
a simple class to control print indentation
Definition: vtkIndent.h:49
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.
void ThresholdByLower(double lower)
Criterion is cells whose scalars are less or equal to lower threshold.
~vtkThresholdPoints() override=default
static vtkThresholdPoints * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void ThresholdBetween(double lower, double upper)
Criterion is cells whose scalars are between lower and upper thresholds (inclusive of the end values)...
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.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453