VTK  9.4.20241222
vtkAbstractCellArray.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
13#ifndef vtkAbstractCellArray_h
14#define vtkAbstractCellArray_h
15
16#include "vtkCommonDataModelModule.h" // For export macro
17#include "vtkNew.h" // for vtkNew
18#include "vtkObject.h"
19#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
20
21#include <initializer_list> // for std::initializer_list
22
23VTK_ABI_NAMESPACE_BEGIN
24
25class vtkDataArray;
26class vtkIdList;
27
28class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkAbstractCellArray : public vtkObject
29{
30public:
32 void PrintSelf(ostream& os, vtkIndent indent) override;
33
37 virtual void Initialize() = 0;
38
42 virtual vtkIdType GetNumberOfCells() const = 0;
43
48 virtual vtkIdType GetNumberOfOffsets() const = 0;
49
53 virtual vtkIdType GetOffset(vtkIdType cellId) = 0;
54
62
69 virtual bool IsStorageShareable() const = 0;
70
79 virtual vtkIdType IsHomogeneous() = 0;
80
91 void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints)
92 VTK_SIZEHINT(cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells());
93
103 virtual void GetCellAtId(
104 vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints, vtkIdList* ptIds)
105 VTK_SIZEHINT(cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) = 0;
106
112 virtual void GetCellAtId(vtkIdType cellId, vtkIdList* pts)
113 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) = 0;
114
122 virtual void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType* cellPoints)
123 VTK_SIZEHINT(cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) = 0;
124
128 virtual vtkIdType GetCellSize(vtkIdType cellId) const = 0;
129
134 virtual int GetMaxCellSize() = 0;
135
139 virtual void DeepCopy(vtkAbstractCellArray* ca) = 0;
140
144 virtual void ShallowCopy(vtkAbstractCellArray* ca) = 0;
145
146protected:
149
151
152private:
154 void operator=(const vtkAbstractCellArray&) = delete;
155};
156
157VTK_ABI_NAMESPACE_END
158#endif // vtkAbstractCellArray_h
abstract object to represent cell connectivity
virtual void Initialize()=0
Free any memory and reset to an empty state.
virtual void DeepCopy(vtkAbstractCellArray *ca)=0
Perform a deep copy (no reference counting) of the given cell array.
virtual bool IsStorageShareable() const =0
virtual int GetMaxCellSize()=0
Returns the size of the largest cell.
virtual void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType *cellPoints)=0
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.
virtual void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *ptIds)=0
Return the point ids for the cell at cellId.
virtual void GetCellAtId(vtkIdType cellId, vtkIdList *pts)=0
Return the point ids for the cell at cellId.
virtual vtkIdType GetNumberOfCells() const =0
Get the number of cells in the array.
vtkNew< vtkIdList > TempCell
virtual vtkIdType IsHomogeneous()=0
Check if all cells have the same number of vertices.
virtual vtkIdType GetOffset(vtkIdType cellId)=0
Get the offset (into the connectivity) for a specified cell id.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
~vtkAbstractCellArray() override
virtual vtkIdType GetNumberOfConnectivityIds() const =0
Get the size of the connectivity array that stores the point ids.
virtual void ShallowCopy(vtkAbstractCellArray *ca)=0
Shallow copy ca into this cell array.
virtual vtkIdType GetNumberOfOffsets() const =0
Get the number of elements in the offsets array.
virtual vtkIdType GetCellSize(vtkIdType cellId) const =0
Return the size of the cell at cellId.
abstract superclass for arrays of numeric data
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
abstract base class for most VTK objects
Definition vtkObject.h:162
int vtkIdType
Definition vtkType.h:315
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_MARSHALAUTO