VTK
dox/Graphics/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 "vtkPolyDataAlgorithm.h"
00060 
00061 #include "vtkContourValues.h" // Needed for direct access to ContourValues
00062 
00063 class vtkIncrementalPointLocator;
00064 class vtkScalarTree;
00065 
00066 class VTK_GRAPHICS_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
00067 {
00068 public:
00069   vtkTypeMacro(vtkMarchingContourFilter,vtkPolyDataAlgorithm);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00074   static vtkMarchingContourFilter *New();
00075 
00077 
00078   void SetValue(int i, double value);
00079   double GetValue(int i);
00080   double *GetValues();
00081   void GetValues(double *contourValues);
00082   void SetNumberOfContours(int number);
00083   int GetNumberOfContours();
00084   void GenerateValues(int numContours, double range[2]);
00085   void GenerateValues(int numContours, double rangeStart, double rangeEnd);
00087 
00089   unsigned long GetMTime();
00090 
00092 
00096   vtkSetMacro(ComputeNormals,int);
00097   vtkGetMacro(ComputeNormals,int);
00098   vtkBooleanMacro(ComputeNormals,int);
00100 
00102 
00108   vtkSetMacro(ComputeGradients,int);
00109   vtkGetMacro(ComputeGradients,int);
00110   vtkBooleanMacro(ComputeGradients,int);
00112 
00114 
00115   vtkSetMacro(ComputeScalars,int);
00116   vtkGetMacro(ComputeScalars,int);
00117   vtkBooleanMacro(ComputeScalars,int);
00119 
00121 
00122   vtkSetMacro(UseScalarTree,int);
00123   vtkGetMacro(UseScalarTree,int);
00124   vtkBooleanMacro(UseScalarTree,int);
00126 
00128 
00130   void SetLocator(vtkIncrementalPointLocator *locator);
00131   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00133 
00136   void CreateDefaultLocator();
00137 
00138 protected:
00139   vtkMarchingContourFilter();
00140   ~vtkMarchingContourFilter();
00141 
00142   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00143   virtual int FillInputPortInformation(int port, vtkInformation *info);
00144 
00145   vtkContourValues *ContourValues;
00146   int ComputeNormals;
00147   int ComputeGradients;
00148   int ComputeScalars;
00149   vtkIncrementalPointLocator *Locator;
00150   int UseScalarTree;
00151   vtkScalarTree *ScalarTree;
00152   
00153   //special contouring for structured points
00154   void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output); 
00155   //special contouring for image data
00156   void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output);
00157   //default if not structured data
00158   void DataSetContour(vtkDataSet *input, vtkPolyData *output);
00159 private:
00160   vtkMarchingContourFilter(const vtkMarchingContourFilter&);  // Not implemented.
00161   void operator=(const vtkMarchingContourFilter&);  // Not implemented.
00162 };
00163 
00165 
00167 inline void vtkMarchingContourFilter::SetValue(int i, double value)
00168 {
00169   this->ContourValues->SetValue(i,value);
00170 }
00172 
00174 
00175 inline double vtkMarchingContourFilter::GetValue(int i)
00176 {
00177   return this->ContourValues->GetValue(i);
00178 }
00180 
00182 
00184 inline double *vtkMarchingContourFilter::GetValues()
00185 {
00186   return this->ContourValues->GetValues();
00187 }
00189 
00191 
00194 inline void vtkMarchingContourFilter::GetValues(double *contourValues)
00195 {
00196   this->ContourValues->GetValues(contourValues);
00197 }
00199 
00201 
00204 inline void vtkMarchingContourFilter::SetNumberOfContours(int number)
00205 {
00206   this->ContourValues->SetNumberOfContours(number);
00207 }
00209 
00211 
00212 inline int vtkMarchingContourFilter::GetNumberOfContours()
00213 {
00214   return this->ContourValues->GetNumberOfContours();
00215 }
00217 
00219 
00221 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
00222                                                      double range[2])
00223 {
00224   this->ContourValues->GenerateValues(numContours, range);
00225 }
00227 
00229 
00231 inline void vtkMarchingContourFilter::GenerateValues(int numContours,
00232                                                      double rangeStart,
00233                                                      double rangeEnd)
00234 {
00235   this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
00236 }
00238 
00239 #endif