Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDelaunay3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDelaunay3D.h,v $
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 =========================================================================*/
00105 #ifndef __vtkDelaunay3D_h
00106 #define __vtkDelaunay3D_h
00107 
00108 #include "vtkUnstructuredGridSource.h"
00109 
00110 class vtkIdList;
00111 class vtkPointLocator;
00112 class vtkPointSet;
00113 class vtkPoints;
00114 class vtkTetraArray;
00115 
00116 class VTK_GRAPHICS_EXPORT vtkDelaunay3D : public vtkUnstructuredGridSource
00117 {
00118 public:
00119   vtkTypeRevisionMacro(vtkDelaunay3D,vtkUnstructuredGridSource);
00120   void PrintSelf(ostream& os, vtkIndent indent);
00121 
00124   static vtkDelaunay3D *New();
00125 
00127 
00131   vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
00132   vtkGetMacro(Alpha,double);
00134 
00136 
00139   vtkSetClampMacro(Tolerance,double,0.0,1.0);
00140   vtkGetMacro(Tolerance,double);
00142 
00144 
00146   vtkSetClampMacro(Offset,double,2.5,VTK_DOUBLE_MAX);
00147   vtkGetMacro(Offset,double);
00149 
00151 
00155   vtkSetMacro(BoundingTriangulation,int);
00156   vtkGetMacro(BoundingTriangulation,int);
00157   vtkBooleanMacro(BoundingTriangulation,int);
00159 
00161 
00163   void SetLocator(vtkPointLocator *locator);
00164   vtkGetObjectMacro(Locator,vtkPointLocator);
00166 
00169   void CreateDefaultLocator();
00170 
00172 
00182   vtkUnstructuredGrid *InitPointInsertion(double center[3], double length, 
00183                                           vtkIdType numPts, vtkPoints* &pts);
00185 
00187 
00196   void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
00197                    vtkIdType id, double x[3], vtkIdList *holeTetras);
00199 
00204   void EndPointInsertion();
00205 
00207   unsigned long GetMTime();
00208 
00210 
00211   virtual void SetInput(vtkPointSet *input);
00212   vtkPointSet *GetInput();
00214 
00215 protected:
00216   vtkDelaunay3D();
00217   ~vtkDelaunay3D();
00218 
00219   void Execute();
00220 
00221   double Alpha;
00222   double Tolerance;
00223   int BoundingTriangulation;
00224   double Offset;
00225 
00226   vtkPointLocator *Locator;  //help locate points faster
00227   
00228   vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
00229   int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
00230                 int depth);
00231   int InSphere(double x[3], vtkIdType tetraId);
00232   void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
00233                    vtkIdType tetraId);
00234 
00235   int NumberOfDuplicatePoints; //keep track of bad data
00236   int NumberOfDegeneracies;
00237 
00238   // Keep track of number of references to points to avoid new/delete calls
00239   int *References;
00240 
00241   vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh,
00242                                vtkIdList *tetras, vtkIdList *faces, 
00243                                vtkPointLocator *Locator);
00244 
00245   virtual int FillInputPortInformation(int, vtkInformation*);
00246 private: //members added for performance
00247   vtkIdList *Tetras; //used in InsertPoint
00248   vtkIdList *Faces;  //used in InsertPoint
00249   vtkIdList *BoundaryPts; //used by InsertPoint
00250   vtkIdList *CheckedTetras; //used by InsertPoint
00251   vtkIdList *NeiTetras; //used by InsertPoint
00252 
00253 private:
00254   vtkDelaunay3D(const vtkDelaunay3D&);  // Not implemented.
00255   void operator=(const vtkDelaunay3D&);  // Not implemented.
00256 };
00257 
00258 #endif
00259 
00260