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

vtkMarchingContourFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMarchingContourFilter.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 =========================================================================*/
00084 #ifndef __vtkMarchingContourFilter_h
00085 #define __vtkMarchingContourFilter_h
00086 
00087 #include "vtkDataSetToPolyDataFilter.h"
00088 
00089 #include "vtkContourValues.h" // Needed for direct access to ContourValues
00090 
00091 class vtkPointLocator;
00092 class vtkScalarTree;
00093 
00094 class VTK_PATENTED_EXPORT vtkMarchingContourFilter : public vtkDataSetToPolyDataFilter
00095 {
00096 public:
00097   vtkTypeRevisionMacro(vtkMarchingContourFilter,vtkDataSetToPolyDataFilter);
00098   void PrintSelf(ostream& os, vtkIndent indent);
00099 
00102   static vtkMarchingContourFilter *New();
00103 
00105 
00106   void SetValue(int i, double value);
00107   double GetValue(int i);
00108   double *GetValues();
00109   void GetValues(double *contourValues);
00110   void SetNumberOfContours(int number);
00111   int GetNumberOfContours();
00112   void GenerateValues(int numContours, double range[2]);
00113   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00115 
00117   unsigned long GetMTime();
00118 
00120 
00124   vtkSetMacro(ComputeNormals,int);
00125   vtkGetMacro(ComputeNormals,int);
00126   vtkBooleanMacro(ComputeNormals,int);
00128 
00130 
00136   vtkSetMacro(ComputeGradients,int);
00137   vtkGetMacro(ComputeGradients,int);
00138   vtkBooleanMacro(ComputeGradients,int);
00140 
00142 
00143   vtkSetMacro(ComputeScalars,int);
00144   vtkGetMacro(ComputeScalars,int);
00145   vtkBooleanMacro(ComputeScalars,int);
00147 
00149 
00150   vtkSetMacro(UseScalarTree,int);
00151   vtkGetMacro(UseScalarTree,int);
00152   vtkBooleanMacro(UseScalarTree,int);
00154 
00156 
00158   void SetLocator(vtkPointLocator *locator);
00159   vtkGetObjectMacro(Locator,vtkPointLocator);
00161 
00164   void CreateDefaultLocator();
00165 
00166 protected:
00167   vtkMarchingContourFilter();
00168   ~vtkMarchingContourFilter();
00169 
00170   void Execute();
00171 
00172   vtkContourValues *ContourValues;
00173   int ComputeNormals;
00174   int ComputeGradients;
00175   int ComputeScalars;
00176   vtkPointLocator *Locator;
00177   int UseScalarTree;
00178   vtkScalarTree *ScalarTree;
00179   
00180   //special contouring for structured points
00181   void StructuredPointsContour(int dim); 
00182   //special contouring for image data
00183   void ImageContour(int dim);
00184   //default if not structured data
00185   void DataSetContour();
00186 private:
00187   vtkMarchingContourFilter(const vtkMarchingContourFilter&);  // Not implemented.
00188   void operator=(const vtkMarchingContourFilter&);  // Not implemented.
00189 };
00190 
00193 inline void vtkMarchingContourFilter::SetValue(int i, double value)
00194 {
00195   this->ContourValues->SetValue(i,value);
00196 }
00197 
00199 inline double vtkMarchingContourFilter::GetValue(int i)
00200 {
00201   return this->ContourValues->GetValue(i);
00202 }
00203 
00206 inline double *vtkMarchingContourFilter::GetValues()
00207 {
00208   return this->ContourValues->GetValues();
00209 }
00210 
00214 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
00215 {
00216   this->ContourValues->GetValues(contourValues);
00217 }
00218 
00222 inline void vtkMarchingContourFilter::SetNumberOfContours(int number)
00223 {
00224   this->ContourValues->SetNumberOfContours(number);
00225 }
00226 
00228 inline int vtkMarchingContourFilter::GetNumberOfContours()
00229 {
00230   return this->ContourValues->GetNumberOfContours();
00231 }
00232 
00234 
00236 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
00237                                                      double range[2])
00239 {
00240   this->ContourValues->GenerateValues(numContours, range);
00241 }
00242 
00244 
00246 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
00247                                                      double rangeStart,
00248                                                      double rangeEnd)
00250 {
00251   this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
00252 }
00253 
00254 #endif