VTK  9.3.0
vtkGenericCell.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
30 #ifndef vtkGenericCell_h
31 #define vtkGenericCell_h
32 
33 #include "vtkCell.h"
34 #include "vtkCommonDataModelModule.h" // For export macro
35 
36 VTK_ABI_NAMESPACE_BEGIN
37 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
38 {
39 public:
43  static vtkGenericCell* New();
44 
45  vtkTypeMacro(vtkGenericCell, vtkCell);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
53 
58  void SetPointIds(vtkIdList* pointIds);
59 
61 
64  void ShallowCopy(vtkCell* c) override;
65  void DeepCopy(vtkCell* c) override;
66  int GetCellType() override;
67  int GetCellDimension() override;
68  int IsLinear() override;
69  int RequiresInitialization() override;
70  void Initialize() override;
72  void SetFaces(vtkIdType* faces) override;
73  vtkIdType* GetFaces() override;
74  int GetNumberOfEdges() override;
75  int GetNumberOfFaces() override;
76  vtkCell* GetEdge(int edgeId) override;
77  vtkCell* GetFace(int faceId) override;
78  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
79  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
80  double& dist2, double weights[]) override;
81  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
82  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
83  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
84  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
85  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
86  vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
87  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
88  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
89  double pcoords[3], int& subId) override;
90  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
92  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
93  int GetParametricCenter(double pcoords[3]) override;
94  double* GetParametricCoords() override;
95  int IsPrimaryCell() override;
97 
99 
103  void InterpolateFunctions(const double pcoords[3], double* weights) override;
104  void InterpolateDerivs(const double pcoords[3], double* derivs) override;
106 
114  void SetCellType(int cellType);
115  void SetCellTypeToEmptyCell() { this->SetCellType(VTK_EMPTY_CELL); }
116  void SetCellTypeToVertex() { this->SetCellType(VTK_VERTEX); }
117  void SetCellTypeToPolyVertex() { this->SetCellType(VTK_POLY_VERTEX); }
118  void SetCellTypeToLine() { this->SetCellType(VTK_LINE); }
119  void SetCellTypeToPolyLine() { this->SetCellType(VTK_POLY_LINE); }
120  void SetCellTypeToTriangle() { this->SetCellType(VTK_TRIANGLE); }
121  void SetCellTypeToTriangleStrip() { this->SetCellType(VTK_TRIANGLE_STRIP); }
122  void SetCellTypeToPolygon() { this->SetCellType(VTK_POLYGON); }
123  void SetCellTypeToPixel() { this->SetCellType(VTK_PIXEL); }
124  void SetCellTypeToQuad() { this->SetCellType(VTK_QUAD); }
125  void SetCellTypeToTetra() { this->SetCellType(VTK_TETRA); }
126  void SetCellTypeToVoxel() { this->SetCellType(VTK_VOXEL); }
127  void SetCellTypeToHexahedron() { this->SetCellType(VTK_HEXAHEDRON); }
128  void SetCellTypeToWedge() { this->SetCellType(VTK_WEDGE); }
129  void SetCellTypeToPyramid() { this->SetCellType(VTK_PYRAMID); }
130  void SetCellTypeToPentagonalPrism() { this->SetCellType(VTK_PENTAGONAL_PRISM); }
131  void SetCellTypeToHexagonalPrism() { this->SetCellType(VTK_HEXAGONAL_PRISM); }
132  void SetCellTypeToPolyhedron() { this->SetCellType(VTK_POLYHEDRON); }
133  void SetCellTypeToConvexPointSet() { this->SetCellType(VTK_CONVEX_POINT_SET); }
134  void SetCellTypeToQuadraticEdge() { this->SetCellType(VTK_QUADRATIC_EDGE); }
135  void SetCellTypeToCubicLine() { this->SetCellType(VTK_CUBIC_LINE); }
138  void SetCellTypeToQuadraticQuad() { this->SetCellType(VTK_QUADRATIC_QUAD); }
140  void SetCellTypeToQuadraticTetra() { this->SetCellType(VTK_QUADRATIC_TETRA); }
142  void SetCellTypeToQuadraticWedge() { this->SetCellType(VTK_QUADRATIC_WEDGE); }
145  void SetCellTypeToBiQuadraticQuad() { this->SetCellType(VTK_BIQUADRATIC_QUAD); }
148  {
149  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
150  }
154  {
155  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);
156  }
159  void SetCellTypeToLagrangeCurve() { this->SetCellType(VTK_LAGRANGE_CURVE); }
162  void SetCellTypeToLagrangeWedge() { this->SetCellType(VTK_LAGRANGE_WEDGE); }
163 
164  void SetCellTypeToBezierTriangle() { this->SetCellType(VTK_BEZIER_TRIANGLE); }
165  void SetCellTypeToBezierTetra() { this->SetCellType(VTK_BEZIER_TETRAHEDRON); }
166  void SetCellTypeToBezierCurve() { this->SetCellType(VTK_BEZIER_CURVE); }
169  void SetCellTypeToBezierWedge() { this->SetCellType(VTK_BEZIER_WEDGE); }
173  static vtkCell* InstantiateCell(int cellType);
174 
175  vtkCell* GetRepresentativeCell() { return this->Cell; }
176 
177 protected:
179  ~vtkGenericCell() override;
180 
183 
184 private:
185  vtkGenericCell(const vtkGenericCell&) = delete;
186  void operator=(const vtkGenericCell&) = delete;
187 };
188 
189 VTK_ABI_NAMESPACE_END
190 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:185
represent and manipulate cell attribute data
Definition: vtkCellData.h:40
abstract class to specify cell behavior
Definition: vtkCell.h:59
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
provides thread-safe access to cells
void SetCellTypeToLagrangeCurve()
void SetCellTypeToHexahedron()
void SetCellTypeToQuadraticLinearWedge()
vtkCell * GetRepresentativeCell()
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToLagrangeWedge()
void Initialize() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToQuadraticWedge()
void SetCellTypeToQuadraticPolygon()
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToPyramid()
void SetCellTypeToQuadraticTetra()
void SetCellTypeToQuad()
void SetCellTypeToTriangleStrip()
void SetCellTypeToPixel()
int RequiresInitialization() override
See the vtkCell API for descriptions of these methods.
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToQuadraticQuad()
void SetCellTypeToQuadraticLinearQuad()
int GetParametricCenter(double pcoords[3]) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToBezierWedge()
static vtkCell * InstantiateCell(int cellType)
Instantiate a new vtkCell based on it's cell type value.
void SetCellTypeToTetra()
~vtkGenericCell() override
static vtkGenericCell * New()
Create handle to any type of cell; by default a vtkEmptyCell.
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToLagrangeTetra()
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
See the vtkCell API for descriptions of these methods.
void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToPolyhedron()
void SetCellTypeToLine()
vtkIdType * GetFaces() override
See the vtkCell API for descriptions of these methods.
void InterpolateDerivs(const double pcoords[3], double *derivs) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
void SetCellTypeToBezierTetra()
int IsPrimaryCell() override
See the vtkCell API for descriptions of these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int IsLinear() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToQuadraticHexahedron()
void SetCellTypeToVoxel()
void SetPoints(vtkPoints *points)
Set the points object to use for this cell.
double * GetParametricCoords() override
See the vtkCell API for descriptions of these methods.
vtkCell * GetFace(int faceId) override
See the vtkCell API for descriptions of these methods.
void SetFaces(vtkIdType *faces) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToTriQuadraticHexahedron()
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToBiQuadraticQuadraticHexahedron()
void SetCellTypeToBiQuadraticQuad()
void SetCellTypeToCubicLine()
int RequiresExplicitFaceRepresentation() override
See the vtkCell API for descriptions of these methods.
int GetNumberOfEdges() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToConvexPointSet()
int GetCellDimension() override
See the vtkCell API for descriptions of these methods.
void DeepCopy(vtkCell *c) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToVertex()
void SetCellTypeToBezierCurve()
int GetNumberOfFaces() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToLagrangeTriangle()
void SetCellTypeToWedge()
void SetCellType(int cellType)
This method is used to support the vtkDataSet::GetCell(vtkGenericCell *) method.
int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToTriangle()
void SetCellTypeToQuadraticPyramid()
void SetCellTypeToQuadraticEdge()
int GetCellType() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToBiQuadraticQuadraticWedge()
void SetCellTypeToBiQuadraticTriangle()
void SetCellTypeToPolyLine()
void SetCellTypeToPentagonalPrism()
void SetCellTypeToPolygon()
void SetCellTypeToBezierQuadrilateral()
void SetCellTypeToLagrangeQuadrilateral()
void SetCellTypeToBezierTriangle()
void InterpolateFunctions(const double pcoords[3], double *weights) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
void SetCellTypeToHexagonalPrism()
void SetCellTypeToBezierHexahedron()
vtkCell * GetEdge(int edgeId) override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToEmptyCell()
void SetCellTypeToLagrangeHexahedron()
void SetCellTypeToPolyVertex()
void ShallowCopy(vtkCell *c) override
See the vtkCell API for descriptions of these methods.
void SetPointIds(vtkIdList *pointIds)
Set the point ids to use for this cell.
void SetCellTypeToTriQuadraticPyramid()
void SetCellTypeToQuadraticTriangle()
list of point or cell ids
Definition: vtkIdList.h:32
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate point attribute data
Definition: vtkPointData.h:39
represent and manipulate 3D points
Definition: vtkPoints.h:38
@ points
Definition: vtkX3D.h:446
@ value
Definition: vtkX3D.h:220
@ index
Definition: vtkX3D.h:246
@ VTK_VOXEL
Definition: vtkCellType.h:57
@ VTK_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:70
@ VTK_TRIANGLE_STRIP
Definition: vtkCellType.h:52
@ VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:79
@ VTK_NUMBER_OF_CELL_TYPES
Definition: vtkCellType.h:127
@ VTK_LAGRANGE_CURVE
Definition: vtkCellType.h:110
@ VTK_PYRAMID
Definition: vtkCellType.h:60
@ VTK_PIXEL
Definition: vtkCellType.h:54
@ VTK_QUADRATIC_WEDGE
Definition: vtkCellType.h:71
@ VTK_BEZIER_WEDGE
Definition: vtkCellType.h:124
@ VTK_BIQUADRATIC_QUAD
Definition: vtkCellType.h:73
@ VTK_LAGRANGE_QUADRILATERAL
Definition: vtkCellType.h:112
@ VTK_POLY_LINE
Definition: vtkCellType.h:50
@ VTK_TRIQUADRATIC_PYRAMID
Definition: vtkCellType.h:75
@ VTK_TRIANGLE
Definition: vtkCellType.h:51
@ VTK_BEZIER_TRIANGLE
Definition: vtkCellType.h:120
@ VTK_POLYGON
Definition: vtkCellType.h:53
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:46
@ VTK_QUADRATIC_PYRAMID
Definition: vtkCellType.h:72
@ VTK_POLYHEDRON
Definition: vtkCellType.h:89
@ VTK_TRIQUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:74
@ VTK_TETRA
Definition: vtkCellType.h:56
@ VTK_LINE
Definition: vtkCellType.h:49
@ VTK_CONVEX_POINT_SET
Definition: vtkCellType.h:86
@ VTK_BEZIER_HEXAHEDRON
Definition: vtkCellType.h:123
@ VTK_LAGRANGE_WEDGE
Definition: vtkCellType.h:115
@ VTK_LAGRANGE_HEXAHEDRON
Definition: vtkCellType.h:114
@ VTK_PENTAGONAL_PRISM
Definition: vtkCellType.h:61
@ VTK_QUADRATIC_QUAD
Definition: vtkCellType.h:67
@ VTK_WEDGE
Definition: vtkCellType.h:59
@ VTK_LAGRANGE_TETRAHEDRON
Definition: vtkCellType.h:113
@ VTK_BEZIER_CURVE
Definition: vtkCellType.h:119
@ VTK_HEXAGONAL_PRISM
Definition: vtkCellType.h:62
@ VTK_BEZIER_QUADRILATERAL
Definition: vtkCellType.h:121
@ VTK_QUADRATIC_LINEAR_WEDGE
Definition: vtkCellType.h:77
@ VTK_HEXAHEDRON
Definition: vtkCellType.h:58
@ VTK_CUBIC_LINE
Definition: vtkCellType.h:83
@ VTK_LAGRANGE_TRIANGLE
Definition: vtkCellType.h:111
@ VTK_QUADRATIC_POLYGON
Definition: vtkCellType.h:68
@ VTK_QUAD
Definition: vtkCellType.h:55
@ VTK_QUADRATIC_TRIANGLE
Definition: vtkCellType.h:66
@ VTK_QUADRATIC_EDGE
Definition: vtkCellType.h:65
@ VTK_QUADRATIC_TETRA
Definition: vtkCellType.h:69
@ VTK_BEZIER_TETRAHEDRON
Definition: vtkCellType.h:122
@ VTK_VERTEX
Definition: vtkCellType.h:47
@ VTK_POLY_VERTEX
Definition: vtkCellType.h:48
@ VTK_QUADRATIC_LINEAR_QUAD
Definition: vtkCellType.h:76
@ VTK_BIQUADRATIC_QUADRATIC_WEDGE
Definition: vtkCellType.h:78
@ VTK_BIQUADRATIC_TRIANGLE
Definition: vtkCellType.h:80
int vtkIdType
Definition: vtkType.h:315