VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Filters/Core/vtkMarchingCubes.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMarchingCubes.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 =========================================================================*/
00038 #ifndef vtkMarchingCubes_h
00039 #define vtkMarchingCubes_h
00040 
00041 #include "vtkFiltersCoreModule.h" // For export macro
00042 #include "vtkPolyDataAlgorithm.h"
00043 
00044 #include "vtkContourValues.h" // Needed for direct access to ContourValues
00045 
00046 class vtkIncrementalPointLocator;
00047 
00048 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
00049 {
00050 public:
00051   static vtkMarchingCubes *New();
00052   vtkTypeMacro(vtkMarchingCubes,vtkPolyDataAlgorithm);
00053   void PrintSelf(ostream& os, vtkIndent indent);
00054 
00055   // Methods to set contour values
00056   void SetValue(int i, double value);
00057   double GetValue(int i);
00058   double *GetValues();
00059   void GetValues(double *contourValues);
00060   void SetNumberOfContours(int number);
00061   int GetNumberOfContours();
00062   void GenerateValues(int numContours, double range[2]);
00063   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00064 
00065   // Because we delegate to vtkContourValues
00066   unsigned long int GetMTime();
00067 
00069 
00073   vtkSetMacro(ComputeNormals,int);
00074   vtkGetMacro(ComputeNormals,int);
00075   vtkBooleanMacro(ComputeNormals,int);
00077 
00079 
00085   vtkSetMacro(ComputeGradients,int);
00086   vtkGetMacro(ComputeGradients,int);
00087   vtkBooleanMacro(ComputeGradients,int);
00089 
00091 
00092   vtkSetMacro(ComputeScalars,int);
00093   vtkGetMacro(ComputeScalars,int);
00094   vtkBooleanMacro(ComputeScalars,int);
00096 
00098 
00100   void SetLocator(vtkIncrementalPointLocator *locator);
00101   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00103 
00106   void CreateDefaultLocator();
00107 
00108 protected:
00109   vtkMarchingCubes();
00110   ~vtkMarchingCubes();
00111 
00112   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00113   virtual int FillInputPortInformation(int port, vtkInformation *info);
00114 
00115   vtkContourValues *ContourValues;
00116   int ComputeNormals;
00117   int ComputeGradients;
00118   int ComputeScalars;
00119   vtkIncrementalPointLocator *Locator;
00120 private:
00121   vtkMarchingCubes(const vtkMarchingCubes&);  // Not implemented.
00122   void operator=(const vtkMarchingCubes&);  // Not implemented.
00123 };
00124 
00126 
00128 inline void vtkMarchingCubes::SetValue(int i, double value)
00129 {this->ContourValues->SetValue(i,value);}
00131 
00133 
00134 inline double vtkMarchingCubes::GetValue(int i)
00135 {return this->ContourValues->GetValue(i);}
00137 
00139 
00141 inline double *vtkMarchingCubes::GetValues()
00142 {return this->ContourValues->GetValues();}
00144 
00146 
00149 inline void vtkMarchingCubes::GetValues(double *contourValues)
00150 {this->ContourValues->GetValues(contourValues);}
00152 
00154 
00157 inline void vtkMarchingCubes::SetNumberOfContours(int number)
00158 {this->ContourValues->SetNumberOfContours(number);}
00160 
00162 
00163 inline int vtkMarchingCubes::GetNumberOfContours()
00164 {return this->ContourValues->GetNumberOfContours();}
00166 
00168 
00170 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
00171 {this->ContourValues->GenerateValues(numContours, range);}
00173 
00175 
00177 inline void vtkMarchingCubes::GenerateValues(int numContours, double
00178                                              rangeStart, double rangeEnd)
00179 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00181 
00182 #endif