Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkMarchingSquares.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMarchingSquares.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 
00015      THIS CLASS IS PATENTED UNDER UNITED STATES PATENT NUMBER 4,710,876
00016      "System and Method for the Display of Surface Structures Contained
00017      Within the Interior Region of a Solid Body".
00018      Application of this software for commercial purposes requires 
00019      a license grant from GE. Contact:
00020 
00021          Carl B. Horton
00022          Sr. Counsel, Intellectual Property
00023          3000 N. Grandview Blvd., W-710
00024          Waukesha, WI  53188
00025          Phone:  (262) 513-4022
00026          E-Mail: [email protected]
00027 
00028      for more information.
00029 
00030 =========================================================================*/
00070 #ifndef __vtkMarchingSquares_h
00071 #define __vtkMarchingSquares_h
00072 
00073 #include "vtkPolyDataSource.h"
00074 
00075 #include "vtkContourValues.h" // Passes calls to vtkContourValues
00076 
00077 class vtkImageData;
00078 class vtkPointLocator;
00079 
00080 class VTK_PATENTED_EXPORT vtkMarchingSquares : public vtkPolyDataSource
00081 {
00082 public:
00083   static vtkMarchingSquares *New();
00084   vtkTypeRevisionMacro(vtkMarchingSquares,vtkPolyDataSource);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00088 
00089   void SetInput(vtkImageData *input);
00090   vtkImageData *GetInput();  
00092   
00094 
00098   vtkSetVectorMacro(ImageRange,int,6);
00099   vtkGetVectorMacro(ImageRange,int,6);
00100   void SetImageRange(int imin, int imax, int jmin, int jmax, 
00101                      int kmin, int kmax);
00103 
00104   // Methods to set contour values
00105   void SetValue(int i, double value);
00106   double GetValue(int i);
00107   double *GetValues();
00108   void GetValues(double *contourValues);
00109   void SetNumberOfContours(int number);
00110   int GetNumberOfContours();
00111   void GenerateValues(int numContours, double range[2]);
00112   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00113 
00114   // Because we delegate to vtkContourValues
00115   unsigned long int GetMTime();
00116 
00117   void SetLocator(vtkPointLocator *locator);
00118   vtkGetObjectMacro(Locator,vtkPointLocator);
00119 
00122   void CreateDefaultLocator();
00123 
00124 protected:
00125   vtkMarchingSquares();
00126   ~vtkMarchingSquares();
00127 
00128   void Execute();
00129 
00130   vtkContourValues *ContourValues;
00131   int ImageRange[6];
00132   vtkPointLocator *Locator;
00133 
00134   virtual int FillInputPortInformation(int, vtkInformation*);
00135 private:
00136   vtkMarchingSquares(const vtkMarchingSquares&);  // Not implemented.
00137   void operator=(const vtkMarchingSquares&);  // Not implemented.
00138 };
00139 
00142 inline void vtkMarchingSquares::SetValue(int i, double value)
00143 {this->ContourValues->SetValue(i,value);}
00144 
00146 
00147 inline double vtkMarchingSquares::GetValue(int i)
00148 {return this->ContourValues->GetValue(i);}
00150 
00152 
00154 inline double *vtkMarchingSquares::GetValues()
00155 {return this->ContourValues->GetValues();}
00157 
00161 inline void vtkMarchingSquares::GetValues(double *contourValues)
00162 {this->ContourValues->GetValues(contourValues);}
00163 
00167 inline void vtkMarchingSquares::SetNumberOfContours(int number)
00168 {this->ContourValues->SetNumberOfContours(number);}
00169 
00171 
00172 inline int vtkMarchingSquares::GetNumberOfContours()
00173 {return this->ContourValues->GetNumberOfContours();}
00175 
00177 
00179 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
00180 {this->ContourValues->GenerateValues(numContours, range);}
00182 
00184 
00186 inline void vtkMarchingSquares::GenerateValues(int numContours, double
00187                                              rangeStart, double rangeEnd)
00188 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00190 
00191 #endif
00192