VTK  9.7.1
vtkUnstructuredGridBase.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
19 #ifndef vtkUnstructuredGridBase_h
20 #define vtkUnstructuredGridBase_h
21 
22 #include "vtkCommonDataModelModule.h" // For export macro
23 #include "vtkPointSet.h"
24 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkCellArray;
28 
29 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkUnstructuredGridBase : public vtkPointSet
30 {
31 public:
32  vtkAbstractTypeMacro(vtkUnstructuredGridBase, vtkPointSet);
33  void PrintSelf(ostream& os, vtkIndent indent) override
34  {
35  this->Superclass::PrintSelf(os, indent);
36  }
37 
38  int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_UNSTRUCTURED_GRID_BASE; }
39 
43  virtual void Allocate(vtkIdType numCells = 1000, int extSize = 1000) = 0;
44 
48  void DeepCopy(vtkDataObject* src) override;
49 
60  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
61  VTK_SIZEHINT(ptIds, npts);
62 
72  vtkIdType InsertNextCell(int type, vtkIdList* ptIds);
73 
74  // Description:
75  // Insert/create a polyhedron cell. npts is the number of unique points in
76  // the cell. pts is the list of the unique cell point Ids. nfaces is the
77  // number of faces in the cell. faces is the face-stream
78  // [numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...].
79  // All point Ids are global.
80  // Make sure you have called Allocate() before calling this method
81  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces,
82  const vtkIdType faces[]) VTK_SIZEHINT(ptIds, npts) VTK_SIZEHINT(faces, nfaces);
83 
84  // Description:
85  // Insert/create a polyhedron cell. npts is the number of unique points in
86  // the cell. pts is the list of the unique cell point Ids.
87  // faces is the face-stream stored in vtkCellArray format
88  // All point Ids are global.
89  // Make sure you have called Allocate() before calling this method
90  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkCellArray* faces)
91  VTK_SIZEHINT(ptIds, npts);
92 
99  void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
100 
106  virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray* array) = 0;
107 
111  virtual int IsHomogeneous() = 0;
112 
114 
120 
121 protected:
123  ~vtkUnstructuredGridBase() override;
124 
125  virtual vtkIdType InternalInsertNextCell(int type, vtkIdList* ptIds) = 0;
126  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) = 0;
127  virtual vtkIdType InternalInsertNextCell(
128  int type, vtkIdType npts, const vtkIdType ptIds[], vtkCellArray* faces) = 0;
129  virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) = 0;
130 
131 private:
132  vtkUnstructuredGridBase(const vtkUnstructuredGridBase&) = delete;
133  void operator=(const vtkUnstructuredGridBase&) = delete;
134 };
135 
136 VTK_ABI_NAMESPACE_END
137 #endif
Store vtkAlgorithm input/output information.
int GetDataObjectType() VTK_FUTURE_CONST override
Standard vtkDataSet API methods.
concrete class for storing a set of points
Definition: vtkPointSet.h:58
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:363
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
VTKACCELERATORSVTKMDATAMODEL_EXPORT vtkIdType IsHomogeneous(vtkCellArray *cells)
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
#define VTK_SIZEHINT(...)
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
object to represent cell connectivity
Definition: vtkCellArray.h:177
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
general representation of visualization data
Definition: vtkDataObject.h:55
dataset represents arbitrary combinations of all possible cell types.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.