VTK
dox/Filters/Core/vtkDelaunay3D.h
Go to the documentation of this file.
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 =========================================================================*/
00096 #ifndef __vtkDelaunay3D_h
00097 #define __vtkDelaunay3D_h
00098 
00099 #include "vtkFiltersCoreModule.h" // For export macro
00100 #include "vtkUnstructuredGridAlgorithm.h"
00101 
00102 class vtkIdList;
00103 class vtkPointLocator;
00104 class vtkPointSet;
00105 class vtkPoints;
00106 class vtkTetraArray;
00107 class vtkIncrementalPointLocator;
00108 
00109 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
00110 {
00111 public:
00112   vtkTypeMacro(vtkDelaunay3D,vtkUnstructuredGridAlgorithm);
00113   void PrintSelf(ostream& os, vtkIndent indent);
00114 
00117   static vtkDelaunay3D *New();
00118 
00120 
00124   vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
00125   vtkGetMacro(Alpha,double);
00127 
00129 
00132   vtkSetClampMacro(Tolerance,double,0.0,1.0);
00133   vtkGetMacro(Tolerance,double);
00135 
00137 
00139   vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
00140   vtkGetMacro(Offset,double);
00142 
00144 
00148   vtkSetMacro(BoundingTriangulation,int);
00149   vtkGetMacro(BoundingTriangulation,int);
00150   vtkBooleanMacro(BoundingTriangulation,int);
00152 
00154 
00156   void SetLocator(vtkIncrementalPointLocator *locator);
00157   vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
00159 
00162   void CreateDefaultLocator();
00163 
00165 
00175   vtkUnstructuredGrid *InitPointInsertion(double center[3], double length,
00176                                           vtkIdType numPts, vtkPoints* &pts);
00178 
00180 
00189   void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
00190                    vtkIdType id, double x[3], vtkIdList *holeTetras);
00192 
00197   void EndPointInsertion();
00198 
00200   unsigned long GetMTime();
00201 
00203 
00206   vtkSetMacro(OutputPointsPrecision,int);
00207   vtkGetMacro(OutputPointsPrecision,int);
00209 
00210 protected:
00211   vtkDelaunay3D();
00212   ~vtkDelaunay3D();
00213 
00214   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00215 
00216   double Alpha;
00217   double Tolerance;
00218   int BoundingTriangulation;
00219   double Offset;
00220   int OutputPointsPrecision;
00221 
00222   vtkIncrementalPointLocator *Locator;  //help locate points faster
00223 
00224   vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
00225   int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
00226                 int depth);
00227   int InSphere(double x[3], vtkIdType tetraId);
00228   void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
00229                    vtkIdType tetraId);
00230 
00231   int NumberOfDuplicatePoints; //keep track of bad data
00232   int NumberOfDegeneracies;
00233 
00234   // Keep track of number of references to points to avoid new/delete calls
00235   int *References;
00236 
00237   vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
00238                                vtkIdList *tetras, vtkIdList *faces,
00239                                vtkIncrementalPointLocator *Locator);
00240 
00241   virtual int FillInputPortInformation(int, vtkInformation*);
00242 private: //members added for performance
00243   vtkIdList *Tetras; //used in InsertPoint
00244   vtkIdList *Faces;  //used in InsertPoint
00245   vtkIdList *BoundaryPts; //used by InsertPoint
00246   vtkIdList *CheckedTetras; //used by InsertPoint
00247   vtkIdList *NeiTetras; //used by InsertPoint
00248 
00249 private:
00250   vtkDelaunay3D(const vtkDelaunay3D&);  // Not implemented.
00251   void operator=(const vtkDelaunay3D&);  // Not implemented.
00252 };
00253 
00254 #endif
00255 
00256