Public Types | Public Member Functions
QwtSplineC2 Class Reference

Base class for spline interpolations providing a second order parametric continuity ( C2 ) between adjoing curves. More...

#include <qwt_spline.h>

Inheritance diagram for QwtSplineC2:
Inheritance graph
[legend]

List of all members.

Public Types

enum  BoundaryConditionC2 { CubicRunout = LinearRunout + 1, NotAKnot }

Public Member Functions

virtual QVector< QLineF > bezierControlLines (const QPolygonF &) const
 Interpolate a curve with Bezier curves.
virtual QVector< double > curvatures (const QPolygonF &) const =0
 Find the second derivative at the control points.
virtual QPolygonF equidistantPolygon (const QPolygonF &, double distance, bool withNodes) const
 Find an interpolated polygon with "equidistant" points.
virtual QPainterPath painterPath (const QPolygonF &) const
 Interpolate a curve with Bezier curves.
virtual QVector
< QwtSplinePolynomial
polynomials (const QPolygonF &) const
 Calculate the interpolating polynomials for a non parametric spline.
 QwtSplineC2 ()
 Constructor.
virtual QVector< double > slopes (const QPolygonF &) const
 Find the first derivative at the control points.
virtual ~QwtSplineC2 ()
 Destructor.

Detailed Description

Base class for spline interpolations providing a second order parametric continuity ( C2 ) between adjoing curves.

All interpolations with C2 continuity are based on rules for finding the 2. derivate at some control points.

In case of non parametric splines those points are the curve points, while for parametric splines the calculation is done twice using a parameter value t.

See also:
QwtSplineParametrization

Definition at line 262 of file qwt_spline.h.


Member Enumeration Documentation

Boundary condition that requires C2 continuity

See also:
QwtSpline::boundaryCondition, QwtSpline::BoundaryCondition
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].

Note:
boundaryValue() is ignored
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

Note:
boundaryValue() is ignored

Definition at line 270 of file qwt_spline.h.


Constructor & Destructor Documentation

Constructor.

The default setting is a non closing spline with no parametrization ( QwtSplineParametrization::ParameterX ).

See also:
QwtSpline::setParametrization(), QwtSpline::setBoundaryType()

Definition at line 1225 of file qwt_spline.cpp.

Destructor.

Definition at line 1230 of file qwt_spline.cpp.


Member Function Documentation

QVector< QLineF > QwtSplineC2::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(), but is intended to be replaced by a more efficient implementation that builds the polynomials by the curvatures some day.

Reimplemented from QwtSplineC1.

Reimplemented in QwtSplineCubic.

Definition at line 1267 of file qwt_spline.cpp.

QVector< double > QwtSplineC2::curvatures ( const QPolygonF &  points) const [pure 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

Implemented in QwtSplineCubic.

QPolygonF QwtSplineC2::equidistantPolygon ( const QPolygonF &  points,
double  distance,
bool  withNodes 
) const [virtual]

Find an interpolated polygon with "equidistant" points.

The implementation is optimzed for non parametric curves ( QwtSplineParametrization::ParameterX ) and falls back to QwtSpline::equidistantPolygon() otherwise.

Parameters:
pointsControl nodes of the spline
distanceDistance between 2 points according to the parametrization
withNodesWhen true, also add the control nodes ( even if not being equidistant )
Returns:
Interpolating polygon
See also:
QwtSpline::equidistantPolygon()

Reimplemented from QwtSplineC1.

Definition at line 1292 of file qwt_spline.cpp.

QPainterPath QwtSplineC2::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(), but is intended to be replaced by a one pass calculation some day.

Reimplemented from QwtSplineC1.

Reimplemented in QwtSplineCubic.

Definition at line 1246 of file qwt_spline.cpp.

QVector< QwtSplinePolynomial > QwtSplineC2::polynomials ( const QPolygonF &  points) const [virtual]

Calculate the interpolating polynomials for a non parametric spline.

C2 spline interpolations are based on finding values for the second derivates of f at the control points. The interpolating polynomials can be calculated from the the second derivates using QwtSplinePolynomial::fromCurvatures.

The default implementation is a 2 pass calculation. In derived classes it might be overloaded by a one pass implementation.

Parameters:
pointsControl points
Returns:
Interpolating polynomials
Note:
The x coordinates need to be increasing or decreasing

Reimplemented from QwtSplineC1.

Reimplemented in QwtSplineCubic.

Definition at line 1378 of file qwt_spline.cpp.

QVector< double > QwtSplineC2::slopes ( const QPolygonF &  points) const [virtual]

Find the first derivative at the control points.

An implementation calculating the 2nd derivatives and then building the slopes in a 2nd loop. QwtSplineCubic overloads it with a more performant implementation doing it in one loop.

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

Implements QwtSplineC1.

Reimplemented in QwtSplineCubic.

Definition at line 1336 of file qwt_spline.cpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:58