Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Graphics/vtkDelaunay3D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDelaunay3D.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00109 #ifndef __vtkDelaunay3D_h
00110 #define __vtkDelaunay3D_h
00111 
00112 #include "vtkUnstructuredGridSource.h"
00113 
00114 class vtkIdList;
00115 class vtkPointLocator;
00116 class vtkPointSet;
00117 class vtkPoints;
00118 class vtkTetraArray;
00119 
00120 class VTK_GRAPHICS_EXPORT vtkDelaunay3D : public vtkUnstructuredGridSource
00121 {
00122 public:
00123   vtkTypeRevisionMacro(vtkDelaunay3D,vtkUnstructuredGridSource);
00124   void PrintSelf(ostream& os, vtkIndent indent);
00125 
00128   static vtkDelaunay3D *New();
00129 
00131 
00135   vtkSetClampMacro(Alpha,float,0.0,VTK_LARGE_FLOAT);
00136   vtkGetMacro(Alpha,float);
00138 
00140 
00143   vtkSetClampMacro(Tolerance,float,0.0,1.0);
00144   vtkGetMacro(Tolerance,float);
00146 
00148 
00150   vtkSetClampMacro(Offset,float,2.5,VTK_LARGE_FLOAT);
00151   vtkGetMacro(Offset,float);
00153 
00155 
00159   vtkSetMacro(BoundingTriangulation,int);
00160   vtkGetMacro(BoundingTriangulation,int);
00161   vtkBooleanMacro(BoundingTriangulation,int);
00163 
00165 
00167   void SetLocator(vtkPointLocator *locator);
00168   vtkGetObjectMacro(Locator,vtkPointLocator);
00170 
00173   void CreateDefaultLocator();
00174 
00176 
00186   vtkUnstructuredGrid *InitPointInsertion(float center[3], float length, 
00187                                           vtkIdType numPts, vtkPoints* &pts);
00189 
00191 
00200   void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points,
00201                    vtkIdType id, float x[3], vtkIdList *holeTetras);
00203 
00208   void EndPointInsertion();
00209 
00211   unsigned long GetMTime();
00212 
00214 
00215   virtual void SetInput(vtkPointSet *input);
00216   vtkPointSet *GetInput();
00218 
00219 protected:
00220   vtkDelaunay3D();
00221   ~vtkDelaunay3D();
00222 
00223   void Execute();
00224 
00225   float Alpha;
00226   float Tolerance;
00227   int BoundingTriangulation;
00228   float Offset;
00229 
00230   vtkPointLocator *Locator;  //help locate points faster
00231   
00232   vtkTetraArray *TetraArray; //used to keep track of circumspheres/neighbors
00233   int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetId,
00234                 int depth);
00235   int InSphere(double x[3], vtkIdType tetraId);
00236   void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *pts,
00237                    vtkIdType tetraId);
00238 
00239   int NumberOfDuplicatePoints; //keep track of bad data
00240   int NumberOfDegeneracies;
00241 
00242   // Keep track of number of references to points to avoid new/delete calls
00243   int *References;
00244 
00245   vtkIdType FindEnclosingFaces(float x[3], vtkUnstructuredGrid *Mesh,
00246                                vtkIdList *tetras, vtkIdList *faces, 
00247                                vtkPointLocator *Locator);
00248   
00249 private: //members added for performance
00250   vtkIdList *Tetras; //used in InsertPoint
00251   vtkIdList *Faces;  //used in InsertPoint
00252   vtkIdList *BoundaryPts; //used by InsertPoint
00253   vtkIdList *CheckedTetras; //used by InsertPoint
00254   vtkIdList *NeiTetras; //used by InsertPoint
00255 
00256 private:
00257   vtkDelaunay3D(const vtkDelaunay3D&);  // Not implemented.
00258   void operator=(const vtkDelaunay3D&);  // Not implemented.
00259 };
00260 
00261 #endif
00262 
00263