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

vtkOrderedTriangulator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkOrderedTriangulator.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 =========================================================================*/
00092 #ifndef __vtkOrderedTriangulator_h
00093 #define __vtkOrderedTriangulator_h
00094 
00095 #include "vtkObject.h"
00096 
00097 class  vtkUnstructuredGrid;
00098 class  vtkCellArray;
00099 class  vtkHeap;
00100 class  vtkIdList;
00101 class  vtkPoints;
00102 class  vtkTetra;
00103 class  vtkDataArray;
00104 class  vtkDoubleArray;
00105 struct vtkOTMesh;
00106 struct vtkOTTemplates;
00107 
00108 
00109 // Template ID's must be 32-bits. See .cxx file for more information.
00110 #if VTK_SIZEOF_SHORT == 4
00111 typedef unsigned short  TemplateIDType;
00112 #elif VTK_SIZEOF_INT == 4
00113 typedef unsigned int    TemplateIDType;
00114 #elif VTK_SIZEOF_LONG == 4
00115 typedef unsigned long   TemplateIDType;
00116 #endif    
00117 
00118 class VTK_FILTERING_EXPORT vtkOrderedTriangulator : public vtkObject
00119 {
00120 public:
00121   vtkTypeRevisionMacro(vtkOrderedTriangulator,vtkObject);
00122   void PrintSelf(ostream& os, vtkIndent indent);
00123 
00125   static vtkOrderedTriangulator *New();
00126 
00128 
00130   void InitTriangulation(double xmin, double xmax, double ymin, double ymax,
00131                          double zmin, double zmax, int numPts);
00132   void InitTriangulation(double bounds[6], int numPts);
00134 
00136 
00149   vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
00150   vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3], 
00151                         double p[3], int type);
00152   vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid,  vtkIdType sortid2, 
00153                         double x[3], double p[3], int type);
00155 
00157 
00160   void Triangulate();
00161   void TemplateTriangulate(int cellType, int numPts, int numEdges);
00163 
00169   void UpdatePointType(vtkIdType internalId, int type);
00170 
00172 
00177   vtkSetMacro(UseTemplates,int);
00178   vtkGetMacro(UseTemplates,int);
00179   vtkBooleanMacro(UseTemplates,int);
00181 
00183 
00187   vtkSetMacro(PreSorted,int);
00188   vtkGetMacro(PreSorted,int);
00189   vtkBooleanMacro(PreSorted,int);
00191 
00193 
00195   vtkSetMacro(UseTwoSortIds,int);
00196   vtkGetMacro(UseTwoSortIds,int);
00197   vtkBooleanMacro(UseTwoSortIds,int);
00199 
00209   vtkIdType GetTetras(int classification, vtkUnstructuredGrid *ugrid);
00210   
00218   vtkIdType AddTetras(int classification, vtkUnstructuredGrid *ugrid);
00219   
00225   vtkIdType AddTetras(int classification, vtkCellArray *connectivity);
00226   
00230   vtkIdType AddTetras(int classification, vtkIdList *ptIds, vtkPoints *pts);
00231   
00234   vtkIdType AddTriangles(vtkCellArray *connectivity);
00235   
00239   vtkIdType AddTriangles(vtkIdType id, vtkCellArray *connectivity);
00240   
00242 
00244   void InitTetraTraversal();
00245   int  GetNextTetra(int classification, vtkTetra *tet,
00246                     vtkDataArray *cellScalars, vtkDoubleArray *tetScalars);
00248   
00249 protected:
00250   vtkOrderedTriangulator();
00251   ~vtkOrderedTriangulator();
00252 
00253 private:
00254   void       Initialize();
00255 
00256   vtkOTMesh *Mesh;
00257   int        NumberOfPoints; //number of points inserted
00258   int        MaximumNumberOfPoints; //maximum possible number of points to be inserted
00259   double     Bounds[6];
00260   int        PreSorted;
00261   int        UseTwoSortIds;
00262   vtkHeap   *Heap;
00263   double     Quanta;
00264 
00265   int             UseTemplates;
00266   int             CellType;
00267   int             NumberOfCellPoints;
00268   int             NumberOfCellEdges;
00269   vtkHeap        *TemplateHeap;
00270   vtkOTTemplates *Templates;
00271   int             TemplateTriangulation();
00272   void            AddTemplate();
00273   TemplateIDType  ComputeTemplateIndex();
00274     
00275 private:
00276   vtkOrderedTriangulator(const vtkOrderedTriangulator&);  // Not implemented.
00277   void operator=(const vtkOrderedTriangulator&);  // Not implemented.
00278 };
00279 
00280 #endif
00281 
00282