Base class for spline interpolations providing a second order parametric continuity ( C2 ) between adjoining curves. More...
#include <qwt_spline.h>
Public Types | |
enum | BoundaryConditionC2 { CubicRunout = LinearRunout + 1, NotAKnot } |
Public Types inherited from QwtSpline | |
enum | BoundaryCondition { Clamped1, Clamped2, Clamped3, LinearRunout } |
Boundary condition. More... | |
enum | BoundaryPosition { AtBeginning, AtEnd } |
enum | BoundaryType { ConditionalBoundaries, PeriodicPolygon, ClosedPolygon } |
Public Member Functions | |
virtual QVector< QLineF > | bezierControlLines (const QPolygonF &) const QWT_OVERRIDE |
Interpolate a curve with Bezier curves. More... | |
virtual QVector< double > | curvatures (const QPolygonF &) const =0 |
Find the second derivative at the control points. More... | |
virtual QPolygonF | equidistantPolygon (const QPolygonF &, double distance, bool withNodes) const QWT_OVERRIDE |
Find an interpolated polygon with "equidistant" points. More... | |
virtual QPainterPath | painterPath (const QPolygonF &) const QWT_OVERRIDE |
Interpolate a curve with Bezier curves. More... | |
virtual QVector< QwtSplinePolynomial > | polynomials (const QPolygonF &) const QWT_OVERRIDE |
Calculate the interpolating polynomials for a non parametric spline. More... | |
QwtSplineC2 () | |
Constructor. More... | |
virtual QVector< double > | slopes (const QPolygonF &) const QWT_OVERRIDE |
Find the first derivative at the control points. More... | |
virtual | ~QwtSplineC2 () |
Destructor. More... | |
Public Member Functions inherited from QwtSplineC1 | |
QwtSplineC1 () | |
Constructor. More... | |
virtual double | slopeAtBeginning (const QPolygonF &, double slopeNext) const |
virtual double | slopeAtEnd (const QPolygonF &, double slopeBefore) const |
virtual | ~QwtSplineC1 () |
Destructor. More... | |
Public Member Functions inherited from QwtSplineG1 | |
QwtSplineG1 () | |
Constructor. More... | |
virtual | ~QwtSplineG1 () |
Destructor. More... | |
Public Member Functions inherited from QwtSplineInterpolating | |
virtual QPolygonF | polygon (const QPolygonF &, double tolerance) const QWT_OVERRIDE |
Interpolate a curve by a polygon. More... | |
QwtSplineInterpolating () | |
Constructor. More... | |
virtual | ~QwtSplineInterpolating () |
Destructor. More... | |
Public Member Functions inherited from QwtSpline | |
int | boundaryCondition (BoundaryPosition) const |
BoundaryType | boundaryType () const |
double | boundaryValue (BoundaryPosition) const |
virtual uint | locality () const |
const QwtSplineParametrization * | parametrization () const |
QwtSpline () | |
Constructor. More... | |
void | setBoundaryCondition (BoundaryPosition, int condition) |
Define the condition for an endpoint of the spline. More... | |
void | setBoundaryConditions (int condition, double valueBegin=0.0, double valueEnd=0.0) |
Define the condition at the endpoints of a spline. More... | |
void | setBoundaryType (BoundaryType) |
void | setBoundaryValue (BoundaryPosition, double value) |
Define the boundary value. More... | |
void | setParametrization (int type) |
void | setParametrization (QwtSplineParametrization *) |
virtual | ~QwtSpline () |
Destructor. More... | |
Base class for spline interpolations providing a second order parametric continuity ( C2 ) between adjoining 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.
Definition at line 267 of file qwt_spline.h.
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
|
Definition at line 275 of file qwt_spline.h.
QwtSplineC2::QwtSplineC2 | ( | ) |
Constructor.
The default setting is a non closing spline with no parametrization ( QwtSplineParametrization::ParameterX ).
Definition at line 1228 of file qwt_spline.cpp.
|
virtual |
Destructor.
Definition at line 1233 of file qwt_spline.cpp.
|
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.
points | Control points |
Reimplemented from QwtSplineC1.
Reimplemented in QwtSplineCubic.
Definition at line 1270 of file qwt_spline.cpp.
|
pure virtual |
Find the second derivative at the control points.
points | Control nodes of the spline |
Implemented in QwtSplineCubic.
|
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.
points | Control nodes of the spline |
distance | Distance between 2 points according to the parametrization |
withNodes | When true, also add the control nodes ( even if not being equidistant ) |
Reimplemented from QwtSplineC1.
Definition at line 1295 of file qwt_spline.cpp.
|
virtual |
Interpolate a curve with Bezier curves.
Interpolates a polygon piecewise with cubic Bezier curves and returns them as QPainterPath.
points | Control points |
Reimplemented from QwtSplineC1.
Reimplemented in QwtSplineCubic.
Definition at line 1249 of file qwt_spline.cpp.
|
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.
points | Control points |
Reimplemented from QwtSplineC1.
Reimplemented in QwtSplineCubic.
Definition at line 1381 of file qwt_spline.cpp.
|
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.
points | Control nodes of the spline |
Implements QwtSplineC1.
Reimplemented in QwtSplineCubic.
Definition at line 1339 of file qwt_spline.cpp.