Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

patented/vtkImageMarchingCubes.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageMarchingCubes.h,v $
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010     THIS CLASS IS PATENTED UNDER UNITED STATES PATENT NUMBER 4,710,876
00011     "System and Method for the Display of Surface Structures Contained
00012     Within The Interior Region of a Solid body".
00013     Application of this software for commercial purposes requires 
00014     a license grant from GE. Contact:
00015         Jerald Roehling
00016         GE Licensing
00017         One Independence Way
00018         PO Box 2023
00019         Princeton, N.J. 08540
00020         phone 609-734-9823
00021         e-mail:[email protected]
00022     for more information.
00023 
00024 Redistribution and use in source and binary forms, with or without
00025 modification, are permitted provided that the following conditions are met:
00026 
00027  * Redistributions of source code must retain the above copyright notice,
00028    this list of conditions and the following disclaimer.
00029 
00030  * Redistributions in binary form must reproduce the above copyright notice,
00031    this list of conditions and the following disclaimer in the documentation
00032    and/or other materials provided with the distribution.
00033 
00034  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00035    of any contributors may be used to endorse or promote products derived
00036    from this software without specific prior written permission.
00037 
00038  * Modified source versions must be plainly marked as such, and must not be
00039    misrepresented as being the original software.
00040 
00041 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00042 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00043 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00044 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00045 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00046 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00047 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00048 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00049 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00050 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00051 
00052 =========================================================================*/
00080 #ifndef __vtkImageMarchingCubes_h
00081 #define __vtkImageMarchingCubes_h
00082 
00083 #include "vtkImageData.h"
00084 #include "vtkPolyDataSource.h"
00085 #include "vtkContourValues.h"
00086 
00087 class VTK_EXPORT vtkImageMarchingCubes : public vtkPolyDataSource
00088 {
00089 public:
00090   static vtkImageMarchingCubes *New();
00091   vtkTypeMacro(vtkImageMarchingCubes,vtkPolyDataSource);
00092   void PrintSelf(ostream& os, vtkIndent indent);
00093   
00095   void SetInput(vtkImageData *input);
00096   vtkImageData *GetInput();
00097   
00098   // Methods to set contour values
00099   void SetValue(int i, float value);
00100   float GetValue(int i);
00101   float *GetValues();
00102   void GetValues(float *contourValues);
00103   void SetNumberOfContours(int number);
00104   int GetNumberOfContours();
00105   void GenerateValues(int numContours, float range[2]);
00106   void GenerateValues(int numContours, float rangeStart, float rangeEnd);
00107 
00108   // Because we delegate to vtkContourValues & refer to vtkImplicitFunction
00109   unsigned long int GetMTime();
00110 
00112   vtkSetMacro(ComputeScalars, int);
00113   vtkGetMacro(ComputeScalars, int);
00114   vtkBooleanMacro(ComputeScalars, int);
00115   
00120   vtkSetMacro(ComputeNormals, int);
00121   vtkGetMacro(ComputeNormals, int);
00122   vtkBooleanMacro(ComputeNormals, int);
00123   
00130   vtkSetMacro(ComputeGradients, int);
00131   vtkGetMacro(ComputeGradients, int);
00132   vtkBooleanMacro(ComputeGradients, int);
00133   
00134   // Should be protected, but the templated functions need these
00135   int ComputeScalars;
00136   int ComputeNormals;
00137   int ComputeGradients;
00138   int NeedGradients;
00139 
00140   vtkCellArray *Triangles;
00141   vtkScalars *Scalars;
00142   vtkPoints *Points;
00143   vtkNormals *Normals;
00144   vtkVectors *Gradients;
00145   
00146   int GetLocatorPoint(int cellX, int cellY, int edge);
00147   void AddLocatorPoint(int cellX, int cellY, int edge, int ptId);
00148   void IncrementLocatorZ();
00149 
00150   void Update();
00151   
00155   vtkSetMacro(InputMemoryLimit, int);
00156   vtkGetMacro(InputMemoryLimit, int);
00157 
00158 protected:
00159   vtkImageMarchingCubes();
00160   ~vtkImageMarchingCubes();
00161   vtkImageMarchingCubes(const vtkImageMarchingCubes&) {};
00162   void operator=(const vtkImageMarchingCubes&) {};
00163 
00164   int NumberOfSlicesPerChunk;
00165   int InputMemoryLimit;
00166 
00167   vtkContourValues *ContourValues;
00168    
00169   int *LocatorPointIds;
00170   int LocatorDimX;
00171   int LocatorDimY;
00172   int LocatorMinX;
00173   int LocatorMinY;
00174   
00175   void Execute();
00176 
00177   void March(vtkImageData *inData, int chunkMin, int chunkMax,
00178              int numContours, float *values);
00179   void InitializeLocator(int min0, int max0, int min1, int max1);
00180   void DeleteLocator();
00181   int *GetLocatorPointer(int cellX, int cellY, int edge);
00182 };
00183 
00186 inline void vtkImageMarchingCubes::SetValue(int i, float value)
00187 {this->ContourValues->SetValue(i,value);}
00188 
00190 inline float vtkImageMarchingCubes::GetValue(int i)
00191 {return this->ContourValues->GetValue(i);}
00192 
00195 inline float *vtkImageMarchingCubes::GetValues()
00196 {return this->ContourValues->GetValues();}
00197 
00201 inline void vtkImageMarchingCubes::GetValues(float *contourValues)
00202 {this->ContourValues->GetValues(contourValues);}
00203 
00207 inline void vtkImageMarchingCubes::SetNumberOfContours(int number)
00208 {this->ContourValues->SetNumberOfContours(number);}
00209 
00211 inline int vtkImageMarchingCubes::GetNumberOfContours()
00212 {return this->ContourValues->GetNumberOfContours();}
00213 
00216 inline void vtkImageMarchingCubes::GenerateValues(int numContours, float range[2])
00217 {this->ContourValues->GenerateValues(numContours, range);}
00218 
00221 inline void vtkImageMarchingCubes::GenerateValues(int numContours, float
00222                                                  rangeStart, float rangeEnd)
00223 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00224 
00225 #endif
00226 
00227 
00228 

Generated on Wed Nov 21 12:27:09 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001