VTK  9.3.1
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
21 #ifndef vtkGenericCell_h
22 #define vtkGenericCell_h
23 
24 #include "vtkCell.h"
25 #include "vtkCommonDataModelModule.h" // For export macro
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
29 {
30 public:
34  static vtkGenericCell* New();
35 
36  vtkTypeMacro(vtkGenericCell, vtkCell);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
43  void SetPoints(vtkPoints* points);
44 
49  void SetPointIds(vtkIdList* pointIds);
50 
52 
55  void ShallowCopy(vtkCell* c) override;
56  void DeepCopy(vtkCell* c) override;
57  int GetCellType() override;
58  int GetCellDimension() override;
59  int IsLinear() override;
60  int RequiresInitialization() override;
61  void Initialize() override;
63  void SetFaces(vtkIdType* faces) override;
64  vtkIdType* GetFaces() override;
65  int GetNumberOfEdges() override;
66  int GetNumberOfFaces() override;
67  vtkCell* GetEdge(int edgeId) override;
68  vtkCell* GetFace(int faceId) override;
69  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
70  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
71  double& dist2, double weights[]) override;
72  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
73  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
74  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
75  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
76  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
77  vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
78  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
79  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
80  double pcoords[3], int& subId) override;
81  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
82  void Derivatives(
83  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
84  int GetParametricCenter(double pcoords[3]) override;
85  double* GetParametricCoords() override;
86  int IsPrimaryCell() override;
88 
90 
94  void InterpolateFunctions(const double pcoords[3], double* weights) override;
95  void InterpolateDerivs(const double pcoords[3], double* derivs) override;
97 
105  void SetCellType(int cellType);
106  void SetCellTypeToEmptyCell() { this->SetCellType(VTK_EMPTY_CELL); }
107  void SetCellTypeToVertex() { this->SetCellType(VTK_VERTEX); }
108  void SetCellTypeToPolyVertex() { this->SetCellType(VTK_POLY_VERTEX); }
109  void SetCellTypeToLine() { this->SetCellType(VTK_LINE); }
110  void SetCellTypeToPolyLine() { this->SetCellType(VTK_POLY_LINE); }
111  void SetCellTypeToTriangle() { this->SetCellType(VTK_TRIANGLE); }
112  void SetCellTypeToTriangleStrip() { this->SetCellType(VTK_TRIANGLE_STRIP); }
113  void SetCellTypeToPolygon() { this->SetCellType(VTK_POLYGON); }
114  void SetCellTypeToPixel() { this->SetCellType(VTK_PIXEL); }
115  void SetCellTypeToQuad() { this->SetCellType(VTK_QUAD); }
116  void SetCellTypeToTetra() { this->SetCellType(VTK_TETRA); }
117  void SetCellTypeToVoxel() { this->SetCellType(VTK_VOXEL); }
118  void SetCellTypeToHexahedron() { this->SetCellType(VTK_HEXAHEDRON); }
119  void SetCellTypeToWedge() { this->SetCellType(VTK_WEDGE); }
120  void SetCellTypeToPyramid() { this->SetCellType(VTK_PYRAMID); }
121  void SetCellTypeToPentagonalPrism() { this->SetCellType(VTK_PENTAGONAL_PRISM); }
122  void SetCellTypeToHexagonalPrism() { this->SetCellType(VTK_HEXAGONAL_PRISM); }
123  void SetCellTypeToPolyhedron() { this->SetCellType(VTK_POLYHEDRON); }
124  void SetCellTypeToConvexPointSet() { this->SetCellType(VTK_CONVEX_POINT_SET); }
125  void SetCellTypeToQuadraticEdge() { this->SetCellType(VTK_QUADRATIC_EDGE); }
126  void SetCellTypeToCubicLine() { this->SetCellType(VTK_CUBIC_LINE); }
129  void SetCellTypeToQuadraticQuad() { this->SetCellType(VTK_QUADRATIC_QUAD); }
131  void SetCellTypeToQuadraticTetra() { this->SetCellType(VTK_QUADRATIC_TETRA); }
133  void SetCellTypeToQuadraticWedge() { this->SetCellType(VTK_QUADRATIC_WEDGE); }
136  void SetCellTypeToBiQuadraticQuad() { this->SetCellType(VTK_BIQUADRATIC_QUAD); }
139  {
140  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
141  }
145  {
146  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);
147  }
150  void SetCellTypeToLagrangeCurve() { this->SetCellType(VTK_LAGRANGE_CURVE); }
153  void SetCellTypeToLagrangeWedge() { this->SetCellType(VTK_LAGRANGE_WEDGE); }
154 
155  void SetCellTypeToBezierTriangle() { this->SetCellType(VTK_BEZIER_TRIANGLE); }
156  void SetCellTypeToBezierTetra() { this->SetCellType(VTK_BEZIER_TETRAHEDRON); }
157  void SetCellTypeToBezierCurve() { this->SetCellType(VTK_BEZIER_CURVE); }
160  void SetCellTypeToBezierWedge() { this->SetCellType(VTK_BEZIER_WEDGE); }
164  static vtkCell* InstantiateCell(int cellType);
165 
166  vtkCell* GetRepresentativeCell() { return this->Cell; }
167 
168 protected:
169  vtkGenericCell();
170  ~vtkGenericCell() override;
171 
174 
175 private:
176  vtkGenericCell(const vtkGenericCell&) = delete;
177  void operator=(const vtkGenericCell&) = delete;
178 };
179 
180 VTK_ABI_NAMESPACE_END
181 #endif
virtual void DeepCopy(vtkCell *c)
Copy this cell by completely copying internal data structures.
void SetCellTypeToLagrangeTetra()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetCellTypeToPyramid()
virtual int GetCellDimension()=0
Return the topological dimensional of the cell (0,1,2, or 3).
void SetCellTypeToTriangle()
represent and manipulate point attribute data
Definition: vtkPointData.h:29
virtual int GetNumberOfFaces()=0
Return the number of faces in the cell.
void SetCellTypeToPolyVertex()
void SetCellTypeToConvexPointSet()
virtual int GetCellType()=0
Return the type of cell.
void SetCellTypeToPentagonalPrism()
void SetCellTypeToHexahedron()
represent and manipulate cell attribute data
Definition: vtkCellData.h:30
void SetCellTypeToBiQuadraticQuadraticHexahedron()
Abstract class in support of both point location and point insertion.
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
Generate simplices of proper dimension.
void SetCellTypeToQuadraticPolygon()
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:380
void SetCellTypeToPolyhedron()
void SetCellTypeToLagrangeTriangle()
void SetCellTypeToPolygon()
int vtkIdType
Definition: vtkType.h:315
void SetCellTypeToQuadraticQuad()
void SetCellTypeToPolyLine()
provides thread-safe access to cells
virtual int IsLinear()
Non-linear cells require special treatment beyond the usual cell type and connectivity list informati...
Definition: vtkCell.h:97
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...
void SetCellTypeToLagrangeHexahedron()
virtual void InterpolateDerivs(const double vtkNotUsed(pcoords)[3], double *vtkNotUsed(derivs))
Definition: vtkCell.h:383
void SetCellTypeToPixel()
void SetCellTypeToBezierHexahedron()
void SetCellTypeToBezierTriangle()
void SetCellTypeToTetra()
void SetCellTypeToWedge()
virtual void SetFaces(vtkIdType *vtkNotUsed(faces))
Definition: vtkCell.h:119
void SetCellTypeToQuadraticWedge()
abstract class to specify cell behavior
Definition: vtkCell.h:49
void SetCellTypeToTriQuadraticHexahedron()
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.
void SetCellTypeToLagrangeWedge()
void SetCellTypeToBezierTetra()
void SetCellTypeToBezierQuadrilateral()
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
void SetCellTypeToQuad()
void SetCellTypeToTriQuadraticPyramid()
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
void SetCellTypeToBezierCurve()
void SetCellTypeToBezierWedge()
virtual int RequiresInitialization()
Some cells require initialization prior to access.
Definition: vtkCell.h:103
void SetCellTypeToVoxel()
void SetCellTypeToQuadraticLinearQuad()
void SetCellTypeToVertex()
void SetCellTypeToQuadraticPyramid()
void SetCellTypeToBiQuadraticQuadraticWedge()
virtual int RequiresExplicitFaceRepresentation()
Determine whether the cell requires explicit face representation, and methods for setting and getting...
Definition: vtkCell.h:118
void SetCellTypeToQuadraticEdge()
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 * GetRepresentativeCell()
virtual void ShallowCopy(vtkCell *c)
Copy this cell by reference counting the internal data structures.
virtual vtkCell * GetFace(int faceId)=0
Return the face cell from the faceId of the cell.
virtual int GetNumberOfEdges()=0
Return the number of edges in the cell.
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...
object to represent cell connectivity
Definition: vtkCellArray.h:175
virtual vtkCell * GetEdge(int edgeId)=0
Return the edge cell from the edgeId of the cell.
void SetCellTypeToBiQuadraticTriangle()
void SetCellTypeToQuadraticLinearWedge()
void SetCellTypeToLine()
void SetCellTypeToTriangleStrip()
void SetCellTypeToQuadraticTriangle()
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.
virtual int IsPrimaryCell()
Return whether this cell type has a fixed topology or whether the topology varies depending on the da...
Definition: vtkCell.h:362
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.
void SetCellTypeToHexagonalPrism()
void SetCellTypeToLagrangeQuadrilateral()
virtual vtkIdType * GetFaces()
Definition: vtkCell.h:120
void SetCellTypeToLagrangeCurve()
virtual void Initialize()
Definition: vtkCell.h:104
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SetCellTypeToQuadraticTetra()
virtual double * GetParametricCoords())
Return a contiguous array of parametric coordinates of the points defining this cell.
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
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.
void SetCellTypeToCubicLine()
void SetCellTypeToBiQuadraticQuad()
represent and manipulate 3D points
Definition: vtkPoints.h:28
void SetCellTypeToEmptyCell()
void SetCellTypeToQuadraticHexahedron()