QWT 7.0.1
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 The default setting is a non closing natural spline with no parametrization.
 
virtual ~QwtSplineCubic ()
 Destructor.
 
virtual uint locality () const QWT_OVERRIDE
 A cubic spline is non local, where changing one point has em effect on all polynomials.
 
virtual QPainterPath painterPath (const QPolygonF &) const QWT_OVERRIDE
 Interpolate a curve with Bezier curves.
 
virtual QVector< QLineF > bezierControlLines (const QPolygonF &points) const QWT_OVERRIDE
 Interpolate a curve with Bezier curves.
 
virtual QVector< QwtSplinePolynomialpolynomials (const QPolygonF &) const QWT_OVERRIDE
 Calculate the interpolating polynomials for a non parametric spline.
 
virtual QVector< double > slopes (const QPolygonF &) const QWT_OVERRIDE
 Find the first derivative at the control points.
 
virtual QVector< double > curvatures (const QPolygonF &) const QWT_OVERRIDE
 Find the second derivative at the control points.
 
- Public Member Functions inherited from QwtSplineC2
 QwtSplineC2 ()
 Constructor.
 
virtual ~QwtSplineC2 ()
 Destructor.
 
virtual QPolygonF equidistantPolygon (const QPolygonF &, double distance, bool withNodes) const QWT_OVERRIDE
 Find an interpolated polygon with "equidistant" points.
 
- Public Member Functions inherited from QwtSplineC1
 QwtSplineC1 ()
 Constructor.
 
virtual ~QwtSplineC1 ()
 Destructor.
 
virtual double slopeAtBeginning (const QPolygonF &, double slopeNext) const
 
virtual double slopeAtEnd (const QPolygonF &, double slopeBefore) const
 
- Public Member Functions inherited from QwtSplineG1
 QwtSplineG1 ()
 Constructor.
 
virtual ~QwtSplineG1 ()
 Destructor.
 
- Public Member Functions inherited from QwtSplineInterpolating
 QwtSplineInterpolating ()
 Constructor.
 
virtual ~QwtSplineInterpolating ()
 Destructor.
 
virtual QPolygonF polygon (const QPolygonF &, double tolerance) const QWT_OVERRIDE
 Interpolate a curve by a polygon.
 
- Public Member Functions inherited from QwtSpline
 QwtSpline ()
 Constructor.
 
virtual ~QwtSpline ()
 Destructor.
 
void setParametrization (int type)
 Define the parametrization for a parametric spline approximation The default setting is a chordal parametrization.
 
void setParametrization (QwtSplineParametrization *)
 Define the parametrization for a parametric spline approximation The default setting is a chordal parametrization.
 
const QwtSplineParametrizationparametrization () const
 
void setBoundaryType (BoundaryType)
 Define the boundary type for the endpoints of the approximating spline.
 
BoundaryType boundaryType () const
 
void setBoundaryValue (BoundaryPosition, double value)
 Define the boundary value.
 
double boundaryValue (BoundaryPosition) const
 
void setBoundaryCondition (BoundaryPosition, int condition)
 Define the condition for an endpoint of the spline.
 
int boundaryCondition (BoundaryPosition) const
 
void setBoundaryConditions (int condition, double valueBegin=0.0, double valueEnd=0.0)
 Define the condition at the endpoints of a spline.
 

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, what means that all polynomials are changing when one control point has changed.

The implementation is based on the fact, that the continuity condition means an equation with 3 unknowns for 3 adjacent points. The equation system can be resolved by defining start/end conditions, that allow substituting of one of the unknowns for the start/end equations.

Resolving the equation system is a 2 pass algorithm, requiring more CPU costs than all other implemented type of splines.

Todo:
The implementation is not numerical stable

Member Function Documentation

◆ bezierControlLines()

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

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
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
virtual

Find the second derivative at the control points.

Parameters
pointsControl nodes of the spline
Returns
Vector with the values of the 2nd derivate at the control points
See also
slopes()
Note
The x coordinates need to be increasing or decreasing

Implements QwtSplineC2.

◆ locality()

uint QwtSplineCubic::locality ( ) const
virtual

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

Returns
0

Reimplemented from QwtSpline.

◆ painterPath()

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

Interpolate a curve with Bezier curves.

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

Parameters
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
virtual

Calculate the interpolating polynomials for a non parametric spline.

Parameters
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
virtual

Find the first derivative at the control points.

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

Parameters
pointsControl nodes of the spline
Returns
Vector with the values of the 2nd derivate 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: