VTK  9.4.20250206
vtkBezierInterpolation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3// .NAME vtkBezierInterpolation
4// .SECTION Description
5// .SECTION See Also
6#ifndef vtkBezierInterpolation_h
7#define vtkBezierInterpolation_h
8
9#include "vtkCommonDataModelModule.h" // For export macro.
11#include "vtkSmartPointer.h" // For API.
12#include "vtkVector.h" // For FlattenSimplex
13
14#include <vector> // For scratch storage.
15
16// Define this to include support for a "complete" (21- vs 18-point) wedge.
17#define VTK_21_POINT_WEDGE true
18
19VTK_ABI_NAMESPACE_BEGIN
20class vtkPoints;
21class vtkVector2i;
22class vtkVector3d;
23
24class VTKCOMMONDATAMODEL_EXPORT vtkBezierInterpolation : public vtkHigherOrderInterpolation
25{
26public:
28 void PrintSelf(ostream& os, vtkIndent indent) override;
30
31 // see Geometrically Exact and Analysis Suitable Mesh Generation Using Rational Bernstein–Bezier
32 // Elements https://scholar.colorado.edu/cgi/viewcontent.cgi?article=1170&context=mcen_gradetds
33 // Chapter 3, pg 25. given a dimension ( 2 triangle, 3 tetrahedron ) and the degree of the
34 // simplex flatten a simplicial bezier function's coordinate to an integer
35 static int FlattenSimplex(int dim, int deg, vtkVector3i coord);
36
37 // given a dimension ( 2 triangle, 3 tetrahedron ) and the degree of the simplex,
38 // unflatten a simplicial bezier function integer to a simplicial coordinate
39 static vtkVector3i UnFlattenSimplex(int dim, int deg, vtkIdType flat);
40
41 // simplicial version of deCasteljau
42 static void DeCasteljauSimplex(int dim, int deg, const double* pcoords, double* weights);
43 static void DeCasteljauSimplexDeriv(int dim, int deg, const double* pcoords, double* weights);
44
45 static void EvaluateShapeFunctions(int order, double pcoord, double* shape);
46 static void EvaluateShapeAndGradient(int order, double pcoord, double* shape, double* grad);
47
48 static int Tensor1ShapeFunctions(const int order[1], const double* pcoords, double* shape);
49 static int Tensor1ShapeDerivatives(const int order[1], const double* pcoords, double* derivs);
50
51 static int Tensor2ShapeFunctions(const int order[2], const double* pcoords, double* shape);
52 static int Tensor2ShapeDerivatives(const int order[2], const double* pcoords, double* derivs);
53
54 static int Tensor3ShapeFunctions(const int order[3], const double* pcoords, double* shape);
55 static int Tensor3ShapeDerivatives(const int order[3], const double* pcoords, double* derivs);
56
57 void Tensor3EvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
58 const double* fieldVals, int fieldDim, double* fieldDerivs) override;
59
61 const int order[3], vtkIdType numberOfPoints, const double* pcoords, double* shape);
63 const int order[3], vtkIdType numberOfPoints, const double* pcoords, double* derivs);
64
65 void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double* pcoords,
66 double* fieldVals, int fieldDim, double* fieldAtPCoords) override;
67
68 void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
69 const double* fieldVals, int fieldDim, double* fieldDerivs) override;
70
71protected:
74
75private:
77 void operator=(const vtkBezierInterpolation&) = delete;
78};
79
80VTK_ABI_NAMESPACE_END
81#endif // vtkBezierInterpolation_h
static int FlattenSimplex(int dim, int deg, vtkVector3i coord)
static void WedgeShapeDerivatives(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *derivs)
static int Tensor1ShapeFunctions(const int order[1], const double *pcoords, double *shape)
static vtkBezierInterpolation * New()
static int Tensor2ShapeDerivatives(const int order[2], const double *pcoords, double *derivs)
static vtkVector3i UnFlattenSimplex(int dim, int deg, vtkIdType flat)
void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords) override
void WedgeEvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkBezierInterpolation() override
void Tensor3EvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs) override
static void DeCasteljauSimplexDeriv(int dim, int deg, const double *pcoords, double *weights)
static int Tensor1ShapeDerivatives(const int order[1], const double *pcoords, double *derivs)
static int Tensor3ShapeFunctions(const int order[3], const double *pcoords, double *shape)
static void DeCasteljauSimplex(int dim, int deg, const double *pcoords, double *weights)
static void EvaluateShapeFunctions(int order, double pcoord, double *shape)
static void WedgeShapeFunctions(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *shape)
static int Tensor2ShapeFunctions(const int order[2], const double *pcoords, double *shape)
static int Tensor3ShapeDerivatives(const int order[3], const double *pcoords, double *derivs)
static void EvaluateShapeAndGradient(int order, double pcoord, double *shape, double *grad)
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:139
Some derived classes for the different vectors commonly used.
Definition vtkVector.h:440
int vtkIdType
Definition vtkType.h:315