00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00041 #ifndef __vtkMarchingSquares_h
00042 #define __vtkMarchingSquares_h
00043 
00044 #include "vtkPolyDataAlgorithm.h"
00045 
00046 #include "vtkContourValues.h" 
00047 
00048 class vtkImageData;
00049 class vtkPointLocator;
00050 
00051 class VTK_GRAPHICS_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
00052 {
00053 public:
00054   static vtkMarchingSquares *New();
00055   vtkTypeRevisionMacro(vtkMarchingSquares,vtkPolyDataAlgorithm);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00063   vtkSetVectorMacro(ImageRange,int,6);
00064   vtkGetVectorMacro(ImageRange,int,6);
00065   void SetImageRange(int imin, int imax, int jmin, int jmax, 
00066                      int kmin, int kmax);
00068 
00070 
00071   void SetValue(int i, double value);
00072   double GetValue(int i);
00073   double *GetValues();
00074   void GetValues(double *contourValues);
00075   void SetNumberOfContours(int number);
00076   int GetNumberOfContours();
00077   void GenerateValues(int numContours, double range[2]);
00078   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00080 
00082   unsigned long int GetMTime();
00083 
00084   void SetLocator(vtkPointLocator *locator);
00085   vtkGetObjectMacro(Locator,vtkPointLocator);
00086 
00089   void CreateDefaultLocator();
00090 
00091 protected:
00092   vtkMarchingSquares();
00093   ~vtkMarchingSquares();
00094 
00095   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00096   virtual int FillInputPortInformation(int port, vtkInformation *info);
00097 
00098   vtkContourValues *ContourValues;
00099   int ImageRange[6];
00100   vtkPointLocator *Locator;
00101 
00102 private:
00103   vtkMarchingSquares(const vtkMarchingSquares&);  
00104   void operator=(const vtkMarchingSquares&);  
00105 };
00106 
00109 inline void vtkMarchingSquares::SetValue(int i, double value)
00110 {this->ContourValues->SetValue(i,value);}
00111 
00113 
00114 inline double vtkMarchingSquares::GetValue(int i)
00115 {return this->ContourValues->GetValue(i);}
00117 
00119 
00121 inline double *vtkMarchingSquares::GetValues()
00122 {return this->ContourValues->GetValues();}
00124 
00128 inline void vtkMarchingSquares::GetValues(double *contourValues)
00129 {this->ContourValues->GetValues(contourValues);}
00130 
00134 inline void vtkMarchingSquares::SetNumberOfContours(int number)
00135 {this->ContourValues->SetNumberOfContours(number);}
00136 
00138 
00139 inline int vtkMarchingSquares::GetNumberOfContours()
00140 {return this->ContourValues->GetNumberOfContours();}
00142 
00144 
00146 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
00147 {this->ContourValues->GenerateValues(numContours, range);}
00149 
00151 
00153 inline void vtkMarchingSquares::GenerateValues(int numContours, double
00154                                              rangeStart, double rangeEnd)
00155 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00157 
00158 #endif