Public Member Functions | List of all members
QwtSplineC1 Class Referenceabstract

Base class for spline interpolations providing a first order parametric continuity ( C1 ) between adjoining curves. More...

#include <qwt_spline.h>

Inheritance diagram for QwtSplineC1:
Inheritance graph
[legend]

Public Member Functions

virtual QVector< QLineF > bezierControlLines (const QPolygonF &) const QWT_OVERRIDE
 Interpolate a curve with Bezier curves. 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
 Calculate an interpolated painter path. More...
 
virtual QVector< QwtSplinePolynomialpolynomials (const QPolygonF &) const
 Calculate the interpolating polynomials for a non parametric spline. More...
 
 QwtSplineC1 ()
 Constructor. More...
 
virtual double slopeAtBeginning (const QPolygonF &, double slopeNext) const
 
virtual double slopeAtEnd (const QPolygonF &, double slopeBefore) const
 
virtual QVector< double > slopes (const QPolygonF &) const =0
 Find the first derivative at the control points. More...
 
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 QwtSplineParametrizationparametrization () 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...
 

Additional Inherited Members

- Public Types inherited from QwtSpline
enum  BoundaryCondition { Clamped1, Clamped2, Clamped3, LinearRunout }
 Boundary condition. More...
 
enum  BoundaryPosition { AtBeginning, AtEnd }
 
enum  BoundaryType { ConditionalBoundaries, PeriodicPolygon, ClosedPolygon }
 

Detailed Description

Base class for spline interpolations providing a first order parametric continuity ( C1 ) between adjoining curves.

All interpolations with C1 continuity are based on rules for finding the 1. 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 235 of file qwt_spline.h.

Constructor & Destructor Documentation

◆ QwtSplineC1()

QwtSplineC1::QwtSplineC1 ( )

Constructor.

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

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

Definition at line 962 of file qwt_spline.cpp.

◆ ~QwtSplineC1()

QwtSplineC1::~QwtSplineC1 ( )
virtual

Destructor.

Definition at line 968 of file qwt_spline.cpp.

Member Function Documentation

◆ bezierControlLines()

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

Implements QwtSplineInterpolating.

Reimplemented in QwtSplineCubic, QwtSplineC2, and QwtSplineLocal.

Definition at line 1101 of file qwt_spline.cpp.

◆ equidistantPolygon()

QPolygonF QwtSplineC1::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 QwtSplineInterpolating.

Reimplemented in QwtSplineC2.

Definition at line 1167 of file qwt_spline.cpp.

◆ painterPath()

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

Calculate an interpolated painter path.

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

The implementation calculates the slopes at the control points and converts them into painter path elements in an additional loop.

Parameters
pointsControl points
Returns
QPainterPath Painter path, that can be rendered by QPainter
Note
Derived spline classes might overload painterPath() to avoid the extra loops for converting results into a QPainterPath

Reimplemented from QwtSplineInterpolating.

Reimplemented in QwtSplineC2, QwtSplineLocal, and QwtSplineCubic.

Definition at line 1043 of file qwt_spline.cpp.

◆ polynomials()

QVector< QwtSplinePolynomial > QwtSplineC1::polynomials ( const QPolygonF &  points) const
virtual

Calculate the interpolating polynomials for a non parametric spline.

C1 spline interpolations are based on finding values for the first derivates at the control points. The interpolating polynomials can be calculated from the the first derivates using QwtSplinePolynomial::fromSlopes().

The default implementation is a two 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 in QwtSplineC2, QwtSplineLocal, and QwtSplineCubic.

Definition at line 1201 of file qwt_spline.cpp.

◆ slopeAtBeginning()

double QwtSplineC1::slopeAtBeginning ( const QPolygonF &  points,
double  slopeNext 
) const
virtual
Parameters
pointsControl points
slopeNextValue of the first derivative at the second point
Returns
value of the first derivative at the first point
See also
slopeAtEnd(), QwtSpline::boundaryCondition(), QwtSpline::boundaryValue()

Definition at line 979 of file qwt_spline.cpp.

◆ slopeAtEnd()

double QwtSplineC1::slopeAtEnd ( const QPolygonF &  points,
double  slopeBefore 
) const
virtual
Parameters
pointsControl points
slopeBeforeValue of the first derivative at the point before the last one
Returns
value of the first derivative at the last point
See also
slopeAtBeginning(), QwtSpline::boundaryCondition(), QwtSpline::boundaryValue()

Definition at line 997 of file qwt_spline.cpp.

◆ slopes()

QVector< double > QwtSplineC1::slopes ( const QPolygonF &  points) const
pure 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

Implemented in QwtSplineC2, QwtSplineLocal, and QwtSplineCubic.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:51