2021-03-09 01:56:41 +00:00
|
|
|
|
#ifndef SMOOTHCURVE_H
|
2021-03-08 01:26:04 +00:00
|
|
|
|
#define SMOOTHCURVE_H
|
|
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QVector>
|
|
|
|
|
#include <QPointF>
|
|
|
|
|
#include <QPainterPath>
|
|
|
|
|
|
|
|
|
|
#ifdef quc
|
2021-04-26 23:43:06 +00:00
|
|
|
|
class Q_DECL_EXPORT SmoothCurve
|
2021-03-08 01:26:04 +00:00
|
|
|
|
#else
|
2021-04-26 23:43:06 +00:00
|
|
|
|
class SmoothCurve
|
2021-03-08 01:26:04 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
//创建平滑曲线路径
|
|
|
|
|
static QPainterPath createSmoothCurve(const QVector<QPointF> &points);
|
2021-03-09 01:56:41 +00:00
|
|
|
|
static QPainterPath createSmoothCurve2(const QVector<QPointF> &points);
|
2021-03-08 01:26:04 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static void calculateFirstControlPoints(double *&result, const double *rhs, int n);
|
|
|
|
|
static void calculateControlPoints(const QVector<QPointF> &datas,
|
|
|
|
|
QVector<QPointF> *firstControlPoints,
|
|
|
|
|
QVector<QPointF> *secondControlPoints);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // SMOOTHCURVE_H
|