VTK  9.1.0
vtkMappedUnstructuredGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMappedUnstructuredGrid.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 =========================================================================*/
139 #ifndef vtkMappedUnstructuredGrid_h
140 #define vtkMappedUnstructuredGrid_h
141 
142 #include "vtkUnstructuredGridBase.h"
143 
144 #include "vtkMappedUnstructuredGridCellIterator.h" // For default cell iterator
145 #include "vtkNew.h" // For vtkNew
146 #include "vtkSmartPointer.h" // For vtkSmartPointer
147 
148 template <class Implementation,
151 {
153 
154 public:
156  typedef Implementation ImplementationType;
157  typedef CellIterator CellIteratorType;
158 
159  // Virtuals from various base classes:
160  void PrintSelf(ostream& os, vtkIndent indent) override;
161  void CopyStructure(vtkDataSet* pd) override;
162  void ShallowCopy(vtkDataObject* src) override;
164  using vtkDataSet::GetCell;
165  vtkCell* GetCell(vtkIdType cellId) override;
166  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
167  int GetCellType(vtkIdType cellId) override;
168  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
170  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
171  int GetMaxCellSize() override;
172  void GetIdsOfCellsOfType(int type, vtkIdTypeArray* array) override;
173  int IsHomogeneous() override;
174  void Allocate(vtkIdType numCells, int extSize = 1000) override;
175  vtkMTimeType GetMTime() override;
176 
179 
180 protected:
183 
184  // For convenience...
186 
188 
189  vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) override;
192  vtkIdType nfaces, const vtkIdType faces[]) override;
193  void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) override;
194 
195 private:
197  void operator=(const vtkMappedUnstructuredGrid&) = delete;
198 
199  vtkNew<vtkGenericCell> TempCell;
200 };
201 
202 #include "vtkMappedUnstructuredGrid.txx"
203 
204 // We need to fake the superclass for the wrappers, otherwise they will choke on
205 // the template:
206 #ifndef __VTK_WRAP__
207 
208 #define vtkMakeExportedMappedUnstructuredGrid(_className, _impl, _exportDecl) \
209  class _exportDecl _className : public vtkMappedUnstructuredGrid<_impl> \
210  { \
211  public: \
212  vtkTypeMacro(_className, vtkMappedUnstructuredGrid<_impl>); \
213  static _className* New(); \
214  \
215  protected: \
216  _className() \
217  { \
218  _impl* i = _impl::New(); \
219  this->SetImplementation(i); \
220  i->Delete(); \
221  } \
222  ~_className() override {} \
223  \
224  private: \
225  _className(const _className&); \
226  void operator=(const _className&); \
227  }
228 
229 #define vtkMakeExportedMappedUnstructuredGridWithIter(_className, _impl, _cIter, _exportDecl) \
230  class _exportDecl _className : public vtkMappedUnstructuredGrid<_impl, _cIter> \
231  { \
232  public: \
233  typedef vtkMappedUnstructuredGrid<_impl, _cIter> SelfType; \
234  vtkTypeMacro(_className, SelfType); \
235  static _className* New(); \
236  \
237  protected: \
238  _className() \
239  { \
240  _impl* i = _impl::New(); \
241  this->SetImplementation(i); \
242  i->Delete(); \
243  } \
244  ~_className() override {} \
245  \
246  private: \
247  _className(const _className&); \
248  void operator=(const _className&); \
249  }
250 
251 #else // __VTK_WRAP__
252 
253 #define vtkMakeExportedMappedUnstructuredGrid(_className, _impl, _exportDecl) \
254  class _exportDecl _className : public vtkUnstructuredGridBase \
255  { \
256  public: \
257  vtkTypeMacro(_className, vtkUnstructuredGridBase); \
258  static _className* New(); \
259  \
260  protected: \
261  _className() {} \
262  ~_className() override {} \
263  \
264  private: \
265  _className(const _className&); \
266  void operator=(const _className&); \
267  }
268 
269 #define vtkMakeExportedMappedUnstructuredGridWithIter(_className, _impl, _cIter, _exportDecl) \
270  class _exportDecl _className : public vtkUnstructuredGridBase \
271  { \
272  public: \
273  vtkTypeMacro(_className, vtkUnstructuredGridBase); \
274  static _className* New(); \
275  \
276  protected: \
277  _className() {} \
278  ~_className() override {} \
279  \
280  private: \
281  _className(const _className&); \
282  void operator=(const _className&); \
283  }
284 
285 #endif // __VTK_WRAP__
286 
287 #define vtkMakeMappedUnstructuredGrid(_className, _impl) \
288  vtkMakeExportedMappedUnstructuredGrid(_className, _impl, )
289 
290 #define vtkMakeMappedUnstructuredGridWithIter(_className, _impl, _cIter) \
291  vtkMakeExportedMappedUnstructuredGridWithIter(_className, _impl, _cIter, )
292 
293 #endif // vtkMappedUnstructuredGrid_h
294 
295 // VTK-HeaderTest-Exclude: vtkMappedUnstructuredGrid.h
vtkMappedUnstructuredGrid::InternalInsertNextCell
vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) override
vtkMappedUnstructuredGrid::GetCell
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkUnstructuredGridBase.h
vtkMappedUnstructuredGrid::InternalInsertNextCell
vtkIdType InternalInsertNextCell(int type, vtkIdList *ptIds) override
vtkMappedUnstructuredGrid::NewCellIterator
vtkCellIterator * NewCellIterator() override
Return an iterator that traverses the cells in this data set.
vtkMappedUnstructuredGrid
Allows datasets with arbitrary storage layouts to be used with VTK.
Definition: vtkMappedUnstructuredGrid.h:151
vtkMappedUnstructuredGrid::CopyStructure
void CopyStructure(vtkDataSet *pd) override
Copy the geometric and topological structure of an object.
vtkMappedUnstructuredGrid::vtkTemplateTypeMacro
vtkTemplateTypeMacro(SelfType, vtkUnstructuredGridBase)
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkMappedUnstructuredGrid::GetMTime
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for MTime THIS METHOD IS THREAD SAFE.
vtkMappedUnstructuredGrid::IsHomogeneous
int IsHomogeneous() override
Traverse cells and determine if cells are all of the same type.
vtkUnstructuredGridBase
dataset represents arbitrary combinations of all possible cell types.
Definition: vtkUnstructuredGridBase.h:35
vtkSmartPointer< ImplementationType >
vtkMappedUnstructuredGrid::CellIteratorType
CellIterator CellIteratorType
Definition: vtkMappedUnstructuredGrid.h:157
vtkMappedUnstructuredGridCellIterator.h
vtkMappedUnstructuredGrid::SetImplementation
void SetImplementation(ImplementationType *impl)
vtkMappedUnstructuredGrid::ThisType
vtkMappedUnstructuredGrid< Implementation, CellIterator > ThisType
Definition: vtkMappedUnstructuredGrid.h:185
vtkMappedUnstructuredGrid::InternalReplaceCell
void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) override
vtkMappedUnstructuredGridCellIterator
Default cell iterator for vtkMappedUnstructuredGrid.
Definition: vtkMappedUnstructuredGridCellIterator.h:38
vtkMappedUnstructuredGrid::GetCellType
int GetCellType(vtkIdType cellId) override
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkMappedUnstructuredGrid::Impl
vtkSmartPointer< ImplementationType > Impl
Definition: vtkMappedUnstructuredGrid.h:187
vtkMappedUnstructuredGrid::GetCell
vtkCell * GetCell(vtkIdType cellId) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkMappedUnstructuredGrid::GetImplementation
ImplementationType * GetImplementation()
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:147
vtkMappedUnstructuredGrid::GetMaxCellSize
int GetMaxCellSize() override
Convenience method returns largest cell size in dataset.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkMappedUnstructuredGrid::vtkMappedUnstructuredGrid
vtkMappedUnstructuredGrid()
vtkSmartPointer.h
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkMappedUnstructuredGrid::~vtkMappedUnstructuredGrid
~vtkMappedUnstructuredGrid() override
vtkMappedUnstructuredGrid::GetNumberOfCells
vtkIdType GetNumberOfCells() override
Determine the number of cells composing the dataset.
vtkNew< vtkGenericCell >
vtkMappedUnstructuredGrid::GetIdsOfCellsOfType
void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array) override
Fill vtkIdTypeArray container with list of cell Ids.
vtkMappedUnstructuredGrid::Allocate
void Allocate(vtkIdType numCells, int extSize=1000) override
Allocate memory for the number of cells indicated.
vtkMappedUnstructuredGrid::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkMappedUnstructuredGrid::ImplementationType
Implementation ImplementationType
Definition: vtkMappedUnstructuredGrid.h:156
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:145
vtkMappedUnstructuredGrid::InternalInsertNextCell
vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces, const vtkIdType faces[]) override
vtkNew.h
impl
Definition: TestMotionFXCFGReaderCommon.h:37
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:116
vtkMappedUnstructuredGrid::GetCellPoints
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Topological inquiry to get points defining cell.
vtkCellIterator
Efficient cell iterator for vtkDataSet topologies.
Definition: vtkCellIterator.h:177
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkMappedUnstructuredGrid::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMappedUnstructuredGrid::GetPointCells
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Topological inquiry to get cells using point.
vtkDataSet::GetCell
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287