VTK
dox/Filters/Core/vtkThresholdPoints.h
Go to the documentation of this file.
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 
00070 
00073   vtkSetMacro(OutputPointsPrecision,int);
00074   vtkGetMacro(OutputPointsPrecision,int);
00076 
00077 protected:
00078   vtkThresholdPoints();
00079   ~vtkThresholdPoints() {}
00080 
00081   // Usual data generation method
00082   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00083 
00084   virtual int FillInputPortInformation(int port, vtkInformation *info);
00085 
00086   double LowerThreshold;
00087   double UpperThreshold;
00088   int OutputPointsPrecision;
00089 
00090   //BTX
00091   int (vtkThresholdPoints::*ThresholdFunction)(double s);
00092   //ETX
00093 
00094   int Lower(double s) {return ( s <= this->LowerThreshold ? 1 : 0 );};
00095   int Upper(double s) {return ( s >= this->UpperThreshold ? 1 : 0 );};
00096   int Between(double s) {return ( s >= this->LowerThreshold ?
00097                                ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );};
00098 private:
00099   vtkThresholdPoints(const vtkThresholdPoints&);  // Not implemented.
00100   void operator=(const vtkThresholdPoints&);  // Not implemented.
00101 };
00102 
00103 #endif