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 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Qwt User's Guide: qwt_plot_marker.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.8 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>qwt_plot_marker.cpp</h1><pre class="fragment"><div>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span>
00002 <span class="comment"> * Qwt Widget Library</span>
00003 <span class="comment"> * Copyright (C) 1997 Josef Wilgen</span>
00004 <span class="comment"> * Copyright (C) 2002 Uwe Rathmann</span>
00005 <span class="comment"> * </span>
00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span>
00008 <span class="comment"> *****************************************************************************/</span>
00009
00010 <span class="comment">// vim: expandtab</span>
00011
00012 <span class="preprocessor">#include "qwt_plot.h"</span>
00013 <span class="preprocessor">#include "qwt_plot_dict.h"</span>
00014 <span class="preprocessor">#include "<a class="code" href="qwt__math_8h.html">qwt_math.h</a>"</span>
00015
<a name="l00017"></a><a class="code" href="class_qwt_plot.html#a38">00017</a> QwtPlotMarkerIterator <a class="code" href="class_qwt_plot.html#a38">QwtPlot::markerIterator</a>()<span class="keyword"> const</span>
00018 <span class="keyword"></span>{
00019 <span class="keywordflow">return</span> QwtPlotMarkerIterator(*d_markers);
00020 }
00021
<a name="l00029"></a><a class="code" href="class_qwt_plot.html#a131">00029</a> <span class="keywordtype">long</span> <a class="code" href="class_qwt_plot.html#a131">QwtPlot::closestMarker</a>(<span class="keywordtype">int</span> xpos, <span class="keywordtype">int</span> ypos, <span class="keywordtype">int</span> &dist)<span class="keyword"> const</span>
00030 <span class="keyword"></span>{
00031 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> map[axisCnt];
00032 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a109">axis</a> = 0; axis < axisCnt; axis++ )
00033 map[axis] = <a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(axis);
00034
00035 <span class="keywordtype">long</span> rv = 0;
00036 <span class="keywordtype">double</span> dmin = 1.0e10;
00037
00038 QwtPlotMarkerIterator itm = <a class="code" href="class_qwt_plot.html#a38">markerIterator</a>();
00039 <span class="keywordflow">for</span> (<a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = itm.toFirst(); m != 0; m = ++itm )
00040 {
00041 <span class="keywordtype">double</span> cx = map[m-><a class="code" href="class_qwt_plot_mapped_item.html#a3">xAxis</a>()].<a class="code" href="class_qwt_di_map.html#a10">xTransform</a>(m-><a class="code" href="class_qwt_plot_marker.html#a1">xValue</a>());
00042 <span class="keywordtype">double</span> cy = map[m-><a class="code" href="class_qwt_plot_mapped_item.html#a5">yAxis</a>()].xTransform(m-><a class="code" href="class_qwt_plot_marker.html#a2">yValue</a>());
00043
00044 <span class="keywordflow">if</span> (m-><a class="code" href="class_qwt_marker.html#a5">lineStyle</a>() == QwtMarker::HLine)
00045 {
00046 <span class="keywordflow">if</span> (m-><a class="code" href="class_qwt_marker.html#a7">symbol</a>().<a class="code" href="class_qwt_symbol.html#a13">style</a>() == QwtSymbol::None)
00047 cx = double(xpos);
00048 }
00049 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (m-><a class="code" href="class_qwt_marker.html#a5">lineStyle</a>() == QwtMarker::VLine)
00050 {
00051 <span class="keywordflow">if</span> (m-><a class="code" href="class_qwt_marker.html#a7">symbol</a>().<a class="code" href="class_qwt_symbol.html#a13">style</a>() == QwtSymbol::None)
00052 cy = double(ypos);
00053 }
00054
00055 <span class="keywordtype">double</span> f = <a class="code" href="qwt__math_8h.html#a31">qwtSqr</a>(cx - <span class="keywordtype">double</span>(xpos)) + <a class="code" href="qwt__math_8h.html#a31">qwtSqr</a>(cy - <span class="keywordtype">double</span>(ypos));
00056 <span class="keywordflow">if</span> (f < dmin)
00057 {
00058 dmin = f;
00059 rv = itm.currentKey();
00060 }
00061 }
00062
00063 dist = int(sqrt(dmin));
00064 <span class="keywordflow">return</span> rv;
00065 }
00066
00068 <span class="keywordtype">long</span> QwtPlot::newMarkerKey()
00069 {
00070 <span class="keywordtype">long</span> newkey = d_markers->count() + 1;
00071
00072 <span class="keywordflow">if</span> (newkey > 1) <span class="comment">// count > 0</span>
00073 {
00074 <span class="keywordflow">if</span> (d_markers->find(newkey)) <span class="comment">// key count+1 exists => there must be a</span>
00075 <span class="comment">// free key <= count</span>
00076 {
00077 <span class="comment">// find the first available key <= count</span>
00078 newkey = 1;
00079 <span class="keywordflow">while</span> (newkey <= long(d_markers->count()))
00080 {
00081 <span class="keywordflow">if</span> (d_markers->find(newkey))
00082 newkey++;
00083 <span class="keywordflow">else</span>
00084 <span class="keywordflow">break</span>;
00085 }
00086
00087 <span class="comment">// This can't happen. Just paranoia.</span>
00088 <span class="keywordflow">if</span> (newkey > long(d_markers->count()))
00089 {
00090 <span class="keywordflow">while</span> (!d_markers->find(newkey))
00091 {
00092 newkey++;
00093 <span class="keywordflow">if</span> (newkey > 10000) <span class="comment">// prevent infinite loop</span>
00094 {
00095 newkey = 0;
00096 <span class="keywordflow">break</span>;
00097 }
00098 }
00099 }
00100 }
00101 }
00102 <span class="keywordflow">return</span> newkey;
00103
00104 }
00105
<a name="l00113"></a><a class="code" href="class_qwt_plot.html#a128">00113</a> <span class="keywordtype">long</span> <a class="code" href="class_qwt_plot.html#a128">QwtPlot::insertLineMarker</a>(<span class="keyword">const</span> QString &label, <span class="keywordtype">int</span> axis)
00114 {
00115 QwtMarker::LineStyle lineStyle = QwtMarker::NoLine;
00116 <span class="keywordtype">int</span> xAxis = QwtPlot::xBottom;
00117 <span class="keywordtype">int</span> yAxis = QwtPlot::yLeft;
00118
00119 <span class="keywordflow">switch</span>(axis)
00120 {
00121 <span class="keywordflow">case</span> yLeft:
00122 <span class="keywordflow">case</span> yRight:
00123 yAxis = axis;
00124 lineStyle = QwtMarker::HLine;
00125 <span class="keywordflow">break</span>;
00126 <span class="keywordflow">case</span> xTop:
00127 <span class="keywordflow">case</span> xBottom:
00128 xAxis = axis;
00129 lineStyle = QwtMarker::VLine;
00130 <span class="keywordflow">break</span>;
00131 }
00132
00133 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *<a class="code" href="class_qwt_plot.html#a129">marker</a> = <span class="keyword">new</span> <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a>(<span class="keyword">this</span>);
00134 <span class="keywordflow">if</span> ( marker == 0 )
00135 <span class="keywordflow">return</span> 0;
00136
00137 marker-><a class="code" href="class_qwt_plot_mapped_item.html#a1">setAxis</a>(xAxis, yAxis);
00138 marker-><a class="code" href="class_qwt_marker.html#a8">setLabel</a>(label);
00139 marker-><a class="code" href="class_qwt_marker.html#a4">setLineStyle</a>(lineStyle);
00140 marker-><a class="code" href="class_qwt_marker.html#a11">setLabelAlignment</a>(Qt::AlignRight|Qt::AlignTop);
00141
00142 <span class="keywordtype">long</span> key = <a class="code" href="class_qwt_plot.html#a126">insertMarker</a>(marker);
00143 <span class="keywordflow">if</span> ( key == 0 )
00144 <span class="keyword">delete</span> marker;
00145
00146 <span class="keywordflow">return</span> key;
00147 }
00148
<a name="l00156"></a><a class="code" href="class_qwt_plot.html#a127">00156</a> <span class="keywordtype">long</span> <a class="code" href="class_qwt_plot.html#a126">QwtPlot::insertMarker</a>(<span class="keyword">const</span> QString &label, <span class="keywordtype">int</span> xAxis, <span class="keywordtype">int</span> yAxis)
00157 {
00158 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *<a class="code" href="class_qwt_plot.html#a129">marker</a> = <span class="keyword">new</span> <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a>(<span class="keyword">this</span>);
00159 <span class="keywordflow">if</span> ( marker == 0 )
00160 <span class="keywordflow">return</span> 0;
00161
00162 marker-><a class="code" href="class_qwt_plot_mapped_item.html#a1">setAxis</a>(xAxis, yAxis);
00163 marker-><a class="code" href="class_qwt_marker.html#a8">setLabel</a>(label);
00164
00165 <span class="keywordtype">long</span> key = <a class="code" href="class_qwt_plot.html#a126">insertMarker</a>(marker);
00166 <span class="keywordflow">if</span> ( key == 0 )
00167 <span class="keyword">delete</span> marker;
00168
00169 <span class="keywordflow">return</span> key;
00170 }
00171
<a name="l00177"></a><a class="code" href="class_qwt_plot.html#a126">00177</a> <span class="keywordtype">long</span> <a class="code" href="class_qwt_plot.html#a126">QwtPlot::insertMarker</a>(<a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *marker)
00178 {
00179 <span class="keywordflow">if</span> ( marker == 0 )
00180 <span class="keywordflow">return</span> 0;
00181
00182 <span class="keywordtype">long</span> key = newMarkerKey();
00183 <span class="keywordflow">if</span> ( key == 0 )
00184 <span class="keywordflow">return</span> 0;
00185
00186 marker-><a class="code" href="class_qwt_plot_item.html#a2">reparent</a>(<span class="keyword">this</span>);
00187 d_markers->insert(key, marker);
00188
00189 <a class="code" href="class_qwt_plot.html#b0">autoRefresh</a>();
00190
00191 <span class="keywordflow">return</span> key;
00192 }
00193
<a name="l00200"></a><a class="code" href="class_qwt_plot.html#a129">00200</a> <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *<a class="code" href="class_qwt_plot.html#a129">QwtPlot::marker</a>(<span class="keywordtype">long</span> key)
00201 {
00202 <span class="keywordflow">return</span> d_markers->find(key);
00203 }
00204
<a name="l00211"></a><a class="code" href="class_qwt_plot.html#a130">00211</a> <span class="keyword">const</span> <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *<a class="code" href="class_qwt_plot.html#a129">QwtPlot::marker</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00212 <span class="keyword"></span>{
00213 <span class="keywordflow">return</span> d_markers->find(key);
00214 }
00215
<a name="l00219"></a><a class="code" href="class_qwt_plot.html#a132">00219</a> QwtArray<long> <a class="code" href="class_qwt_plot.html#a132">QwtPlot::markerKeys</a>()<span class="keyword"> const</span>
00220 <span class="keyword"></span>{
00221 QwtArray<long> keys(d_markers->count());
00222
00223 <span class="keywordtype">int</span> i = 0;
00224
00225 QwtPlotMarkerIterator itm = <a class="code" href="class_qwt_plot.html#a38">markerIterator</a>();
00226 <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = itm.toFirst(); m != 0; m = ++itm, i++ )
00227 keys[i] = itm.currentKey();
00228
00229 <span class="keywordflow">return</span> keys;
00230 }
00231
<a name="l00235"></a><a class="code" href="class_qwt_plot.html#a142">00235</a> QFont <a class="code" href="class_qwt_plot.html#a142">QwtPlot::markerFont</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00236 <span class="keyword"></span>{
00237 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00238 <span class="keywordflow">if</span> (m)
00239 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a20">font</a>();
00240 <span class="keywordflow">else</span>
00241 <span class="keywordflow">return</span> QFont();
00242 }
00243
<a name="l00248"></a><a class="code" href="class_qwt_plot.html#a146">00248</a> <span class="keyword">const</span> QString <a class="code" href="class_qwt_plot.html#a146">QwtPlot::markerLabel</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00249 <span class="keyword"></span>{
00250 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00251 <span class="keywordflow">if</span> (m)
00252 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a10">label</a>();
00253 <span class="keywordflow">else</span>
00254 <span class="keywordflow">return</span> QString::null;
00255 }
00256
<a name="l00261"></a><a class="code" href="class_qwt_plot.html#a148">00261</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a148">QwtPlot::markerLabelAlign</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00262 <span class="keyword"></span>{
00263 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00264 <span class="keywordflow">if</span> (m)
00265 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a12">labelAlignment</a>();
00266 <span class="keywordflow">else</span>
00267 <span class="keywordflow">return</span> 0;
00268 }
00269
<a name="l00274"></a><a class="code" href="class_qwt_plot.html#a150">00274</a> QPen <a class="code" href="class_qwt_plot.html#a150">QwtPlot::markerLabelPen</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00275 <span class="keyword"></span>{
00276 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00277 <span class="keywordflow">if</span> (m)
00278 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a16">labelPen</a>();
00279 <span class="keywordflow">else</span>
00280 <span class="keywordflow">return</span> QPen();
00281
00282 }
00283
<a name="l00288"></a><a class="code" href="class_qwt_plot.html#a152">00288</a> QPen <a class="code" href="class_qwt_plot.html#a152">QwtPlot::markerLinePen</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const </span>
00289 <span class="keyword"></span>{
00290 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00291 <span class="keywordflow">if</span> (m)
00292 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a18">linePen</a>();
00293 <span class="keywordflow">else</span>
00294 <span class="keywordflow">return</span> QPen();
00295
00296 }
00297
<a name="l00302"></a><a class="code" href="class_qwt_plot.html#a154">00302</a> QwtMarker::LineStyle <a class="code" href="class_qwt_plot.html#a154">QwtPlot::markerLineStyle</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00303 <span class="keyword"></span>{
00304 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00305 <span class="keywordflow">if</span> (m)
00306 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a5">lineStyle</a>();
00307 <span class="keywordflow">else</span>
00308 <span class="keywordflow">return</span> QwtMarker::NoLine;
00309 }
00310
<a name="l00318"></a><a class="code" href="class_qwt_plot.html#a140">00318</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot.html#a140">QwtPlot::markerPos</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">double</span> &mx, <span class="keywordtype">double</span> &my )<span class="keyword"> const</span>
00319 <span class="keyword"></span>{
00320 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00321 <span class="keywordflow">if</span> (m)
00322 {
00323 mx = m-><a class="code" href="class_qwt_plot_marker.html#a1">xValue</a>();
00324 my = m-><a class="code" href="class_qwt_plot_marker.html#a2">yValue</a>();
00325 }
00326 <span class="keywordflow">else</span>
00327 {
00328 mx = 0;
00329 my = 0;
00330 }
00331 }
00332
<a name="l00337"></a><a class="code" href="class_qwt_plot.html#a156">00337</a> <a class="code" href="class_qwt_symbol.html">QwtSymbol</a> <a class="code" href="class_qwt_plot.html#a156">QwtPlot::markerSymbol</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00338 <span class="keyword"></span>{
00339 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00340 <span class="keywordflow">if</span> (m)
00341 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_marker.html#a7">symbol</a>();
00342 <span class="keywordflow">else</span>
00343 <span class="keywordflow">return</span> <a class="code" href="class_qwt_symbol.html">QwtSymbol</a>();
00344 }
00345
00346
<a name="l00351"></a><a class="code" href="class_qwt_plot.html#a134">00351</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a134">QwtPlot::markerXAxis</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00352 <span class="keyword"></span>{
00353 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00354 <span class="keywordflow">if</span> (m)
00355 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_plot_mapped_item.html#a3">xAxis</a>();
00356 <span class="keywordflow">else</span>
00357 <span class="keywordflow">return</span> -1;
00358
00359 }
00360
00361
<a name="l00366"></a><a class="code" href="class_qwt_plot.html#a136">00366</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot.html#a136">QwtPlot::markerYAxis</a>(<span class="keywordtype">long</span> key)<span class="keyword"> const</span>
00367 <span class="keyword"></span>{
00368 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m = d_markers->find(key);
00369 <span class="keywordflow">if</span> (m)
00370 <span class="keywordflow">return</span> m-><a class="code" href="class_qwt_plot_mapped_item.html#a5">yAxis</a>();
00371 <span class="keywordflow">else</span>
00372 <span class="keywordflow">return</span> -1;
00373
00374 }
00375
<a name="l00380"></a><a class="code" href="class_qwt_plot.html#i3">00380</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#i3">QwtPlot::removeMarker</a>(<span class="keywordtype">long</span> key)
00381 {
00382 <span class="keywordflow">if</span> (d_markers->remove(key))
00383 {
00384 <a class="code" href="class_qwt_plot.html#b0">autoRefresh</a>();
00385 <span class="keywordflow">return</span> TRUE;
00386 }
00387 <span class="keywordflow">else</span>
00388 <span class="keywordflow">return</span> FALSE;
00389 }
00390
00391
<a name="l00396"></a><a class="code" href="class_qwt_plot.html#a133">00396</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a133">QwtPlot::setMarkerXAxis</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">int</span> axis)
00397 {
00398 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00399 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00400 {
00401 m-><a class="code" href="class_qwt_plot_mapped_item.html#a2">setXAxis</a>(axis);
00402 <span class="keywordflow">return</span> TRUE;
00403 }
00404 <span class="keywordflow">else</span>
00405 <span class="keywordflow">return</span> FALSE;
00406 }
00407
<a name="l00414"></a><a class="code" href="class_qwt_plot.html#a135">00414</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a135">QwtPlot::setMarkerYAxis</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">int</span> axis)
00415 {
00416 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00417 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00418 {
00419 m-><a class="code" href="class_qwt_plot_mapped_item.html#a4">setYAxis</a>(axis);
00420 <span class="keywordflow">return</span> TRUE;
00421 }
00422 <span class="keywordflow">else</span>
00423 <span class="keywordflow">return</span> FALSE;
00424 }
00425
<a name="l00432"></a><a class="code" href="class_qwt_plot.html#a141">00432</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a141">QwtPlot::setMarkerFont</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> QFont &f)
00433 {
00434 <span class="keywordtype">int</span> rv = FALSE;
00435
00436 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00437 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00438 {
00439 m-><a class="code" href="class_qwt_marker.html#a19">setFont</a>(f);
00440 rv = TRUE;
00441 }
00442 <span class="keywordflow">return</span> rv;
00443 }
00444
<a name="l00451"></a><a class="code" href="class_qwt_plot.html#a151">00451</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a151">QwtPlot::setMarkerLinePen</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> QPen &p)
00452 {
00453 <span class="keywordtype">int</span> rv = FALSE;
00454
00455 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00456 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00457 {
00458 m-><a class="code" href="class_qwt_marker.html#a17">setLinePen</a>(p);
00459 rv = TRUE;
00460 }
00461 <span class="keywordflow">return</span> rv;
00462
00463 }
00464
00465
<a name="l00473"></a><a class="code" href="class_qwt_plot.html#a153">00473</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a153">QwtPlot::setMarkerLineStyle</a>(<span class="keywordtype">long</span> key, QwtMarker::LineStyle st)
00474 {
00475 <span class="keywordtype">int</span> rv = FALSE;
00476 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00477 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00478 {
00479 m-><a class="code" href="class_qwt_marker.html#a4">setLineStyle</a>(st);
00480 rv = TRUE;
00481 }
00482 <span class="keywordflow">return</span> rv;
00483 }
00484
<a name="l00491"></a><a class="code" href="class_qwt_plot.html#a143">00491</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a143">QwtPlot::setMarkerPen</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> QPen &p)
00492 {
00493 <span class="keywordtype">int</span> rv = FALSE;
00494
00495 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00496 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00497 {
00498 m-><a class="code" href="class_qwt_marker.html#a17">setLinePen</a>(p);
00499 m-><a class="code" href="class_qwt_marker.html#a15">setLabelPen</a>(p);
00500 rv = TRUE;
00501 }
00502 <span class="keywordflow">return</span> rv;
00503 }
00504
00505
<a name="l00513"></a><a class="code" href="class_qwt_plot.html#a137">00513</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a137">QwtPlot::setMarkerPos</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">double</span> xval, <span class="keywordtype">double</span> yval)
00514 {
00515 <span class="keywordtype">int</span> rv = FALSE;
00516
00517 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00518 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00519 {
00520 m-><a class="code" href="class_qwt_plot_marker.html#a3">setXValue</a>(xval);
00521 m-><a class="code" href="class_qwt_plot_marker.html#a4">setYValue</a>(yval);
00522 rv = TRUE;
00523 }
00524 <span class="keywordflow">return</span> rv;
00525 }
00526
<a name="l00533"></a><a class="code" href="class_qwt_plot.html#a138">00533</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a138">QwtPlot::setMarkerXPos</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">double</span> val)
00534 {
00535 <span class="keywordtype">int</span> rv = FALSE;
00536
00537 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00538 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00539 {
00540 m-><a class="code" href="class_qwt_plot_marker.html#a3">setXValue</a>(val);
00541 rv = TRUE;
00542 }
00543 <span class="keywordflow">return</span> rv;
00544 }
00545
<a name="l00552"></a><a class="code" href="class_qwt_plot.html#a139">00552</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a139">QwtPlot::setMarkerYPos</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">double</span> val)
00553 {
00554 <span class="keywordtype">int</span> rv = FALSE;
00555
00556 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00557 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00558 {
00559 m-><a class="code" href="class_qwt_plot_marker.html#a4">setYValue</a>(val);
00560 rv = TRUE;
00561 }
00562 <span class="keywordflow">return</span> rv;
00563 }
00564
<a name="l00571"></a><a class="code" href="class_qwt_plot.html#a155">00571</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a155">QwtPlot::setMarkerSymbol</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> <a class="code" href="class_qwt_symbol.html">QwtSymbol</a> &s)
00572 {
00573 <span class="keywordtype">int</span> rv = FALSE;
00574 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00575 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00576 {
00577 m-><a class="code" href="class_qwt_marker.html#a6">setSymbol</a>(s);
00578 rv = TRUE;
00579 }
00580 <span class="keywordflow">return</span> rv;
00581 }
00582
<a name="l00589"></a><a class="code" href="class_qwt_plot.html#a145">00589</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a145">QwtPlot::setMarkerLabelText</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> QString &text)
00590 {
00591 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00592 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00593 {
00594 m-><a class="code" href="class_qwt_marker.html#a9">setLabelText</a>(text);
00595 <span class="keywordflow">return</span> TRUE;
00596 }
00597 <span class="keywordflow">return</span> FALSE;
00598 }
00599
<a name="l00610"></a><a class="code" href="class_qwt_plot.html#a144">00610</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a144">QwtPlot::setMarkerLabel</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> QString &text, <span class="keyword">const</span> QFont &font,
00611 <span class="keyword">const</span> QColor &color, <span class="keyword">const</span> QPen &pen, <span class="keyword">const</span> QBrush &brush)
00612 {
00613 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00614 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00615 {
00616 m-><a class="code" href="class_qwt_marker.html#a8">setLabel</a>(text, font, color, pen, brush);
00617 <span class="keywordflow">return</span> TRUE;
00618 }
00619 <span class="keywordflow">return</span> FALSE;
00620 }
00621
<a name="l00633"></a><a class="code" href="class_qwt_plot.html#a147">00633</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a147">QwtPlot::setMarkerLabelAlign</a>(<span class="keywordtype">long</span> key, <span class="keywordtype">int</span> align)
00634 {
00635 <span class="keywordtype">int</span> rv = FALSE;
00636 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00637 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00638 {
00639 m-><a class="code" href="class_qwt_marker.html#a11">setLabelAlignment</a>(align);
00640 rv = TRUE;
00641 }
00642 <span class="keywordflow">return</span> rv;
00643 }
00644
<a name="l00651"></a><a class="code" href="class_qwt_plot.html#a149">00651</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot.html#a149">QwtPlot::setMarkerLabelPen</a>(<span class="keywordtype">long</span> key, <span class="keyword">const</span> QPen &p)
00652 {
00653 <span class="keywordtype">int</span> rv = FALSE;
00654 <a class="code" href="class_qwt_plot_marker.html">QwtPlotMarker</a> *m;
00655 <span class="keywordflow">if</span> ((m = d_markers->find(key)))
00656 {
00657 m-><a class="code" href="class_qwt_marker.html#a15">setLabelPen</a>(p);
00658 rv = TRUE;
00659 }
00660 <span class="keywordflow">return</span> rv;
00661 }
00662
00663
00664
00665
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 16 21:12:20 2004 for Qwt User's Guide by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>
|