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 =========================================================================*/
31 #ifndef vtkThresholdPoints_h
32 #define vtkThresholdPoints_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 
37 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
38 {
39 public:
40  static vtkThresholdPoints* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void ThresholdByLower(double lower);
48 
52  void ThresholdByUpper(double upper);
53 
58  void ThresholdBetween(double lower, double upper);
59 
61 
64  vtkSetMacro(UpperThreshold, double);
65  vtkGetMacro(UpperThreshold, double);
67 
69 
72  vtkSetMacro(LowerThreshold, double);
73  vtkGetMacro(LowerThreshold, double);
75 
77 
81  vtkSetMacro(InputArrayComponent, int);
82  vtkGetMacro(InputArrayComponent, int);
84 
86 
91  vtkSetMacro(OutputPointsPrecision, int);
92  vtkGetMacro(OutputPointsPrecision, int);
94 
95 protected:
97  ~vtkThresholdPoints() override = default;
98 
99  // Usual data generation method
101 
102  int FillInputPortInformation(int port, vtkInformation* info) override;
103 
108 
109  int (vtkThresholdPoints::*ThresholdFunction)(double s);
110 
111  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
112  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
113  int Between(double s)
114  {
115  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
116  }
117 
118 private:
119  vtkThresholdPoints(const vtkThresholdPoints&) = delete;
120  void operator=(const vtkThresholdPoints&) = delete;
121 };
122 
123 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
extracts points whose scalar value satisfies threshold criterion
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.