VTK
dox/Graphics/vtkMarchingSquares.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMarchingSquares.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 =========================================================================*/
00041 #ifndef __vtkMarchingSquares_h
00042 #define __vtkMarchingSquares_h
00043 
00044 #include "vtkPolyDataAlgorithm.h"
00045 
00046 #include "vtkContourValues.h" // Passes calls to vtkContourValues
00047 
00048 class vtkImageData;
00049 class vtkIncrementalPointLocator;
00050 
00051 class VTK_GRAPHICS_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
00052 {
00053 public:
00054   static vtkMarchingSquares *New();
00055   vtkTypeMacro(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(vtkIncrementalPointLocator *locator);
00085   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
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   vtkIncrementalPointLocator *Locator;
00101 
00102 private:
00103   vtkMarchingSquares(const vtkMarchingSquares&);  // Not implemented.
00104   void operator=(const vtkMarchingSquares&);  // Not implemented.
00105 };
00106 
00108 
00110 inline void vtkMarchingSquares::SetValue(int i, double value)
00111 {this->ContourValues->SetValue(i,value);}
00113 
00115 
00116 inline double vtkMarchingSquares::GetValue(int i)
00117 {return this->ContourValues->GetValue(i);}
00119 
00121 
00123 inline double *vtkMarchingSquares::GetValues()
00124 {return this->ContourValues->GetValues();}
00126 
00128 
00131 inline void vtkMarchingSquares::GetValues(double *contourValues)
00132 {this->ContourValues->GetValues(contourValues);}
00134 
00136 
00139 inline void vtkMarchingSquares::SetNumberOfContours(int number)
00140 {this->ContourValues->SetNumberOfContours(number);}
00142 
00144 
00145 inline int vtkMarchingSquares::GetNumberOfContours()
00146 {return this->ContourValues->GetNumberOfContours();}
00148 
00150 
00152 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
00153 {this->ContourValues->GenerateValues(numContours, range);}
00155 
00157 
00159 inline void vtkMarchingSquares::GenerateValues(int numContours, double
00160                                              rangeStart, double rangeEnd)
00161 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00163 
00164 #endif