VTK
vtkDelaunay3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDelaunay3D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
96 #ifndef __vtkDelaunay3D_h
97 #define __vtkDelaunay3D_h
98 
100 
101 class vtkIdList;
102 class vtkPointLocator;
103 class vtkPointSet;
104 class vtkPoints;
105 class vtkTetraArray;
107 
109 {
110 public:
112  void PrintSelf(ostream& os, vtkIndent indent);
113 
116  static vtkDelaunay3D *New();
117 
119 
123  vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
124  vtkGetMacro(Alpha,double);
126 
128 
131  vtkSetClampMacro(Tolerance,double,0.0,1.0);
132  vtkGetMacro(Tolerance,double);
134 
136 
138  vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
139  vtkGetMacro(Offset,double);
141 
143 
147  vtkSetMacro(BoundingTriangulation,int);
148  vtkGetMacro(BoundingTriangulation,int);
149  vtkBooleanMacro(BoundingTriangulation,int);
151 
153 
155  void SetLocator(vtkIncrementalPointLocator *locator);
156  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
158 
161  void CreateDefaultLocator();
162 
164 
174  vtkUnstructuredGrid *InitPointInsertion(double center[3], double length,
175  vtkIdType numPts, vtkPoints* &pts);
177 
179 
188  void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
189  vtkIdType id, double x[3], vtkIdList *holeTetras);
191 
196  void EndPointInsertion();
197 
199  unsigned long GetMTime();
200 
201 protected:
202  vtkDelaunay3D();
203  ~vtkDelaunay3D();
204 
206 
207  double Alpha;
208  double Tolerance;
210  double Offset;
211 
212  vtkIncrementalPointLocator *Locator; //help locate points faster
213 
214  vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
215  int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
216  int depth);
217  int InSphere(double x[3], vtkIdType tetraId);
218  void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
219  vtkIdType tetraId);
220 
221  int NumberOfDuplicatePoints; //keep track of bad data
223 
224  // Keep track of number of references to points to avoid new/delete calls
226 
227  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
228  vtkIdList *tetras, vtkIdList *faces,
229  vtkIncrementalPointLocator *Locator);
230 
231  virtual int FillInputPortInformation(int, vtkInformation*);
232 private: //members added for performance
233  vtkIdList *Tetras; //used in InsertPoint
234  vtkIdList *Faces; //used in InsertPoint
235  vtkIdList *BoundaryPts; //used by InsertPoint
236  vtkIdList *CheckedTetras; //used by InsertPoint
237  vtkIdList *NeiTetras; //used by InsertPoint
238 
239 private:
240  vtkDelaunay3D(const vtkDelaunay3D&); // Not implemented.
241  void operator=(const vtkDelaunay3D&); // Not implemented.
242 };
243 
244 #endif
245 
246