VTK  9.5.20251109
vtkStructuredCellArray.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
22#ifndef vtkStructuredCellArray_h
23#define vtkStructuredCellArray_h
24
26#include "vtkCommonDataModelModule.h" // For export macro
27#include "vtkSmartPointer.h" // For vtkSmartPointer
28
29VTK_ABI_NAMESPACE_BEGIN
30
31template <typename T, int ArrayType>
33
34class VTKCOMMONDATAMODEL_EXPORT vtkStructuredCellArray : public vtkAbstractCellArray
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 void Initialize() override;
45
49 vtkIdType GetNumberOfCells() const override;
50
55 vtkIdType GetNumberOfOffsets() const override;
56
60 vtkIdType GetOffset(vtkIdType cellId) override;
61
66
71 void SetData(int extent[6], bool usePixelVoxelOrientation);
72
79 bool IsStorageShareable() const override { return false; }
80
89 vtkIdType IsHomogeneous() const override;
90
100 void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints,
101 vtkIdList* ptIds) VTK_SIZEHINT(cellPoints, cellSize)
102 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
103
109 void GetCellAtId(vtkIdType cellId, vtkIdList* ptIds)
110 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
111
119 void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType* cellPoints) VTK_SIZEHINT(
120 cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
121
127 void GetCellAtId(int ijk[3], vtkIdList* ptIds);
128
136 void GetCellAtId(int ijk[3], vtkIdType& cellSize, vtkIdType* cellPoints);
137
141 vtkIdType GetCellSize(vtkIdType cellId) const override;
142
147 int GetMaxCellSize() override;
148
152 void DeepCopy(vtkAbstractCellArray* ca) override;
153
158
159protected:
162
166 struct vtkStructuredCellBackend;
167 template <int DataDescription, bool UsePixelVoxelOrientation>
171
172private:
174 void operator=(const vtkStructuredCellArray&) = delete;
175};
176
177VTK_ABI_NAMESPACE_END
178#endif // vtkStructuredCellArray_h
abstract object to represent cell connectivity
virtual vtkIdType GetNumberOfCells() const =0
Get the number of cells in the array.
list of point or cell ids
Definition vtkIdList.h:133
A read only array class that wraps an implicit function from integers to any value type supported by ...
a simple class to control print indentation
Definition vtkIndent.h:108
Hold a reference to a vtkObjectBase instance.
implicit object to represent cell connectivity
void ShallowCopy(vtkAbstractCellArray *ca) override
Shallow copy ca into this cell array.
int GetMaxCellSize() override
Returns the size of the largest cell.
void GetCellAtId(int ijk[3], vtkIdList *ptIds)
Return the point ids for the cell at ijk.
vtkIdType GetNumberOfConnectivityIds() const override
Get the size of the connectivity array that stores the point ids.
vtkIdType IsHomogeneous() const override
Check if all cells have the same number of vertices.
void Initialize() override
Free any memory and reset to an empty state.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *ptIds) override
Return the point ids for the cell at cellId.
vtkIdType GetOffset(vtkIdType cellId) override
Get the offset (into the connectivity) for a specified cell id.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType *cellPoints) override
Return the point ids for the cell at cellId.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkImplicitArray< vtkStructuredCellBackend, vtkArrayTypes::VTK_IMPLICIT_ARRAY > > Connectivity
vtkIdType GetNumberOfOffsets() const override
Get the number of elements in the offsets array.
static vtkStructuredCellArray * New()
void SetData(int extent[6], bool usePixelVoxelOrientation)
Create a new cell array given extent and a flag indicating whether the data should be stored in a vox...
bool IsStorageShareable() const override
~vtkStructuredCellArray() override
void GetCellAtId(int ijk[3], vtkIdType &cellSize, vtkIdType *cellPoints)
Return the point ids for the cell at ijk.
vtkIdType GetCellSize(vtkIdType cellId) const override
Return the size of the cell at cellId.
void DeepCopy(vtkAbstractCellArray *ca) override
Perform a deep copy (no reference counting) of the given cell array.
vtkIdType GetNumberOfCells() const override
Get the number of cells in the array.
void GetCellAtId(vtkIdType cellId, vtkIdList *ptIds) override
Return the point ids for the cell at cellId.
int vtkIdType
Definition vtkType.h:367
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)