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 
00016         Carl B. Horton
00017         Sr. Counsel, Intellectual Property
00018         3000 N. Grandview Blvd., W-710
00019         Waukesha, WI  53188
00020         Phone:  (262) 513-4022
00021         E-Mail: Carl.Horton@med.ge.com
00022 
00023     for more information.
00024 
00025 Redistribution and use in source and binary forms, with or without
00026 modification, are permitted provided that the following conditions are met:
00027 
00028  * Redistributions of source code must retain the above copyright notice,
00029    this list of conditions and the following disclaimer.
00030 
00031  * Redistributions in binary form must reproduce the above copyright notice,
00032    this list of conditions and the following disclaimer in the documentation
00033    and/or other materials provided with the distribution.
00034 
00035  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00036    of any contributors may be used to endorse or promote products derived
00037    from this software without specific prior written permission.
00038 
00039  * Modified source versions must be plainly marked as such, and must not be
00040    misrepresented as being the original software.
00041 
00042 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00043 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00044 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00045 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00046 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00047 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00048 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00049 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00050 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00051 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00052 
00053 =========================================================================*/
00085 #ifndef __vtkImageMarchingCubes_h
00086 #define __vtkImageMarchingCubes_h
00087 
00088 #include "vtkImageData.h"
00089 #include "vtkPolyDataSource.h"
00090 #include "vtkContourValues.h"
00091 
00092 class vtkFloatArray;
00093 
00094 class VTK_PATENTED_EXPORT vtkImageMarchingCubes : public vtkPolyDataSource
00095 {
00096 public:
00097   static vtkImageMarchingCubes *New();
00098   vtkTypeMacro(vtkImageMarchingCubes,vtkPolyDataSource);
00099   void PrintSelf(ostream& os, vtkIndent indent);
00100   
00102 
00103   void SetInput(vtkImageData *input);
00104   vtkImageData *GetInput();
00106   
00107   // Methods to set contour values
00108   void SetValue(int i, float value);
00109   float GetValue(int i);
00110   float *GetValues();
00111   void GetValues(float *contourValues);
00112   void SetNumberOfContours(int number);
00113   int GetNumberOfContours();
00114   void GenerateValues(int numContours, float range[2]);
00115   void GenerateValues(int numContours, float rangeStart, float rangeEnd);
00116 
00117   // Because we delegate to vtkContourValues & refer to vtkImplicitFunction
00118   unsigned long int GetMTime();
00119 
00121 
00122   vtkSetMacro(ComputeScalars, int);
00123   vtkGetMacro(ComputeScalars, int);
00124   vtkBooleanMacro(ComputeScalars, int);
00126   
00128 
00132   vtkSetMacro(ComputeNormals, int);
00133   vtkGetMacro(ComputeNormals, int);
00134   vtkBooleanMacro(ComputeNormals, int);
00136   
00138 
00144   vtkSetMacro(ComputeGradients, int);
00145   vtkGetMacro(ComputeGradients, int);
00146   vtkBooleanMacro(ComputeGradients, int);
00148   
00149   // Should be protected, but the templated functions need these
00150   int ComputeScalars;
00151   int ComputeNormals;
00152   int ComputeGradients;
00153   int NeedGradients;
00154 
00155   vtkCellArray *Triangles;
00156   vtkFloatArray *Scalars;
00157   vtkPoints *Points;
00158   vtkFloatArray *Normals;
00159   vtkFloatArray *Gradients;
00160   
00161   int GetLocatorPoint(int cellX, int cellY, int edge);
00162   void AddLocatorPoint(int cellX, int cellY, int edge, int ptId);
00163   void IncrementLocatorZ();
00164 
00165   void Update();
00166   
00168 
00171   vtkSetMacro(InputMemoryLimit, int);
00172   vtkGetMacro(InputMemoryLimit, int);
00174 
00175 protected:
00176   vtkImageMarchingCubes();
00177   ~vtkImageMarchingCubes();
00178 
00179   int NumberOfSlicesPerChunk;
00180   int InputMemoryLimit;
00181 
00182   vtkContourValues *ContourValues;
00183    
00184   int *LocatorPointIds;
00185   int LocatorDimX;
00186   int LocatorDimY;
00187   int LocatorMinX;
00188   int LocatorMinY;
00189   
00190   void Execute();
00191 
00192   void March(vtkImageData *inData, int chunkMin, int chunkMax,
00193              int numContours, float *values);
00194   void InitializeLocator(int min0, int max0, int min1, int max1);
00195   void DeleteLocator();
00196   int *GetLocatorPointer(int cellX, int cellY, int edge);
00197 private:
00198   vtkImageMarchingCubes(const vtkImageMarchingCubes&);  // Not implemented.
00199   void operator=(const vtkImageMarchingCubes&);  // Not implemented.
00200 };
00201 
00204 inline void vtkImageMarchingCubes::SetValue(int i, float value)
00205 {this->ContourValues->SetValue(i,value);}
00206 
00208 
00209 inline float vtkImageMarchingCubes::GetValue(int i)
00210 {return this->ContourValues->GetValue(i);}
00212 
00214 
00216 inline float *vtkImageMarchingCubes::GetValues()
00217 {return this->ContourValues->GetValues();}
00219 
00223 inline void vtkImageMarchingCubes::GetValues(float *contourValues)
00224 {this->ContourValues->GetValues(contourValues);}
00225 
00229 inline void vtkImageMarchingCubes::SetNumberOfContours(int number)
00230 {this->ContourValues->SetNumberOfContours(number);}
00231 
00233 
00234 inline int vtkImageMarchingCubes::GetNumberOfContours()
00235 {return this->ContourValues->GetNumberOfContours();}
00237 
00239 
00241 inline void vtkImageMarchingCubes::GenerateValues(int numContours, float range[2])
00242 {this->ContourValues->GenerateValues(numContours, range);}
00244 
00246 
00248 inline void vtkImageMarchingCubes::GenerateValues(int numContours, float
00249                                                  rangeStart, float rangeEnd)
00250 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
00252 
00253 #endif
00254 
00255 
00256 

Generated on Thu Mar 28 14:19:31 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001