QWT 7.0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QwtSplineLocal Class Reference

A spline with C1 continuity. More...

#include <qwt_spline_local.h>

Inheritance diagram for QwtSplineLocal:
QwtSplineC1 QwtSplineG1 QwtSplineInterpolating QwtSpline

Public Types

enum  Type { Cardinal , ParabolicBlending , Akima , PChip }
 Spline interpolation type. 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

 QwtSplineLocal (Type type)
 Constructor.
 
virtual ~QwtSplineLocal ()
 Destructor.
 
Type type () const
 
virtual uint locality () const QWT_OVERRIDE
 The locality of an spline interpolation identifies how many adjacent polynomials are affected, when changing the position of one point.
 
virtual QPainterPath painterPath (const QPolygonF &) const QWT_OVERRIDE
 Interpolate a curve with Bezier curves.
 
virtual QVector< QLineF > bezierControlLines (const QPolygonF &) 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.
 
- Public Member Functions inherited from QwtSplineC1
 QwtSplineC1 ()
 Constructor.
 
virtual ~QwtSplineC1 ()
 Destructor.
 
virtual QPolygonF equidistantPolygon (const QPolygonF &, double distance, bool withNodes) const QWT_OVERRIDE
 Find an interpolated polygon with "equidistant" points.
 
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.
 

Detailed Description

A spline with C1 continuity.

QwtSplineLocal offers several standard algorithms for interpolating a curve with polynomials having C1 continuity at the control points. All algorithms are local in a sense, that changing one control point only few polynomials.

Member Enumeration Documentation

◆ Type

Spline interpolation type.

All type of spline interpolations are lightweight algorithms calculating the slopes at a point by looking 1 or 2 points back and ahead.

Enumerator
Cardinal 

A cardinal spline.

The cardinal spline interpolation is a very cheap calculation with a locality of 1.

ParabolicBlending 

Parabolic blending is a cheap calculation with a locality of 1.

Sometimes it is also called Cubic Bessel interpolation.

Akima 

The algorithm of H.Akima is a calculation with a locality of 2.

PChip 

Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) is an algorithm that is popular because of being offered by MATLAB.

It preserves the shape of the data and respects monotonicity. It has a locality of 1.

Constructor & Destructor Documentation

◆ QwtSplineLocal()

QwtSplineLocal::QwtSplineLocal ( Type  type)

Constructor.

Parameters
typeSpline type, specifying the type of interpolation
See also
type()

Member Function Documentation

◆ bezierControlLines()

QVector< QLineF > QwtSplineLocal::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

Reimplemented from QwtSplineC1.

◆ locality()

uint QwtSplineLocal::locality ( ) const
virtual

The locality of an spline interpolation identifies how many adjacent polynomials are affected, when changing the position of one point.

The Cardinal, ParabolicBlending and PChip algorithms have a locality of 1, while the Akima interpolation has a locality of 2.

Returns
1 or 2.

Reimplemented from QwtSpline.

◆ painterPath()

QPainterPath QwtSplineLocal::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

Reimplemented from QwtSplineC1.

◆ polynomials()

QVector< QwtSplinePolynomial > QwtSplineLocal::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 QwtSplineC1::polynomials(), but is intended to be replaced by a one pass calculation some day.

Reimplemented from QwtSplineC1.

◆ slopes()

QVector< double > QwtSplineLocal::slopes ( const QPolygonF &  points) const
virtual

Find the first derivative at the control points.

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

Implements QwtSplineC1.

◆ type()

QwtSplineLocal::Type QwtSplineLocal::type ( ) const
Returns
Spline type, specifying the type of interpolation

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