VTK
|
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 "vtkObject.h" 00048 #include "vtkDataSetAttributes.h" // Needed for FieldList 00049 00050 class vtkDataSet; 00051 class vtkUnstructuredGrid; 00052 class vtkPointData; 00053 class vtkCellData; 00054 class vtkMergeCellsSTLCloak; 00055 00056 class VTK_GRAPHICS_EXPORT vtkMergeCells : public vtkObject 00057 { 00058 public: 00059 vtkTypeMacro(vtkMergeCells, vtkObject); 00060 virtual void PrintSelf(ostream &os, vtkIndent indent); 00061 00062 static vtkMergeCells *New(); 00063 00068 virtual void SetUnstructuredGrid(vtkUnstructuredGrid*); 00069 vtkGetObjectMacro(UnstructuredGrid, vtkUnstructuredGrid); 00070 00074 vtkSetMacro(TotalNumberOfCells, vtkIdType); 00075 vtkGetMacro(TotalNumberOfCells, vtkIdType); 00076 00081 vtkSetMacro(TotalNumberOfPoints, vtkIdType); 00082 vtkGetMacro(TotalNumberOfPoints, vtkIdType); 00083 00088 vtkSetMacro(UseGlobalIds, int); 00089 vtkGetMacro(UseGlobalIds, int); 00090 00096 vtkSetClampMacro(PointMergeTolerance, float, 0.0, VTK_LARGE_FLOAT); 00097 vtkGetMacro(PointMergeTolerance, float); 00098 00102 vtkSetMacro(UseGlobalCellIds, int); 00103 vtkGetMacro(UseGlobalCellIds, int); 00104 00109 vtkSetMacro(MergeDuplicatePoints, int); 00110 vtkGetMacro(MergeDuplicatePoints, int); 00111 vtkBooleanMacro(MergeDuplicatePoints, int); 00112 00117 vtkSetMacro(TotalNumberOfDataSets, int); 00118 vtkGetMacro(TotalNumberOfDataSets, int); 00119 00126 int MergeDataSet(vtkDataSet *set); 00127 00132 void Finish(); 00133 00134 protected: 00135 00136 vtkMergeCells(); 00137 ~vtkMergeCells(); 00138 00139 private: 00140 00141 void FreeLists(); 00142 void StartUGrid(vtkDataSet *set); 00143 vtkIdType *MapPointsToIdsUsingGlobalIds(vtkDataSet *set); 00144 vtkIdType *MapPointsToIdsUsingLocator(vtkDataSet *set); 00145 vtkIdType AddNewCellsUnstructuredGrid(vtkDataSet *set, vtkIdType *idMap); 00146 vtkIdType AddNewCellsDataSet(vtkDataSet *set, vtkIdType *idMap); 00147 00148 vtkIdType GlobalCellIdAccessGetId(vtkIdType idx); 00149 int GlobalCellIdAccessStart(vtkDataSet *set); 00150 vtkIdType GlobalNodeIdAccessGetId(vtkIdType idx); 00151 int GlobalNodeIdAccessStart(vtkDataSet *set); 00152 00153 int TotalNumberOfDataSets; 00154 00155 vtkIdType TotalNumberOfCells; 00156 vtkIdType TotalNumberOfPoints; 00157 00158 vtkIdType NumberOfCells; // so far 00159 vtkIdType NumberOfPoints; 00160 00161 int UseGlobalIds; // point, or node, IDs 00162 int GlobalIdArrayType; 00163 void* GlobalIdArray; 00164 00165 int UseGlobalCellIds; // cell IDs 00166 int GlobalCellIdArrayType; 00167 void* GlobalCellIdArray; 00168 00169 float PointMergeTolerance; 00170 int MergeDuplicatePoints; 00171 00172 char InputIsUGrid; 00173 char InputIsPointSet; 00174 00175 vtkMergeCellsSTLCloak *GlobalIdMap; 00176 vtkMergeCellsSTLCloak *GlobalCellIdMap; 00177 00178 //BTX 00179 vtkDataSetAttributes::FieldList *ptList; 00180 vtkDataSetAttributes::FieldList *cellList; 00181 //ETX 00182 00183 vtkUnstructuredGrid *UnstructuredGrid; 00184 00185 int nextGrid; 00186 00187 vtkMergeCells(const vtkMergeCells&); // Not implemented 00188 void operator=(const vtkMergeCells&); // Not implemented 00189 }; 00190 #endif