VTK  9.0.20210126
vtkWedge.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWedge.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 =========================================================================*/
31 #ifndef vtkWedge_h
32 #define vtkWedge_h
33 
34 #include "vtkCell3D.h"
35 #include "vtkCommonDataModelModule.h" // For export macro
36 
37 class vtkLine;
38 class vtkTriangle;
39 class vtkQuad;
42 
43 class VTKCOMMONDATAMODEL_EXPORT vtkWedge : public vtkCell3D
44 {
45 public:
46  static vtkWedge* New();
47  vtkTypeMacro(vtkWedge, vtkCell3D);
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
54  void GetEdgePoints(vtkIdType edgeId, const vtkIdType*& pts) override;
55  // @deprecated Replaced by GetEdgePoints(vtkIdType, const vtkIdType*&) as of VTK 9.0
56  VTK_DEPRECATED_IN_9_0_0("Replaced by vtkWedge::GetEdgePoints(vtkIdType, const vtkIdType*&)")
57  void GetEdgePoints(int edgeId, int*& pts) override;
58  vtkIdType GetFacePoints(vtkIdType faceId, const vtkIdType*& pts) override;
59  // @deprecated Replaced by GetFacePoints(vtkIdType, const vtkIdType*&) as of VTK 9.0
60  VTK_DEPRECATED_IN_9_0_0("Replaced by vtkWedge::GetFacePoints(vtkIdType, const vtkIdType*&)")
61  void GetFacePoints(int faceId, int*& pts) override;
62  void GetEdgeToAdjacentFaces(vtkIdType edgeId, const vtkIdType*& pts) override;
63  vtkIdType GetFaceToAdjacentFaces(vtkIdType faceId, const vtkIdType*& faceIds) override;
64  vtkIdType GetPointToIncidentEdges(vtkIdType pointId, const vtkIdType*& edgeIds) override;
65  vtkIdType GetPointToIncidentFaces(vtkIdType pointId, const vtkIdType*& faceIds) override;
66  vtkIdType GetPointToOneRingPoints(vtkIdType pointId, const vtkIdType*& pts) override;
67  bool GetCentroid(double centroid[3]) const override;
68  bool IsInsideOut() override;
70 
74  static constexpr vtkIdType NumberOfPoints = 6;
75 
79  static constexpr vtkIdType NumberOfEdges = 9;
80 
84  static constexpr vtkIdType NumberOfFaces = 5;
85 
90  static constexpr vtkIdType MaximumFaceSize = 4;
91 
97  static constexpr vtkIdType MaximumValence = 3;
98 
100 
103  int GetCellType() override { return VTK_WEDGE; }
104  int GetCellDimension() override { return 3; }
105  int GetNumberOfEdges() override { return static_cast<int>(NumberOfEdges); }
106  int GetNumberOfFaces() override { return static_cast<int>(NumberOfFaces); }
107  vtkCell* GetEdge(int edgeId) override;
108  vtkCell* GetFace(int faceId) override;
109  int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
110  void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
111  vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
112  vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
113  int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
114  double& dist2, double weights[]) override;
115  void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
116  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
117  double pcoords[3], int& subId) override;
118  int Triangulate(int index, vtkIdList* ptIds, vtkPoints* pts) override;
119  void Derivatives(
120  int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
121  double* GetParametricCoords() override;
123 
131  static int* GetTriangleCases(int caseId);
132 
136  int GetParametricCenter(double pcoords[3]) override;
137 
138  static void InterpolationFunctions(const double pcoords[3], double weights[6]);
139  static void InterpolationDerivs(const double pcoords[3], double derivs[18]);
141 
145  void InterpolateFunctions(const double pcoords[3], double weights[6]) override
146  {
147  vtkWedge::InterpolationFunctions(pcoords, weights);
148  }
149  void InterpolateDerivs(const double pcoords[3], double derivs[18]) override
150  {
151  vtkWedge::InterpolationDerivs(pcoords, derivs);
152  }
153  int JacobianInverse(const double pcoords[3], double** inverse, double derivs[18]);
155 
157 
165  static const vtkIdType* GetEdgeArray(vtkIdType edgeId) VTK_SIZEHINT(2);
166  static const vtkIdType* GetFaceArray(vtkIdType faceId) VTK_SIZEHINT(MaximumFaceSize + 1);
168 
172  static const vtkIdType* GetEdgeToAdjacentFacesArray(vtkIdType edgeId) VTK_SIZEHINT(2);
173 
177  static const vtkIdType* GetFaceToAdjacentFacesArray(vtkIdType faceId) VTK_SIZEHINT(4);
178 
182  static const vtkIdType* GetPointToIncidentEdgesArray(vtkIdType pointId) VTK_SIZEHINT(3);
183 
187  static const vtkIdType* GetPointToIncidentFacesArray(vtkIdType pointId) VTK_SIZEHINT(3);
188 
192  static const vtkIdType* GetPointToOneRingPointsArray(vtkIdType pointId) VTK_SIZEHINT(3);
193 
197  static bool ComputeCentroid(vtkPoints* points, const vtkIdType* pointIds, double centroid[3]);
198 
199 protected:
200  vtkWedge();
201  ~vtkWedge() override;
202 
206 
207 private:
208  vtkWedge(const vtkWedge&) = delete;
209  void operator=(const vtkWedge&) = delete;
210 };
211 
212 inline int vtkWedge::GetParametricCenter(double pcoords[3])
213 {
214  pcoords[0] = pcoords[1] = 0.333333;
215  pcoords[2] = 0.5;
216  return 0;
217 }
218 
219 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkCell::IntersectWithLine
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.
vtkWedge::Line
vtkLine * Line
Definition: vtkWedge.h:203
vtkWedge::GetParametricCenter
int GetParametricCenter(double pcoords[3]) override
Return the center of the wedge in parametric coordinates.
Definition: vtkWedge.h:212
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:32
vtkX3D::value
Definition: vtkX3D.h:226
vtkWedge::GetNumberOfFaces
int GetNumberOfFaces() override
Return the number of faces in the cell.
Definition: vtkWedge.h:106
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkIossUtilities::GetCellType
int GetCellType(const Ioss::ElementTopology *topology)
Returns VTK celltype for a Ioss topology element.
vtkWedge::GetNumberOfEdges
int GetNumberOfEdges() override
Return the number of edges in the cell.
Definition: vtkWedge.h:105
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkCell3D.h
vtkCell::EvaluateLocation
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.
vtkWedge::InterpolationFunctions
static void InterpolationFunctions(const double pcoords[3], double weights[6])
vtkLine
cell represents a 1D line
Definition: vtkLine.h:30
vtkCell3D::GetEdgePoints
virtual void GetEdgePoints(vtkIdType edgeId, const vtkIdType *&pts)=0
Get the pair of vertices that define an edge.
vtkCell3D
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:39
vtkX3D::points
Definition: vtkX3D.h:452
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkCell::Triangulate
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
Generate simplices of proper dimension.
vtkWedge
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:43
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:57
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
vtkCell::GetFace
virtual vtkCell * GetFace(int faceId)=0
Return the face cell from the faceId of the cell.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkWedge::Triangle
vtkTriangle * Triangle
Definition: vtkWedge.h:204
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
VTK_DEPRECATED_IN_9_0_0
#define VTK_DEPRECATED_IN_9_0_0(reason)
Definition: vtkDeprecation.h:83
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkCell3D::Contour
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.
vtkWedge::GetCellDimension
int GetCellDimension() override
The topological dimension of the cell.
Definition: vtkWedge.h:104
vtkCell3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTriangle
a cell that represents a triangle
Definition: vtkTriangle.h:35
vtkCell::CellBoundary
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...
vtkCell::EvaluatePosition
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...
vtkCell::GetParametricCoords
virtual double * GetParametricCoords())
Return a contiguous array of parametric coordinates of the points defining this cell.
vtkCell::GetEdge
virtual vtkCell * GetEdge(int edgeId)=0
Return the edge cell from the edgeId of the cell.
vtkCell::Derivatives
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.
vtkCell::GetParametricCenter
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
vtkWedge::Quad
vtkQuad * Quad
Definition: vtkWedge.h:205
vtkWedge::InterpolationDerivs
static void InterpolationDerivs(const double pcoords[3], double derivs[18])
vtkWedge::InterpolateDerivs
void InterpolateDerivs(const double pcoords[3], double derivs[18]) override
Definition: vtkWedge.h:149
VTK_WEDGE
Definition: vtkCellType.h:59
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:93
vtkX3D::index
Definition: vtkX3D.h:252
vtkQuad
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:35
vtkWedge::InterpolateFunctions
void InterpolateFunctions(const double pcoords[3], double weights[6]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkWedge.h:145