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
52class vtkDataSet;
54class vtkPointData;
55class vtkCellData;
56class vtkMergeCellsSTLCloak;
57
58class VTKFILTERSGENERAL_EXPORT vtkMergeCells : public vtkObject
59{
60public:
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
157protected:
158
160 ~vtkMergeCells() VTK_OVERRIDE;
161
162private:
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
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
a simple class to control print indentation
Definition: vtkIndent.h:40
merges any number of vtkDataSets back into a single vtkUnstructuredGrid
Definition: vtkMergeCells.h:59
int MergeDataSet(vtkDataSet *set)
Provide a DataSet to be merged in to the final UnstructuredGrid.
void Finish()
Call Finish() after merging last DataSet to free unneeded memory and to make sure the ugrid's GetNumb...
static vtkMergeCells * New()
~vtkMergeCells() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetUnstructuredGrid(vtkUnstructuredGrid *)
Set the vtkUnstructuredGrid object that will become the union of the DataSets specified in MergeDataS...
abstract base class for most VTK objects
Definition: vtkObject.h:60
represent and manipulate point attribute data
Definition: vtkPointData.h:38
dataset represents arbitrary combinations of all possible cell types
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
#define VTK_FLOAT_MAX
Definition: vtkType.h:161