VTK
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:
40  vtkAbstractTypeMacro(vtkUnstructuredGridBase,vtkPointSet)
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[]) VTK_SIZEHINT(ptIds, npts);
69 
79  vtkIdType InsertNextCell(int type, vtkIdList *ptIds);
80 
81  // Description:
82  // Insert/create a polyhedron cell. npts is the number of unique points in
83  // the cell. pts is the list of the unique cell point Ids. nfaces is the
84  // number of faces in the cell. faces is the face-stream
85  // [numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...].
86  // All point Ids are global.
87  // Make sure you have called Allocate() before calling this method
88  vtkIdType InsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[],
89  vtkIdType nfaces, const vtkIdType faces[]) VTK_SIZEHINT(ptIds, npts) VTK_SIZEHINT(faces, nfaces);
90 
97  void ReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) VTK_SIZEHINT(pts, npts);
98 
104  virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array) = 0;
105 
109  virtual int IsHomogeneous() = 0;
110 
112 
118 
119 protected:
121  ~vtkUnstructuredGridBase() override;
122 
123  virtual vtkIdType InternalInsertNextCell(int type, vtkIdList *ptIds) = 0;
124  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[]) = 0;
125  virtual vtkIdType InternalInsertNextCell(int type, vtkIdType npts, const vtkIdType ptIds[],
126  vtkIdType nfaces, const vtkIdType faces[]) = 0;
127  virtual void InternalReplaceCell(vtkIdType cellId, int npts, const vtkIdType pts[]) = 0;
128 
129 private:
131  void operator=(const vtkUnstructuredGridBase&) = delete;
132 };
133 
134 #endif
Store vtkAlgorithm input/output information.
static vtkPointSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:42
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:347
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
int GetDataObjectType() override
Return the type of data object.
list of point or cell ids
Definition: vtkIdList.h:36
#define VTK_SIZEHINT(...)
#define VTK_UNSTRUCTURED_GRID_BASE
Definition: vtkType.h:127
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:64
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.