VTK  9.0.1
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 
51  void SetPoints(vtkPoints* points);
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;
90  void Derivatives(
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:
176  vtkGenericCell();
177  ~vtkGenericCell() override;
178 
181 
182 private:
183  vtkGenericCell(const vtkGenericCell&) = delete;
184  void operator=(const vtkGenericCell&) = delete;
185 };
186 
187 #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:31
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:32
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:341
void SetCellTypeToPolyhedron()
void SetCellTypeToLagrangeTriangle()
void SetCellTypeToPolygon()
int vtkIdType
Definition: vtkType.h:338
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:104
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:344
void SetCellTypeToPixel()
void SetCellTypeToBezierHexahedron()
void SetCellTypeToBezierTriangle()
void SetCellTypeToTetra()
void SetCellTypeToWedge()
virtual void SetFaces(vtkIdType *vtkNotUsed(faces))
Definition: vtkCell.h:126
void SetCellTypeToQuadraticWedge()
abstract class to specify cell behavior
Definition: vtkCell.h:56
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:33
list of point or cell ids
Definition: vtkIdList.h:30
void SetCellTypeToQuad()
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
void SetCellTypeToBezierCurve()
void SetCellTypeToBezierWedge()
virtual int RequiresInitialization()
Some cells require initialization prior to access.
Definition: vtkCell.h:110
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:125
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:179
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:323
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:127
void SetCellTypeToLagrangeCurve()
virtual void Initialize()
Definition: vtkCell.h:111
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:33
void SetCellTypeToEmptyCell()
void SetCellTypeToQuadraticHexahedron()