VTK
dox/Filters/General/vtkMergeCells.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMergeCells.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 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00044 #ifndef __vtkMergeCells_h
00045 #define __vtkMergeCells_h
00046 
00047 #include "vtkFiltersGeneralModule.h" // For export macro
00048 #include "vtkObject.h"
00049 #include "vtkDataSetAttributes.h" // Needed for FieldList
00050 
00051 class vtkDataSet;
00052 class vtkUnstructuredGrid;
00053 class vtkPointData;
00054 class vtkCellData;
00055 class vtkMergeCellsSTLCloak;
00056 
00057 class VTKFILTERSGENERAL_EXPORT vtkMergeCells : public vtkObject
00058 {
00059 public:
00060   vtkTypeMacro(vtkMergeCells, vtkObject);
00061   virtual void PrintSelf(ostream &os, vtkIndent indent);
00062 
00063   static vtkMergeCells *New();
00064 
00069   virtual void SetUnstructuredGrid(vtkUnstructuredGrid*);
00070   vtkGetObjectMacro(UnstructuredGrid, vtkUnstructuredGrid);
00071 
00075   vtkSetMacro(TotalNumberOfCells, vtkIdType);
00076   vtkGetMacro(TotalNumberOfCells, vtkIdType);
00077 
00082   vtkSetMacro(TotalNumberOfPoints, vtkIdType);
00083   vtkGetMacro(TotalNumberOfPoints, vtkIdType);
00084 
00089   vtkSetMacro(UseGlobalIds, int);
00090   vtkGetMacro(UseGlobalIds, int);
00091 
00097   vtkSetClampMacro(PointMergeTolerance, float, 0.0, VTK_FLOAT_MAX);
00098   vtkGetMacro(PointMergeTolerance, float);
00099 
00103   vtkSetMacro(UseGlobalCellIds, int);
00104   vtkGetMacro(UseGlobalCellIds, int);
00105 
00110   vtkSetMacro(MergeDuplicatePoints, int);
00111   vtkGetMacro(MergeDuplicatePoints, int);
00112   vtkBooleanMacro(MergeDuplicatePoints, int);
00113 
00118   vtkSetMacro(TotalNumberOfDataSets, int);
00119   vtkGetMacro(TotalNumberOfDataSets, int);
00120 
00127   int MergeDataSet(vtkDataSet *set);
00128 
00133   void Finish();
00134 
00135 protected:
00136 
00137   vtkMergeCells();
00138   ~vtkMergeCells();
00139 
00140 private:
00141 
00142   void FreeLists();
00143   void StartUGrid(vtkDataSet *set);
00144   vtkIdType *MapPointsToIdsUsingGlobalIds(vtkDataSet *set);
00145   vtkIdType *MapPointsToIdsUsingLocator(vtkDataSet *set);
00146   vtkIdType AddNewCellsUnstructuredGrid(vtkDataSet *set, vtkIdType *idMap);
00147   vtkIdType AddNewCellsDataSet(vtkDataSet *set, vtkIdType *idMap);
00148 
00149   vtkIdType GlobalCellIdAccessGetId(vtkIdType idx);
00150   int GlobalCellIdAccessStart(vtkDataSet *set);
00151   vtkIdType GlobalNodeIdAccessGetId(vtkIdType idx);
00152   int GlobalNodeIdAccessStart(vtkDataSet *set);
00153 
00154   int TotalNumberOfDataSets;
00155 
00156   vtkIdType TotalNumberOfCells;
00157   vtkIdType TotalNumberOfPoints;
00158 
00159   vtkIdType NumberOfCells;     // so far
00160   vtkIdType NumberOfPoints;
00161 
00162   int UseGlobalIds;       // point, or node, IDs
00163   int GlobalIdArrayType;
00164   void* GlobalIdArray;
00165 
00166   int UseGlobalCellIds;   // cell IDs
00167   int GlobalCellIdArrayType;
00168   void* GlobalCellIdArray;
00169 
00170   float PointMergeTolerance;
00171   int MergeDuplicatePoints;
00172 
00173   char InputIsUGrid;
00174   char InputIsPointSet;
00175 
00176   vtkMergeCellsSTLCloak *GlobalIdMap;
00177   vtkMergeCellsSTLCloak *GlobalCellIdMap;
00178 
00179 //BTX
00180   vtkDataSetAttributes::FieldList *ptList;
00181   vtkDataSetAttributes::FieldList *cellList;
00182 //ETX
00183 
00184   vtkUnstructuredGrid *UnstructuredGrid;
00185 
00186   int nextGrid;
00187 
00188   vtkMergeCells(const vtkMergeCells&); // Not implemented
00189   void operator=(const vtkMergeCells&); // Not implemented
00190 };
00191 #endif