QwtWeedingCurveFitter(3)
π NAME π
Okay bestie, welcome to the QwtWeedingCurveFitter(3) page from the Library Functions Manual. The main-character energy here is simple: QwtWeedingCurveFitter is a curve fitter implementing the Douglas and Peucker algorithm. Periodt. π
β¨ SYNOPSIS β¨
#include <qwt_weeding_curve_fitter.h>
Inherits QwtCurveFitter.
πΈ Public Member Functions πΈ
QwtWeedingCurveFitter (double tolerance=1.0)virtual ~QwtWeedingCurveFitter ()β Destructor.void setTolerance (double)double tolerance () constvoid setChunkSize (uint)uint chunkSize () constvirtual QPolygonF fitCurve (const QPolygonF &) const overridevirtual QPainterPath fitCurvePath (const QPolygonF &) const override
π¦ Public Member Functions inherited from QwtCurveFitter π¦
virtual ~QwtCurveFitter ()β Destructor.Mode mode () const
π§ Additional Inherited Members π§
π Public Types inherited from QwtCurveFitter π
enum Mode { Polygon, Path }β Preferred mode of the fitting algorithm.
π Protected Member Functions inherited from QwtCurveFitter π
QwtCurveFitter (Mode mode)
π¦ Detailed Description π¦
A curve fitter implementing Douglas and Peucker algorithm.
The Douglas and Peucker algorithm is literally here to take a βcurveβ made of line segments and find a curve that is not too dissimilar but has fewer points. It defines βtoo dissimilarβ using the maximum distance β the tolerance β between the original curve and the smoothed curve. Lowkey iconic. β¨
Bestie, the runtime of the algorithm increases non linear (worst caseO( n*n )) and might be very slow for huge polygons. To avoid performance issues it might be useful to split the polygon (setChunkSize()) and to run the algorithm for these smaller parts. The disadvantage of having no interpolation at the borders is for most use cases irrelevant.
The smoothed curve consists of a subset of the points that defined the original curve.
In opposite to QwtSplineCurveFitter, the Douglas and Peucker algorithm reduces the number of points. By adjusting the tolerance parameter according to the axis scales QwtSplineCurveFitter can be used to implement different level of details to speed up painting of curves of many points.
Definition at line 38 of file qwt_weeding_curve_fitter.h.
π Constructor & Destructor Documentation π
QwtWeedingCurveFitter::QwtWeedingCurveFitter (double tolerance = 1.0) [explicit]
Constructor. Itβs giving βset me up with a tolerance,β bestie. π
- Parameters
toleranceβ Tolerance
- See also:
setTolerance(),tolerance()
Definition at line 50 of file qwt_weeding_curve_fitter.cpp.
QwtWeedingCurveFitter::~QwtWeedingCurveFitter () [virtual]
Destructor. Clean up, no cap. π§Ήβ¨
Definition at line 58 of file qwt_weeding_curve_fitter.cpp.
π Member Function Documentation π
uint QwtWeedingCurveFitter::chunkSize () const
Returns the maximum for the number of points passed to a run of the algorithm β or 0 when unlimited. Thatβs the whole vibe check. π
- Returns: Maximum for the number of points passed to a run of the algorithm - or
0, when unlimited - See also:
setChunkSize()
Definition at line 114 of file qwt_weeding_curve_fitter.cpp.
QPolygonF QwtWeedingCurveFitter::fitCurve (const QPolygonF & points) const [override], [virtual]
- Parameters
pointsβ Series of data points
- Returns: Curve points
- See also:
fitCurvePath()
Implements QwtCurveFitter.
Definition at line 124 of file qwt_weeding_curve_fitter.cpp.
QPainterPath QwtWeedingCurveFitter::fitCurvePath (const QPolygonF & points) const [override], [virtual]
- Parameters
pointsβ Series of data points
- Returns: Curve path
- See also:
fitCurve()
Implements QwtCurveFitter.
Definition at line 151 of file qwt_weeding_curve_fitter.cpp.
void QwtWeedingCurveFitter::setChunkSize (uint numPoints)
Limit the number of points passed to a run of the algorithm.
The runtime of the Douglas Peucker algorithm increases non linear with the number of points. For a chunk size > 0 the polygon is split into pieces passed to the algorithm one by one. Itβs the βbreak it into snack-size piecesβ move, fr fr. π
- Parameters
numPointsβ Maximum for the number of points passed to the algorithm
- See also:
chunkSize()
Definition at line 101 of file qwt_weeding_curve_fitter.cpp.
void QwtWeedingCurveFitter::setTolerance (double tolerance)
Assign the tolerance.
The tolerance is the maximum distance, that is acceptable between the original curve and the smoothed curve.
Increasing the tolerance will reduce the number of the resulting points. Highkey the main dial, bestie. π₯
- Parameters
toleranceβ Tolerance
- See also:
tolerance()
Definition at line 76 of file qwt_weeding_curve_fitter.cpp.
QPolygonF QwtWeedingCurveFitter::simplify (const QPolygonF & points) const [private], [virtual]
This one is marked [private], [virtual], and the page gives its signature plus the definition line β no extra prose desc, just the facts. π
Definition at line 158 of file qwt_weeding_curve_fitter.cpp.
double QwtWeedingCurveFitter::tolerance () const
- Returns: Tolerance
- See also:
setTolerance()
Definition at line 85 of file qwt_weeding_curve_fitter.cpp.
πΈ Author πΈ
Generated automatically by Doxygen for Qwt User's Guide from the source code. So yes, the robots wrote this one, not a sleepy human. π€π
Signed off from the Qwt User's Guide on the QwtWeedingCurveFitter(3) page β the footer didnβt hand me a date, so Iβm not inventing one, bestie. π
β¨
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms