VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
99 #include "vtkFiltersCoreModule.h" // For export macro
101 
102 class vtkIdList;
103 class vtkPointLocator;
104 class vtkPointSet;
105 class vtkPoints;
106 class vtkTetraArray;
108 
109 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
110 {
111 public:
113  void PrintSelf(ostream& os, vtkIndent indent);
114 
117  static vtkDelaunay3D *New();
118 
120 
124  vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
125  vtkGetMacro(Alpha,double);
127 
129 
132  vtkSetClampMacro(Tolerance,double,0.0,1.0);
133  vtkGetMacro(Tolerance,double);
135 
137 
139  vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
140  vtkGetMacro(Offset,double);
142 
144 
148  vtkSetMacro(BoundingTriangulation,int);
149  vtkGetMacro(BoundingTriangulation,int);
150  vtkBooleanMacro(BoundingTriangulation,int);
152 
154 
156  void SetLocator(vtkIncrementalPointLocator *locator);
157  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
159 
162  void CreateDefaultLocator();
163 
165 
175  vtkUnstructuredGrid *InitPointInsertion(double center[3], double length,
176  vtkIdType numPts, vtkPoints* &pts);
178 
180 
189  void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
190  vtkIdType id, double x[3], vtkIdList *holeTetras);
192 
197  void EndPointInsertion();
198 
200  unsigned long GetMTime();
201 
202 protected:
203  vtkDelaunay3D();
204  ~vtkDelaunay3D();
205 
206  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
207 
208  double Alpha;
209  double Tolerance;
211  double Offset;
212 
213  vtkIncrementalPointLocator *Locator; //help locate points faster
214 
215  vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
216  int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
217  int depth);
218  int InSphere(double x[3], vtkIdType tetraId);
219  void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
220  vtkIdType tetraId);
221 
222  int NumberOfDuplicatePoints; //keep track of bad data
224 
225  // Keep track of number of references to points to avoid new/delete calls
227 
228  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
229  vtkIdList *tetras, vtkIdList *faces,
230  vtkIncrementalPointLocator *Locator);
231 
232  virtual int FillInputPortInformation(int, vtkInformation*);
233 private: //members added for performance
234  vtkIdList *Tetras; //used in InsertPoint
235  vtkIdList *Faces; //used in InsertPoint
236  vtkIdList *BoundaryPts; //used by InsertPoint
237  vtkIdList *CheckedTetras; //used by InsertPoint
238  vtkIdList *NeiTetras; //used by InsertPoint
239 
240 private:
241  vtkDelaunay3D(const vtkDelaunay3D&); // Not implemented.
242  void operator=(const vtkDelaunay3D&); // Not implemented.
243 };
244 
245 #endif
246 
247 
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
int NumberOfDuplicatePoints
int NumberOfDegeneracies
virtual int FillInputPortInformation(int port, vtkInformation *info)
create 3D Delaunay triangulation of input points
vtkIncrementalPointLocator * Locator
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only unstructured grid as output.
vtkTetraArray * TetraArray
int BoundingTriangulation