VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Filters/General/vtkMarchingContourFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMarchingContourFilter.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 =========================================================================*/
00056 #ifndef vtkMarchingContourFilter_h
00057 #define vtkMarchingContourFilter_h
00058 
00059 #include "vtkFiltersGeneralModule.h" // For export macro
00060 #include "vtkPolyDataAlgorithm.h"
00061 
00062 #include "vtkContourValues.h" // Needed for direct access to ContourValues
00063 
00064 class vtkIncrementalPointLocator;
00065 class vtkScalarTree;
00066 
00067 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
00068 {
00069 public:
00070   vtkTypeMacro(vtkMarchingContourFilter,vtkPolyDataAlgorithm);
00071   void PrintSelf(ostream& os, vtkIndent indent);
00072 
00075   static vtkMarchingContourFilter *New();
00076 
00078 
00079   void SetValue(int i, double value);
00080   double GetValue(int i);
00081   double *GetValues();
00082   void GetValues(double *contourValues);
00083   void SetNumberOfContours(int number);
00084   int GetNumberOfContours();
00085   void GenerateValues(int numContours, double range[2]);
00086   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00088 
00090   unsigned long 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 
00123   vtkSetMacro(UseScalarTree,int);
00124   vtkGetMacro(UseScalarTree,int);
00125   vtkBooleanMacro(UseScalarTree,int);
00127 
00129 
00131   void SetLocator(vtkIncrementalPointLocator *locator);
00132   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00134 
00137   void CreateDefaultLocator();
00138 
00139 protected:
00140   vtkMarchingContourFilter();
00141   ~vtkMarchingContourFilter();
00142 
00143   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00144   virtual int FillInputPortInformation(int port, vtkInformation *info);
00145 
00146   vtkContourValues *ContourValues;
00147   int ComputeNormals;
00148   int ComputeGradients;
00149   int ComputeScalars;
00150   vtkIncrementalPointLocator *Locator;
00151   int UseScalarTree;
00152   vtkScalarTree *ScalarTree;
00153 
00154   //special contouring for structured points
00155   void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output);
00156   //special contouring for image data
00157   void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output);
00158   //default if not structured data
00159   void DataSetContour(vtkDataSet *input, vtkPolyData *output);
00160 private:
00161   vtkMarchingContourFilter(const vtkMarchingContourFilter&);  // Not implemented.
00162   void operator=(const vtkMarchingContourFilter&);  // Not implemented.
00163 };
00164 
00166 
00168 inline void vtkMarchingContourFilter::SetValue(int i, double value)
00169 {
00170   this->ContourValues->SetValue(i,value);
00171 }
00173 
00175 
00176 inline double vtkMarchingContourFilter::GetValue(int i)
00177 {
00178   return this->ContourValues->GetValue(i);
00179 }
00181 
00183 
00185 inline double *vtkMarchingContourFilter::GetValues()
00186 {
00187   return this->ContourValues->GetValues();
00188 }
00190 
00192 
00195 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
00196 {
00197   this->ContourValues->GetValues(contourValues);
00198 }
00200 
00202 
00205 inline void vtkMarchingContourFilter::SetNumberOfContours(int number)
00206 {
00207   this->ContourValues->SetNumberOfContours(number);
00208 }
00210 
00212 
00213 inline int vtkMarchingContourFilter::GetNumberOfContours()
00214 {
00215   return this->ContourValues->GetNumberOfContours();
00216 }
00218 
00220 
00222 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
00223                                                      double range[2])
00224 {
00225   this->ContourValues->GenerateValues(numContours, range);
00226 }
00228 
00230 
00232 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
00233                                                      double rangeStart,
00234                                                      double rangeEnd)
00235 {
00236   this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
00237 }
00239 
00240 #endif