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 =========================================================================*/
99 #ifndef vtkDelaunay3D_h
100 #define vtkDelaunay3D_h
101 
102 #include "vtkFiltersCoreModule.h" // For export macro
104 
105 class vtkIdList;
106 class vtkPointLocator;
107 class vtkPointSet;
108 class vtkPoints;
109 class vtkTetraArray;
111 
113 {
114 public:
116  void PrintSelf(ostream& os, vtkIndent indent);
117 
120  static vtkDelaunay3D *New();
121 
123 
131  vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
132  vtkGetMacro(Alpha,double);
134 
136 
138  vtkSetMacro(AlphaTets,int);
139  vtkGetMacro(AlphaTets,int);
140  vtkBooleanMacro(AlphaTets,int);
142 
144 
146  vtkSetMacro(AlphaTris,int);
147  vtkGetMacro(AlphaTris,int);
148  vtkBooleanMacro(AlphaTris,int);
150 
152 
153  vtkSetMacro(AlphaLines,int);
154  vtkGetMacro(AlphaLines,int);
155  vtkBooleanMacro(AlphaLines,int);
157 
159 
161  vtkSetMacro(AlphaVerts,int);
162  vtkGetMacro(AlphaVerts,int);
163  vtkBooleanMacro(AlphaVerts,int);
165 
167 
170  vtkSetClampMacro(Tolerance,double,0.0,1.0);
171  vtkGetMacro(Tolerance,double);
173 
175 
177  vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
178  vtkGetMacro(Offset,double);
180 
182 
186  vtkSetMacro(BoundingTriangulation,int);
187  vtkGetMacro(BoundingTriangulation,int);
188  vtkBooleanMacro(BoundingTriangulation,int);
190 
192 
194  void SetLocator(vtkIncrementalPointLocator *locator);
195  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
197 
200  void CreateDefaultLocator();
201 
203 
213  vtkUnstructuredGrid *InitPointInsertion(double center[3], double length,
214  vtkIdType numPts, vtkPoints* &pts);
216 
218 
227  void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
228  vtkIdType id, double x[3], vtkIdList *holeTetras);
230 
235  void EndPointInsertion();
236 
238  unsigned long GetMTime();
239 
241 
244  vtkSetMacro(OutputPointsPrecision,int);
245  vtkGetMacro(OutputPointsPrecision,int);
247 
248 protected:
249  vtkDelaunay3D();
250  ~vtkDelaunay3D();
251 
253 
254  double Alpha;
259  double Tolerance;
261  double Offset;
263 
264  vtkIncrementalPointLocator *Locator; //help locate points faster
265 
266  vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
267  int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
268  int depth);
269  int InSphere(double x[3], vtkIdType tetraId);
270  void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
271  vtkIdType tetraId);
272 
273  int NumberOfDuplicatePoints; //keep track of bad data
275 
276  // Keep track of number of references to points to avoid new/delete calls
278 
279  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
280  vtkIdList *tetras, vtkIdList *faces,
281  vtkIncrementalPointLocator *Locator);
282 
283  virtual int FillInputPortInformation(int, vtkInformation*);
284 private: //members added for performance
285  vtkIdList *Tetras; //used in InsertPoint
286  vtkIdList *Faces; //used in InsertPoint
287  vtkIdList *BoundaryPts; //used by InsertPoint
288  vtkIdList *CheckedTetras; //used by InsertPoint
289  vtkIdList *NeiTetras; //used by InsertPoint
290 
291 private:
292  vtkDelaunay3D(const vtkDelaunay3D&); // Not implemented.
293  void operator=(const vtkDelaunay3D&); // Not implemented.
294 };
295 
296 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
#define VTKFILTERSCORE_EXPORT
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
int NumberOfDuplicatePoints
int NumberOfDegeneracies
int OutputPointsPrecision
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:44
virtual int FillInputPortInformation(int port, vtkInformation *info)
create 3D Delaunay triangulation of input points
int vtkIdType
Definition: vtkType.h:275
vtkIncrementalPointLocator * Locator
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
dataset represents arbitrary combinations of all possible cell types
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only unstructured grid as output.
vtkTetraArray * TetraArray
Store zero or more vtkInformation instances.
int BoundingTriangulation
represent and manipulate 3D points
Definition: vtkPoints.h:38