VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
32 #ifndef __vtkThresholdPoints_h
33 #define __vtkThresholdPoints_h
34 
35 #include "vtkFiltersCoreModule.h" // For export macro
36 #include "vtkPolyDataAlgorithm.h"
37 
38 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm
39 {
40 public:
41  static vtkThresholdPoints *New();
42  vtkTypeMacro(vtkThresholdPoints,vtkPolyDataAlgorithm);
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
47  void ThresholdByLower(double lower);
48 
51  void ThresholdByUpper(double upper);
52 
55  void ThresholdBetween(double lower, double upper);
56 
58 
59  vtkSetMacro(UpperThreshold,double);
60  vtkGetMacro(UpperThreshold,double);
62 
64 
65  vtkSetMacro(LowerThreshold,double);
66  vtkGetMacro(LowerThreshold,double);
68 
69 protected:
72 
73  // Usual data generation method
74  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
75 
76  virtual int FillInputPortInformation(int port, vtkInformation *info);
77 
80 
81  //BTX
82  int (vtkThresholdPoints::*ThresholdFunction)(double s);
83  //ETX
84 
85  int Lower(double s) {return ( s <= this->LowerThreshold ? 1 : 0 );};
86  int Upper(double s) {return ( s >= this->UpperThreshold ? 1 : 0 );};
87  int Between(double s) {return ( s >= this->LowerThreshold ?
88  ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );};
89 private:
90  vtkThresholdPoints(const vtkThresholdPoints&); // Not implemented.
91  void operator=(const vtkThresholdPoints&); // Not implemented.
92 };
93 
94 #endif
extracts points whose scalar value satisfies threshold criterion