VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkDelaunay3D.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 =========================================================================*/ 00096 #ifndef __vtkDelaunay3D_h 00097 #define __vtkDelaunay3D_h 00098 00099 #include "vtkFiltersCoreModule.h" // For export macro 00100 #include "vtkUnstructuredGridAlgorithm.h" 00101 00102 class vtkIdList; 00103 class vtkPointLocator; 00104 class vtkPointSet; 00105 class vtkPoints; 00106 class vtkTetraArray; 00107 class vtkIncrementalPointLocator; 00108 00109 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm 00110 { 00111 public: 00112 vtkTypeMacro(vtkDelaunay3D,vtkUnstructuredGridAlgorithm); 00113 void PrintSelf(ostream& os, vtkIndent indent); 00114 00117 static vtkDelaunay3D *New(); 00118 00120 00124 vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX); 00125 vtkGetMacro(Alpha,double); 00127 00129 00132 vtkSetClampMacro(Tolerance,double,0.0,1.0); 00133 vtkGetMacro(Tolerance,double); 00135 00137 00139 vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX); 00140 vtkGetMacro(Offset,double); 00142 00144 00148 vtkSetMacro(BoundingTriangulation,int); 00149 vtkGetMacro(BoundingTriangulation,int); 00150 vtkBooleanMacro(BoundingTriangulation,int); 00152 00154 00156 void SetLocator(vtkIncrementalPointLocator *locator); 00157 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00159 00162 void CreateDefaultLocator(); 00163 00165 00175 vtkUnstructuredGrid *InitPointInsertion(double center[3], double length, 00176 vtkIdType numPts, vtkPoints* &pts); 00178 00180 00189 void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points, 00190 vtkIdType id, double x[3], vtkIdList *holeTetras); 00192 00197 void EndPointInsertion(); 00198 00200 unsigned long GetMTime(); 00201 00202 protected: 00203 vtkDelaunay3D(); 00204 ~vtkDelaunay3D(); 00205 00206 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00207 00208 double Alpha; 00209 double Tolerance; 00210 int BoundingTriangulation; 00211 double Offset; 00212 00213 vtkIncrementalPointLocator *Locator; //help locate points faster 00214 00215 vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors 00216 int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId, 00217 int depth); 00218 int InSphere(double x[3], vtkIdType tetraId); 00219 void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts, 00220 vtkIdType tetraId); 00221 00222 int NumberOfDuplicatePoints; //keep track of bad data 00223 int NumberOfDegeneracies; 00224 00225 // Keep track of number of references to points to avoid new/delete calls 00226 int *References; 00227 00228 vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh, 00229 vtkIdList *tetras, vtkIdList *faces, 00230 vtkIncrementalPointLocator *Locator); 00231 00232 virtual int FillInputPortInformation(int, vtkInformation*); 00233 private: //members added for performance 00234 vtkIdList *Tetras; //used in InsertPoint 00235 vtkIdList *Faces; //used in InsertPoint 00236 vtkIdList *BoundaryPts; //used by InsertPoint 00237 vtkIdList *CheckedTetras; //used by InsertPoint 00238 vtkIdList *NeiTetras; //used by InsertPoint 00239 00240 private: 00241 vtkDelaunay3D(const vtkDelaunay3D&); // Not implemented. 00242 void operator=(const vtkDelaunay3D&); // Not implemented. 00243 }; 00244 00245 #endif 00246 00247