VTK  9.0.1
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 =========================================================================*/
28 #ifndef vtkUnstructuredGridBase_h
29 #define vtkUnstructuredGridBase_h
30 
31 #include "vtkCommonDataModelModule.h" // For export macro
32 #include "vtkPointSet.h"
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkUnstructuredGridBase : public vtkPointSet
35 {
36 public:
38  void PrintSelf(ostream& os, vtkIndent indent) override
39  {
40  this->Superclass::PrintSelf(os, indent);
41  }
42 
43  int GetDataObjectType() override { return VTK_UNSTRUCTURED_GRID_BASE; }
44 
48  virtual void Allocate(vtkIdType numCells = 1000, int extSize = 1000) = 0;
49 
53  void DeepCopy(vtkDataObject* src) override;
54 
65  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
66  VTK_SIZEHINT(ptIds, npts);
67 
78 
79  // Description:
80  // Insert/create a polyhedron cell. npts is the number of unique points in
81  // the cell. pts is the list of the unique cell point Ids. nfaces is the
82  // number of faces in the cell. faces is the face-stream
83  // [numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...].
84  // All point Ids are global.
85  // Make sure you have called Allocate() before calling this method
86  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces,
87  const vtkIdType faces[]) VTK_SIZEHINT(ptIds, npts) VTK_SIZEHINT(faces, nfaces);
88 
95  void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
96 
102  virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray* array) = 0;
103 
107  virtual int IsHomogeneous() = 0;
108 
110 
116 
117 protected:
120 
121  virtual vtkIdType InternalInsertNextCell(int type, vtkIdList* ptIds) = 0;
122  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) = 0;
123  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[],
124  vtkIdType nfaces, const vtkIdType faces[]) = 0;
125  virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) = 0;
126 
127 private:
129  void operator=(const vtkUnstructuredGridBase&) = delete;
130 };
131 
132 #endif
vtkUnstructuredGridBase::GetData
static vtkUnstructuredGridBase * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkUnstructuredGridBase::InternalInsertNextCell
virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces, const vtkIdType faces[])=0
vtkUnstructuredGridBase::GetData
static vtkUnstructuredGridBase * GetData(vtkInformationVector *v, int i=0)
vtkPointSet.h
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkUnstructuredGridBase
dataset represents arbitrary combinations of all possible cell types.
Definition: vtkUnstructuredGridBase.h:35
vtkDataSet::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkUnstructuredGridBase::InternalInsertNextCell
virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])=0
vtkUnstructuredGridBase::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Definition: vtkUnstructuredGridBase.h:38
vtkUnstructuredGridBase::GetIdsOfCellsOfType
virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)=0
Fill vtkIdTypeArray container with list of cell Ids.
vtkUnstructuredGridBase::InsertNextCell
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[], vtkIdType nfaces, const vtkIdType faces[])
vtkUnstructuredGridBase::vtkUnstructuredGridBase
vtkUnstructuredGridBase()
vtkUnstructuredGridBase::InternalInsertNextCell
virtual vtkIdType InternalInsertNextCell(int type, vtkIdList *ptIds)=0
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkUnstructuredGridBase::InternalReplaceCell
virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[])=0
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:31
vtkUnstructuredGridBase::vtkAbstractTypeMacro
vtkAbstractTypeMacro(vtkUnstructuredGridBase, vtkPointSet)
vtkUnstructuredGridBase::GetDataObjectType
int GetDataObjectType() override
Return the type of data object.
Definition: vtkUnstructuredGridBase.h:43
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:36
vtkUnstructuredGridBase::DeepCopy
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkUnstructuredGridBase::~vtkUnstructuredGridBase
~vtkUnstructuredGridBase() override
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:63
VTK_UNSTRUCTURED_GRID_BASE
#define VTK_UNSTRUCTURED_GRID_BASE
Definition: vtkType.h:121
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:60
vtkUnstructuredGridBase::Allocate
virtual void Allocate(vtkIdType numCells=1000, int extSize=1000)=0
Allocate memory for the number of cells indicated.
vtkUnstructuredGridBase::IsHomogeneous
virtual int IsHomogeneous()=0
Traverse cells and determine if cells are all of the same type.
vtkUnstructuredGridBase::InsertNextCell
vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[])
Insert/create cell in object by type and list of point ids defining cell topology.
vtkUnstructuredGridBase::InsertNextCell
vtkIdType InsertNextCell(int type, vtkIdList *ptIds)
Insert/create cell in object by a list of point ids defining cell topology.
vtkUnstructuredGridBase::ReplaceCell
void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[])
Replace the points defining cell "cellId" with a new set of points.