|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
Base class for spline interpolations with C2 (second order parametric) continuity. More...
#include <qwt_spline.h>
Public Types | |
| enum | BoundaryConditionC2 { CubicRunout = LinearRunout + 1 , NotAKnot } |
| Boundary condition that requires C2 continuity. More... | |
Public Types inherited from QwtSpline | |
| enum | BoundaryType { ConditionalBoundaries , PeriodicPolygon , ClosedPolygon } |
| Boundary type specifying the spline at its endpoints. More... | |
| enum | BoundaryPosition { AtBeginning , AtEnd } |
| position of a boundary condition More... | |
| enum | BoundaryCondition { Clamped1 , Clamped2 , Clamped3 , LinearRunout } |
| Boundary condition. More... | |
Public Member Functions | |
| QwtSplineC2 () | |
| Constructor. | |
| ~QwtSplineC2 () override | |
| Destructor. | |
| virtual QPainterPath | painterPath (const QPolygonF &) const override |
| Interpolate a curve with Bezier curves. | |
| virtual QVector< QLineF > | bezierControlLines (const QPolygonF &) const override |
| Interpolate a curve with Bezier curves. | |
| virtual QPolygonF | equidistantPolygon (const QPolygonF &, double distance, bool withNodes) const override |
| Find an interpolated polygon with "equidistant" points. | |
| virtual QVector< QwtSplinePolynomial > | polynomials (const QPolygonF &) const override |
| Calculate the interpolating polynomials for a non-parametric spline. | |
| virtual QVector< double > | slopes (const QPolygonF &) const override |
| Find the first derivative at the control points. | |
| virtual QVector< double > | curvatures (const QPolygonF &) const =0 |
| Find the second derivative at the control points. | |
Public Member Functions inherited from QwtSplineC1 | |
| QwtSplineC1 () | |
| Constructor. | |
| ~QwtSplineC1 () override | |
| Destructor. | |
| virtual double | slopeAtBeginning (const QPolygonF &, double slopeNext) const |
| Calculate the slope at the beginning of the spline. | |
| virtual double | slopeAtEnd (const QPolygonF &, double slopeBefore) const |
| Calculate the slope at the end of the spline. | |
Public Member Functions inherited from QwtSplineG1 | |
| QwtSplineG1 () | |
| Constructor. | |
| ~QwtSplineG1 () override | |
| Destructor. | |
Public Member Functions inherited from QwtSplineInterpolating | |
| QwtSplineInterpolating () | |
| Constructor. | |
| ~QwtSplineInterpolating () override | |
| Destructor. | |
| virtual QPolygonF | polygon (const QPolygonF &, double tolerance) const override |
| Interpolate a curve by a polygon. | |
Public Member Functions inherited from QwtSpline | |
| QwtSpline () | |
| Constructor. | |
| virtual | ~QwtSpline () |
| Destructor. | |
| void | setParametrization (int type) |
| Set parametrization by type. | |
| void | setParametrization (QwtSplineParametrization *) |
| Set parametrization object. | |
| const QwtSplineParametrization * | parametrization () const |
| Get parametrization. | |
| void | setBoundaryType (BoundaryType) |
| Set boundary type. | |
| BoundaryType | boundaryType () const |
| Get boundary type. | |
| void | setBoundaryValue (BoundaryPosition, double value) |
| Set boundary value. | |
| double | boundaryValue (BoundaryPosition) const |
| Get boundary value. | |
| void | setBoundaryCondition (BoundaryPosition, int condition) |
| Set boundary condition. | |
| int | boundaryCondition (BoundaryPosition) const |
| Get boundary condition. | |
| void | setBoundaryConditions (int condition, double valueBegin=0.0, double valueEnd=0.0) |
| Set boundary conditions for both ends. | |
| virtual uint | locality () const |
| Get locality (number of points used for calculation) | |
Base class for spline interpolations with C2 (second order parametric) continuity.
All interpolations with C2 continuity are based on rules for finding the second derivative at some control points.
For non-parametric splines those points are the curve points, while for parametric splines the calculation is done twice using a parameter value t.
Boundary condition that requires C2 continuity.
| Enumerator | |
|---|---|
| CubicRunout | The second derivate at the endpoint is related to the second derivatives at the 2 neighbours: cv[0] := 2.0 * cv[1] - cv[2].
|
| NotAKnot | The 3rd derivate at the endpoint matches the 3rd derivate at its neighbours. Or in other words: the first/last curve segment extents the polynomial of its neighboured polynomial
|
| QwtSplineC2::QwtSplineC2 | ( | ) |
Constructor.
The default setting is a non-closing spline with no parametrization (QwtSplineParametrization::ParameterX).
|
overridevirtual |
Interpolate a curve with Bezier curves.
Interpolates a polygon piecewise with cubic Bezier curves and returns the 2 control points of each curve as QLineF.
| [in] | points | Control points |
Reimplemented from QwtSplineC1.
Reimplemented in QwtSplineCubic.
|
pure virtual |
Find the second derivative at the control points.
| points | Control nodes of the spline |
Implemented in QwtSplineCubic.
|
overridevirtual |
Find an interpolated polygon with "equidistant" points.
The implementation is optimized for non-parametric curves (QwtSplineParametrization::ParameterX) and falls back to QwtSpline::equidistantPolygon() otherwise.
| [in] | points | Control nodes of the spline |
| [in] | distance | Distance between 2 points according to the parametrization |
| [in] | withNodes | When true, also add the control nodes (even if not being equidistant) |
Reimplemented from QwtSplineC1.
|
overridevirtual |
Interpolate a curve with Bezier curves.
Interpolates a polygon piecewise with cubic Bezier curves and returns them as QPainterPath.
| [in] | points | Control points |
Reimplemented from QwtSplineC1.
Reimplemented in QwtSplineCubic.
|
overridevirtual |
Calculate the interpolating polynomials for a non-parametric spline.
C2 spline interpolations are based on finding values for the second derivatives of f at the control points. The interpolating polynomials can be calculated from the second derivatives using QwtSplinePolynomial::fromCurvatures.
The default implementation is a two-pass calculation. In derived classes it might be overloaded by a one-pass implementation.
| [in] | points | Control points |
Reimplemented from QwtSplineC1.
Reimplemented in QwtSplineCubic.
|
overridevirtual |
Find the first derivative at the control points.
An implementation calculating the second derivatives and then building the slopes in a second loop. QwtSplineCubic overloads it with a more performant implementation doing it in one loop.
| [in] | points | Control nodes of the spline |
Implements QwtSplineC1.
Reimplemented in QwtSplineCubic.