VTK
vtkMergeCells.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMergeCells.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
45 #ifndef vtkMergeCells_h
46 #define vtkMergeCells_h
47 
48 #include "vtkFiltersGeneralModule.h" // For export macro
49 #include "vtkObject.h"
50 #include "vtkDataSetAttributes.h" // Needed for FieldList
51 
52 class vtkDataSet;
54 class vtkPointData;
55 class vtkCellData;
56 class vtkMergeCellsSTLCloak;
57 
58 class VTKFILTERSGENERAL_EXPORT vtkMergeCells : public vtkObject
59 {
60 public:
61  vtkTypeMacro(vtkMergeCells, vtkObject);
62  void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE;
63 
64  static vtkMergeCells *New();
65 
73  vtkGetObjectMacro(UnstructuredGrid, vtkUnstructuredGrid);
74 
80  vtkSetMacro(TotalNumberOfCells, vtkIdType);
81  vtkGetMacro(TotalNumberOfCells, vtkIdType);
82 
89  vtkSetMacro(TotalNumberOfPoints, vtkIdType);
90  vtkGetMacro(TotalNumberOfPoints, vtkIdType);
91 
99  vtkSetMacro(UseGlobalIds, int);
100  vtkGetMacro(UseGlobalIds, int);
101 
110  vtkSetClampMacro(PointMergeTolerance, float, 0.0, VTK_FLOAT_MAX);
111  vtkGetMacro(PointMergeTolerance, float);
112 
118  vtkSetMacro(UseGlobalCellIds, int);
119  vtkGetMacro(UseGlobalCellIds, int);
120 
127  vtkSetMacro(MergeDuplicatePoints, int);
128  vtkGetMacro(MergeDuplicatePoints, int);
129  vtkBooleanMacro(MergeDuplicatePoints, int);
130 
137  vtkSetMacro(TotalNumberOfDataSets, int);
138  vtkGetMacro(TotalNumberOfDataSets, int);
139 
148 
155  void Finish();
156 
157 protected:
158 
160  ~vtkMergeCells() VTK_OVERRIDE;
161 
162 private:
163 
164  void FreeLists();
165  void StartUGrid(vtkDataSet *set);
166  vtkIdType *MapPointsToIdsUsingGlobalIds(vtkDataSet *set);
167  vtkIdType *MapPointsToIdsUsingLocator(vtkDataSet *set);
168  vtkIdType AddNewCellsUnstructuredGrid(vtkDataSet *set, vtkIdType *idMap);
169  vtkIdType AddNewCellsDataSet(vtkDataSet *set, vtkIdType *idMap);
170 
171  vtkIdType GlobalCellIdAccessGetId(vtkIdType idx);
172  int GlobalCellIdAccessStart(vtkDataSet *set);
173  vtkIdType GlobalNodeIdAccessGetId(vtkIdType idx);
174  int GlobalNodeIdAccessStart(vtkDataSet *set);
175 
176  int TotalNumberOfDataSets;
177 
178  vtkIdType TotalNumberOfCells;
179  vtkIdType TotalNumberOfPoints;
180 
181  vtkIdType NumberOfCells; // so far
182  vtkIdType NumberOfPoints;
183 
184  int UseGlobalIds; // point, or node, IDs
185  int GlobalIdArrayType;
186  void* GlobalIdArray;
187 
188  int UseGlobalCellIds; // cell IDs
189  int GlobalCellIdArrayType;
190  void* GlobalCellIdArray;
191 
192  float PointMergeTolerance;
193  int MergeDuplicatePoints;
194 
195  char InputIsUGrid;
196  char InputIsPointSet;
197 
198  vtkMergeCellsSTLCloak *GlobalIdMap;
199  vtkMergeCellsSTLCloak *GlobalCellIdMap;
200 
201  vtkDataSetAttributes::FieldList *ptList;
202  vtkDataSetAttributes::FieldList *cellList;
203 
204  vtkUnstructuredGrid *UnstructuredGrid;
205 
206  int nextGrid;
207 
208  vtkMergeCells(const vtkMergeCells&) VTK_DELETE_FUNCTION;
209  void operator=(const vtkMergeCells&) VTK_DELETE_FUNCTION;
210 };
211 #endif
vtkMergeCells::~vtkMergeCells
~vtkMergeCells() override
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:38
vtkMergeCells::vtkMergeCells
vtkMergeCells()
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:59
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkMergeCells::MergeDataSet
int MergeDataSet(vtkDataSet *set)
Provide a DataSet to be merged in to the final UnstructuredGrid.
vtkMergeCells::SetUnstructuredGrid
virtual void SetUnstructuredGrid(vtkUnstructuredGrid *)
Set the vtkUnstructuredGrid object that will become the union of the DataSets specified in MergeDataS...
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
vtkMergeCells::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMergeCells
merges any number of vtkDataSets back into a single vtkUnstructuredGrid
Definition: vtkMergeCells.h:59
VTK_FLOAT_MAX
#define VTK_FLOAT_MAX
Definition: vtkType.h:161
vtkObject.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkMergeCells::New
static vtkMergeCells * New()
vtkMergeCells::Finish
void Finish()
Call Finish() after merging last DataSet to free unneeded memory and to make sure the ugrid's GetNumb...
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:83
vtkDataSetAttributes.h