File: class_qwt_weeding_curve_fitter.html

package info (click to toggle)
qwt 6.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 23,808 kB
  • sloc: cpp: 57,687; xml: 182; makefile: 32
file content (316 lines) | stat: -rw-r--r-- 18,392 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qwt User&#39;s Guide: QwtWeedingCurveFitter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.1.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_qwt_weeding_curve_fitter.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_qwt_weeding_curve_fitter-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QwtWeedingCurveFitter Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A curve fitter implementing Douglas and Peucker algorithm.  
 <a href="class_qwt_weeding_curve_fitter.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="qwt__curve__fitter_8h_source.html">qwt_curve_fitter.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for QwtWeedingCurveFitter:</div>
<div class="dyncontent">
<div class="center"><img src="class_qwt_weeding_curve_fitter__inherit__graph.png" border="0" usemap="#_qwt_weeding_curve_fitter_inherit__map" alt="Inheritance graph"/></div>
<map name="_qwt_weeding_curve_fitter_inherit__map" id="_qwt_weeding_curve_fitter_inherit__map">
<area shape="rect" id="node2" href="class_qwt_curve_fitter.html" title="Abstract base class for a curve fitter. " alt="" coords="33,5,143,32"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7deb4d070a329cbdee454023194898a7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#a7deb4d070a329cbdee454023194898a7">QwtWeedingCurveFitter</a> (double <a class="el" href="class_qwt_weeding_curve_fitter.html#a484813f52d921cc5dc57bb6dcf82668d">tolerance</a>=1.0)</td></tr>
<tr class="separator:a7deb4d070a329cbdee454023194898a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbd30a948fc6974f881678f80a29768c"><td class="memItemLeft" align="right" valign="top"><a id="abbd30a948fc6974f881678f80a29768c"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#abbd30a948fc6974f881678f80a29768c">~QwtWeedingCurveFitter</a> ()</td></tr>
<tr class="memdesc:abbd30a948fc6974f881678f80a29768c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:abbd30a948fc6974f881678f80a29768c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62c303f6826fef2be7b7bbe82f530680"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#a62c303f6826fef2be7b7bbe82f530680">setTolerance</a> (double)</td></tr>
<tr class="separator:a62c303f6826fef2be7b7bbe82f530680"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a484813f52d921cc5dc57bb6dcf82668d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#a484813f52d921cc5dc57bb6dcf82668d">tolerance</a> () const</td></tr>
<tr class="separator:a484813f52d921cc5dc57bb6dcf82668d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f17a819447cba0e733bd71d90ee2766"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#a9f17a819447cba0e733bd71d90ee2766">setChunkSize</a> (uint)</td></tr>
<tr class="separator:a9f17a819447cba0e733bd71d90ee2766"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfffe6d108f7170bafe5cc81379eaef7"><td class="memItemLeft" align="right" valign="top">uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#adfffe6d108f7170bafe5cc81379eaef7">chunkSize</a> () const</td></tr>
<tr class="separator:adfffe6d108f7170bafe5cc81379eaef7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf876e668d027828c86288e8ac9808ab"><td class="memItemLeft" align="right" valign="top">virtual QPolygonF&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_weeding_curve_fitter.html#acf876e668d027828c86288e8ac9808ab">fitCurve</a> (const QPolygonF &amp;) const</td></tr>
<tr class="separator:acf876e668d027828c86288e8ac9808ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_qwt_curve_fitter"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_qwt_curve_fitter')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_qwt_curve_fitter.html">QwtCurveFitter</a></td></tr>
<tr class="memitem:a62919f309f0441d94adea94573d0f778 inherit pub_methods_class_qwt_curve_fitter"><td class="memItemLeft" align="right" valign="top"><a id="a62919f309f0441d94adea94573d0f778"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_curve_fitter.html#a62919f309f0441d94adea94573d0f778">~QwtCurveFitter</a> ()</td></tr>
<tr class="memdesc:a62919f309f0441d94adea94573d0f778 inherit pub_methods_class_qwt_curve_fitter"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a62919f309f0441d94adea94573d0f778 inherit pub_methods_class_qwt_curve_fitter"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_class_qwt_curve_fitter"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_class_qwt_curve_fitter')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="class_qwt_curve_fitter.html">QwtCurveFitter</a></td></tr>
<tr class="memitem:ad804660017ae0f3ede604470724b3df3 inherit pro_methods_class_qwt_curve_fitter"><td class="memItemLeft" align="right" valign="top"><a id="ad804660017ae0f3ede604470724b3df3"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_curve_fitter.html#ad804660017ae0f3ede604470724b3df3">QwtCurveFitter</a> ()</td></tr>
<tr class="memdesc:ad804660017ae0f3ede604470724b3df3 inherit pro_methods_class_qwt_curve_fitter"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:ad804660017ae0f3ede604470724b3df3 inherit pro_methods_class_qwt_curve_fitter"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A curve fitter implementing Douglas and Peucker algorithm. </p>
<p>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.</p>
<p>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 ( <a class="el" href="class_qwt_weeding_curve_fitter.html#a9f17a819447cba0e733bd71d90ee2766">setChunkSize()</a> ) and to run the algorithm for these smaller parts. The disadvantage of having no interpolation at the borders is for most use cases irrelevant.</p>
<p>The smoothed curve consists of a subset of the points that defined the original curve.</p>
<p>In opposite to <a class="el" href="class_qwt_spline_curve_fitter.html" title="A curve fitter using cubic splines. ">QwtSplineCurveFitter</a> the Douglas and Peucker algorithm reduces the number of points. By adjusting the tolerance parameter according to the axis scales <a class="el" href="class_qwt_spline_curve_fitter.html" title="A curve fitter using cubic splines. ">QwtSplineCurveFitter</a> can be used to implement different level of details to speed up painting of curves of many points. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7deb4d070a329cbdee454023194898a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7deb4d070a329cbdee454023194898a7">&#9670;&nbsp;</a></span>QwtWeedingCurveFitter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QwtWeedingCurveFitter::QwtWeedingCurveFitter </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>tolerance</em> = <code>1.0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructor</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tolerance</td><td>Tolerance </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_weeding_curve_fitter.html#a62c303f6826fef2be7b7bbe82f530680">setTolerance()</a>, <a class="el" href="class_qwt_weeding_curve_fitter.html#a484813f52d921cc5dc57bb6dcf82668d">tolerance()</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="adfffe6d108f7170bafe5cc81379eaef7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfffe6d108f7170bafe5cc81379eaef7">&#9670;&nbsp;</a></span>chunkSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint QwtWeedingCurveFitter::chunkSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Maximum for the number of points passed to a run of the algorithm - or 0, when unlimited </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_weeding_curve_fitter.html#a9f17a819447cba0e733bd71d90ee2766">setChunkSize()</a> </dd></dl>

</div>
</div>
<a id="acf876e668d027828c86288e8ac9808ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf876e668d027828c86288e8ac9808ab">&#9670;&nbsp;</a></span>fitCurve()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QPolygonF QwtWeedingCurveFitter::fitCurve </td>
          <td>(</td>
          <td class="paramtype">const QPolygonF &amp;&#160;</td>
          <td class="paramname"><em>points</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">points</td><td>Series of data points </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Curve points </dd></dl>

<p>Implements <a class="el" href="class_qwt_curve_fitter.html#afa9bf5b328aa553229e204533a60fec0">QwtCurveFitter</a>.</p>

</div>
</div>
<a id="a9f17a819447cba0e733bd71d90ee2766"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f17a819447cba0e733bd71d90ee2766">&#9670;&nbsp;</a></span>setChunkSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QwtWeedingCurveFitter::setChunkSize </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>numPoints</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Limit the number of points passed to a run of the algorithm</p>
<p>The runtime of the Douglas Peucker algorithm increases non linear with the number of points. For a chunk size &gt; 0 the polygon is split into pieces passed to the algorithm one by one.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numPoints</td><td>Maximum for the number of points passed to the algorithm</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_weeding_curve_fitter.html#adfffe6d108f7170bafe5cc81379eaef7">chunkSize()</a> </dd></dl>

</div>
</div>
<a id="a62c303f6826fef2be7b7bbe82f530680"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62c303f6826fef2be7b7bbe82f530680">&#9670;&nbsp;</a></span>setTolerance()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QwtWeedingCurveFitter::setTolerance </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>tolerance</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Assign the tolerance</p>
<p>The tolerance is the maximum distance, that is acceptable between the original curve and the smoothed curve.</p>
<p>Increasing the tolerance will reduce the number of the resulting points.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">tolerance</td><td>Tolerance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_weeding_curve_fitter.html#a484813f52d921cc5dc57bb6dcf82668d">tolerance()</a> </dd></dl>

</div>
</div>
<a id="a484813f52d921cc5dc57bb6dcf82668d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a484813f52d921cc5dc57bb6dcf82668d">&#9670;&nbsp;</a></span>tolerance()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double QwtWeedingCurveFitter::tolerance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Tolerance </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_weeding_curve_fitter.html#a62c303f6826fef2be7b7bbe82f530680">setTolerance()</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_qwt_weeding_curve_fitter.html">QwtWeedingCurveFitter</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>