VTK  9.0.3
vtkBezierInterpolation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBezierInterpolation.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 =========================================================================*/
15 // .NAME vtkBezierInterpolation
16 // .SECTION Description
17 // .SECTION See Also
18 #ifndef vtkBezierInterpolation_h
19 #define vtkBezierInterpolation_h
20 
21 #include "vtkCommonDataModelModule.h" // For export macro.
23 #include "vtkSmartPointer.h" // For API.
24 #include "vtkVector.h" // For flattenSimplex
25 
26 #include <vector> // For scratch storage.
27 
28 // Define this to include support for a "complete" (21- vs 18-point) wedge.
29 #define VTK_21_POINT_WEDGE true
30 
31 class vtkPoints;
32 class vtkVector2i;
33 class vtkVector3d;
34 
35 class VTKCOMMONDATAMODEL_EXPORT vtkBezierInterpolation : public vtkHigherOrderInterpolation
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  // see Geometrically Exact and Analysis Suitable Mesh Generation Using Rational Bernstein–Bezier
43  // Elements https://scholar.colorado.edu/cgi/viewcontent.cgi?article=1170&context=mcen_gradetds
44  // Chapter 3, pg 25. given a dimmension ( 2 triangle, 3 tetrahedron ) and the degree of the
45  // simplex flatten a simplicial bezier function's coordinate to an integer
46  static int flattenSimplex(const int dim, const int deg, const vtkVector3i coord);
47 
48  // given a dimmension ( 2 triangle, 3 tetrahedron ) and the degree of the simplex,
49  // unflatten a simplicial bezier function integer to a simplicial coordinate
50  static vtkVector3i unflattenSimplex(const int dim, const int deg, const vtkIdType flat);
51 
52  // simplicial version of deCasteljau
53  static void deCasteljauSimplex(
54  const int dim, const int deg, const double* pcoords, double* weights);
56  const int dim, const int deg, const double* pcoords, double* weights);
57 
58  static void EvaluateShapeFunctions(int order, double pcoord, double* shape);
59  static void EvaluateShapeAndGradient(int order, double pcoord, double* shape, double* grad);
60 
61  static int Tensor1ShapeFunctions(const int order[1], const double* pcoords, double* shape);
62  static int Tensor1ShapeDerivatives(const int order[1], const double* pcoords, double* derivs);
63 
64  static int Tensor2ShapeFunctions(const int order[2], const double* pcoords, double* shape);
65  static int Tensor2ShapeDerivatives(const int order[2], const double* pcoords, double* derivs);
66 
67  static int Tensor3ShapeFunctions(const int order[3], const double* pcoords, double* shape);
68  static int Tensor3ShapeDerivatives(const int order[3], const double* pcoords, double* derivs);
69 
70  virtual void Tensor3EvaluateDerivative(const int order[3], const double* pcoords,
71  vtkPoints* points, const double* fieldVals, int fieldDim, double* fieldDerivs) override;
72 
73  static void WedgeShapeFunctions(
74  const int order[3], const vtkIdType numberOfPoints, const double* pcoords, double* shape);
75  static void WedgeShapeDerivatives(
76  const int order[3], const vtkIdType numberOfPoints, const double* pcoords, double* derivs);
77 
78  virtual void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints,
79  const double* pcoords, double* fieldVals, int fieldDim, double* fieldAtPCoords) override;
80 
81  virtual void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
82  const double* fieldVals, int fieldDim, double* fieldDerivs) override;
83 
84 protected:
87 
88 private:
90  void operator=(const vtkBezierInterpolation&) = delete;
91 };
92 
93 #endif // vtkBezierInterpolation_h
static int Tensor1ShapeFunctions(const int order[1], const double *pcoords, double *shape)
static int Tensor2ShapeDerivatives(const int order[2], const double *pcoords, double *derivs)
static void deCasteljauSimplexDeriv(const int dim, const int deg, const double *pcoords, double *weights)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int flattenSimplex(const int dim, const int deg, const vtkVector3i coord)
~vtkBezierInterpolation() override
static void WedgeShapeDerivatives(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *derivs)
static vtkVector3i unflattenSimplex(const int dim, const int deg, const vtkIdType flat)
static int Tensor1ShapeDerivatives(const int order[1], const double *pcoords, double *derivs)
static int Tensor3ShapeFunctions(const int order[3], const double *pcoords, double *shape)
virtual void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords) override
virtual void WedgeEvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs) override
static void EvaluateShapeFunctions(int order, double pcoord, double *shape)
static vtkBezierInterpolation * New()
static int Tensor2ShapeFunctions(const int order[2], const double *pcoords, double *shape)
static void WedgeShapeFunctions(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *shape)
virtual void Tensor3EvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs) override
static int Tensor3ShapeDerivatives(const int order[3], const double *pcoords, double *derivs)
static void deCasteljauSimplex(const int dim, const int deg, const double *pcoords, double *weights)
static void EvaluateShapeAndGradient(int order, double pcoord, double *shape, double *grad)
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 3D points
Definition: vtkPoints.h:34
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:420
@ points
Definition: vtkX3D.h:452
@ order
Definition: vtkX3D.h:446
int vtkIdType
Definition: vtkType.h:338