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 "vtkPolyDataAlgorithm.h" 00036 00037 class VTK_GRAPHICS_EXPORT vtkThresholdPoints : public vtkPolyDataAlgorithm 00038 { 00039 public: 00040 static vtkThresholdPoints *New(); 00041 vtkTypeMacro(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 vtkSetMacro(UpperThreshold,double); 00059 vtkGetMacro(UpperThreshold,double); 00061 00063 00064 vtkSetMacro(LowerThreshold,double); 00065 vtkGetMacro(LowerThreshold,double); 00067 00068 protected: 00069 vtkThresholdPoints(); 00070 ~vtkThresholdPoints() {}; 00071 00072 // Usual data generation method 00073 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00074 00075 virtual int FillInputPortInformation(int port, vtkInformation *info); 00076 00077 double LowerThreshold; 00078 double UpperThreshold; 00079 00080 //BTX 00081 int (vtkThresholdPoints::*ThresholdFunction)(double s); 00082 //ETX 00083 00084 int Lower(double s) {return ( s <= this->LowerThreshold ? 1 : 0 );}; 00085 int Upper(double s) {return ( s >= this->UpperThreshold ? 1 : 0 );}; 00086 int Between(double s) {return ( s >= this->LowerThreshold ? 00087 ( s <= this->UpperThreshold ? 1 : 0 ) : 0 );}; 00088 private: 00089 vtkThresholdPoints(const vtkThresholdPoints&); // Not implemented. 00090 void operator=(const vtkThresholdPoints&); // Not implemented. 00091 }; 00092 00093 #endif