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

vtkMergeCells.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkMergeCells.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 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00055 #ifndef __vtkMergeCells_h
00056 #define __vtkMergeCells_h
00057 
00058 #include "vtkObject.h"
00059 #include "vtkDataSetAttributes.h" // Needed for FieldList
00060 
00061 class vtkDataSet;
00062 class vtkUnstructuredGrid;
00063 class vtkPointData;
00064 class vtkCellData;
00065 class vtkMergeCellsSTLCloak;
00066 
00067 class VTK_PARALLEL_EXPORT vtkMergeCells : public vtkObject
00068 { 
00069 public:
00070   vtkTypeRevisionMacro(vtkMergeCells, vtkObject);
00071   virtual void PrintSelf(ostream &os, vtkIndent indent);
00072 
00073   static vtkMergeCells *New();
00074 
00079   virtual void SetUnstructuredGrid(vtkUnstructuredGrid*);
00080   vtkGetObjectMacro(UnstructuredGrid, vtkUnstructuredGrid);
00081 
00085   vtkSetMacro(TotalNumberOfCells, vtkIdType);
00086   vtkGetMacro(TotalNumberOfCells, vtkIdType);
00087 
00092   vtkSetMacro(TotalNumberOfPoints, vtkIdType);
00093   vtkGetMacro(TotalNumberOfPoints, vtkIdType);
00094 
00099   vtkSetStringMacro(GlobalIdArrayName);
00100   vtkGetStringMacro(GlobalIdArrayName);
00101 
00107   vtkSetClampMacro(PointMergeTolerance, float, 0.0, .25);
00108   vtkGetMacro(PointMergeTolerance, float);
00109 
00113   vtkSetStringMacro(GlobalCellIdArrayName);
00114   vtkGetStringMacro(GlobalCellIdArrayName);
00115 
00120   vtkSetMacro(MergeDuplicatePoints, int);
00121   vtkGetMacro(MergeDuplicatePoints, int);
00122   vtkBooleanMacro(MergeDuplicatePoints, int);
00123 
00128   vtkSetMacro(TotalNumberOfDataSets, int);
00129   vtkGetMacro(TotalNumberOfDataSets, int);
00130 
00137   int MergeDataSet(vtkDataSet *set);
00138 
00143   void Finish();
00144 
00145 protected:
00146 
00147   vtkMergeCells();
00148   ~vtkMergeCells();
00149 
00150 private:
00151 
00152   void FreeLists();
00153   void StartUGrid(vtkDataSet *set);
00154   vtkIdType *MapPointsToIdsUsingGlobalIds(vtkDataSet *set);
00155   vtkIdType *MapPointsToIdsUsingLocator(vtkDataSet *set);
00156   vtkIdType AddNewCellsUnstructuredGrid(vtkDataSet *set, vtkIdType *idMap);
00157   vtkIdType AddNewCellsDataSet(vtkDataSet *set, vtkIdType *idMap);
00158 
00159   vtkIdType GlobalCellIdAccessGetId(vtkIdType idx);
00160   int GlobalCellIdAccessStart(vtkDataSet *set);
00161   vtkIdType GlobalNodeIdAccessGetId(vtkIdType idx);
00162   int GlobalNodeIdAccessStart(vtkDataSet *set);
00163 
00164   int TotalNumberOfDataSets;
00165 
00166   vtkIdType TotalNumberOfCells;
00167   vtkIdType TotalNumberOfPoints;
00168 
00169   vtkIdType NumberOfCells;     // so far
00170   vtkIdType NumberOfPoints;
00171 
00172   char *GlobalIdArrayName;       // point, or node, IDs
00173 
00174   vtkIdType *GlobalIdArrayIdType;
00175   long *GlobalIdArrayLong;
00176   int *GlobalIdArrayInt;
00177   short *GlobalIdArrayShort;
00178   char *GlobalIdArrayChar;
00179 
00180   char *GlobalCellIdArrayName;   // cell IDs
00181 
00182   vtkIdType *GlobalCellIdArrayIdType;
00183   long *GlobalCellIdArrayLong;
00184   int *GlobalCellIdArrayInt;
00185   short *GlobalCellIdArrayShort;
00186   char *GlobalCellIdArrayChar;
00187 
00188   float PointMergeTolerance;
00189   int MergeDuplicatePoints;
00190 
00191   char InputIsUGrid;
00192   char InputIsPointSet;
00193 
00194   vtkMergeCellsSTLCloak *GlobalIdMap;
00195   vtkMergeCellsSTLCloak *GlobalCellIdMap;
00196 
00197 //BTX
00198   vtkDataSetAttributes::FieldList *ptList;
00199   vtkDataSetAttributes::FieldList *cellList;
00200 //ETX
00201 
00202   vtkUnstructuredGrid *UnstructuredGrid;
00203 
00204   int nextGrid;
00205 
00206   vtkMergeCells(const vtkMergeCells&); // Not implemented
00207   void operator=(const vtkMergeCells&); // Not implemented
00208 };
00209 #endif