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 =========================================================================*/ 00099 #ifndef vtkDelaunay3D_h 00100 #define vtkDelaunay3D_h 00101 00102 #include "vtkFiltersCoreModule.h" // For export macro 00103 #include "vtkUnstructuredGridAlgorithm.h" 00104 00105 class vtkIdList; 00106 class vtkPointLocator; 00107 class vtkPointSet; 00108 class vtkPoints; 00109 class vtkTetraArray; 00110 class vtkIncrementalPointLocator; 00111 00112 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm 00113 { 00114 public: 00115 vtkTypeMacro(vtkDelaunay3D,vtkUnstructuredGridAlgorithm); 00116 void PrintSelf(ostream& os, vtkIndent indent); 00117 00120 static vtkDelaunay3D *New(); 00121 00123 00131 vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX); 00132 vtkGetMacro(Alpha,double); 00134 00136 00138 vtkSetMacro(AlphaTets,int); 00139 vtkGetMacro(AlphaTets,int); 00140 vtkBooleanMacro(AlphaTets,int); 00142 00144 00146 vtkSetMacro(AlphaTris,int); 00147 vtkGetMacro(AlphaTris,int); 00148 vtkBooleanMacro(AlphaTris,int); 00150 00152 00153 vtkSetMacro(AlphaLines,int); 00154 vtkGetMacro(AlphaLines,int); 00155 vtkBooleanMacro(AlphaLines,int); 00157 00159 00161 vtkSetMacro(AlphaVerts,int); 00162 vtkGetMacro(AlphaVerts,int); 00163 vtkBooleanMacro(AlphaVerts,int); 00165 00167 00170 vtkSetClampMacro(Tolerance,double,0.0,1.0); 00171 vtkGetMacro(Tolerance,double); 00173 00175 00177 vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX); 00178 vtkGetMacro(Offset,double); 00180 00182 00186 vtkSetMacro(BoundingTriangulation,int); 00187 vtkGetMacro(BoundingTriangulation,int); 00188 vtkBooleanMacro(BoundingTriangulation,int); 00190 00192 00194 void SetLocator(vtkIncrementalPointLocator *locator); 00195 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator); 00197 00200 void CreateDefaultLocator(); 00201 00203 00213 vtkUnstructuredGrid *InitPointInsertion(double center[3], double length, 00214 vtkIdType numPts, vtkPoints* &pts); 00216 00218 00227 void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points, 00228 vtkIdType id, double x[3], vtkIdList *holeTetras); 00230 00235 void EndPointInsertion(); 00236 00238 unsigned long GetMTime(); 00239 00241 00244 vtkSetMacro(OutputPointsPrecision,int); 00245 vtkGetMacro(OutputPointsPrecision,int); 00247 00248 protected: 00249 vtkDelaunay3D(); 00250 ~vtkDelaunay3D(); 00251 00252 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00253 00254 double Alpha; 00255 int AlphaTets; 00256 int AlphaTris; 00257 int AlphaLines; 00258 int AlphaVerts; 00259 double Tolerance; 00260 int BoundingTriangulation; 00261 double Offset; 00262 int OutputPointsPrecision; 00263 00264 vtkIncrementalPointLocator *Locator; //help locate points faster 00265 00266 vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors 00267 int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId, 00268 int depth); 00269 int InSphere(double x[3], vtkIdType tetraId); 00270 void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts, 00271 vtkIdType tetraId); 00272 00273 int NumberOfDuplicatePoints; //keep track of bad data 00274 int NumberOfDegeneracies; 00275 00276 // Keep track of number of references to points to avoid new/delete calls 00277 int *References; 00278 00279 vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh, 00280 vtkIdList *tetras, vtkIdList *faces, 00281 vtkIncrementalPointLocator *Locator); 00282 00283 virtual int FillInputPortInformation(int, vtkInformation*); 00284 private: //members added for performance 00285 vtkIdList *Tetras; //used in InsertPoint 00286 vtkIdList *Faces; //used in InsertPoint 00287 vtkIdList *BoundaryPts; //used by InsertPoint 00288 vtkIdList *CheckedTetras; //used by InsertPoint 00289 vtkIdList *NeiTetras; //used by InsertPoint 00290 00291 private: 00292 vtkDelaunay3D(const vtkDelaunay3D&); // Not implemented. 00293 void operator=(const vtkDelaunay3D&); // Not implemented. 00294 }; 00295 00296 #endif