VTK: Common/DataModel/vtkMappedUnstructuredGrid.h Source File

| VTK 9.3.1

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