VTK
vtkGenericCell.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGenericCell.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 =========================================================================*/
33 #ifndef vtkGenericCell_h
34 #define vtkGenericCell_h
35 
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkCell.h"
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
40 {
41 public:
45  static vtkGenericCell *New();
46 
47  vtkTypeMacro(vtkGenericCell,vtkCell);
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
54  void SetPoints(vtkPoints *points);
55 
60  void SetPointIds(vtkIdList *pointIds);
61 
63 
66  void ShallowCopy(vtkCell *c) override;
67  void DeepCopy(vtkCell *c) override;
68  int GetCellType() override;
69  int GetCellDimension() override;
70  int IsLinear() override;
71  int RequiresInitialization() override;
72  void Initialize() override;
74  void SetFaces(vtkIdType *faces) override;
75  vtkIdType *GetFaces() override;
76  int GetNumberOfEdges() override;
77  int GetNumberOfFaces() override;
78  vtkCell *GetEdge(int edgeId) override;
79  vtkCell *GetFace(int faceId) override;
80  int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override;
81  int EvaluatePosition(const double x[3], double closestPoint[3],
82  int& subId, double pcoords[3],
83  double& dist2, double weights[]) override;
84  void EvaluateLocation(int& subId, const double pcoords[3],
85  double x[3], double *weights) override;
86  void Contour(double value, vtkDataArray *cellScalars,
88  vtkCellArray *lines, vtkCellArray *polys,
89  vtkPointData *inPd, vtkPointData *outPd,
90  vtkCellData *inCd, vtkIdType cellId,
91  vtkCellData *outCd) override;
92  void Clip(double value, vtkDataArray *cellScalars,
93  vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
94  vtkPointData *inPd, vtkPointData *outPd,
95  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
96  int insideOut) override;
97  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t,
98  double x[3], double pcoords[3],
99  int& subId) override;
100  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) override;
101  void Derivatives(int subId, const double pcoords[3], const double *values,
102  int dim, double *derivs) override;
103  int GetParametricCenter(double pcoords[3]) override;
104  double *GetParametricCoords() override;
105  int IsPrimaryCell() override;
107 
109 
113  void InterpolateFunctions(const double pcoords[3], double *weights) override;
114  void InterpolateDerivs(const double pcoords[3], double *derivs) override;
116 
124  void SetCellType(int cellType);
125  void SetCellTypeToEmptyCell() {this->SetCellType(VTK_EMPTY_CELL);}
126  void SetCellTypeToVertex() {this->SetCellType(VTK_VERTEX);}
127  void SetCellTypeToPolyVertex() {this->SetCellType(VTK_POLY_VERTEX);}
128  void SetCellTypeToLine() {this->SetCellType(VTK_LINE);}
129  void SetCellTypeToPolyLine() {this->SetCellType(VTK_POLY_LINE);}
130  void SetCellTypeToTriangle() {this->SetCellType(VTK_TRIANGLE);}
131  void SetCellTypeToTriangleStrip() {this->SetCellType(VTK_TRIANGLE_STRIP);}
132  void SetCellTypeToPolygon() {this->SetCellType(VTK_POLYGON);}
133  void SetCellTypeToPixel() {this->SetCellType(VTK_PIXEL);}
134  void SetCellTypeToQuad() {this->SetCellType(VTK_QUAD);}
135  void SetCellTypeToTetra() {this->SetCellType(VTK_TETRA);}
136  void SetCellTypeToVoxel() {this->SetCellType(VTK_VOXEL);}
137  void SetCellTypeToHexahedron() {this->SetCellType(VTK_HEXAHEDRON);}
138  void SetCellTypeToWedge() {this->SetCellType(VTK_WEDGE);}
139  void SetCellTypeToPyramid() {this->SetCellType(VTK_PYRAMID);}
142  void SetCellTypeToPolyhedron() {this->SetCellType(VTK_POLYHEDRON);}
144  void SetCellTypeToQuadraticEdge() {this->SetCellType(VTK_QUADRATIC_EDGE);}
145  void SetCellTypeToCubicLine() {this->SetCellType(VTK_CUBIC_LINE);}
148  void SetCellTypeToQuadraticQuad() {this->SetCellType(VTK_QUADRATIC_QUAD);}
158  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);}
160  this->SetCellType(VTK_TRIQUADRATIC_HEXAHEDRON);}
162  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);}
164  this->SetCellType(VTK_LAGRANGE_TRIANGLE);}
166  this->SetCellType(VTK_LAGRANGE_TETRAHEDRON);}
168  this->SetCellType(VTK_LAGRANGE_CURVE);}
170  this->SetCellType(VTK_LAGRANGE_QUADRILATERAL);}
172  this->SetCellType(VTK_LAGRANGE_HEXAHEDRON);}
174  this->SetCellType(VTK_LAGRANGE_WEDGE);}
175 
179  static vtkCell* InstantiateCell(int cellType);
180 
181  vtkCell* GetRepresentativeCell() { return this->Cell; }
182 
183 protected:
184  vtkGenericCell();
185  ~vtkGenericCell() override;
186 
189 private:
190  vtkGenericCell(const vtkGenericCell&) = delete;
191  void operator=(const vtkGenericCell&) = delete;
192 };
193 
194 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkGenericCell::SetCellTypeToPolyLine
void SetCellTypeToPolyLine()
Definition: vtkGenericCell.h:129
vtkGenericCell::SetCellTypeToQuadraticEdge
void SetCellTypeToQuadraticEdge()
Definition: vtkGenericCell.h:144
VTK_LAGRANGE_WEDGE
Definition: vtkCellType.h:113
VTK_QUADRATIC_QUAD
Definition: vtkCellType.h:66
VTK_VOXEL
Definition: vtkCellType.h:56
vtkCell::IntersectWithLine
virtual int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
Intersect with a ray.
vtkGenericCell::SetCellTypeToQuadraticTetra
void SetCellTypeToQuadraticTetra()
Definition: vtkGenericCell.h:150
vtkGenericCell::SetCellTypeToLagrangeCurve
void SetCellTypeToLagrangeCurve()
Definition: vtkGenericCell.h:167
VTK_TRIANGLE_STRIP
Definition: vtkCellType.h:51
VTK_POLYHEDRON
Definition: vtkCellType.h:87
vtkCell::DeepCopy
virtual void DeepCopy(vtkCell *c)
Copy this cell by completely copying internal data structures.
vtkGenericCell::SetCellTypeToQuadraticPyramid
void SetCellTypeToQuadraticPyramid()
Definition: vtkGenericCell.h:153
vtkGenericCell::SetCellTypeToPolyVertex
void SetCellTypeToPolyVertex()
Definition: vtkGenericCell.h:127
vtkGenericCell::SetCellTypeToLagrangeHexahedron
void SetCellTypeToLagrangeHexahedron()
Definition: vtkGenericCell.h:171
vtkGenericCell::SetCellTypeToQuadraticPolygon
void SetCellTypeToQuadraticPolygon()
Definition: vtkGenericCell.h:149
vtkCell::Contour
virtual void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)=0
Generate contouring primitives.
vtkCell::ShallowCopy
virtual void ShallowCopy(vtkCell *c)
Copy this cell by reference counting the internal data structures.
vtkGenericCell::SetCellTypeToQuadraticLinearQuad
void SetCellTypeToQuadraticLinearQuad()
Definition: vtkGenericCell.h:154
vtkGenericCell::Cell
vtkCell * Cell
Definition: vtkGenericCell.h:187
VTK_QUADRATIC_LINEAR_WEDGE
Definition: vtkCellType.h:75
vtkGenericCell::GetRepresentativeCell
vtkCell * GetRepresentativeCell()
Definition: vtkGenericCell.h:181
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkX3D::value
Definition: vtkX3D.h:220
vtkCell::RequiresExplicitFaceRepresentation
virtual int RequiresExplicitFaceRepresentation()
Determine whether the cell requires explicit face representation, and methods for setting and getting...
Definition: vtkCell.h:128
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkGenericCell::SetCellTypeToQuadraticQuad
void SetCellTypeToQuadraticQuad()
Definition: vtkGenericCell.h:148
VTK_LINE
Definition: vtkCellType.h:48
VTK_PIXEL
Definition: vtkCellType.h:53
vtkGenericCell::SetCellTypeToVoxel
void SetCellTypeToVoxel()
Definition: vtkGenericCell.h:136
vtkGenericCell::SetCellTypeToPolygon
void SetCellTypeToPolygon()
Definition: vtkGenericCell.h:132
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkCell::GetCellDimension
virtual int GetCellDimension()=0
Return the topological dimensional of the cell (0,1,2, or 3).
vtkCell::Initialize
virtual void Initialize()
Definition: vtkCell.h:114
vtkGenericCell::SetCellTypeToTriangleStrip
void SetCellTypeToTriangleStrip()
Definition: vtkGenericCell.h:131
VTK_LAGRANGE_HEXAHEDRON
Definition: vtkCellType.h:112
vtkGenericCell::SetCellTypeToHexagonalPrism
void SetCellTypeToHexagonalPrism()
Definition: vtkGenericCell.h:141
VTK_LAGRANGE_TRIANGLE
Definition: vtkCellType.h:109
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
VTK_PYRAMID
Definition: vtkCellType.h:59
vtkCell::GetCellType
virtual int GetCellType()=0
Return the type of cell.
VTK_QUADRATIC_TETRA
Definition: vtkCellType.h:68
vtkGenericCell::SetCellTypeToLagrangeQuadrilateral
void SetCellTypeToLagrangeQuadrilateral()
Definition: vtkGenericCell.h:169
vtkCell::EvaluateLocation
virtual void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights)=0
Determine global coordinate (x[3]) from subId and parametric coordinates.
vtkGenericCell::SetCellTypeToPolyhedron
void SetCellTypeToPolyhedron()
Definition: vtkGenericCell.h:142
vtkCell::IsLinear
virtual int IsLinear()
Non-linear cells require special treatment beyond the usual cell type and connectivity list informati...
Definition: vtkCell.h:107
vtkGenericCell::SetCellTypeToCubicLine
void SetCellTypeToCubicLine()
Definition: vtkGenericCell.h:145
VTK_LAGRANGE_CURVE
Definition: vtkCellType.h:108
vtkGenericCell::SetCellTypeToTriQuadraticHexahedron
void SetCellTypeToTriQuadraticHexahedron()
Definition: vtkGenericCell.h:159
vtkGenericCell::SetCellTypeToConvexPointSet
void SetCellTypeToConvexPointSet()
Definition: vtkGenericCell.h:143
VTK_POLY_LINE
Definition: vtkCellType.h:49
vtkGenericCell::SetCellTypeToLagrangeTetra
void SetCellTypeToLagrangeTetra()
Definition: vtkGenericCell.h:165
vtkGenericCell::SetCellTypeToPixel
void SetCellTypeToPixel()
Definition: vtkGenericCell.h:133
vtkCell.h
VTK_QUADRATIC_PYRAMID
Definition: vtkCellType.h:71
vtkGenericCell::SetCellTypeToQuadraticWedge
void SetCellTypeToQuadraticWedge()
Definition: vtkGenericCell.h:152
VTK_QUAD
Definition: vtkCellType.h:54
VTK_NUMBER_OF_CELL_TYPES
Definition: vtkCellType.h:116
vtkGenericCell::SetCellTypeToLagrangeTriangle
void SetCellTypeToLagrangeTriangle()
Definition: vtkGenericCell.h:163
vtkGenericCell::SetCellTypeToWedge
void SetCellTypeToWedge()
Definition: vtkGenericCell.h:138
vtkGenericCell::SetCellTypeToPentagonalPrism
void SetCellTypeToPentagonalPrism()
Definition: vtkGenericCell.h:140
vtkX3D::points
Definition: vtkX3D.h:446
vtkGenericCell::SetCellTypeToTetra
void SetCellTypeToTetra()
Definition: vtkGenericCell.h:135
vtkGenericCell::SetCellTypeToTriangle
void SetCellTypeToTriangle()
Definition: vtkGenericCell.h:130
VTK_QUADRATIC_LINEAR_QUAD
Definition: vtkCellType.h:74
VTK_CONVEX_POINT_SET
Definition: vtkCellType.h:84
VTK_EMPTY_CELL
Definition: vtkCellType.h:45
vtkCell::Triangulate
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
Generate simplices of proper dimension.
vtkGenericCell::SetCellTypeToHexahedron
void SetCellTypeToHexahedron()
Definition: vtkGenericCell.h:137
VTK_TRIQUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:73
vtkCell::GetFaces
virtual vtkIdType * GetFaces()
Definition: vtkCell.h:130
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:59
vtkGenericCell::SetCellTypeToBiQuadraticQuad
void SetCellTypeToBiQuadraticQuad()
Definition: vtkGenericCell.h:155
vtkGenericCell::SetCellTypeToLine
void SetCellTypeToLine()
Definition: vtkGenericCell.h:128
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
VTK_QUADRATIC_POLYGON
Definition: vtkCellType.h:67
vtkCell::GetFace
virtual vtkCell * GetFace(int faceId)=0
Return the face cell from the faceId of the cell.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCell::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
VTK_BIQUADRATIC_QUAD
Definition: vtkCellType.h:72
vtkGenericCell::SetCellTypeToBiQuadraticTriangle
void SetCellTypeToBiQuadraticTriangle()
Definition: vtkGenericCell.h:147
VTK_POLY_VERTEX
Definition: vtkCellType.h:47
vtkGenericCell::SetCellTypeToLagrangeWedge
void SetCellTypeToLagrangeWedge()
Definition: vtkGenericCell.h:173
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
VTK_HEXAHEDRON
Definition: vtkCellType.h:57
VTK_TETRA
Definition: vtkCellType.h:55
VTK_QUADRATIC_TRIANGLE
Definition: vtkCellType.h:65
VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:77
vtkCell::IsPrimaryCell
virtual int IsPrimaryCell()
Return whether this cell type has a fixed topology or whether the topology varies depending on the da...
Definition: vtkCell.h:338
vtkCell::GetNumberOfEdges
virtual int GetNumberOfEdges()=0
Return the number of edges in the cell.
vtkCell::GetNumberOfFaces
virtual int GetNumberOfFaces()=0
Return the number of faces in the cell.
VTK_QUADRATIC_EDGE
Definition: vtkCellType.h:64
vtkGenericCell::SetCellTypeToQuadraticLinearWedge
void SetCellTypeToQuadraticLinearWedge()
Definition: vtkGenericCell.h:156
VTK_PENTAGONAL_PRISM
Definition: vtkCellType.h:60
vtkCell::RequiresInitialization
virtual int RequiresInitialization()
Some cells require initialization prior to access.
Definition: vtkCell.h:113
vtkCell::CellBoundary
virtual int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts)=0
Given parametric coordinates of a point, return the closest cell boundary, and whether the point is i...
VTK_QUADRATIC_WEDGE
Definition: vtkCellType.h:70
vtkCell::InterpolateDerivs
virtual void InterpolateDerivs(const double vtkNotUsed(pcoords)[3], double *vtkNotUsed(derivs))
Definition: vtkCell.h:360
vtkCell::SetFaces
virtual void SetFaces(vtkIdType *vtkNotUsed(faces))
Definition: vtkCell.h:129
vtkGenericCell::SetCellTypeToQuad
void SetCellTypeToQuad()
Definition: vtkGenericCell.h:134
VTK_LAGRANGE_TETRAHEDRON
Definition: vtkCellType.h:111
vtkCell::EvaluatePosition
virtual int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[])=0
Given a point x[3] return inside(=1), outside(=0) cell, or (-1) computational problem encountered; ev...
VTK_CUBIC_LINE
Definition: vtkCellType.h:81
vtkCell::GetParametricCoords
virtual double * GetParametricCoords())
Return a contiguous array of parametric coordinates of the points defining this cell.
vtkCell::Clip
virtual void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)=0
Cut (or clip) the cell based on the input cellScalars and the specified value.
vtkCell::GetEdge
virtual vtkCell * GetEdge(int edgeId)=0
Return the edge cell from the edgeId of the cell.
vtkCell::InterpolateFunctions
virtual void InterpolateFunctions(const double vtkNotUsed(pcoords)[3], double *vtkNotUsed(weight))
Compute the interpolation functions/derivatives (aka shape functions/derivatives) No-ops at this leve...
Definition: vtkCell.h:357
vtkGenericCell::SetCellTypeToEmptyCell
void SetCellTypeToEmptyCell()
Definition: vtkGenericCell.h:125
VTK_POLYGON
Definition: vtkCellType.h:52
vtkGenericCell::SetCellTypeToVertex
void SetCellTypeToVertex()
Definition: vtkGenericCell.h:126
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:39
vtkCell::Derivatives
virtual void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs)=0
Compute derivatives given cell subId and parametric coordinates.
vtkCell::GetParametricCenter
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
vtkGenericCell::SetCellTypeToBiQuadraticQuadraticWedge
void SetCellTypeToBiQuadraticQuadraticWedge()
Definition: vtkGenericCell.h:157
vtkGenericCell::SetCellTypeToQuadraticTriangle
void SetCellTypeToQuadraticTriangle()
Definition: vtkGenericCell.h:146
VTK_WEDGE
Definition: vtkCellType.h:58
VTK_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:69
VTK_BIQUADRATIC_QUADRATIC_WEDGE
Definition: vtkCellType.h:76
vtkX3D::index
Definition: vtkX3D.h:246
vtkGenericCell::SetCellTypeToBiQuadraticQuadraticHexahedron
void SetCellTypeToBiQuadraticQuadraticHexahedron()
Definition: vtkGenericCell.h:161
VTK_VERTEX
Definition: vtkCellType.h:46
VTK_TRIANGLE
Definition: vtkCellType.h:50
vtkGenericCell::SetCellTypeToQuadraticHexahedron
void SetCellTypeToQuadraticHexahedron()
Definition: vtkGenericCell.h:151
VTK_LAGRANGE_QUADRILATERAL
Definition: vtkCellType.h:110
vtkGenericCell::SetCellTypeToPyramid
void SetCellTypeToPyramid()
Definition: vtkGenericCell.h:139
VTK_HEXAGONAL_PRISM
Definition: vtkCellType.h:61
VTK_BIQUADRATIC_TRIANGLE
Definition: vtkCellType.h:78