VTK  9.5.20251011
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
59
66 virtual bool IsStorageShareable() const = 0;
67
76 virtual vtkIdType IsHomogeneous() const = 0;
77
88 void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints)
89 VTK_SIZEHINT(cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells());
90
100 virtual void GetCellAtId(
101 vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints, vtkIdList* ptIds)
102 VTK_SIZEHINT(cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) = 0;
103
109 virtual void GetCellAtId(vtkIdType cellId, vtkIdList* pts)
110 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) = 0;
111
119 virtual void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType* cellPoints)
120 VTK_SIZEHINT(cellPoints, cellSize) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) = 0;
121
125 virtual vtkIdType GetCellSize(vtkIdType cellId) const = 0;
126
131 virtual int GetMaxCellSize() = 0;
132
136 virtual void DeepCopy(vtkAbstractCellArray* ca) = 0;
137
141 virtual void ShallowCopy(vtkAbstractCellArray* ca) = 0;
142
143protected:
146
148
149private:
151 void operator=(const vtkAbstractCellArray&) = delete;
152};
153
154VTK_ABI_NAMESPACE_END
155#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 vtkIdType IsHomogeneous() const =0
Check if all cells have the same number of vertices.
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 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:367
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_MARSHALAUTO