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

dox/Graphics/vtkDelaunay3D.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkDelaunay3D.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 =========================================================================*/ 00094 #ifndef __vtkDelaunay3D_h 00095 #define __vtkDelaunay3D_h 00096 00097 #include "vtkUnstructuredGridSource.h" 00098 00099 class vtkIdList; 00100 class vtkPointLocator; 00101 class vtkPointSet; 00102 class vtkPoints; 00103 class vtkTetraArray; 00104 00105 class VTK_GRAPHICS_EXPORT vtkDelaunay3D : public vtkUnstructuredGridSource 00106 { 00107 public: 00108 vtkTypeRevisionMacro(vtkDelaunay3D,vtkUnstructuredGridSource); 00109 void PrintSelf(ostream& os, vtkIndent indent); 00110 00113 static vtkDelaunay3D *New(); 00114 00116 00120 vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX); 00121 vtkGetMacro(Alpha,double); 00123 00125 00128 vtkSetClampMacro(Tolerance,double,0.0,1.0); 00129 vtkGetMacro(Tolerance,double); 00131 00133 00135 vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX); 00136 vtkGetMacro(Offset,double); 00138 00140 00144 vtkSetMacro(BoundingTriangulation,int); 00145 vtkGetMacro(BoundingTriangulation,int); 00146 vtkBooleanMacro(BoundingTriangulation,int); 00148 00150 00152 void SetLocator(vtkPointLocator *locator); 00153 vtkGetObjectMacro(Locator,vtkPointLocator); 00155 00158 void CreateDefaultLocator(); 00159 00161 00171 vtkUnstructuredGrid *InitPointInsertion(double center[3], double length, 00172 vtkIdType numPts, vtkPoints* &pts); 00174 00176 00185 void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points, 00186 vtkIdType id, double x[3], vtkIdList *holeTetras); 00188 00193 void EndPointInsertion(); 00194 00196 unsigned long GetMTime(); 00197 00199 00200 virtual void SetInput(vtkPointSet *input); 00201 vtkPointSet *GetInput(); 00203 00204 protected: 00205 vtkDelaunay3D(); 00206 ~vtkDelaunay3D(); 00207 00208 void Execute(); 00209 00210 double Alpha; 00211 double Tolerance; 00212 int BoundingTriangulation; 00213 double Offset; 00214 00215 vtkPointLocator *Locator; //help locate points faster 00216 00217 vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors 00218 int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId, 00219 int depth); 00220 int InSphere(double x[3], vtkIdType tetraId); 00221 void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts, 00222 vtkIdType tetraId); 00223 00224 int NumberOfDuplicatePoints; //keep track of bad data 00225 int NumberOfDegeneracies; 00226 00227 // Keep track of number of references to points to avoid new/delete calls 00228 int *References; 00229 00230 vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh, 00231 vtkIdList *tetras, vtkIdList *faces, 00232 vtkPointLocator *Locator); 00233 00234 private: //members added for performance 00235 vtkIdList *Tetras; //used in InsertPoint 00236 vtkIdList *Faces; //used in InsertPoint 00237 vtkIdList *BoundaryPts; //used by InsertPoint 00238 vtkIdList *CheckedTetras; //used by InsertPoint 00239 vtkIdList *NeiTetras; //used by InsertPoint 00240 00241 private: 00242 vtkDelaunay3D(const vtkDelaunay3D&); // Not implemented. 00243 void operator=(const vtkDelaunay3D&); // Not implemented. 00244 }; 00245 00246 #endif 00247 00248