VTK
vtkUnstructuredGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUnstructuredGrid.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 =========================================================================*/
32 #ifndef __vtkUnstructuredGrid_h
33 #define __vtkUnstructuredGrid_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
37 
38 class vtkCellArray;
39 class vtkCellLinks;
40 class vtkConvexPointSet;
41 class vtkEmptyCell;
42 class vtkHexahedron;
43 class vtkIdList;
44 class vtkIdTypeArray;
45 class vtkLine;
46 class vtkPixel;
47 class vtkPolyLine;
48 class vtkPolyVertex;
49 class vtkPolygon;
50 class vtkPyramid;
51 class vtkPentagonalPrism;
52 class vtkHexagonalPrism;
53 class vtkQuad;
54 class vtkQuadraticEdge;
56 class vtkQuadraticWedge;
59 class vtkQuadraticQuad;
60 class vtkQuadraticTetra;
62 class vtkTetra;
63 class vtkTriangle;
64 class vtkTriangleStrip;
66 class vtkVertex;
67 class vtkVoxel;
68 class vtkWedge;
72 class vtkBiQuadraticQuad;
76 class vtkCubicLine;
77 class vtkPolyhedron;
78 class vtkIdTypeArray;
79 
82 {
83 public:
84  static vtkUnstructuredGrid *New();
85 
87  void PrintSelf(ostream& os, vtkIndent indent);
88 
90  int GetDataObjectType() {return VTK_UNSTRUCTURED_GRID;};
91 
96  virtual void Allocate(vtkIdType numCells=1000, int extSize=1000);
97 
106  vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds);
107 
114  vtkIdType InsertNextCell(int type, vtkIdList *ptIds);
115 
116  // Desciption:
117  // Insert/create a polyhedron cell. npts is the number of unique points in
118  // the cell. pts is the list of the unique cell point Ids. nfaces is the
119  // number of faces in the cell. faces is the face-stream
120  // [numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...].
121  // All point Ids are global.
122  vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds,
123  vtkIdType nfaces, vtkIdType *faces);
124 
126 
127  void Reset();
128  virtual void CopyStructure(vtkDataSet *ds);
130  virtual vtkCell *GetCell(vtkIdType cellId);
131  virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
132  virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
133  virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
134  void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
137 
138  int GetCellType(vtkIdType cellId);
139  vtkUnsignedCharArray* GetCellTypesArray() { return this->Types; }
140  vtkIdTypeArray* GetCellLocationsArray() { return this->Locations; }
141  void Squeeze();
142  void Initialize();
143  int GetMaxCellSize();
144  void BuildLinks();
145  vtkCellLinks *GetCellLinks() {return this->Links;};
146  virtual void GetCellPoints(vtkIdType cellId, vtkIdType& npts,
147  vtkIdType* &pts);
148 
154  void GetFaceStream(vtkIdType cellId, vtkIdList *ptIds);
155 
161  void GetFaceStream(vtkIdType cellId, vtkIdType& nfaces, vtkIdType* &ptIds);
162 
164 
176  void SetCells(int type, vtkCellArray *cells);
177  void SetCells(int *types, vtkCellArray *cells);
178  void SetCells(vtkUnsignedCharArray *cellTypes, vtkIdTypeArray *cellLocations,
179  vtkCellArray *cells);
180  void SetCells(vtkUnsignedCharArray *cellTypes, vtkIdTypeArray *cellLocations,
181  vtkCellArray *cells, vtkIdTypeArray *faceLocations,
182  vtkIdTypeArray *faces);
184 
185  vtkCellArray *GetCells() {return this->Connectivity;};
186  void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts);
187  vtkIdType InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
188  void RemoveReferenceToCell(vtkIdType ptId, vtkIdType cellId);
189  void AddReferenceToCell(vtkIdType ptId, vtkIdType cellId);
190  void ResizeCellList(vtkIdType ptId, int size);
191 
193 
196  virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
197  vtkIdList *cellIds);
199 
201 
203  virtual int GetPiece();
204  virtual int GetNumberOfPieces();
206 
208  virtual int GetGhostLevel();
209 
215  unsigned long GetActualMemorySize();
216 
218 
219  virtual void ShallowCopy(vtkDataObject *src);
220  virtual void DeepCopy(vtkDataObject *src);
222 
226  void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array);
227 
229  int IsHomogeneous();
230 
233  void RemoveGhostCells(int level);
234 
235  //BTX
237 
240  //ETX
242 
244  vtkIdType *GetFaces(vtkIdType cellId);
245 
247 
248  vtkIdTypeArray* GetFaces(){return this->Faces;};
249  vtkIdTypeArray* GetFaceLocations(){return this->FaceLocations;};
251 
258  int InitializeFacesRepresentation(vtkIdType numPrevCells);
259 
261 
270  static void DecomposeAPolyhedronCell(vtkCellArray *polyhedronCellArray,
271  vtkIdType & nCellpts,
272  vtkIdType & nCellfaces,
273  vtkCellArray *cellArray,
274  vtkIdTypeArray *faces);
276 
277  static void DecomposeAPolyhedronCell(vtkIdType * polyhedronCellStream,
278  vtkIdType & nCellpts,
279  vtkIdType & nCellfaces,
280  vtkCellArray *cellArray,
281  vtkIdTypeArray *faces);
282 
284 
293  static void DecomposeAPolyhedronCell(vtkIdType nCellFaces,
294  vtkIdType * inFaceStream,
295  vtkIdType & nCellpts,
296  vtkCellArray * cellArray,
297  vtkIdTypeArray * faces);
299 
301 
305  static void ConvertFaceStreamPointIds(vtkIdList * faceStream,
306  vtkIdType * idMap);
308 
310 
314  static void ConvertFaceStreamPointIds(vtkIdType nfaces,
315  vtkIdType * faceStream,
316  vtkIdType * idMap);
318 
319 
320 protected:
323 
324  // used by GetCell method
360 
361  // points inherited
362  // point data (i.e., scalars, vectors, normals, tcoords) inherited
367 
368  // Special support for polyhedra/cells with explicit face representations.
369  // The Faces class represents polygonal faces using a modified vtkCellArray
370  // structure. Each cell face list begins with the total number of faces in
371  // the cell, followed by a vtkCellArray data organization
372  // (n,i,j,k,n,i,j,k,...).
375 
376 private:
377  // Hide these from the user and the compiler.
378  vtkUnstructuredGrid(const vtkUnstructuredGrid&); // Not implemented.
379  void operator=(const vtkUnstructuredGrid&); // Not implemented.
380 
381  void Cleanup();
382 
384 
385  VTK_LEGACY(void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds));
386 };
388 
389 #endif
virtual vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds)=0
GLsizeiptr size
Definition: vtkgl.h:11843
vtkIdTypeArray * Faces
virtual void Allocate(vtkIdType numCells=1000, int extSize=1000)=0
static vtkUnstructuredGridBase * GetData(vtkInformation *info)
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
virtual vtkIdType GetNumberOfCells()=0
virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)=0
vtkTriangleStrip * TriangleStrip
const GLdouble * v
Definition: vtkgl.h:11595
static vtkDataObject * New()
cell represents a parabolic, 13-node isoparametric pyramid
vtkTriQuadraticHexahedron * TriQuadraticHexahedron
Store vtkAlgorithm input/output information.
vtkCellLinks * GetCellLinks()
void DeepCopy(vtkDataObject *src)
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
a cell that represents a 3D point
Definition: vtkVertex.h:35
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:48
vtkQuadraticWedge * QuadraticWedge
virtual void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts)=0
a cell that represents an orthogonal quadrilateral
Definition: vtkPixel.h:39
cell represents a parabolic, 9-node isoparametric quad
GLint level
Definition: vtkgl.h:11316
vtkQuadraticTriangle * QuadraticTriangle
vtkPentagonalPrism * PentagonalPrism
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
void CopyStructure(vtkDataSet *pd)
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:40
dynamic, self-adjusting array of vtkIdType
void Initialize()
unsigned long GetActualMemorySize()
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:31
vtkQuadraticHexahedron * QuadraticHexahedron
int vtkIdType
Definition: vtkType.h:268
cell represents a set of 0D vertices
Definition: vtkPolyVertex.h:37
void Squeeze()
vtkQuadraticTetra * QuadraticTetra
cell represents a parabolic, 18-node isoparametric wedge
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
provides thread-safe access to cells
vtkPolyhedron * Polyhedron
cell represents a biquadratic, 24-node isoparametric hexahedron
a 3D cell that represents a prism with hexagonal base
vtkHexagonalPrism * HexagonalPrism
cell represents a cubic , isoparametric 1D line
Definition: vtkCubicLine.h:44
vtkBiQuadraticQuad * BiQuadraticQuad
a cell that represents a triangle strip
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
a 3D cell that represents a prism with pentagonal base
vtkIdTypeArray * FaceLocations
cell represents a 1D line
Definition: vtkLine.h:34
abstract class to specify cell behavior
Definition: vtkCell.h:58
a cell that represents a 3D orthogonal parallelepiped
Definition: vtkVoxel.h:43
GLenum src
Definition: vtkgl.h:12525
cell represents a parabolic, 8-node isoparametric quad
virtual void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)=0
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkQuadraticQuad * QuadraticQuad
virtual int GetMaxCellSize()=0
vtkIdTypeArray * GetFaces()
list of point or cell ids
Definition: vtkIdList.h:35
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
dataset represents arbitrary combinations of all possible cell types
vtkBiQuadraticTriangle * BiQuadraticTriangle
vtkHexahedron * Hexahedron
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:44
cell represents a parabolic, isoparametric triangle
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:46
cell represents a parabolic, 10-node isoparametric tetrahedron
a 3D cell defined by a set of convex points
virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds)
GLsizei GLenum GLenum * types
Definition: vtkgl.h:14417
dynamic, self-adjusting array of unsigned char
#define VTK_LEGACY(method)
Definition: vtkSetGet.h:787
vtkQuadraticLinearWedge * QuadraticLinearWedge
vtkUnsignedCharArray * GetCellTypesArray()
vtkCellIterator * NewCellIterator()
vtkBiQuadraticQuadraticWedge * BiQuadraticQuadraticWedge
object to represent cell connectivity
Definition: vtkCellArray.h:49
vtkBiQuadraticQuadraticHexahedron * BiQuadraticQuadraticHexahedron
cell represents a parabolic, 27-node isoparametric hexahedron
a cell that represents a parabolic n-sided polygon
cell represents a parabolic, isoparametric edge
virtual int IsHomogeneous()=0
a cell that represents a triangle
Definition: vtkTriangle.h:40
cell represents a parabolic, 20-node isoparametric hexahedron
vtkUnsignedCharArray * Types
cell represents a parabolic, isoparametric triangle
cell represents a parabolic, 15-node isoparametric wedge
vtkQuadraticLinearQuad * QuadraticLinearQuad
vtkConvexPointSet * ConvexPointSet
Store zero or more vtkInformation instances.
a 3D cell defined by a set of polygonal faces
Definition: vtkPolyhedron.h:59
vtkCellArray * GetCells()
Efficient cell iterator for vtkDataSet topologies.
vtkPolyVertex * PolyVertex
vtkIdTypeArray * GetFaceLocations()
vtkCellArray * Connectivity
void ShallowCopy(vtkDataObject *src)
general representation of visualization data
Definition: vtkDataObject.h:64
cell represents a, 12-node isoparametric wedge
cell represents a quadratic-linear, 6-node isoparametric quad
vtkQuadraticPolygon * QuadraticPolygon
dataset represents arbitrary combinations of all possible cell types. May be mapped onto a non-standa...
vtkQuadraticEdge * QuadraticEdge
#define VTKCOMMONDATAMODEL_EXPORT
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:48
vtkIdTypeArray * Locations
virtual vtkCell * GetCell(vtkIdType cellId)=0
virtual void GetCellBounds(vtkIdType cellId, double bounds[6])
#define VTK_UNSTRUCTURED_GRID
Definition: vtkType.h:70
vtkQuadraticPyramid * QuadraticPyramid
cell represents a set of 1D lines
Definition: vtkPolyLine.h:41
virtual int GetCellType(vtkIdType cellId)=0
vtkIdTypeArray * GetCellLocationsArray()