VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkThresholdPoints.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00032 #ifndef __vtkThresholdPoints_h 00033 #define __vtkThresholdPoints_h 00034 00035 #include "vtkFiltersCoreModule.h" // For export macro 00036 #include "vtkPolyDataAlgorithm.h" 00037 00038 class VTKFILTERSCORE_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm 00039 { 00040 public: 00041 static vtkThresholdPoints *New(); 00042 vtkTypeMacro(vtkThresholdPoints,vtkPolyDataAlgorithm); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00047 void ThresholdByLower(double lower); 00048 00051 void ThresholdByUpper(double upper); 00052 00055 void ThresholdBetween(double lower, double upper); 00056 00058 00059 vtkSetMacro(UpperThreshold,double); 00060 vtkGetMacro(UpperThreshold,double); 00062 00064 00065 vtkSetMacro(LowerThreshold,double); 00066 vtkGetMacro(LowerThreshold,double); 00068 00069 protected: 00070 vtkThresholdPoints(); 00071 ~vtkThresholdPoints() {}; 00072 00073 // Usual data generation method 00074 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00075 00076 virtual int FillInputPortInformation(int port, vtkInformation *info); 00077 00078 double LowerThreshold; 00079 double UpperThreshold; 00080 00081 //BTX 00082 int (vtkThresholdPoints::*ThresholdFunction)(double s); 00083 //ETX 00084 00085 int Lower(double s) {return ( s <= this->LowerThreshold ? 1 : 0 );}; 00086 int Upper(double s) {return ( s >= this->UpperThreshold ? 1 : 0 );}; 00087 int Between(double s) {return ( s >= this->LowerThreshold ? 00088 ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );}; 00089 private: 00090 vtkThresholdPoints(const vtkThresholdPoints&); // Not implemented. 00091 void operator=(const vtkThresholdPoints&); // Not implemented. 00092 }; 00093 00094 #endif