VTK  9.2.6
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 =========================================================================*/
33 #ifndef vtkGenericCell_h
34 #define vtkGenericCell_h
35 
36 #include "vtkCell.h"
37 #include "vtkCommonDataModelModule.h" // For export macro
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkGenericCell : public vtkCell
40 {
41 public:
45  static vtkGenericCell* New();
46 
47  vtkTypeMacro(vtkGenericCell, vtkCell);
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
54  void SetPoints(vtkPoints* points);
55 
60  void SetPointIds(vtkIdList* pointIds);
61 
63 
66  void ShallowCopy(vtkCell* c) override;
67  void DeepCopy(vtkCell* c) override;
68  int GetCellType() override;
69  int GetCellDimension() override;
70  int IsLinear() override;
71  int RequiresInitialization() override;
72  void Initialize() override;
74  void SetFaces(vtkIdType* faces) override;
75  vtkIdType* GetFaces() override;
76  int GetNumberOfEdges() override;
77  int GetNumberOfFaces() override;
78  vtkCell* GetEdge(int edgeId) override;
79  vtkCell* GetFace(int faceId) override;
80  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
81  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
82  double& dist2, double weights[]) override;
83  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
84  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
85  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
86  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
87  void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
88  vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
89  vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
90  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
91  double pcoords[3], int& subId) override;
92  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
93  void Derivatives(
94  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
95  int GetParametricCenter(double pcoords[3]) override;
96  double* GetParametricCoords() override;
97  int IsPrimaryCell() override;
99 
101 
105  void InterpolateFunctions(const double pcoords[3], double* weights) override;
106  void InterpolateDerivs(const double pcoords[3], double* derivs) override;
108 
116  void SetCellType(int cellType);
117  void SetCellTypeToEmptyCell() { this->SetCellType(VTK_EMPTY_CELL); }
118  void SetCellTypeToVertex() { this->SetCellType(VTK_VERTEX); }
119  void SetCellTypeToPolyVertex() { this->SetCellType(VTK_POLY_VERTEX); }
120  void SetCellTypeToLine() { this->SetCellType(VTK_LINE); }
121  void SetCellTypeToPolyLine() { this->SetCellType(VTK_POLY_LINE); }
122  void SetCellTypeToTriangle() { this->SetCellType(VTK_TRIANGLE); }
123  void SetCellTypeToTriangleStrip() { this->SetCellType(VTK_TRIANGLE_STRIP); }
124  void SetCellTypeToPolygon() { this->SetCellType(VTK_POLYGON); }
125  void SetCellTypeToPixel() { this->SetCellType(VTK_PIXEL); }
126  void SetCellTypeToQuad() { this->SetCellType(VTK_QUAD); }
127  void SetCellTypeToTetra() { this->SetCellType(VTK_TETRA); }
128  void SetCellTypeToVoxel() { this->SetCellType(VTK_VOXEL); }
129  void SetCellTypeToHexahedron() { this->SetCellType(VTK_HEXAHEDRON); }
130  void SetCellTypeToWedge() { this->SetCellType(VTK_WEDGE); }
131  void SetCellTypeToPyramid() { this->SetCellType(VTK_PYRAMID); }
132  void SetCellTypeToPentagonalPrism() { this->SetCellType(VTK_PENTAGONAL_PRISM); }
133  void SetCellTypeToHexagonalPrism() { this->SetCellType(VTK_HEXAGONAL_PRISM); }
134  void SetCellTypeToPolyhedron() { this->SetCellType(VTK_POLYHEDRON); }
135  void SetCellTypeToConvexPointSet() { this->SetCellType(VTK_CONVEX_POINT_SET); }
136  void SetCellTypeToQuadraticEdge() { this->SetCellType(VTK_QUADRATIC_EDGE); }
137  void SetCellTypeToCubicLine() { this->SetCellType(VTK_CUBIC_LINE); }
140  void SetCellTypeToQuadraticQuad() { this->SetCellType(VTK_QUADRATIC_QUAD); }
142  void SetCellTypeToQuadraticTetra() { this->SetCellType(VTK_QUADRATIC_TETRA); }
144  void SetCellTypeToQuadraticWedge() { this->SetCellType(VTK_QUADRATIC_WEDGE); }
147  void SetCellTypeToBiQuadraticQuad() { this->SetCellType(VTK_BIQUADRATIC_QUAD); }
150  {
151  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
152  }
156  {
157  this->SetCellType(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON);
158  }
161  void SetCellTypeToLagrangeCurve() { this->SetCellType(VTK_LAGRANGE_CURVE); }
164  void SetCellTypeToLagrangeWedge() { this->SetCellType(VTK_LAGRANGE_WEDGE); }
165 
166  void SetCellTypeToBezierTriangle() { this->SetCellType(VTK_BEZIER_TRIANGLE); }
167  void SetCellTypeToBezierTetra() { this->SetCellType(VTK_BEZIER_TETRAHEDRON); }
168  void SetCellTypeToBezierCurve() { this->SetCellType(VTK_BEZIER_CURVE); }
171  void SetCellTypeToBezierWedge() { this->SetCellType(VTK_BEZIER_WEDGE); }
175  static vtkCell* InstantiateCell(int cellType);
176 
177  vtkCell* GetRepresentativeCell() { return this->Cell; }
178 
179 protected:
180  vtkGenericCell();
181  ~vtkGenericCell() override;
182 
185 
186 private:
187  vtkGenericCell(const vtkGenericCell&) = delete;
188  void operator=(const vtkGenericCell&) = delete;
189 };
190 
191 #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:41
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:41
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:391
void SetCellTypeToPolyhedron()
void SetCellTypeToLagrangeTriangle()
void SetCellTypeToPolygon()
int vtkIdType
Definition: vtkType.h:332
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:108
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:394
void SetCellTypeToPixel()
void SetCellTypeToBezierHexahedron()
void SetCellTypeToBezierTriangle()
void SetCellTypeToTetra()
void SetCellTypeToWedge()
virtual void SetFaces(vtkIdType *vtkNotUsed(faces))
Definition: vtkCell.h:130
void SetCellTypeToQuadraticWedge()
abstract class to specify cell behavior
Definition: vtkCell.h:60
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:39
list of point or cell ids
Definition: vtkIdList.h:33
void SetCellTypeToQuad()
void SetCellTypeToTriQuadraticPyramid()
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
void SetCellTypeToBezierCurve()
void SetCellTypeToBezierWedge()
virtual int RequiresInitialization()
Some cells require initialization prior to access.
Definition: vtkCell.h:114
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:129
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:186
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:373
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:131
void SetCellTypeToLagrangeCurve()
virtual void Initialize()
Definition: vtkCell.h:115
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:39
void SetCellTypeToEmptyCell()
void SetCellTypeToQuadraticHexahedron()