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

vtkMarchingCubes.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMarchingCubes.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 =========================================================================*/
00063 #ifndef __vtkMarchingCubes_h
00064 #define __vtkMarchingCubes_h
00065 
00066 #include "vtkStructuredPointsToPolyDataFilter.h"
00067 
00068 #include "vtkContourValues.h" // Needed for direct access to ContourValues
00069 
00070 class vtkPointLocator;
00071 
00072 class VTK_PATENTED_EXPORT vtkMarchingCubes : public vtkStructuredPointsToPolyDataFilter
00073 {
00074 public:
00075   static vtkMarchingCubes *New();
00076   vtkTypeRevisionMacro(vtkMarchingCubes,vtkStructuredPointsToPolyDataFilter);
00077   void PrintSelf(ostream& os, vtkIndent indent);
00078 
00079   // Methods to set contour values
00080   void SetValue(int i, double value);
00081   double GetValue(int i);
00082   double *GetValues();
00083   void GetValues(double *contourValues);
00084   void SetNumberOfContours(int number);
00085   int GetNumberOfContours();
00086   void GenerateValues(int numContours, double range[2]);
00087   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00088 
00089   // Because we delegate to vtkContourValues
00090   unsigned long int GetMTime();
00091 
00093 
00097   vtkSetMacro(ComputeNormals,int);
00098   vtkGetMacro(ComputeNormals,int);
00099   vtkBooleanMacro(ComputeNormals,int);
00101 
00103 
00109   vtkSetMacro(ComputeGradients,int);
00110   vtkGetMacro(ComputeGradients,int);
00111   vtkBooleanMacro(ComputeGradients,int);
00113 
00115 
00116   vtkSetMacro(ComputeScalars,int);
00117   vtkGetMacro(ComputeScalars,int);
00118   vtkBooleanMacro(ComputeScalars,int);
00120 
00122 
00124   void SetLocator(vtkPointLocator *locator);
00125   vtkGetObjectMacro(Locator,vtkPointLocator);
00127 
00130   void CreateDefaultLocator();
00131 
00132 protected:
00133   vtkMarchingCubes();
00134   ~vtkMarchingCubes();
00135 
00136   void Execute();
00137 
00138   vtkContourValues *ContourValues;
00139   int ComputeNormals;
00140   int ComputeGradients;
00141   int ComputeScalars;
00142   vtkPointLocator *Locator;
00143 private:
00144   vtkMarchingCubes(const vtkMarchingCubes&);  // Not implemented.
00145   void operator=(const vtkMarchingCubes&);  // Not implemented.
00146 };
00147 
00150 inline void vtkMarchingCubes::SetValue(int i, double value)
00151 {this->ContourValues->SetValue(i,value);}
00152 
00154 
00155 inline double vtkMarchingCubes::GetValue(int i)
00156 {return this->ContourValues->GetValue(i);}
00158 
00160 
00162 inline double *vtkMarchingCubes::GetValues()
00163 {return this->ContourValues->GetValues();}
00165 
00169 inline void vtkMarchingCubes::GetValues(double *contourValues)
00170 {this->ContourValues->GetValues(contourValues);}
00171 
00175 inline void vtkMarchingCubes::SetNumberOfContours(int number)
00176 {this->ContourValues->SetNumberOfContours(number);}
00177 
00179 
00180 inline int vtkMarchingCubes::GetNumberOfContours()
00181 {return this->ContourValues->GetNumberOfContours();}
00183 
00185 
00187 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
00188 {this->ContourValues->GenerateValues(numContours, range);}
00190 
00192 
00194 inline void vtkMarchingCubes::GenerateValues(int numContours, double
00195                                              rangeStart, double rangeEnd)
00196 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00198 
00199 #endif
00200 
00201