Files
qwt/doc/man/man3/QwtWeedingCurveFitter.3
2023-10-31 09:22:42 +01:00

197 lines
4.8 KiB
Groff

.TH "QwtWeedingCurveFitter" 3 "Sun Jul 18 2021" "Version 6.2.0" "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 <qwt_weeding_curve_fitter\&.h>\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 override"
.br
.ti -1c
.RI "virtual QPainterPath \fBfitCurvePath\fP (const QPolygonF &) const override"
.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\&.
.PP
Definition at line 38 of file qwt_weeding_curve_fitter\&.h\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtWeedingCurveFitter::QwtWeedingCurveFitter (double tolerance = \fC1\&.0\fP)\fC [explicit]\fP"
Constructor
.PP
\fBParameters\fP
.RS 4
\fItolerance\fP Tolerance
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetTolerance()\fP, \fBtolerance()\fP
.RE
.PP
.PP
Definition at line 50 of file qwt_weeding_curve_fitter\&.cpp\&.
.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
.PP
Definition at line 114 of file qwt_weeding_curve_fitter\&.cpp\&.
.SS "QPolygonF QwtWeedingCurveFitter::fitCurve (const QPolygonF & points) const\fC [override]\fP, \fC [virtual]\fP"
.PP
\fBParameters\fP
.RS 4
\fIpoints\fP Series of data points
.RE
.PP
\fBReturns\fP
.RS 4
Curve points
.RE
.PP
\fBSee also\fP
.RS 4
\fBfitCurvePath()\fP
.RE
.PP
.PP
Implements \fBQwtCurveFitter\fP\&.
.PP
Definition at line 124 of file qwt_weeding_curve_fitter\&.cpp\&.
.SS "QPainterPath QwtWeedingCurveFitter::fitCurvePath (const QPolygonF & points) const\fC [override]\fP, \fC [virtual]\fP"
.PP
\fBParameters\fP
.RS 4
\fIpoints\fP Series of data points
.RE
.PP
\fBReturns\fP
.RS 4
Curve path
.RE
.PP
\fBSee also\fP
.RS 4
\fBfitCurve()\fP
.RE
.PP
.PP
Implements \fBQwtCurveFitter\fP\&.
.PP
Definition at line 151 of file qwt_weeding_curve_fitter\&.cpp\&.
.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
.PP
Definition at line 101 of file qwt_weeding_curve_fitter\&.cpp\&.
.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
.PP
Definition at line 76 of file qwt_weeding_curve_fitter\&.cpp\&.
.SS "double QwtWeedingCurveFitter::tolerance () const"
.PP
\fBReturns\fP
.RS 4
Tolerance
.RE
.PP
\fBSee also\fP
.RS 4
\fBsetTolerance()\fP
.RE
.PP
.PP
Definition at line 85 of file qwt_weeding_curve_fitter\&.cpp\&.
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.