.TH "QwtWeedingCurveFitter" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtWeedingCurveFitter \- A curve fitter implementing Douglas and Peucker algorithm\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtCurveFitter\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtWeedingCurveFitter\fP (double \fBtolerance\fP=1\&.0)" .br .ti -1c .RI "virtual \fB~QwtWeedingCurveFitter\fP ()" .br .RI "Destructor\&. " .ti -1c .RI "void \fBsetTolerance\fP (double)" .br .ti -1c .RI "double \fBtolerance\fP () const" .br .ti -1c .RI "void \fBsetChunkSize\fP (uint)" .br .ti -1c .RI "uint \fBchunkSize\fP () const" .br .ti -1c .RI "virtual QPolygonF \fBfitCurve\fP (const QPolygonF &) const" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP A curve fitter implementing Douglas and Peucker algorithm\&. The purpose of the Douglas and Peucker algorithm is that given a 'curve' composed of line segments to find a curve not too dissimilar but that has fewer points\&. The algorithm defines 'too dissimilar' based on the maximum distance (tolerance) between the original curve and the smoothed curve\&. .PP The runtime of the algorithm increases non linear ( worst case O( n*n ) ) and might be very slow for huge polygons\&. To avoid performance issues it might be useful to split the polygon ( \fBsetChunkSize()\fP ) and to run the algorithm for these smaller parts\&. The disadvantage of having no interpolation at the borders is for most use cases irrelevant\&. .PP The smoothed curve consists of a subset of the points that defined the original curve\&. .PP In opposite to \fBQwtSplineCurveFitter\fP the Douglas and Peucker algorithm reduces the number of points\&. By adjusting the tolerance parameter according to the axis scales \fBQwtSplineCurveFitter\fP can be used to implement different level of details to speed up painting of curves of many points\&. .SH "Constructor & Destructor Documentation" .PP .SS "QwtWeedingCurveFitter::QwtWeedingCurveFitter (double tolerance = \fC1\&.0\fP)" Constructor .PP \fBParameters\fP .RS 4 \fItolerance\fP Tolerance .RE .PP \fBSee also\fP .RS 4 \fBsetTolerance()\fP, \fBtolerance()\fP .RE .PP .SH "Member Function Documentation" .PP .SS "uint QwtWeedingCurveFitter::chunkSize () const" .PP \fBReturns\fP .RS 4 Maximum for the number of points passed to a run of the algorithm - or 0, when unlimited .RE .PP \fBSee also\fP .RS 4 \fBsetChunkSize()\fP .RE .PP .SS "QPolygonF QwtWeedingCurveFitter::fitCurve (const QPolygonF & points) const\fC [virtual]\fP" .PP \fBParameters\fP .RS 4 \fIpoints\fP Series of data points .RE .PP \fBReturns\fP .RS 4 Curve points .RE .PP .PP Implements \fBQwtCurveFitter\fP\&. .SS "void QwtWeedingCurveFitter::setChunkSize (uint numPoints)" Limit the number of points passed to a run of the algorithm .PP 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\&. .PP \fBParameters\fP .RS 4 \fInumPoints\fP Maximum for the number of points passed to the algorithm .RE .PP \fBSee also\fP .RS 4 \fBchunkSize()\fP .RE .PP .SS "void QwtWeedingCurveFitter::setTolerance (double tolerance)" Assign the tolerance .PP The tolerance is the maximum distance, that is acceptable between the original curve and the smoothed curve\&. .PP Increasing the tolerance will reduce the number of the resulting points\&. .PP \fBParameters\fP .RS 4 \fItolerance\fP Tolerance .RE .PP \fBSee also\fP .RS 4 \fBtolerance()\fP .RE .PP .SS "double QwtWeedingCurveFitter::tolerance () const" .PP \fBReturns\fP .RS 4 Tolerance .RE .PP \fBSee also\fP .RS 4 \fBsetTolerance()\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.