| 1 | /******************************************************************************
|
|---|
| 2 | * Qwt Widget Library
|
|---|
| 3 | * Copyright (C) 1997 Josef Wilgen
|
|---|
| 4 | * Copyright (C) 2002 Uwe Rathmann
|
|---|
| 5 | *
|
|---|
| 6 | * This library is free software; you can redistribute it and/or
|
|---|
| 7 | * modify it under the terms of the Qwt License, Version 1.0
|
|---|
| 8 | *****************************************************************************/
|
|---|
| 9 |
|
|---|
| 10 | #ifndef QWT_SPLINE_CUBIC_H
|
|---|
| 11 | #define QWT_SPLINE_CUBIC_H
|
|---|
| 12 |
|
|---|
| 13 | #include "qwt_global.h"
|
|---|
| 14 | #include "qwt_spline.h"
|
|---|
| 15 |
|
|---|
| 16 | /*!
|
|---|
| 17 | \brief A cubic spline
|
|---|
| 18 |
|
|---|
| 19 | A cubic spline is a spline with C2 continuity at all control points.
|
|---|
| 20 | It is a non local spline, what means that all polynomials are changing
|
|---|
| 21 | when one control point has changed.
|
|---|
| 22 |
|
|---|
| 23 | The implementation is based on the fact, that the continuity condition
|
|---|
| 24 | means an equation with 3 unknowns for 3 adjacent points. The equation
|
|---|
| 25 | system can be resolved by defining start/end conditions, that allow
|
|---|
| 26 | substituting of one of the unknowns for the start/end equations.
|
|---|
| 27 |
|
|---|
| 28 | Resolving the equation system is a 2 pass algorithm, requiring more CPU costs
|
|---|
| 29 | than all other implemented type of splines.
|
|---|
| 30 |
|
|---|
| 31 | \todo The implementation is not numerical stable
|
|---|
| 32 | */
|
|---|
| 33 | class QWT_EXPORT QwtSplineCubic : public QwtSplineC2
|
|---|
| 34 | {
|
|---|
| 35 | public:
|
|---|
| 36 | QwtSplineCubic();
|
|---|
| 37 | virtual ~QwtSplineCubic();
|
|---|
| 38 |
|
|---|
| 39 | virtual uint locality() const QWT_OVERRIDE;
|
|---|
| 40 |
|
|---|
| 41 | virtual QPainterPath painterPath( const QPolygonF& ) const QWT_OVERRIDE;
|
|---|
| 42 | virtual QVector< QLineF > bezierControlLines( const QPolygonF& points ) const QWT_OVERRIDE;
|
|---|
| 43 |
|
|---|
| 44 | // calculating the parametric equations
|
|---|
| 45 | virtual QVector< QwtSplinePolynomial > polynomials( const QPolygonF& ) const QWT_OVERRIDE;
|
|---|
| 46 | virtual QVector< double > slopes( const QPolygonF& ) const QWT_OVERRIDE;
|
|---|
| 47 | virtual QVector< double > curvatures( const QPolygonF& ) const QWT_OVERRIDE;
|
|---|
| 48 |
|
|---|
| 49 | private:
|
|---|
| 50 | class PrivateData;
|
|---|
| 51 | PrivateData* m_data;
|
|---|
| 52 | };
|
|---|
| 53 |
|
|---|
| 54 | #endif
|
|---|