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 "vtkObject.h"
48 #include "vtkDataSetAttributes.h" // Needed for FieldList
49 
50 class vtkDataSet;
52 class vtkPointData;
53 class vtkCellData;
54 class vtkMergeCellsSTLCloak;
55 
57 {
58 public:
59  vtkTypeMacro(vtkMergeCells, vtkObject);
60  virtual void PrintSelf(ostream &os, vtkIndent indent);
61 
62  static vtkMergeCells *New();
63 
68  virtual void SetUnstructuredGrid(vtkUnstructuredGrid*);
69  vtkGetObjectMacro(UnstructuredGrid, vtkUnstructuredGrid);
70 
74  vtkSetMacro(TotalNumberOfCells, vtkIdType);
75  vtkGetMacro(TotalNumberOfCells, vtkIdType);
76 
81  vtkSetMacro(TotalNumberOfPoints, vtkIdType);
82  vtkGetMacro(TotalNumberOfPoints, vtkIdType);
83 
88  vtkSetMacro(UseGlobalIds, int);
89  vtkGetMacro(UseGlobalIds, int);
90 
96  vtkSetClampMacro(PointMergeTolerance, float, 0.0, VTK_LARGE_FLOAT);
97  vtkGetMacro(PointMergeTolerance, float);
98 
102  vtkSetMacro(UseGlobalCellIds, int);
103  vtkGetMacro(UseGlobalCellIds, int);
104 
109  vtkSetMacro(MergeDuplicatePoints, int);
110  vtkGetMacro(MergeDuplicatePoints, int);
111  vtkBooleanMacro(MergeDuplicatePoints, int);
112 
117  vtkSetMacro(TotalNumberOfDataSets, int);
118  vtkGetMacro(TotalNumberOfDataSets, int);
119 
126  int MergeDataSet(vtkDataSet *set);
127 
132  void Finish();
133 
134 protected:
135 
136  vtkMergeCells();
137  ~vtkMergeCells();
138 
139 private:
140 
141  void FreeLists();
142  void StartUGrid(vtkDataSet *set);
143  vtkIdType *MapPointsToIdsUsingGlobalIds(vtkDataSet *set);
144  vtkIdType *MapPointsToIdsUsingLocator(vtkDataSet *set);
145  vtkIdType AddNewCellsUnstructuredGrid(vtkDataSet *set, vtkIdType *idMap);
146  vtkIdType AddNewCellsDataSet(vtkDataSet *set, vtkIdType *idMap);
147 
148  vtkIdType GlobalCellIdAccessGetId(vtkIdType idx);
149  int GlobalCellIdAccessStart(vtkDataSet *set);
150  vtkIdType GlobalNodeIdAccessGetId(vtkIdType idx);
151  int GlobalNodeIdAccessStart(vtkDataSet *set);
152 
153  int TotalNumberOfDataSets;
154 
155  vtkIdType TotalNumberOfCells;
156  vtkIdType TotalNumberOfPoints;
157 
158  vtkIdType NumberOfCells; // so far
159  vtkIdType NumberOfPoints;
160 
161  int UseGlobalIds; // point, or node, IDs
162  int GlobalIdArrayType;
163  void* GlobalIdArray;
164 
165  int UseGlobalCellIds; // cell IDs
166  int GlobalCellIdArrayType;
167  void* GlobalCellIdArray;
168 
169  float PointMergeTolerance;
170  int MergeDuplicatePoints;
171 
172  char InputIsUGrid;
173  char InputIsPointSet;
174 
175  vtkMergeCellsSTLCloak *GlobalIdMap;
176  vtkMergeCellsSTLCloak *GlobalCellIdMap;
177 
178 //BTX
181 //ETX
182 
183  vtkUnstructuredGrid *UnstructuredGrid;
184 
185  int nextGrid;
186 
187  vtkMergeCells(const vtkMergeCells&); // Not implemented
188  void operator=(const vtkMergeCells&); // Not implemented
189 };
190 #endif