00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkThresholdPoints.h,v $ 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 "vtkPolyDataAlgorithm.h" 00036 00037 class VTK_GRAPHICS_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm 00038 { 00039 public: 00040 static vtkThresholdPoints *New(); 00041 vtkTypeRevisionMacro(vtkThresholdPoints,vtkPolyDataAlgorithm); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00046 void ThresholdByLower(double lower); 00047 00050 void ThresholdByUpper(double upper); 00051 00054 void ThresholdBetween(double lower, double upper); 00055 00057 00058 vtkGetMacro(UpperThreshold,double); 00059 vtkGetMacro(LowerThreshold,double); 00061 00062 protected: 00063 vtkThresholdPoints(); 00064 ~vtkThresholdPoints() {}; 00065 00066 // Usual data generation method 00067 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00068 00069 virtual int FillInputPortInformation(int port, vtkInformation *info); 00070 00071 double LowerThreshold; 00072 double UpperThreshold; 00073 00074 //BTX 00075 int (vtkThresholdPoints::*ThresholdFunction)(double s); 00076 //ETX 00077 00078 int Lower(double s) {return ( s <= this->LowerThreshold ? 1 : 0 );}; 00079 int Upper(double s) {return ( s >= this->UpperThreshold ? 1 : 0 );}; 00080 int Between(double s) {return ( s >= this->LowerThreshold ? 00081 ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );}; 00082 private: 00083 vtkThresholdPoints(const vtkThresholdPoints&); // Not implemented. 00084 void operator=(const vtkThresholdPoints&); // Not implemented. 00085 }; 00086 00087 #endif