QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
QwtSplineCubic Class Reference

A cubic spline. More...

#include <qwt_spline_cubic.h>

Inheritance diagram for QwtSplineCubic:
QwtSplineC2 QwtSplineC1 QwtSplineG1 QwtSplineInterpolating QwtSpline

Classes

class  PrivateData
 

Public Member Functions

 QwtSplineCubic ()
 Constructor.
 
 ~QwtSplineCubic () override
 Destructor.
 
virtual uint locality () const override
 Get locality (always 0 - non-local)
 
virtual QPainterPath painterPath (const QPolygonF &) const override
 Get painter path from polygon.
 
virtual QVector< QLineF > bezierControlLines (const QPolygonF &points) const override
 Get Bezier control lines.
 
virtual QVector< QwtSplinePolynomialpolynomials (const QPolygonF &) const override
 Get polynomials from polygon.
 
virtual QVector< double > slopes (const QPolygonF &) const override
 Get slopes at control points.
 
virtual QVector< double > curvatures (const QPolygonF &) const override
 Get curvatures at control points.
 
- Public Member Functions inherited from QwtSplineC2
 QwtSplineC2 ()
 Constructor.
 
 ~QwtSplineC2 () override
 Destructor.
 
virtual QPolygonF equidistantPolygon (const QPolygonF &, double distance, bool withNodes) const override
 Find an interpolated polygon with "equidistant" 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 QwtSplineParametrizationparametrization () 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.
 

Additional Inherited Members

- Public Types inherited from QwtSplineC2
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...
 

Detailed Description

A cubic spline.

A cubic spline is a spline with C2 continuity at all control points. It is a non local spline, where a modification of one control point affects the whole spline.

The implementation is based on the equation system of the second derivatives M(x) of the control points P(x).

QwtSplineCubic offers several algorithms for finding M(x), that are selected by setBoundaryType().

The default setting is a "natural spline" having M(x0) = M(xn) = 0.

See also
QwtSpline::BoundaryType

Constructor & Destructor Documentation

◆ QwtSplineCubic()

QwtSplineCubic::QwtSplineCubic ( )

Constructor.

The default setting is a non-closing natural spline with no parametrization.

Destructor

Member Function Documentation

◆ bezierControlLines()

QVector< QLineF > QwtSplineCubic::bezierControlLines ( const QPolygonF &  points) const
overridevirtual

Get Bezier control lines.

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.

Parameters
[in]pointsControl points
Returns
Control points of the interpolating Bezier curves
Note
The implementation simply calls QwtSplineC1::bezierControlLines()

Reimplemented from QwtSplineC2.

◆ curvatures()

QVector< double > QwtSplineCubic::curvatures ( const QPolygonF &  points) const
overridevirtual

Get curvatures at control points.

Find the second derivative at the control points.

Parameters
[in]pointsControl nodes of the spline
Returns
Vector with the values of the second derivative at the control points
See also
slopes()
Note
The x coordinates need to be increasing or decreasing

Implements QwtSplineC2.

◆ locality()

uint QwtSplineCubic::locality ( ) const
overridevirtual

Get locality (always 0 - non-local)

Get locality.

A cubic spline is non-local, where changing one point has an effect on all polynomials.

Returns
0

Reimplemented from QwtSpline.

◆ painterPath()

QPainterPath QwtSplineCubic::painterPath ( const QPolygonF &  points) const
overridevirtual

Get painter path from polygon.

Interpolate a curve with Bezier curves.

Interpolates a polygon piecewise with cubic Bezier curves and returns them as QPainterPath.

Parameters
[in]pointsControl points
Returns
Painter path that can be rendered by QPainter
Note
The implementation simply calls QwtSplineC1::painterPath()

Reimplemented from QwtSplineC2.

◆ polynomials()

QVector< QwtSplinePolynomial > QwtSplineCubic::polynomials ( const QPolygonF &  points) const
overridevirtual

Get polynomials from polygon.

Calculate the interpolating polynomials for a non-parametric spline.

Parameters
[in]pointsControl points
Returns
Interpolating polynomials
Note
The x coordinates need to be increasing or decreasing
The implementation simply calls QwtSplineC2::polynomials(), but is intended to be replaced by a one-pass calculation some day.

Reimplemented from QwtSplineC2.

◆ slopes()

QVector< double > QwtSplineCubic::slopes ( const QPolygonF &  points) const
overridevirtual

Get slopes at control points.

Find the first derivative at the control points.

In contrast to the QwtSplineC2::slopes implementation, the first derivatives are calculated directly, without calculating the second derivatives first.

Parameters
[in]pointsControl nodes of the spline
Returns
Vector with the values of the first derivative at the control points
See also
curvatures(), QwtSplinePolynomial::fromCurvatures()
Note
The x coordinates need to be increasing or decreasing

Reimplemented from QwtSplineC2.


The documentation for this class was generated from the following files: