VTK  9.0.2
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 =========================================================================*/
30 #ifndef vtkGenericCell_h
31 #define vtkGenericCell_h
32 
33 #include "vtkCell.h"
34 #include "vtkCommonDataModelModule.h" // For export macro
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
37 {
38 public:
42  static vtkGenericCell* New();
43 
44  vtkTypeMacro(vtkGenericCell, vtkCell);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
52 
57  void SetPointIds(vtkIdList* pointIds);
58 
60 
63  void ShallowCopy(vtkCell* c) override;
64  void DeepCopy(vtkCell* c) override;
65  int GetCellType() override;
66  int GetCellDimension() override;
67  int IsLinear() override;
68  int RequiresInitialization() override;
69  void Initialize() override;
71  void SetFaces(vtkIdType* faces) override;
72  vtkIdType* GetFaces() override;
73  int GetNumberOfEdges() override;
74  int GetNumberOfFaces() override;
75  vtkCell* GetEdge(int edgeId) override;
76  vtkCell* GetFace(int faceId) override;
77  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
78  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
79  double& dist2, double weights[]) override;
80  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
81  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
82  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
83  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
84  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
85  vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
86  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
87  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
88  double pcoords[3], int& subId) override;
89  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
91  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
92  int GetParametricCenter(double pcoords[3]) override;
93  double* GetParametricCoords() override;
94  int IsPrimaryCell() override;
96 
98 
102  void InterpolateFunctions(const double pcoords[3], double* weights) override;
103  void InterpolateDerivs(const double pcoords[3], double* derivs) override;
105 
113  void SetCellType(int cellType);
114  void SetCellTypeToEmptyCell() { this->SetCellType(VTK_EMPTY_CELL); }
115  void SetCellTypeToVertex() { this->SetCellType(VTK_VERTEX); }
116  void SetCellTypeToPolyVertex() { this->SetCellType(VTK_POLY_VERTEX); }
117  void SetCellTypeToLine() { this->SetCellType(VTK_LINE); }
118  void SetCellTypeToPolyLine() { this->SetCellType(VTK_POLY_LINE); }
119  void SetCellTypeToTriangle() { this->SetCellType(VTK_TRIANGLE); }
120  void SetCellTypeToTriangleStrip() { this->SetCellType(VTK_TRIANGLE_STRIP); }
121  void SetCellTypeToPolygon() { this->SetCellType(VTK_POLYGON); }
122  void SetCellTypeToPixel() { this->SetCellType(VTK_PIXEL); }
123  void SetCellTypeToQuad() { this->SetCellType(VTK_QUAD); }
124  void SetCellTypeToTetra() { this->SetCellType(VTK_TETRA); }
125  void SetCellTypeToVoxel() { this->SetCellType(VTK_VOXEL); }
126  void SetCellTypeToHexahedron() { this->SetCellType(VTK_HEXAHEDRON); }
127  void SetCellTypeToWedge() { this->SetCellType(VTK_WEDGE); }
128  void SetCellTypeToPyramid() { this->SetCellType(VTK_PYRAMID); }
129  void SetCellTypeToPentagonalPrism() { this->SetCellType(VTK_PENTAGONAL_PRISM); }
130  void SetCellTypeToHexagonalPrism() { this->SetCellType(VTK_HEXAGONAL_PRISM); }
131  void SetCellTypeToPolyhedron() { this->SetCellType(VTK_POLYHEDRON); }
132  void SetCellTypeToConvexPointSet() { this->SetCellType(VTK_CONVEX_POINT_SET); }
133  void SetCellTypeToQuadraticEdge() { this->SetCellType(VTK_QUADRATIC_EDGE); }
134  void SetCellTypeToCubicLine() { this->SetCellType(VTK_CUBIC_LINE); }
137  void SetCellTypeToQuadraticQuad() { this->SetCellType(VTK_QUADRATIC_QUAD); }
139  void SetCellTypeToQuadraticTetra() { this->SetCellType(VTK_QUADRATIC_TETRA); }
141  void SetCellTypeToQuadraticWedge() { this->SetCellType(VTK_QUADRATIC_WEDGE); }
144  void SetCellTypeToBiQuadraticQuad() { this->SetCellType(VTK_BIQUADRATIC_QUAD); }
147  {
148  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
149  }
152  {
153  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);
154  }
157  void SetCellTypeToLagrangeCurve() { this->SetCellType(VTK_LAGRANGE_CURVE); }
160  void SetCellTypeToLagrangeWedge() { this->SetCellType(VTK_LAGRANGE_WEDGE); }
161 
162  void SetCellTypeToBezierTriangle() { this->SetCellType(VTK_BEZIER_TRIANGLE); }
163  void SetCellTypeToBezierTetra() { this->SetCellType(VTK_BEZIER_TETRAHEDRON); }
164  void SetCellTypeToBezierCurve() { this->SetCellType(VTK_BEZIER_CURVE); }
167  void SetCellTypeToBezierWedge() { this->SetCellType(VTK_BEZIER_WEDGE); }
171  static vtkCell* InstantiateCell(int cellType);
172 
173  vtkCell* GetRepresentativeCell() { return this->Cell; }
174 
175 protected:
177  ~vtkGenericCell() override;
178 
181 
182 private:
183  vtkGenericCell(const vtkGenericCell&) = delete;
184  void operator=(const vtkGenericCell&) = delete;
185 };
186 
187 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:180
represent and manipulate cell attribute data
Definition: vtkCellData.h:33
abstract class to specify cell behavior
Definition: vtkCell.h:57
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
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
Determine global coordinate (x[3]) from subId and parametric coordinates.
void SetCellTypeToLagrangeWedge()
void Initialize() override
void SetCellTypeToQuadraticWedge()
void SetCellTypeToQuadraticPolygon()
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
Given parametric coordinates of a point, return the closest cell boundary, and whether the point is i...
void SetCellTypeToPyramid()
void SetCellTypeToQuadraticTetra()
void SetCellTypeToQuad()
void SetCellTypeToTriangleStrip()
void SetCellTypeToPixel()
int RequiresInitialization() override
Some cells require initialization prior to access.
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
Given a point x[3] return inside(=1), outside(=0) cell, or (-1) computational problem encountered; ev...
void SetCellTypeToQuadraticQuad()
void SetCellTypeToQuadraticLinearQuad()
int GetParametricCenter(double pcoords[3]) override
Return center of the cell in parametric coordinates.
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
Cut (or clip) the cell based on the input cellScalars and the specified value.
void SetCellTypeToLagrangeTetra()
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
Compute derivatives given cell subId and parametric coordinates.
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
Generate contouring primitives.
void SetCellTypeToPolyhedron()
void SetCellTypeToLine()
vtkIdType * GetFaces() override
void InterpolateDerivs(const double pcoords[3], double *derivs) override
void SetCellTypeToBezierTetra()
int IsPrimaryCell() override
Return whether this cell type has a fixed topology or whether the topology varies depending on the da...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int IsLinear() override
Non-linear cells require special treatment beyond the usual cell type and connectivity list informati...
void SetCellTypeToQuadraticHexahedron()
void SetCellTypeToVoxel()
void SetPoints(vtkPoints *points)
Set the points object to use for this cell.
double * GetParametricCoords() override
Return a contiguous array of parametric coordinates of the points defining this cell.
vtkCell * GetFace(int faceId) override
Return the face cell from the faceId of the cell.
void SetFaces(vtkIdType *faces) override
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
Intersect with a ray.
void SetCellTypeToBiQuadraticQuadraticHexahedron()
void SetCellTypeToBiQuadraticQuad()
void SetCellTypeToCubicLine()
int RequiresExplicitFaceRepresentation() override
Determine whether the cell requires explicit face representation, and methods for setting and getting...
int GetNumberOfEdges() override
Return the number of edges in the cell.
void SetCellTypeToConvexPointSet()
int GetCellDimension() override
Return the topological dimensional of the cell (0,1,2, or 3).
void DeepCopy(vtkCell *c) override
Copy this cell by completely copying internal data structures.
void SetCellTypeToVertex()
void SetCellTypeToBezierCurve()
int GetNumberOfFaces() override
Return the number of faces in the cell.
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
Generate simplices of proper dimension.
void SetCellTypeToTriangle()
void SetCellTypeToQuadraticPyramid()
void SetCellTypeToQuadraticEdge()
int GetCellType() override
Return the type of cell.
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
Return the edge cell from the edgeId of the cell.
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 SetCellTypeToQuadraticTriangle()
list of point or cell ids
Definition: vtkIdList.h:31
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate point attribute data
Definition: vtkPointData.h:32
represent and manipulate 3D points
Definition: vtkPoints.h:34
@ points
Definition: vtkX3D.h:452
@ value
Definition: vtkX3D.h:226
@ index
Definition: vtkX3D.h:252
@ 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:78
@ VTK_NUMBER_OF_CELL_TYPES
Definition: vtkCellType.h:126
@ VTK_LAGRANGE_CURVE
Definition: vtkCellType.h:109
@ 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:123
@ VTK_BIQUADRATIC_QUAD
Definition: vtkCellType.h:73
@ VTK_LAGRANGE_QUADRILATERAL
Definition: vtkCellType.h:111
@ VTK_POLY_LINE
Definition: vtkCellType.h:50
@ VTK_TRIANGLE
Definition: vtkCellType.h:51
@ VTK_BEZIER_TRIANGLE
Definition: vtkCellType.h:119
@ 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:88
@ 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:85
@ VTK_BEZIER_HEXAHEDRON
Definition: vtkCellType.h:122
@ VTK_LAGRANGE_WEDGE
Definition: vtkCellType.h:114
@ VTK_LAGRANGE_HEXAHEDRON
Definition: vtkCellType.h:113
@ 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:112
@ VTK_BEZIER_CURVE
Definition: vtkCellType.h:118
@ VTK_HEXAGONAL_PRISM
Definition: vtkCellType.h:62
@ VTK_BEZIER_QUADRILATERAL
Definition: vtkCellType.h:120
@ VTK_QUADRATIC_LINEAR_WEDGE
Definition: vtkCellType.h:76
@ VTK_HEXAHEDRON
Definition: vtkCellType.h:58
@ VTK_CUBIC_LINE
Definition: vtkCellType.h:82
@ VTK_LAGRANGE_TRIANGLE
Definition: vtkCellType.h:110
@ 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:121
@ VTK_VERTEX
Definition: vtkCellType.h:47
@ VTK_POLY_VERTEX
Definition: vtkCellType.h:48
@ VTK_QUADRATIC_LINEAR_QUAD
Definition: vtkCellType.h:75
@ VTK_BIQUADRATIC_QUADRATIC_WEDGE
Definition: vtkCellType.h:77
@ VTK_BIQUADRATIC_TRIANGLE
Definition: vtkCellType.h:79
int vtkIdType
Definition: vtkType.h:338