📄 qwt__plot__curve_8cpp-source.html
字号:
<a name="l00131"></a>00131 <span class="keywordtype">int</span> attributes;<a name="l00132"></a>00132 <span class="keywordtype">int</span> paintAttributes;<a name="l00133"></a>00133 };<a name="l00134"></a>00134 <a name="l00138"></a><a class="code" href="class_qwt_plot_curve.html#798339b953deb10e3dddb0f8b56427c0">00138</a> <a class="code" href="class_qwt_plot_curve.html#798339b953deb10e3dddb0f8b56427c0">QwtPlotCurve::QwtPlotCurve</a>():<a name="l00139"></a>00139 <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a>(<a class="code" href="class_qwt_text.html">QwtText</a>())<a name="l00140"></a>00140 {<a name="l00141"></a>00141 <a class="code" href="class_qwt_plot_curve.html#7afecd61327d56ddc76687d119e92b5d">init</a>();<a name="l00142"></a>00142 }<a name="l00143"></a>00143 <a name="l00148"></a><a class="code" href="class_qwt_plot_curve.html#3bcaa88363509f4bc1ad92bee498f203">00148</a> <a class="code" href="class_qwt_plot_curve.html#798339b953deb10e3dddb0f8b56427c0">QwtPlotCurve::QwtPlotCurve</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_text.html">QwtText</a> &title):<a name="l00149"></a>00149 <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a>(title)<a name="l00150"></a>00150 {<a name="l00151"></a>00151 <a class="code" href="class_qwt_plot_curve.html#7afecd61327d56ddc76687d119e92b5d">init</a>();<a name="l00152"></a>00152 }<a name="l00153"></a>00153 <a name="l00158"></a><a class="code" href="class_qwt_plot_curve.html#0abb61c8a31fad952bfe45a1f325209f">00158</a> <a class="code" href="class_qwt_plot_curve.html#798339b953deb10e3dddb0f8b56427c0">QwtPlotCurve::QwtPlotCurve</a>(<span class="keyword">const</span> QString &title):<a name="l00159"></a>00159 <a class="code" href="class_qwt_plot_item.html">QwtPlotItem</a>(<a class="code" href="class_qwt_text.html">QwtText</a>(title))<a name="l00160"></a>00160 {<a name="l00161"></a>00161 <a class="code" href="class_qwt_plot_curve.html#7afecd61327d56ddc76687d119e92b5d">init</a>();<a name="l00162"></a>00162 }<a name="l00163"></a>00163 <a name="l00165"></a><a class="code" href="class_qwt_plot_curve.html#a05ec6d3883821a8e62330fbeeb85dbd">00165</a> <a class="code" href="class_qwt_plot_curve.html#a05ec6d3883821a8e62330fbeeb85dbd">QwtPlotCurve::~QwtPlotCurve</a>()<a name="l00166"></a>00166 {<a name="l00167"></a>00167 <span class="keyword">delete</span> d_xy;<a name="l00168"></a>00168 <span class="keyword">delete</span> d_data;<a name="l00169"></a>00169 }<a name="l00170"></a>00170 <a name="l00174"></a><a class="code" href="class_qwt_plot_curve.html#7afecd61327d56ddc76687d119e92b5d">00174</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#7afecd61327d56ddc76687d119e92b5d">QwtPlotCurve::init</a>()<a name="l00175"></a>00175 {<a name="l00176"></a>00176 <a class="code" href="class_qwt_plot_item.html#5a335be8ff488809a2cf7f4b734ad1b6">setItemAttribute</a>(QwtPlotItem::Legend);<a name="l00177"></a>00177 <a class="code" href="class_qwt_plot_item.html#5a335be8ff488809a2cf7f4b734ad1b6">setItemAttribute</a>(QwtPlotItem::AutoScale);<a name="l00178"></a>00178 <a name="l00179"></a>00179 d_data = <span class="keyword">new</span> PrivateData;<a name="l00180"></a>00180 d_xy = <span class="keyword">new</span> <a class="code" href="class_qwt_polygon_f_data.html">QwtPolygonFData</a>(QwtArray<QwtDoublePoint>());<a name="l00181"></a>00181 <a name="l00182"></a>00182 <a class="code" href="class_qwt_plot_item.html#57d90e4146133b59d589c71b3a643e82">setZ</a>(20.0);<a name="l00183"></a>00183 }<a name="l00184"></a>00184 <a name="l00185"></a><a class="code" href="class_qwt_plot_curve.html#1cb75062e781f4e0839a6cd2081c3928">00185</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot_curve.html#1cb75062e781f4e0839a6cd2081c3928">QwtPlotCurve::rtti</a>()<span class="keyword"> const</span><a name="l00186"></a>00186 <span class="keyword"></span>{<a name="l00187"></a>00187 <span class="keywordflow">return</span> QwtPlotItem::Rtti_PlotCurve;<a name="l00188"></a>00188 }<a name="l00189"></a>00189 <a name="l00211"></a><a class="code" href="class_qwt_plot_curve.html#7f9c70366415b5cb068af80be5bf3748">00211</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#7f9c70366415b5cb068af80be5bf3748">QwtPlotCurve::setPaintAttribute</a>(<a class="code" href="class_qwt_plot_curve.html#96db1b854c63bfbc452c943251a11b66">PaintAttribute</a> attribute, <span class="keywordtype">bool</span> on)<a name="l00212"></a>00212 {<a name="l00213"></a>00213 <span class="keywordflow">if</span> ( on )<a name="l00214"></a>00214 d_data->paintAttributes |= attribute;<a name="l00215"></a>00215 <span class="keywordflow">else</span><a name="l00216"></a>00216 d_data->paintAttributes &= ~attribute;<a name="l00217"></a>00217 }<a name="l00218"></a>00218 <a name="l00223"></a><a class="code" href="class_qwt_plot_curve.html#d262cf6b8448d3cb693cbceecc6d8481">00223</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot_curve.html#d262cf6b8448d3cb693cbceecc6d8481">QwtPlotCurve::testPaintAttribute</a>(<a class="code" href="class_qwt_plot_curve.html#96db1b854c63bfbc452c943251a11b66">PaintAttribute</a> attribute)<span class="keyword"> const</span><a name="l00224"></a>00224 <span class="keyword"></span>{<a name="l00225"></a>00225 <span class="keywordflow">return</span> (d_data->paintAttributes & attribute);<a name="l00226"></a>00226 }<a name="l00227"></a>00227 <a name="l00255"></a><a class="code" href="class_qwt_plot_curve.html#2de41014c2b87fd459d0c438a15dd33e">00255</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#2de41014c2b87fd459d0c438a15dd33e">QwtPlotCurve::setStyle</a>(<a class="code" href="class_qwt_plot_curve.html#15998aa80a11ba6ba80eebabaf773f70">CurveStyle</a> style)<a name="l00256"></a>00256 {<a name="l00257"></a>00257 <span class="keywordflow">if</span> ( style != d_data->style )<a name="l00258"></a>00258 {<a name="l00259"></a>00259 d_data->style = style;<a name="l00260"></a>00260 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00261"></a>00261 }<a name="l00262"></a>00262 }<a name="l00263"></a>00263 <a name="l00268"></a><a class="code" href="class_qwt_plot_curve.html#2df43bdea2a17118c9114d6fa774e598">00268</a> <a class="code" href="class_qwt_plot_curve.html#15998aa80a11ba6ba80eebabaf773f70">QwtPlotCurve::CurveStyle</a> <a class="code" href="class_qwt_plot_curve.html#2df43bdea2a17118c9114d6fa774e598">QwtPlotCurve::style</a>()<span class="keyword"> const </span><a name="l00269"></a>00269 <span class="keyword"></span>{ <a name="l00270"></a>00270 <span class="keywordflow">return</span> d_data->style; <a name="l00271"></a>00271 }<a name="l00272"></a>00272 <a name="l00278"></a><a class="code" href="class_qwt_plot_curve.html#f7ce6652d2ba981c19bddd1b6973bf94">00278</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#f7ce6652d2ba981c19bddd1b6973bf94">QwtPlotCurve::setSymbol</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_symbol.html">QwtSymbol</a> &s )<a name="l00279"></a>00279 {<a name="l00280"></a>00280 d_data->sym = s;<a name="l00281"></a>00281 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00282"></a>00282 }<a name="l00283"></a>00283 <a name="l00288"></a><a class="code" href="class_qwt_plot_curve.html#4278ed4f767e394b6f92ce4e5d25231a">00288</a> <span class="keyword">const</span> <a class="code" href="class_qwt_symbol.html">QwtSymbol</a> &<a class="code" href="class_qwt_plot_curve.html#4278ed4f767e394b6f92ce4e5d25231a">QwtPlotCurve::symbol</a>()<span class="keyword"> const </span><a name="l00289"></a>00289 <span class="keyword"></span>{ <a name="l00290"></a>00290 <span class="keywordflow">return</span> d_data->sym; <a name="l00291"></a>00291 }<a name="l00292"></a>00292 <a name="l00298"></a><a class="code" href="class_qwt_plot_curve.html#08328abaf2c3b67e479d1e485d2d0c4d">00298</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#08328abaf2c3b67e479d1e485d2d0c4d">QwtPlotCurve::setPen</a>(<span class="keyword">const</span> QPen &p)<a name="l00299"></a>00299 {<a name="l00300"></a>00300 <span class="keywordflow">if</span> ( p != d_data->pen )<a name="l00301"></a>00301 {<a name="l00302"></a>00302 d_data->pen = p;<a name="l00303"></a>00303 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00304"></a>00304 }<a name="l00305"></a>00305 }<a name="l00306"></a>00306 <a name="l00311"></a><a class="code" href="class_qwt_plot_curve.html#778aafd1385ce833821751d0a8635cef">00311</a> <span class="keyword">const</span> QPen& <a class="code" href="class_qwt_plot_curve.html#778aafd1385ce833821751d0a8635cef">QwtPlotCurve::pen</a>()<span class="keyword"> const </span><a name="l00312"></a>00312 <span class="keyword"></span>{ <a name="l00313"></a>00313 <span class="keywordflow">return</span> d_data->pen; <a name="l00314"></a>00314 }<a name="l00315"></a>00315 <a name="l00328"></a><a class="code" href="class_qwt_plot_curve.html#dc52ea882ec1f994e2d2e23c7465b0c2">00328</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#dc52ea882ec1f994e2d2e23c7465b0c2">QwtPlotCurve::setBrush</a>(<span class="keyword">const</span> QBrush &brush)<a name="l00329"></a>00329 {<a name="l00330"></a>00330 <span class="keywordflow">if</span> ( brush != d_data->brush )<a name="l00331"></a>00331 {<a name="l00332"></a>00332 d_data->brush = brush;<a name="l00333"></a>00333 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00334"></a>00334 }<a name="l00335"></a>00335 }<a name="l00336"></a>00336 <a name="l00341"></a><a class="code" href="class_qwt_plot_curve.html#72b678ebb8e4821c1f85351292ce5697">00341</a> <span class="keyword">const</span> QBrush& <a class="code" href="class_qwt_plot_curve.html#72b678ebb8e4821c1f85351292ce5697">QwtPlotCurve::brush</a>()<span class="keyword"> const </span><a name="l00342"></a>00342 <span class="keyword"></span>{<a name="l00343"></a>00343 <span class="keywordflow">return</span> d_data->brush;<a name="l00344"></a>00344 }<a name="l00345"></a>00345 <a name="l00346"></a>00346 <a name="l00358"></a><a class="code" href="class_qwt_plot_curve.html#1dc2caaddb1733703b5fcfbe19f29fe8">00358</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#1dc2caaddb1733703b5fcfbe19f29fe8">QwtPlotCurve::setData</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *xData, <span class="keyword">const</span> <span class="keywordtype">double</span> *yData, <span class="keywordtype">int</span> size)<a name="l00359"></a>00359 {<a name="l00360"></a>00360 <span class="keyword">delete</span> d_xy;<a name="l00361"></a>00361 d_xy = <span class="keyword">new</span> <a class="code" href="class_qwt_array_data.html">QwtArrayData</a>(xData, yData, size);<a name="l00362"></a>00362 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00363"></a>00363 }<a name="l00364"></a>00364 <a name="l00373"></a><a class="code" href="class_qwt_plot_curve.html#ee3452eaaba4fe13e7452319893c4a86">00373</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#1dc2caaddb1733703b5fcfbe19f29fe8">QwtPlotCurve::setData</a>(<span class="keyword">const</span> QwtArray<double> &xData, <a name="l00374"></a>00374 <span class="keyword">const</span> QwtArray<double> &yData)<a name="l00375"></a>00375 {<a name="l00376"></a>00376 <span class="keyword">delete</span> d_xy;<a name="l00377"></a>00377 d_xy = <span class="keyword">new</span> <a class="code" href="class_qwt_array_data.html">QwtArrayData</a>(xData, yData);<a name="l00378"></a>00378 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00379"></a>00379 }<a name="l00380"></a>00380 <a name="l00387"></a>00387 <span class="preprocessor">#if QT_VERSION < 0x040000</span><a name="l00388"></a>00388 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#1dc2caaddb1733703b5fcfbe19f29fe8">QwtPlotCurve::setData</a>(<span class="keyword">const</span> QwtArray<QwtDoublePoint> &data)<a name="l00389"></a>00389 <span class="preprocessor">#else</span><a name="l00390"></a><a class="code" href="class_qwt_plot_curve.html#fabee31ee9ea2c9b8526e5a8b7739e77">00390</a> <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#1dc2caaddb1733703b5fcfbe19f29fe8">QwtPlotCurve::setData</a>(<span class="keyword">const</span> QPolygonF &data)<a name="l00391"></a>00391 <span class="preprocessor">#endif</span><a name="l00392"></a>00392 <span class="preprocessor"></span>{<a name="l00393"></a>00393 <span class="keyword">delete</span> d_xy;<a name="l00394"></a>00394 d_xy = <span class="keyword">new</span> <a class="code" href="class_qwt_polygon_f_data.html">QwtPolygonFData</a>(data);<a name="l00395"></a>00395 itemChanged();<a name="l00396"></a>00396 }<a name="l00397"></a>00397 <a name="l00404"></a><a class="code" href="class_qwt_plot_curve.html#4e9abd5034a175deef8e88a7f8ad41ca">00404</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_curve.html#1dc2caaddb1733703b5fcfbe19f29fe8">QwtPlotCurve::setData</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_data.html">QwtData</a> &data)<a name="l00405"></a>00405 {<a name="l00406"></a>00406 <span class="keyword">delete</span> d_xy;<a name="l00407"></a>00407 d_xy = <a class="code" href="class_qwt_plot_curve.html#1e30b056439ea629f08e8a5f1055949d">data</a>.<a class="code" href="class_qwt_data.html#8531a1add1f0b2d12809f90f97fd80c9">copy</a>();<a name="l00408"></a>00408 <a class="code" href="class_qwt_plot_item.html#d956fdbce5b0721abccce6d09fe4d5ce">itemChanged</a>();<a name="l00409"></a>00409 }<a name="l00410"></a>00410
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -