forked from OpenModelica/OpenModelica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qwt_spline_local.h
83 lines (66 loc) · 2.38 KB
/
qwt_spline_local.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_SPLINE_LOCAL_H
#define QWT_SPLINE_LOCAL_H
#include "qwt_global.h"
#include "qwt_spline.h"
/*!
\brief 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.
*/
class QWT_EXPORT QwtSplineLocal : public QwtSplineC1
{
public:
/*!
\brief 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.
*/
enum Type
{
/*!
A cardinal spline
The cardinal spline interpolation is a very cheap calculation with
a locality of 1.
*/
Cardinal,
/*!
Parabolic blending is a cheap calculation with a locality of 1. Sometimes
it is also called Cubic Bessel interpolation.
*/
ParabolicBlending,
/*!
The algorithm of H.Akima is a calculation with a locality of 2.
*/
Akima,
/*!
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.
*/
PChip
};
QwtSplineLocal( Type type );
virtual ~QwtSplineLocal();
Type type() const;
virtual uint locality() const QWT_OVERRIDE;
virtual QPainterPath painterPath( const QPolygonF& ) const QWT_OVERRIDE;
virtual QVector< QLineF > bezierControlLines( const QPolygonF& ) const QWT_OVERRIDE;
// calculating the parametric equations
virtual QVector< QwtSplinePolynomial > polynomials( const QPolygonF& ) const QWT_OVERRIDE;
virtual QVector< double > slopes( const QPolygonF& ) const QWT_OVERRIDE;
private:
const Type m_type;
};
#endif