VTK  9.7.1
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 
25 #include "vtkAbstractCellArray.h"
26 #include "vtkCommonDataModelModule.h" // For export macro
27 #include "vtkSmartPointer.h" // For vtkSmartPointer
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 
31 template <typename T, int ArrayType>
32 class vtkImplicitArray;
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkStructuredCellArray : public vtkAbstractCellArray
35 {
36 public:
37  static vtkStructuredCellArray* New();
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 
65  vtkIdType GetNumberOfConnectivityIds() const override;
66 
71  void SetData(VTK_FUTURE_CONST 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 
157  void ShallowCopy(vtkAbstractCellArray* ca) override;
158 
159 protected:
161  ~vtkStructuredCellArray() override;
162 
166  struct vtkStructuredCellBackend;
167  template <int DataDescription, bool UsePixelVoxelOrientation>
170  Connectivity;
171 
172 private:
173  vtkStructuredCellArray(const vtkStructuredCellArray&) = delete;
174  void operator=(const vtkStructuredCellArray&) = delete;
175 };
176 
177 VTK_ABI_NAMESPACE_END
178 #endif // vtkStructuredCellArray_h
abstract object to represent cell connectivity
implicit object to represent cell connectivity
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
virtual vtkIdType GetOffset(vtkIdType cellId)=0
Get the offset (into the connectivity) for a specified cell id.
vtkArrayTypes
Definition: vtkType.h:70
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
list of point or cell ids
Definition: vtkIdList.h:25
#define VTK_SIZEHINT(...)
bool IsStorageShareable() const override
A read only array class that wraps an implicit function from integers to any value type supported by ...
virtual vtkIdType GetNumberOfOffsets() const =0
Get the number of elements in the offsets array.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
virtual vtkIdType GetNumberOfCells() const =0
Get the number of cells in the array.
virtual void Initialize()=0
Free any memory and reset to an empty state.
virtual vtkIdType IsHomogeneous() const =0
Check if all cells have the same number of vertices.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define VTK_EXPECTS(x)
virtual vtkIdType GetNumberOfConnectivityIds() const =0
Get the size of the connectivity array that stores the point ids.