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 =========================================================================*/
94 #ifndef vtkDelaunay3D_h
95 #define vtkDelaunay3D_h
96 
97 #include "vtkFiltersCoreModule.h" // For export macro
99 
100 class vtkIdList;
101 class vtkPointLocator;
102 class vtkPointSet;
103 class vtkPoints;
104 class vtkTetraArray;
106 
107 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
108 {
109 public:
111  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
112 
117  static vtkDelaunay3D *New();
118 
120 
129  vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
130  vtkGetMacro(Alpha,double);
132 
134 
137  vtkSetMacro(AlphaTets,int);
138  vtkGetMacro(AlphaTets,int);
139  vtkBooleanMacro(AlphaTets,int);
141 
143 
146  vtkSetMacro(AlphaTris,int);
147  vtkGetMacro(AlphaTris,int);
148  vtkBooleanMacro(AlphaTris,int);
150 
152 
155  vtkSetMacro(AlphaLines,int);
156  vtkGetMacro(AlphaLines,int);
157  vtkBooleanMacro(AlphaLines,int);
159 
161 
164  vtkSetMacro(AlphaVerts,int);
165  vtkGetMacro(AlphaVerts,int);
166  vtkBooleanMacro(AlphaVerts,int);
168 
170 
175  vtkSetClampMacro(Tolerance,double,0.0,1.0);
176  vtkGetMacro(Tolerance,double);
178 
180 
184  vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
185  vtkGetMacro(Offset,double);
187 
189 
195  vtkSetMacro(BoundingTriangulation,int);
196  vtkGetMacro(BoundingTriangulation,int);
197  vtkBooleanMacro(BoundingTriangulation,int);
199 
201 
205  void SetLocator(vtkIncrementalPointLocator *locator);
206  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
208 
213  void CreateDefaultLocator();
214 
227  vtkUnstructuredGrid *InitPointInsertion(double center[3], double length,
228  vtkIdType numPts, vtkPoints* &pts);
229 
240  void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
241  vtkIdType id, double x[3], vtkIdList *holeTetras);
242 
249  void EndPointInsertion();
250 
254  vtkMTimeType GetMTime() VTK_OVERRIDE;
255 
257 
262  vtkSetMacro(OutputPointsPrecision,int);
263  vtkGetMacro(OutputPointsPrecision,int);
265 
266 protected:
267  vtkDelaunay3D();
268  ~vtkDelaunay3D() VTK_OVERRIDE;
269 
270  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
271 
272  double Alpha;
273  int AlphaTets;
274  int AlphaTris;
275  int AlphaLines;
276  int AlphaVerts;
277  double Tolerance;
278  int BoundingTriangulation;
279  double Offset;
280  int OutputPointsPrecision;
281 
282  vtkIncrementalPointLocator *Locator; //help locate points faster
283 
284  vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
285  int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
286  int depth);
287  int InSphere(double x[3], vtkIdType tetraId);
288  void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
289  vtkIdType tetraId);
290 
291  int NumberOfDuplicatePoints; //keep track of bad data
292  int NumberOfDegeneracies;
293 
294  // Keep track of number of references to points to avoid new/delete calls
295  int *References;
296 
297  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
298  vtkIdList *tetras, vtkIdList *faces,
299  vtkIncrementalPointLocator *Locator);
300 
301  int FillInputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
302 private: //members added for performance
303  vtkIdList *Tetras; //used in InsertPoint
304  vtkIdList *Faces; //used in InsertPoint
305  vtkIdList *CheckedTetras; //used by InsertPoint
306 
307 private:
308  vtkDelaunay3D(const vtkDelaunay3D&) VTK_DELETE_FUNCTION;
309  void operator=(const vtkDelaunay3D&) VTK_DELETE_FUNCTION;
310 };
311 
312 #endif
#define VTK_DOUBLE_MAX
Definition: vtkType.h:167
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:39
create 3D Delaunay triangulation of input points
int vtkIdType
Definition: vtkType.h:345
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
dataset represents arbitrary combinations of all possible cell types
virtual vtkMTimeType GetMTime()
Return this object's modified time.
Superclass for algorithms that produce only unstructured grid as output.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represent and manipulate 3D points
Definition: vtkPoints.h:33