VTK  9.3.20240419
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
100 #ifndef vtkGenericCell_h
101 #define vtkGenericCell_h
102 
103 #include "vtkCell.h"
104 #include "vtkCommonDataModelModule.h" // For export macro
105 
106 VTK_ABI_NAMESPACE_BEGIN
107 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
108 {
109 public:
113  static vtkGenericCell* New();
114 
115  vtkTypeMacro(vtkGenericCell, vtkCell);
116  void PrintSelf(ostream& os, vtkIndent indent) override;
117 
123 
129 
131 
134  void ShallowCopy(vtkCell* c) override;
135  void DeepCopy(vtkCell* c) override;
136  int GetCellType() override;
137  int GetCellDimension() override;
138  int IsLinear() override;
139  int RequiresInitialization() override;
140  void Initialize() override;
142  VTK_DEPRECATED_IN_9_4_0("Use SetCellFaces.")
143  void SetFaces(vtkIdType* faces) override;
144  VTK_DEPRECATED_IN_9_4_0("Use GetCellFaces.")
145  vtkIdType* GetFaces() override;
146  int SetCellFaces(vtkCellArray* faces);
147  vtkCellArray* GetCellFaces();
148  void GetCellFaces(vtkCellArray* faces);
149  int GetNumberOfEdges() override;
150  int GetNumberOfFaces() override;
151  vtkCell* GetEdge(int edgeId) override;
152  vtkCell* GetFace(int faceId) override;
153  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
154  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
155  double& dist2, double weights[]) override;
156  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
157  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
158  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
159  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
160  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
161  vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
162  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
163  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
164  double pcoords[3], int& subId) override;
165  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
166  int TriangulateLocalIds(int index, vtkIdList* ptIds) override;
167  int TriangulateIds(int index, vtkIdList* ptIds) override;
168  void Derivatives(
169  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
170  int GetParametricCenter(double pcoords[3]) override;
171  double* GetParametricCoords() override;
172  int IsPrimaryCell() override;
174 
176 
180  void InterpolateFunctions(const double pcoords[3], double* weights) override;
181  void InterpolateDerivs(const double pcoords[3], double* derivs) override;
183 
191  void SetCellType(int cellType);
192  void SetCellTypeToEmptyCell() { this->SetCellType(VTK_EMPTY_CELL); }
193  void SetCellTypeToVertex() { this->SetCellType(VTK_VERTEX); }
194  void SetCellTypeToPolyVertex() { this->SetCellType(VTK_POLY_VERTEX); }
195  void SetCellTypeToLine() { this->SetCellType(VTK_LINE); }
196  void SetCellTypeToPolyLine() { this->SetCellType(VTK_POLY_LINE); }
197  void SetCellTypeToTriangle() { this->SetCellType(VTK_TRIANGLE); }
198  void SetCellTypeToTriangleStrip() { this->SetCellType(VTK_TRIANGLE_STRIP); }
199  void SetCellTypeToPolygon() { this->SetCellType(VTK_POLYGON); }
200  void SetCellTypeToPixel() { this->SetCellType(VTK_PIXEL); }
201  void SetCellTypeToQuad() { this->SetCellType(VTK_QUAD); }
202  void SetCellTypeToTetra() { this->SetCellType(VTK_TETRA); }
203  void SetCellTypeToVoxel() { this->SetCellType(VTK_VOXEL); }
204  void SetCellTypeToHexahedron() { this->SetCellType(VTK_HEXAHEDRON); }
205  void SetCellTypeToWedge() { this->SetCellType(VTK_WEDGE); }
206  void SetCellTypeToPyramid() { this->SetCellType(VTK_PYRAMID); }
207  void SetCellTypeToPentagonalPrism() { this->SetCellType(VTK_PENTAGONAL_PRISM); }
208  void SetCellTypeToHexagonalPrism() { this->SetCellType(VTK_HEXAGONAL_PRISM); }
209  void SetCellTypeToPolyhedron() { this->SetCellType(VTK_POLYHEDRON); }
210  void SetCellTypeToConvexPointSet() { this->SetCellType(VTK_CONVEX_POINT_SET); }
211  void SetCellTypeToQuadraticEdge() { this->SetCellType(VTK_QUADRATIC_EDGE); }
212  void SetCellTypeToCubicLine() { this->SetCellType(VTK_CUBIC_LINE); }
215  void SetCellTypeToQuadraticQuad() { this->SetCellType(VTK_QUADRATIC_QUAD); }
217  void SetCellTypeToQuadraticTetra() { this->SetCellType(VTK_QUADRATIC_TETRA); }
219  void SetCellTypeToQuadraticWedge() { this->SetCellType(VTK_QUADRATIC_WEDGE); }
222  void SetCellTypeToBiQuadraticQuad() { this->SetCellType(VTK_BIQUADRATIC_QUAD); }
225  {
226  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
227  }
231  {
232  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);
233  }
236  void SetCellTypeToLagrangeCurve() { this->SetCellType(VTK_LAGRANGE_CURVE); }
239  void SetCellTypeToLagrangeWedge() { this->SetCellType(VTK_LAGRANGE_WEDGE); }
240 
241  void SetCellTypeToBezierTriangle() { this->SetCellType(VTK_BEZIER_TRIANGLE); }
242  void SetCellTypeToBezierTetra() { this->SetCellType(VTK_BEZIER_TETRAHEDRON); }
243  void SetCellTypeToBezierCurve() { this->SetCellType(VTK_BEZIER_CURVE); }
246  void SetCellTypeToBezierWedge() { this->SetCellType(VTK_BEZIER_WEDGE); }
250  static vtkCell* InstantiateCell(int cellType);
251 
252  vtkCell* GetRepresentativeCell() { return this->Cell; }
253 
254 protected:
256  ~vtkGenericCell() override;
257 
260 
261 private:
262  vtkGenericCell(const vtkGenericCell&) = delete;
263  void operator=(const vtkGenericCell&) = delete;
264 };
265 
266 VTK_ABI_NAMESPACE_END
267 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:286
represent and manipulate cell attribute data
Definition: vtkCellData.h:141
abstract class to specify cell behavior
Definition: vtkCell.h:130
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:155
provides thread-safe access to cells
void SetCellTypeToLagrangeCurve()
void SetCellTypeToHexahedron()
void SetCellTypeToQuadraticLinearWedge()
vtkCell * GetRepresentativeCell()
void SetCellTypeToLagrangeWedge()
void Initialize() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToQuadraticWedge()
void SetCellTypeToQuadraticPolygon()
void SetCellTypeToPyramid()
void SetCellTypeToQuadraticTetra()
void SetCellTypeToQuad()
void SetCellTypeToTriangleStrip()
void SetCellTypeToPixel()
int RequiresInitialization() override
See the vtkCell API for descriptions of these methods.
void SetCellTypeToQuadraticQuad()
void SetCellTypeToQuadraticLinearQuad()
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 SetCellTypeToLagrangeTetra()
void SetCellTypeToPolyhedron()
void SetCellTypeToLine()
void SetCellTypeToBezierTetra()
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.
void SetCellTypeToTriQuadraticHexahedron()
void SetCellTypeToBiQuadraticQuadraticHexahedron()
void SetCellTypeToBiQuadraticQuad()
void SetCellTypeToCubicLine()
int RequiresExplicitFaceRepresentation() 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()
void SetCellTypeToLagrangeTriangle()
void SetCellTypeToWedge()
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 SetCellTypeToHexagonalPrism()
void SetCellTypeToBezierHexahedron()
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:133
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate point attribute data
Definition: vtkPointData.h:140
represent and manipulate 3D points
Definition: vtkPoints.h:139
const std::string pointIds
@ points
Definition: vtkX3D.h:446
@ value
Definition: vtkX3D.h:220
@ index
Definition: vtkX3D.h:246
@ VTK_VOXEL
Definition: vtkCellType.h:67
@ VTK_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:80
@ VTK_TRIANGLE_STRIP
Definition: vtkCellType.h:62
@ VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:89
@ VTK_NUMBER_OF_CELL_TYPES
Definition: vtkCellType.h:137
@ VTK_LAGRANGE_CURVE
Definition: vtkCellType.h:120
@ VTK_PYRAMID
Definition: vtkCellType.h:70
@ VTK_PIXEL
Definition: vtkCellType.h:64
@ VTK_QUADRATIC_WEDGE
Definition: vtkCellType.h:81
@ VTK_BEZIER_WEDGE
Definition: vtkCellType.h:134
@ VTK_BIQUADRATIC_QUAD
Definition: vtkCellType.h:83
@ VTK_LAGRANGE_QUADRILATERAL
Definition: vtkCellType.h:122
@ VTK_POLY_LINE
Definition: vtkCellType.h:60
@ VTK_TRIQUADRATIC_PYRAMID
Definition: vtkCellType.h:85
@ VTK_TRIANGLE
Definition: vtkCellType.h:61
@ VTK_BEZIER_TRIANGLE
Definition: vtkCellType.h:130
@ VTK_POLYGON
Definition: vtkCellType.h:63
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:56
@ VTK_QUADRATIC_PYRAMID
Definition: vtkCellType.h:82
@ VTK_POLYHEDRON
Definition: vtkCellType.h:99
@ VTK_TRIQUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:84
@ VTK_TETRA
Definition: vtkCellType.h:66
@ VTK_LINE
Definition: vtkCellType.h:59
@ VTK_CONVEX_POINT_SET
Definition: vtkCellType.h:96
@ VTK_BEZIER_HEXAHEDRON
Definition: vtkCellType.h:133
@ VTK_LAGRANGE_WEDGE
Definition: vtkCellType.h:125
@ VTK_LAGRANGE_HEXAHEDRON
Definition: vtkCellType.h:124
@ VTK_PENTAGONAL_PRISM
Definition: vtkCellType.h:71
@ VTK_QUADRATIC_QUAD
Definition: vtkCellType.h:77
@ VTK_WEDGE
Definition: vtkCellType.h:69
@ VTK_LAGRANGE_TETRAHEDRON
Definition: vtkCellType.h:123
@ VTK_BEZIER_CURVE
Definition: vtkCellType.h:129
@ VTK_HEXAGONAL_PRISM
Definition: vtkCellType.h:72
@ VTK_BEZIER_QUADRILATERAL
Definition: vtkCellType.h:131
@ VTK_QUADRATIC_LINEAR_WEDGE
Definition: vtkCellType.h:87
@ VTK_HEXAHEDRON
Definition: vtkCellType.h:68
@ VTK_CUBIC_LINE
Definition: vtkCellType.h:93
@ VTK_LAGRANGE_TRIANGLE
Definition: vtkCellType.h:121
@ VTK_QUADRATIC_POLYGON
Definition: vtkCellType.h:78
@ VTK_QUAD
Definition: vtkCellType.h:65
@ VTK_QUADRATIC_TRIANGLE
Definition: vtkCellType.h:76
@ VTK_QUADRATIC_EDGE
Definition: vtkCellType.h:75
@ VTK_QUADRATIC_TETRA
Definition: vtkCellType.h:79
@ VTK_BEZIER_TETRAHEDRON
Definition: vtkCellType.h:132
@ VTK_VERTEX
Definition: vtkCellType.h:57
@ VTK_POLY_VERTEX
Definition: vtkCellType.h:58
@ VTK_QUADRATIC_LINEAR_QUAD
Definition: vtkCellType.h:86
@ VTK_BIQUADRATIC_QUADRATIC_WEDGE
Definition: vtkCellType.h:88
@ VTK_BIQUADRATIC_TRIANGLE
Definition: vtkCellType.h:90
#define VTK_DEPRECATED_IN_9_4_0(reason)
int vtkIdType
Definition: vtkType.h:315