QwtWeedingCurveFitter.3 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. .TH "QwtWeedingCurveFitter" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. QwtWeedingCurveFitter \- A curve fitter implementing Douglas and Peucker algorithm\&.
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .PP
  10. \fC#include <qwt_curve_fitter\&.h>\fP
  11. .PP
  12. Inherits \fBQwtCurveFitter\fP\&.
  13. .SS "Public Member Functions"
  14. .in +1c
  15. .ti -1c
  16. .RI "\fBQwtWeedingCurveFitter\fP (double \fBtolerance\fP=1\&.0)"
  17. .br
  18. .ti -1c
  19. .RI "virtual \fB~QwtWeedingCurveFitter\fP ()"
  20. .br
  21. .RI "Destructor\&. "
  22. .ti -1c
  23. .RI "void \fBsetTolerance\fP (double)"
  24. .br
  25. .ti -1c
  26. .RI "double \fBtolerance\fP () const"
  27. .br
  28. .ti -1c
  29. .RI "void \fBsetChunkSize\fP (uint)"
  30. .br
  31. .ti -1c
  32. .RI "uint \fBchunkSize\fP () const"
  33. .br
  34. .ti -1c
  35. .RI "virtual QPolygonF \fBfitCurve\fP (const QPolygonF &) const"
  36. .br
  37. .in -1c
  38. .SS "Additional Inherited Members"
  39. .SH "Detailed Description"
  40. .PP
  41. A curve fitter implementing Douglas and Peucker algorithm\&.
  42. 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\&.
  43. .PP
  44. 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\&.
  45. .PP
  46. The smoothed curve consists of a subset of the points that defined the original curve\&.
  47. .PP
  48. 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\&.
  49. .SH "Constructor & Destructor Documentation"
  50. .PP
  51. .SS "QwtWeedingCurveFitter::QwtWeedingCurveFitter (double tolerance = \fC1\&.0\fP)"
  52. Constructor
  53. .PP
  54. \fBParameters\fP
  55. .RS 4
  56. \fItolerance\fP Tolerance
  57. .RE
  58. .PP
  59. \fBSee also\fP
  60. .RS 4
  61. \fBsetTolerance()\fP, \fBtolerance()\fP
  62. .RE
  63. .PP
  64. .SH "Member Function Documentation"
  65. .PP
  66. .SS "uint QwtWeedingCurveFitter::chunkSize () const"
  67. .PP
  68. \fBReturns\fP
  69. .RS 4
  70. Maximum for the number of points passed to a run of the algorithm - or 0, when unlimited
  71. .RE
  72. .PP
  73. \fBSee also\fP
  74. .RS 4
  75. \fBsetChunkSize()\fP
  76. .RE
  77. .PP
  78. .SS "QPolygonF QwtWeedingCurveFitter::fitCurve (const QPolygonF & points) const\fC [virtual]\fP"
  79. .PP
  80. \fBParameters\fP
  81. .RS 4
  82. \fIpoints\fP Series of data points
  83. .RE
  84. .PP
  85. \fBReturns\fP
  86. .RS 4
  87. Curve points
  88. .RE
  89. .PP
  90. .PP
  91. Implements \fBQwtCurveFitter\fP\&.
  92. .SS "void QwtWeedingCurveFitter::setChunkSize (uint numPoints)"
  93. Limit the number of points passed to a run of the algorithm
  94. .PP
  95. 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\&.
  96. .PP
  97. \fBParameters\fP
  98. .RS 4
  99. \fInumPoints\fP Maximum for the number of points passed to the algorithm
  100. .RE
  101. .PP
  102. \fBSee also\fP
  103. .RS 4
  104. \fBchunkSize()\fP
  105. .RE
  106. .PP
  107. .SS "void QwtWeedingCurveFitter::setTolerance (double tolerance)"
  108. Assign the tolerance
  109. .PP
  110. The tolerance is the maximum distance, that is acceptable between the original curve and the smoothed curve\&.
  111. .PP
  112. Increasing the tolerance will reduce the number of the resulting points\&.
  113. .PP
  114. \fBParameters\fP
  115. .RS 4
  116. \fItolerance\fP Tolerance
  117. .RE
  118. .PP
  119. \fBSee also\fP
  120. .RS 4
  121. \fBtolerance()\fP
  122. .RE
  123. .PP
  124. .SS "double QwtWeedingCurveFitter::tolerance () const"
  125. .PP
  126. \fBReturns\fP
  127. .RS 4
  128. Tolerance
  129. .RE
  130. .PP
  131. \fBSee also\fP
  132. .RS 4
  133. \fBsetTolerance()\fP
  134. .RE
  135. .PP
  136. .SH "Author"
  137. .PP
  138. Generated automatically by Doxygen for Qwt User's Guide from the source code\&.