|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
#include <qwt_weeding_curve_fitter.h>
类 | |
| class | Line |
| class | PrivateData |
Public 成员函数 | |
| QwtWeedingCurveFitter (double tolerance=1.0) | |
| 构造函数 | |
| virtual | ~QwtWeedingCurveFitter () |
| 析构函数 | |
| void | setTolerance (double) |
| 设置容差 | |
| double | tolerance () const |
| void | setChunkSize (uint) |
| 限制传递给算法运行的点数 | |
| uint | chunkSize () const |
| virtual QPolygonF | fitCurve (const QPolygonF &) const override |
| virtual QPainterPath | fitCurvePath (const QPolygonF &) const override |
Public 成员函数 继承自 QwtCurveFitter | |
| virtual | ~QwtCurveFitter () |
| 析构函数 | |
| Mode | mode () const |
| 获取首选拟合模式 | |
额外继承的成员函数 | |
Public 类型 继承自 QwtCurveFitter | |
| enum | Mode { Polygon , Path } |
Protected 成员函数 继承自 QwtCurveFitter | |
| QwtCurveFitter (Mode mode) | |
| 构造函数 | |
实现 Douglas 和 Peucker 算法的曲线拟合器
Douglas 和 Peucker 算法的目的是给定由线段组成的"曲线", 找到一条不太相似但点数更少的曲线。该算法基于原始曲线和 平滑曲线之间的最大距离(容差)来定义"太不相似"。
算法的运行时间非线性增长(最坏情况 O( n*n )), 对于巨大的多边形可能非常慢。为了避免性能问题, 可以拆分多边形(setChunkSize())并为这些较小的部分运行算法。 在边界处没有插值的缺点对于大多数用例来说无关紧要。
平滑曲线由定义原始曲线的点的子集组成。
与 QwtSplineCurveFitter 相反,Douglas 和 Peucker 算法减少 点数。通过根据轴刻度调整容差参数,QwtSplineCurveFitter 可用于实现不同 的细节级别,以加速绘制多点曲线的速度。
|
explicit |
构造函数
|
virtual |
析构函数
| uint QwtWeedingCurveFitter::chunkSize | ( | ) | const |
|
overridevirtual |
|
overridevirtual |
| void QwtWeedingCurveFitter::setChunkSize | ( | uint | numPoints | ) |
限制传递给算法运行的点数
Douglas Peucker 算法的运行时间随点数非线性增长。 对于块大小 > 0,多边形被拆分成块,逐个传递给算法。
| numPoints | 传递给算法的点数最大值 |
| void QwtWeedingCurveFitter::setTolerance | ( | double | tolerance | ) |
| double QwtWeedingCurveFitter::tolerance | ( | ) | const |