VTK  9.3.0
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 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKCOMMONDATAMODEL_EXPORT vtkUnstructuredGridBase : public vtkPointSet
27 {
28 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override
31  {
32  this->Superclass::PrintSelf(os, indent);
33  }
34 
35  int GetDataObjectType() override { return VTK_UNSTRUCTURED_GRID_BASE; }
36 
40  virtual void Allocate(vtkIdType numCells = 1000, int extSize = 1000) = 0;
41 
45  void DeepCopy(vtkDataObject* src) override;
46 
57  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
58  VTK_SIZEHINT(ptIds, npts);
59 
70 
71  // Description:
72  // Insert/create a polyhedron cell. npts is the number of unique points in
73  // the cell. pts is the list of the unique cell point Ids. nfaces is the
74  // number of faces in the cell. faces is the face-stream
75  // [numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...].
76  // All point Ids are global.
77  // Make sure you have called Allocate() before calling this method
78  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces,
79  const vtkIdType faces[]) VTK_SIZEHINT(ptIds, npts) VTK_SIZEHINT(faces, nfaces);
80 
87  void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
88 
94  virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray* array) = 0;
95 
99  virtual int IsHomogeneous() = 0;
100 
102 
108 
109 protected:
112 
113  virtual vtkIdType InternalInsertNextCell(int type, vtkIdList* ptIds) = 0;
114  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) = 0;
115  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[],
116  vtkIdType nfaces, const vtkIdType faces[]) = 0;
117  virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) = 0;
118 
119 private:
121  void operator=(const vtkUnstructuredGridBase&) = delete;
122 };
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
general representation of visualization data
Definition: vtkDataObject.h:55
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:23
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition: vtkPointSet.h:59
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.
virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces, const vtkIdType faces[])=0
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.
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(...)