VTK  9.2.5
vtkUnstructuredGridBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUnstructuredGridBase.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkUnstructuredGridBase_h
32 #define vtkUnstructuredGridBase_h
33 
34 #include "vtkCommonDataModelModule.h" // For export macro
35 #include "vtkPointSet.h"
36 
37 class VTKCOMMONDATAMODEL_EXPORT vtkUnstructuredGridBase : public vtkPointSet
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override
42  {
43  this->Superclass::PrintSelf(os, indent);
44  }
45 
46  int GetDataObjectType() override { return VTK_UNSTRUCTURED_GRID_BASE; }
47 
51  virtual void Allocate(vtkIdType numCells = 1000, int extSize = 1000) = 0;
52 
56  void DeepCopy(vtkDataObject* src) override;
57 
68  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
69  VTK_SIZEHINT(ptIds, npts);
70 
81 
82  // Description:
83  // Insert/create a polyhedron cell. npts is the number of unique points in
84  // the cell. pts is the list of the unique cell point Ids. nfaces is the
85  // number of faces in the cell. faces is the face-stream
86  // [numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...].
87  // All point Ids are global.
88  // Make sure you have called Allocate() before calling this method
89  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces,
90  const vtkIdType faces[]) VTK_SIZEHINT(ptIds, npts) VTK_SIZEHINT(faces, nfaces);
91 
98  void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
99 
105  virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray* array) = 0;
106 
110  virtual int IsHomogeneous() = 0;
111 
113 
119 
120 protected:
123 
124  virtual vtkIdType InternalInsertNextCell(int type, vtkIdList* ptIds) = 0;
125  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) = 0;
126  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[],
127  vtkIdType nfaces, const vtkIdType faces[]) = 0;
128  virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) = 0;
129 
130 private:
132  void operator=(const vtkUnstructuredGridBase&) = delete;
133 };
134 
135 #endif
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:143
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition: vtkPointSet.h:109
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
Return the type of data object.
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:382
@ type
Definition: vtkX3D.h:522
int vtkIdType
Definition: vtkType.h:332
#define VTK_UNSTRUCTURED_GRID_BASE
Definition: vtkType.h:113
#define VTK_SIZEHINT(...)