VTK  9.3.20240418
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:
33  void PrintSelf(ostream& os, vtkIndent indent) override
34  {
35  this->Superclass::PrintSelf(os, indent);
36  }
37 
38  int GetDataObjectType() 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 
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:
124 
125  virtual vtkIdType InternalInsertNextCell(int type, vtkIdList* ptIds) = 0;
126  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) = 0;
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:
133  void operator=(const vtkUnstructuredGridBase&) = delete;
134 };
135 
136 VTK_ABI_NAMESPACE_END
137 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:286
general representation of visualization data
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:133
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition: vtkPointSet.h:98
dataset represents arbitrary combinations of all possible cell types.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
static vtkUnstructuredGridBase * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[])
Replace the points defining cell "cellId" with a new set of points.
vtkIdType InsertNextCell(int type, vtkIdList *ptIds)
Insert/create cell in object by a list of point ids defining cell topology.
virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[])=0
vtkAbstractTypeMacro(vtkUnstructuredGridBase, vtkPointSet)
int GetDataObjectType() override
Standard vtkDataSet API methods.
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkCellArray *faces)
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces, const vtkIdType faces[])
virtual vtkIdType InternalInsertNextCell(int type, vtkIdList *ptIds)=0
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
~vtkUnstructuredGridBase() override
virtual int IsHomogeneous()=0
Traverse cells and determine if cells are all of the same type.
virtual void Allocate(vtkIdType numCells=1000, int extSize=1000)=0
Allocate memory for the number of cells indicated.
virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])=0
virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)=0
Fill vtkIdTypeArray container with list of cell Ids.
virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkCellArray *faces)=0
static vtkUnstructuredGridBase * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
Insert/create cell in object by type and list of point ids defining cell topology.
@ info
Definition: vtkX3D.h:376
@ type
Definition: vtkX3D.h:516
int vtkIdType
Definition: vtkType.h:315
#define VTK_UNSTRUCTURED_GRID_BASE
Definition: vtkType.h:101
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO