VTK
vtkHexagonalPrism.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHexagonalPrism.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 =========================================================================*/
35 #ifndef vtkHexagonalPrism_h
36 #define vtkHexagonalPrism_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkCell3D.h"
40 
41 class vtkLine;
42 class vtkPolygon;
43 class vtkQuad;
44 
45 class VTKCOMMONDATAMODEL_EXPORT vtkHexagonalPrism : public vtkCell3D
46 {
47 public:
48  static vtkHexagonalPrism *New();
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
56  void GetEdgePoints(int edgeId, int* &pts) override;
57  void GetFacePoints(int faceId, int* &pts) override;
59 
61 
64  int GetCellType() override {return VTK_HEXAGONAL_PRISM;};
65  int GetCellDimension() override {return 3;};
66  int GetNumberOfEdges() override {return 18;};
67  int GetNumberOfFaces() override {return 8;};
68  vtkCell *GetEdge(int edgeId) override;
69  vtkCell *GetFace(int faceId) override;
70  int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override;
72 
73  int EvaluatePosition(const double x[3], double closestPoint[3],
74  int& subId, double pcoords[3],
75  double& dist2, double weights[]) override;
76  void EvaluateLocation(int& subId, const double pcoords[3], double x[3],
77  double *weights) override;
78  int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t,
79  double x[3], double pcoords[3], int& subId) override;
80  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) override;
81  void Derivatives(int subId, const double pcoords[3], const double *values,
82  int dim, double *derivs) override;
83  double *GetParametricCoords() override;
84 
88  int GetParametricCenter(double pcoords[3]) override;
89 
93  static void InterpolationFunctions(const double pcoords[3], double weights[12]);
97  static void InterpolationDerivs(const double pcoords[3], double derivs[36]);
99 
103  void InterpolateFunctions(const double pcoords[3], double weights[12]) override
104  {
106  }
107  void InterpolateDerivs(const double pcoords[3], double derivs[36]) override
108  {
110  }
112 
114 
118  static int *GetEdgeArray(int edgeId);
119  static int *GetFaceArray(int faceId);
121 
127  void JacobianInverse(const double pcoords[3], double **inverse, double derivs[36]);
128 
129 protected:
131  ~vtkHexagonalPrism() override;
132 
136 
137 private:
138  vtkHexagonalPrism(const vtkHexagonalPrism&) = delete;
139  void operator=(const vtkHexagonalPrism&) = delete;
140 };
141 
142 //----------------------------------------------------------------------------
143 inline int vtkHexagonalPrism::GetParametricCenter(double pcoords[3])
144 {
145  pcoords[0] = pcoords[1] = 0.5;
146  pcoords[2] = 0.5;
147  return 0;
148 }
149 #endif
150 
151 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkHexagonalPrism::GetCellType
int GetCellType() override
See the vtkCell API for descriptions of these methods.
Definition: vtkHexagonalPrism.h:64
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.
vtkHexagonalPrism
a 3D cell that represents a prism with hexagonal base
Definition: vtkHexagonalPrism.h:45
vtkHexagonalPrism::InterpolateDerivs
void InterpolateDerivs(const double pcoords[3], double derivs[36]) override
Definition: vtkHexagonalPrism.h:107
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
vtkHexagonalPrism::InterpolationFunctions
static void InterpolationFunctions(const double pcoords[3], double weights[12])
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkHexagonalPrism::GetCellDimension
int GetCellDimension() override
The topological dimension of the cell.
Definition: vtkHexagonalPrism.h:65
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.
vtkHexagonalPrism::GetParametricCenter
int GetParametricCenter(double pcoords[3]) override
Return the center of the wedge in parametric coordinates.
Definition: vtkHexagonalPrism.h:143
vtkLine
cell represents a 1D line
Definition: vtkLine.h:29
vtkCell3D
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:38
vtkHexagonalPrism::Quad
vtkQuad * Quad
Definition: vtkHexagonalPrism.h:134
vtkHexagonalPrism::GetNumberOfFaces
int GetNumberOfFaces() override
Return the number of faces in the cell.
Definition: vtkHexagonalPrism.h:67
vtkCell::Triangulate
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
Generate simplices of proper dimension.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
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
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkCell3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCell3D::GetEdgePoints
virtual void GetEdgePoints(int edgeId, int *&pts)=0
Get the pair of vertices that define an edge.
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...
vtkHexagonalPrism::GetNumberOfEdges
int GetNumberOfEdges() override
Return the number of edges in the cell.
Definition: vtkHexagonalPrism.h:66
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.
vtkHexagonalPrism::InterpolationDerivs
static void InterpolationDerivs(const double pcoords[3], double derivs[36])
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.
vtkCell3D::GetFacePoints
virtual void GetFacePoints(int faceId, int *&pts)=0
Get the list of vertices that define a face.
vtkHexagonalPrism::Polygon
vtkPolygon * Polygon
Definition: vtkHexagonalPrism.h:135
vtkX3D::index
Definition: vtkX3D.h:246
vtkHexagonalPrism::InterpolateFunctions
void InterpolateFunctions(const double pcoords[3], double weights[12]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
Definition: vtkHexagonalPrism.h:103
vtkQuad
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:35
VTK_HEXAGONAL_PRISM
Definition: vtkCellType.h:61
vtkHexagonalPrism::Line
vtkLine * Line
Definition: vtkHexagonalPrism.h:133