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 
44 #ifndef vtkMergeCells_h
45 #define vtkMergeCells_h
46 
47 #include "vtkFiltersGeneralModule.h" // For export macro
48 #include "vtkObject.h"
49 #include "vtkDataSetAttributes.h" // Needed for FieldList
50 
51 class vtkDataSet;
53 class vtkPointData;
54 class vtkCellData;
55 class vtkMergeCellsSTLCloak;
56 
58 {
59 public:
60  vtkTypeMacro(vtkMergeCells, vtkObject);
61  virtual void PrintSelf(ostream &os, vtkIndent indent);
62 
63  static vtkMergeCells *New();
64 
69  virtual void SetUnstructuredGrid(vtkUnstructuredGrid*);
70  vtkGetObjectMacro(UnstructuredGrid, vtkUnstructuredGrid);
71 
75  vtkSetMacro(TotalNumberOfCells, vtkIdType);
76  vtkGetMacro(TotalNumberOfCells, vtkIdType);
77 
82  vtkSetMacro(TotalNumberOfPoints, vtkIdType);
83  vtkGetMacro(TotalNumberOfPoints, vtkIdType);
84 
89  vtkSetMacro(UseGlobalIds, int);
90  vtkGetMacro(UseGlobalIds, int);
91 
97  vtkSetClampMacro(PointMergeTolerance, float, 0.0, VTK_FLOAT_MAX);
98  vtkGetMacro(PointMergeTolerance, float);
99 
103  vtkSetMacro(UseGlobalCellIds, int);
104  vtkGetMacro(UseGlobalCellIds, int);
105 
110  vtkSetMacro(MergeDuplicatePoints, int);
111  vtkGetMacro(MergeDuplicatePoints, int);
112  vtkBooleanMacro(MergeDuplicatePoints, int);
113 
118  vtkSetMacro(TotalNumberOfDataSets, int);
119  vtkGetMacro(TotalNumberOfDataSets, int);
120 
127  int MergeDataSet(vtkDataSet *set);
128 
133  void Finish();
134 
135 protected:
136 
137  vtkMergeCells();
138  ~vtkMergeCells();
139 
140 private:
141 
142  void FreeLists();
143  void StartUGrid(vtkDataSet *set);
144  vtkIdType *MapPointsToIdsUsingGlobalIds(vtkDataSet *set);
145  vtkIdType *MapPointsToIdsUsingLocator(vtkDataSet *set);
146  vtkIdType AddNewCellsUnstructuredGrid(vtkDataSet *set, vtkIdType *idMap);
147  vtkIdType AddNewCellsDataSet(vtkDataSet *set, vtkIdType *idMap);
148 
149  vtkIdType GlobalCellIdAccessGetId(vtkIdType idx);
150  int GlobalCellIdAccessStart(vtkDataSet *set);
151  vtkIdType GlobalNodeIdAccessGetId(vtkIdType idx);
152  int GlobalNodeIdAccessStart(vtkDataSet *set);
153 
154  int TotalNumberOfDataSets;
155 
156  vtkIdType TotalNumberOfCells;
157  vtkIdType TotalNumberOfPoints;
158 
159  vtkIdType NumberOfCells; // so far
160  vtkIdType NumberOfPoints;
161 
162  int UseGlobalIds; // point, or node, IDs
163  int GlobalIdArrayType;
164  void* GlobalIdArray;
165 
166  int UseGlobalCellIds; // cell IDs
167  int GlobalCellIdArrayType;
168  void* GlobalCellIdArray;
169 
170  float PointMergeTolerance;
171  int MergeDuplicatePoints;
172 
173  char InputIsUGrid;
174  char InputIsPointSet;
175 
176  vtkMergeCellsSTLCloak *GlobalIdMap;
177  vtkMergeCellsSTLCloak *GlobalCellIdMap;
178 
179 //BTX
182 //ETX
183 
184  vtkUnstructuredGrid *UnstructuredGrid;
185 
186  int nextGrid;
187 
188  vtkMergeCells(const vtkMergeCells&); // Not implemented
189  void operator=(const vtkMergeCells&); // Not implemented
190 };
191 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate point attribute data
Definition: vtkPointData.h:36
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
int vtkIdType
Definition: vtkType.h:247
#define VTK_FLOAT_MAX
Definition: vtkType.h:138
virtual void PrintSelf(ostream &os, vtkIndent indent)
merges any number of vtkDataSets back into a single vtkUnstructuredGrid
Definition: vtkMergeCells.h:57
a simple class to control print indentation
Definition: vtkIndent.h:38
dataset represents arbitrary combinations of all possible cell types
#define VTKFILTERSGENERAL_EXPORT
static vtkObject * New()