VTK  9.0.1
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 =========================================================================*/
28 #ifndef vtkThresholdPoints_h
29 #define vtkThresholdPoints_h
30 
31 #include "vtkFiltersCoreModule.h" // For export macro
32 #include "vtkPolyDataAlgorithm.h"
33 
34 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
35 {
36 public:
37  static vtkThresholdPoints* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  void ThresholdByLower(double lower);
45 
49  void ThresholdByUpper(double upper);
50 
55  void ThresholdBetween(double lower, double upper);
56 
58 
61  vtkSetMacro(UpperThreshold, double);
62  vtkGetMacro(UpperThreshold, double);
64 
66 
69  vtkSetMacro(LowerThreshold, double);
70  vtkGetMacro(LowerThreshold, double);
72 
74 
79  vtkSetMacro(OutputPointsPrecision, int);
80  vtkGetMacro(OutputPointsPrecision, int);
82 
83 protected:
85  ~vtkThresholdPoints() override {}
86 
87  // Usual data generation method
89 
91 
95 
96  int (vtkThresholdPoints::*ThresholdFunction)(double s);
97 
98  int Lower(double s) { return (s <= this->LowerThreshold ? 1 : 0); }
99  int Upper(double s) { return (s >= this->UpperThreshold ? 1 : 0); }
100  int Between(double s)
101  {
102  return (s >= this->LowerThreshold ? (s <= this->UpperThreshold ? 1 : 0) : 0);
103  }
104 
105 private:
106  vtkThresholdPoints(const vtkThresholdPoints&) = delete;
107  void operator=(const vtkThresholdPoints&) = delete;
108 };
109 
110 #endif
vtkThresholdPoints::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkThresholdPoints.h:94
vtkThresholdPoints::~vtkThresholdPoints
~vtkThresholdPoints() override
Definition: vtkThresholdPoints.h:85
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkThresholdPoints::Lower
int Lower(double s)
Definition: vtkThresholdPoints.h:98
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkThresholdPoints::Between
int Between(double s)
Definition: vtkThresholdPoints.h:100
vtkPolyDataAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkThresholdPoints::UpperThreshold
double UpperThreshold
Definition: vtkThresholdPoints.h:93
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkThresholdPoints
extracts points whose scalar value satisfies threshold criterion
Definition: vtkThresholdPoints.h:34
vtkThresholdPoints::LowerThreshold
double LowerThreshold
Definition: vtkThresholdPoints.h:92
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkThresholdPoints::Upper
int Upper(double s)
Definition: vtkThresholdPoints.h:99
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41