VTK  9.7.1
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 
23 VTK_ABI_NAMESPACE_BEGIN
24 
25 class vtkDataArray;
26 class vtkIdList;
27 
28 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkAbstractCellArray : public vtkObject
29 {
30 public:
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 
58  virtual vtkIdType GetNumberOfConnectivityIds() const = 0;
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 
143 protected:
145  ~vtkAbstractCellArray() override;
146 
147  vtkNew<vtkIdList> TempCell;
148 
149 private:
150  vtkAbstractCellArray(const vtkAbstractCellArray&) = delete;
151  void operator=(const vtkAbstractCellArray&) = delete;
152 };
153 
154 VTK_ABI_NAMESPACE_END
155 #endif // vtkAbstractCellArray_h
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract object to represent cell connectivity
int vtkIdType
Definition: vtkType.h:363
VTKACCELERATORSVTKMDATAMODEL_EXPORT vtkIdType IsHomogeneous(vtkCellArray *cells)
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
#define VTK_SIZEHINT(...)
Allocate and hold a VTK object.
#define VTK_MARSHALAUTO
#define VTK_EXPECTS(x)