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) override;
63 
64  static vtkMergeCells *New();
65 
72  virtual void SetUnstructuredGrid(vtkUnstructuredGrid*);
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, vtkTypeBool);
128  vtkGetMacro(MergeDuplicatePoints, vtkTypeBool);
129  vtkBooleanMacro(MergeDuplicatePoints, vtkTypeBool);
130 
137  vtkSetMacro(TotalNumberOfDataSets, int);
138  vtkGetMacro(TotalNumberOfDataSets, int);
139 
147  int MergeDataSet(vtkDataSet *set);
148 
155  void Finish();
156 
157 protected:
158 
159  vtkMergeCells();
160  ~vtkMergeCells() 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  vtkTypeBool MergeDuplicatePoints;
194 
195  char InputIsUGrid;
196  char InputIsPointSet;
197 
198  vtkMergeCellsSTLCloak *GlobalIdMap;
199  vtkMergeCellsSTLCloak *GlobalCellIdMap;
200 
203 
204  vtkUnstructuredGrid *UnstructuredGrid;
205 
206  int nextGrid;
207 
208  vtkMergeCells(const vtkMergeCells&) = delete;
209  void operator=(const vtkMergeCells&) = delete;
210 };
211 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
represent and manipulate point attribute data
Definition: vtkPointData.h:37
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
helps manage arrays from multiple vtkDataSetAttributes.
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
int vtkIdType
Definition: vtkType.h:347
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_FLOAT_MAX
Definition: vtkType.h:167
merges any number of vtkDataSets back into a single vtkUnstructuredGrid
Definition: vtkMergeCells.h:58
a simple class to control print indentation
Definition: vtkIndent.h:39
dataset represents arbitrary combinations of all possible cell types
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...