VTK  9.2.5
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 =========================================================================*/
112 #ifndef vtkGenericCell_h
113 #define vtkGenericCell_h
114 
115 #include "vtkCell.h"
116 #include "vtkCommonDataModelModule.h" // For export macro
117 
118 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
119 {
120 public:
124  static vtkGenericCell* New();
125 
126  vtkTypeMacro(vtkGenericCell, vtkCell);
127  void PrintSelf(ostream& os, vtkIndent indent) override;
128 
134 
139  void SetPointIds(vtkIdList* pointIds);
140 
142 
145  void ShallowCopy(vtkCell* c) override;
146  void DeepCopy(vtkCell* c) override;
147  int GetCellType() override;
148  int GetCellDimension() override;
149  int IsLinear() override;
150  int RequiresInitialization() override;
151  void Initialize() override;
153  void SetFaces(vtkIdType* faces) override;
154  vtkIdType* GetFaces() override;
155  int GetNumberOfEdges() override;
156  int GetNumberOfFaces() override;
157  vtkCell* GetEdge(int edgeId) override;
158  vtkCell* GetFace(int faceId) override;
159  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
160  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
161  double& dist2, double weights[]) override;
162  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
163  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
164  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
165  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
166  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
167  vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
168  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
169  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
170  double pcoords[3], int& subId) override;
171  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
173  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
174  int GetParametricCenter(double pcoords[3]) override;
175  double* GetParametricCoords() override;
176  int IsPrimaryCell() override;
178 
180 
184  void InterpolateFunctions(const double pcoords[3], double* weights) override;
185  void InterpolateDerivs(const double pcoords[3], double* derivs) override;
187 
195  void SetCellType(int cellType);
196  void SetCellTypeToEmptyCell() { this->SetCellType(VTK_EMPTY_CELL); }
197  void SetCellTypeToVertex() { this->SetCellType(VTK_VERTEX); }
198  void SetCellTypeToPolyVertex() { this->SetCellType(VTK_POLY_VERTEX); }
199  void SetCellTypeToLine() { this->SetCellType(VTK_LINE); }
200  void SetCellTypeToPolyLine() { this->SetCellType(VTK_POLY_LINE); }
201  void SetCellTypeToTriangle() { this->SetCellType(VTK_TRIANGLE); }
202  void SetCellTypeToTriangleStrip() { this->SetCellType(VTK_TRIANGLE_STRIP); }
203  void SetCellTypeToPolygon() { this->SetCellType(VTK_POLYGON); }
204  void SetCellTypeToPixel() { this->SetCellType(VTK_PIXEL); }
205  void SetCellTypeToQuad() { this->SetCellType(VTK_QUAD); }
206  void SetCellTypeToTetra() { this->SetCellType(VTK_TETRA); }
207  void SetCellTypeToVoxel() { this->SetCellType(VTK_VOXEL); }
208  void SetCellTypeToHexahedron() { this->SetCellType(VTK_HEXAHEDRON); }
209  void SetCellTypeToWedge() { this->SetCellType(VTK_WEDGE); }
210  void SetCellTypeToPyramid() { this->SetCellType(VTK_PYRAMID); }
211  void SetCellTypeToPentagonalPrism() { this->SetCellType(VTK_PENTAGONAL_PRISM); }
212  void SetCellTypeToHexagonalPrism() { this->SetCellType(VTK_HEXAGONAL_PRISM); }
213  void SetCellTypeToPolyhedron() { this->SetCellType(VTK_POLYHEDRON); }
214  void SetCellTypeToConvexPointSet() { this->SetCellType(VTK_CONVEX_POINT_SET); }
215  void SetCellTypeToQuadraticEdge() { this->SetCellType(VTK_QUADRATIC_EDGE); }
216  void SetCellTypeToCubicLine() { this->SetCellType(VTK_CUBIC_LINE); }
219  void SetCellTypeToQuadraticQuad() { this->SetCellType(VTK_QUADRATIC_QUAD); }
221  void SetCellTypeToQuadraticTetra() { this->SetCellType(VTK_QUADRATIC_TETRA); }
223  void SetCellTypeToQuadraticWedge() { this->SetCellType(VTK_QUADRATIC_WEDGE); }
226  void SetCellTypeToBiQuadraticQuad() { this->SetCellType(VTK_BIQUADRATIC_QUAD); }
229  {
230  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
231  }
235  {
236  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);
237  }
240  void SetCellTypeToLagrangeCurve() { this->SetCellType(VTK_LAGRANGE_CURVE); }
243  void SetCellTypeToLagrangeWedge() { this->SetCellType(VTK_LAGRANGE_WEDGE); }
244 
245  void SetCellTypeToBezierTriangle() { this->SetCellType(VTK_BEZIER_TRIANGLE); }
246  void SetCellTypeToBezierTetra() { this->SetCellType(VTK_BEZIER_TETRAHEDRON); }
247  void SetCellTypeToBezierCurve() { this->SetCellType(VTK_BEZIER_CURVE); }
250  void SetCellTypeToBezierWedge() { this->SetCellType(VTK_BEZIER_WEDGE); }
254  static vtkCell* InstantiateCell(int cellType);
255 
256  vtkCell* GetRepresentativeCell() { return this->Cell; }
257 
258 protected:
260  ~vtkGenericCell() override;
261 
264 
265 private:
266  vtkGenericCell(const vtkGenericCell&) = delete;
267  void operator=(const vtkGenericCell&) = delete;
268 };
269 
270 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate cell attribute data
Definition: vtkCellData.h:151
abstract class to specify cell behavior
Definition: vtkCell.h:150
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
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:143
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:119
represent and manipulate point attribute data
Definition: vtkPointData.h:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
@ points
Definition: vtkX3D.h:452
@ value
Definition: vtkX3D.h:226
@ index
Definition: vtkX3D.h:252
@ VTK_VOXEL
Definition: vtkCellType.h:96
@ VTK_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:109
@ VTK_TRIANGLE_STRIP
Definition: vtkCellType.h:91
@ VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:118
@ VTK_NUMBER_OF_CELL_TYPES
Definition: vtkCellType.h:166
@ VTK_LAGRANGE_CURVE
Definition: vtkCellType.h:149
@ VTK_PYRAMID
Definition: vtkCellType.h:99
@ VTK_PIXEL
Definition: vtkCellType.h:93
@ VTK_QUADRATIC_WEDGE
Definition: vtkCellType.h:110
@ VTK_BEZIER_WEDGE
Definition: vtkCellType.h:163
@ VTK_BIQUADRATIC_QUAD
Definition: vtkCellType.h:112
@ VTK_LAGRANGE_QUADRILATERAL
Definition: vtkCellType.h:151
@ VTK_POLY_LINE
Definition: vtkCellType.h:89
@ VTK_TRIQUADRATIC_PYRAMID
Definition: vtkCellType.h:114
@ VTK_TRIANGLE
Definition: vtkCellType.h:90
@ VTK_BEZIER_TRIANGLE
Definition: vtkCellType.h:159
@ VTK_POLYGON
Definition: vtkCellType.h:92
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:85
@ VTK_QUADRATIC_PYRAMID
Definition: vtkCellType.h:111
@ VTK_POLYHEDRON
Definition: vtkCellType.h:128
@ VTK_TRIQUADRATIC_HEXAHEDRON
Definition: vtkCellType.h:113
@ VTK_TETRA
Definition: vtkCellType.h:95
@ VTK_LINE
Definition: vtkCellType.h:88
@ VTK_CONVEX_POINT_SET
Definition: vtkCellType.h:125
@ VTK_BEZIER_HEXAHEDRON
Definition: vtkCellType.h:162
@ VTK_LAGRANGE_WEDGE
Definition: vtkCellType.h:154
@ VTK_LAGRANGE_HEXAHEDRON
Definition: vtkCellType.h:153
@ VTK_PENTAGONAL_PRISM
Definition: vtkCellType.h:100
@ VTK_QUADRATIC_QUAD
Definition: vtkCellType.h:106
@ VTK_WEDGE
Definition: vtkCellType.h:98
@ VTK_LAGRANGE_TETRAHEDRON
Definition: vtkCellType.h:152
@ VTK_BEZIER_CURVE
Definition: vtkCellType.h:158
@ VTK_HEXAGONAL_PRISM
Definition: vtkCellType.h:101
@ VTK_BEZIER_QUADRILATERAL
Definition: vtkCellType.h:160
@ VTK_QUADRATIC_LINEAR_WEDGE
Definition: vtkCellType.h:116
@ VTK_HEXAHEDRON
Definition: vtkCellType.h:97
@ VTK_CUBIC_LINE
Definition: vtkCellType.h:122
@ VTK_LAGRANGE_TRIANGLE
Definition: vtkCellType.h:150
@ VTK_QUADRATIC_POLYGON
Definition: vtkCellType.h:107
@ VTK_QUAD
Definition: vtkCellType.h:94
@ VTK_QUADRATIC_TRIANGLE
Definition: vtkCellType.h:105
@ VTK_QUADRATIC_EDGE
Definition: vtkCellType.h:104
@ VTK_QUADRATIC_TETRA
Definition: vtkCellType.h:108
@ VTK_BEZIER_TETRAHEDRON
Definition: vtkCellType.h:161
@ VTK_VERTEX
Definition: vtkCellType.h:86
@ VTK_POLY_VERTEX
Definition: vtkCellType.h:87
@ VTK_QUADRATIC_LINEAR_QUAD
Definition: vtkCellType.h:115
@ VTK_BIQUADRATIC_QUADRATIC_WEDGE
Definition: vtkCellType.h:117
@ VTK_BIQUADRATIC_TRIANGLE
Definition: vtkCellType.h:119
int vtkIdType
Definition: vtkType.h:332