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
|
<!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_picker.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_picker.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_double_rect.h"</span>
00014 <span class="preprocessor">#include "qwt_painter.h"</span>
00015 <span class="preprocessor">#include "qwt_array.h"</span>
00016 <span class="preprocessor">#include "qwt_plot_picker.h"</span>
00017
<a name="l00038"></a><a class="code" href="class_qwt_plot_picker.html#a0">00038</a> <a class="code" href="class_qwt_plot_picker.html#a0">QwtPlotPicker::QwtPlotPicker</a>(<a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *canvas, <span class="keyword">const</span> <span class="keywordtype">char</span> *name):
00039 <a class="code" href="class_qwt_picker.html">QwtPicker</a>(canvas, name),
00040 d_xAxis(-1),
00041 d_yAxis(-1)
00042 {
00043 <span class="keywordflow">if</span> ( !canvas )
00044 <span class="keywordflow">return</span>;
00045
00046 <span class="comment">// attach axes</span>
00047
00048 <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot_picker.html#a4">xAxis</a> = QwtPlot::xBottom;
00049
00050 <span class="keyword">const</span> <a class="code" href="class_qwt_plot.html">QwtPlot</a> *<a class="code" href="class_qwt_plot_picker.html#a6">plot</a> = <a class="code" href="class_qwt_plot_picker.html#a6">QwtPlotPicker::plot</a>();
00051 <span class="keywordflow">if</span> ( !plot-><a class="code" href="class_qwt_plot.html#a97">axisEnabled</a>(QwtPlot::xBottom) &&
00052 plot-><a class="code" href="class_qwt_plot.html#a97">axisEnabled</a>(QwtPlot::xTop) )
00053 {
00054 xAxis = QwtPlot::xTop;
00055 }
00056
00057 <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot_picker.html#a5">yAxis</a> = QwtPlot::yLeft;
00058 <span class="keywordflow">if</span> ( !plot-><a class="code" href="class_qwt_plot.html#a97">axisEnabled</a>(QwtPlot::yLeft) &&
00059 plot-><a class="code" href="class_qwt_plot.html#a97">axisEnabled</a>(QwtPlot::yRight) )
00060 {
00061 yAxis = QwtPlot::yRight;
00062 }
00063
00064 <a class="code" href="class_qwt_plot_picker.html#a3">setAxis</a>(xAxis, yAxis);
00065 }
00066
<a name="l00083"></a><a class="code" href="class_qwt_plot_picker.html#a1">00083</a> <a class="code" href="class_qwt_plot_picker.html#a0">QwtPlotPicker::QwtPlotPicker</a>(<span class="keywordtype">int</span> xAxis, <span class="keywordtype">int</span> yAxis,
00084 <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *canvas, <span class="keyword">const</span> <span class="keywordtype">char</span> *name):
00085 <a class="code" href="class_qwt_picker.html">QwtPicker</a>(canvas, name),
00086 d_xAxis(xAxis),
00087 d_yAxis(yAxis)
00088 {
00089 }
00090
<a name="l00114"></a><a class="code" href="class_qwt_plot_picker.html#a2">00114</a> <a class="code" href="class_qwt_plot_picker.html#a0">QwtPlotPicker::QwtPlotPicker</a>(<span class="keywordtype">int</span> xAxis, <span class="keywordtype">int</span> yAxis, <span class="keywordtype">int</span> selectionFlags,
00115 RubberBand rubberBand, DisplayMode cursorLabelMode,
00116 <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *canvas, <span class="keyword">const</span> <span class="keywordtype">char</span> *name):
00117 <a class="code" href="class_qwt_picker.html">QwtPicker</a>(selectionFlags, rubberBand, cursorLabelMode, canvas, name),
00118 d_xAxis(xAxis),
00119 d_yAxis(yAxis)
00120 {
00121 }
00122
<a name="l00124"></a><a class="code" href="class_qwt_plot_picker.html#a8">00124</a> <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *<a class="code" href="class_qwt_plot_picker.html#a8">QwtPlotPicker::canvas</a>()
00125 {
00126 QWidget *w = <a class="code" href="class_qwt_picker.html#a21">parentWidget</a>();
00127 <span class="keywordflow">if</span> ( w && w->inherits(<span class="stringliteral">"QwtPlotCanvas"</span>) )
00128 <span class="keywordflow">return</span> (<a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *)w;
00129
00130 <span class="keywordflow">return</span> NULL;
00131 }
00132
<a name="l00134"></a><a class="code" href="class_qwt_plot_picker.html#a9">00134</a> <span class="keyword">const</span> <a class="code" href="class_qwt_plot_canvas.html">QwtPlotCanvas</a> *<a class="code" href="class_qwt_plot_picker.html#a8">QwtPlotPicker::canvas</a>()<span class="keyword"> const</span>
00135 <span class="keyword"></span>{
00136 <span class="keywordflow">return</span> ((<a class="code" href="class_qwt_plot_picker.html">QwtPlotPicker</a> *)<span class="keyword">this</span>)->canvas();
00137 }
00138
<a name="l00140"></a><a class="code" href="class_qwt_plot_picker.html#a6">00140</a> <a class="code" href="class_qwt_plot.html">QwtPlot</a> *<a class="code" href="class_qwt_plot_picker.html#a6">QwtPlotPicker::plot</a>()
00141 {
00142 QObject *w = <a class="code" href="class_qwt_plot_picker.html#a8">canvas</a>();
00143 <span class="keywordflow">if</span> ( w )
00144 {
00145 w = w->parent();
00146 <span class="keywordflow">if</span> ( w && w->inherits(<span class="stringliteral">"QwtPlot"</span>) )
00147 <span class="keywordflow">return</span> (<a class="code" href="class_qwt_plot.html">QwtPlot</a> *)w;
00148 }
00149
00150 <span class="keywordflow">return</span> NULL;
00151 }
00152
<a name="l00154"></a><a class="code" href="class_qwt_plot_picker.html#a7">00154</a> <span class="keyword">const</span> <a class="code" href="class_qwt_plot.html">QwtPlot</a> *<a class="code" href="class_qwt_plot_picker.html#a6">QwtPlotPicker::plot</a>()<span class="keyword"> const</span>
00155 <span class="keyword"></span>{
00156 <span class="keywordflow">return</span> ((<a class="code" href="class_qwt_plot_picker.html">QwtPlotPicker</a> *)<span class="keyword">this</span>)->plot();
00157 }
00158
<a name="l00170"></a><a class="code" href="class_qwt_plot_picker.html#b0">00170</a> <a class="code" href="class_qwt_double_rect.html">QwtDoubleRect</a> <a class="code" href="class_qwt_plot_picker.html#b0">QwtPlotPicker::scaleRect</a>()<span class="keyword"> const</span>
00171 <span class="keyword"></span>{
00172 <span class="keyword">const</span> <a class="code" href="class_qwt_plot.html">QwtPlot</a> *plt = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>();
00173
00174 <span class="keyword">const</span> <a class="code" href="class_qwt_double_rect.html">QwtDoubleRect</a> rect(
00175 plt-><a class="code" href="class_qwt_plot.html#a107">axisScale</a>(<a class="code" href="class_qwt_plot_picker.html#a4">xAxis</a>())-><a class="code" href="class_qwt_scale_div.html#a3">lBound</a>(),
00176 plt-><a class="code" href="class_qwt_plot.html#a107">axisScale</a>(<a class="code" href="class_qwt_plot_picker.html#a4">xAxis</a>())-><a class="code" href="class_qwt_scale_div.html#a4">hBound</a>(),
00177 plt-><a class="code" href="class_qwt_plot.html#a107">axisScale</a>(<a class="code" href="class_qwt_plot_picker.html#a5">yAxis</a>())-><a class="code" href="class_qwt_scale_div.html#a3">lBound</a>(),
00178 plt-><a class="code" href="class_qwt_plot.html#a107">axisScale</a>(<a class="code" href="class_qwt_plot_picker.html#a5">yAxis</a>())-><a class="code" href="class_qwt_scale_div.html#a4">hBound</a>()
00179 );
00180
00181 <span class="keywordflow">return</span> rect.normalize();
00182 }
00183
<a name="l00190"></a><a class="code" href="class_qwt_plot_picker.html#a3">00190</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_picker.html#a3">QwtPlotPicker::setAxis</a>(<span class="keywordtype">int</span> xAxis, <span class="keywordtype">int</span> yAxis)
00191 {
00192 <span class="keyword">const</span> <a class="code" href="class_qwt_plot.html">QwtPlot</a> *plt = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>();
00193 <span class="keywordflow">if</span> ( !plt )
00194 <span class="keywordflow">return</span>;
00195
00196 <span class="keywordflow">if</span> ( xAxis != d_xAxis || yAxis != d_yAxis )
00197 {
00198 d_xAxis = xAxis;
00199 d_yAxis = yAxis;
00200 }
00201 }
00202
<a name="l00204"></a><a class="code" href="class_qwt_plot_picker.html#a4">00204</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot_picker.html#a4">QwtPlotPicker::xAxis</a>()<span class="keyword"> const</span>
00205 <span class="keyword"></span>{
00206 <span class="keywordflow">return</span> d_xAxis;
00207 }
00208
<a name="l00210"></a><a class="code" href="class_qwt_plot_picker.html#a5">00210</a> <span class="keywordtype">int</span> <a class="code" href="class_qwt_plot_picker.html#a5">QwtPlotPicker::yAxis</a>()<span class="keyword"> const</span>
00211 <span class="keyword"></span>{
00212 <span class="keywordflow">return</span> d_yAxis;
00213 }
00214
<a name="l00221"></a><a class="code" href="class_qwt_plot_picker.html#b5">00221</a> QString <a class="code" href="class_qwt_plot_picker.html#b5">QwtPlotPicker::cursorLabel</a>(<span class="keyword">const</span> QPoint &pos)<span class="keyword"> const</span>
00222 <span class="keyword"></span>{
00223 <span class="keywordflow">return</span> <a class="code" href="class_qwt_plot_picker.html#b5">cursorLabel</a>(<a class="code" href="class_qwt_plot_picker.html#b1">invTransform</a>(pos));
00224 }
00225
<a name="l00238"></a><a class="code" href="class_qwt_plot_picker.html#b6">00238</a> QString <a class="code" href="class_qwt_plot_picker.html#b5">QwtPlotPicker::cursorLabel</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_double_point.html">QwtDoublePoint</a> &pos)<span class="keyword"> const</span>
00239 <span class="keyword"></span>{
00240 <span class="keywordflow">switch</span>(<a class="code" href="class_qwt_picker.html#a6">rubberBand</a>())
00241 {
00242 <span class="keywordflow">case</span> HLineRubberBand:
00243 <span class="keywordflow">return</span> QString().sprintf(<span class="stringliteral">"%.4f"</span>, pos.<a class="code" href="class_qwt_double_point.html#a5">y</a>());
00244 <span class="keywordflow">case</span> VLineRubberBand:
00245 <span class="keywordflow">return</span> QString().sprintf(<span class="stringliteral">"%.4f"</span>, pos.<a class="code" href="class_qwt_double_point.html#a4">x</a>());
00246 <span class="keywordflow">default</span>:
00247 <span class="keywordflow">return</span> QString().sprintf(<span class="stringliteral">"%.4f, %.4f"</span>, pos.<a class="code" href="class_qwt_double_point.html#a4">x</a>(), pos.<a class="code" href="class_qwt_double_point.html#a5">y</a>());
00248 }
00249 <span class="keywordflow">return</span> QString::null; <span class="comment">// make some dumb compilers happy</span>
00250 }
00251
<a name="l00261"></a><a class="code" href="class_qwt_plot_picker.html#b8">00261</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_picker.html#b8">QwtPlotPicker::append</a>(<span class="keyword">const</span> QPoint &pos)
00262 {
00263 <a class="code" href="class_qwt_picker.html#b3">QwtPicker::append</a>(pos);
00264 emit <a class="code" href="class_qwt_plot_picker.html#l3">appended</a>(<a class="code" href="class_qwt_plot_picker.html#b1">invTransform</a>(pos));
00265 }
00266
<a name="l00276"></a><a class="code" href="class_qwt_plot_picker.html#b7">00276</a> <span class="keywordtype">void</span> <a class="code" href="class_qwt_plot_picker.html#b7">QwtPlotPicker::move</a>(<span class="keyword">const</span> QPoint &pos)
00277 {
00278 <a class="code" href="class_qwt_picker.html#b4">QwtPicker::move</a>(pos);
00279 emit <a class="code" href="class_qwt_plot_picker.html#l4">moved</a>(<a class="code" href="class_qwt_plot_picker.html#b1">invTransform</a>(pos));
00280 }
00281
<a name="l00290"></a><a class="code" href="class_qwt_plot_picker.html#b9">00290</a> <span class="keywordtype">bool</span> <a class="code" href="class_qwt_plot_picker.html#b9">QwtPlotPicker::end</a>(<span class="keywordtype">bool</span> ok)
00291 {
00292 ok = <a class="code" href="class_qwt_picker.html#b5">QwtPicker::end</a>(ok);
00293 <span class="keywordflow">if</span> ( !ok )
00294 <span class="keywordflow">return</span> FALSE;
00295
00296 <a class="code" href="class_qwt_plot.html">QwtPlot</a> *<a class="code" href="class_qwt_plot_picker.html#a6">plot</a> = <a class="code" href="class_qwt_plot_picker.html#a6">QwtPlotPicker::plot</a>();
00297 <span class="keywordflow">if</span> ( !plot )
00298 <span class="keywordflow">return</span> FALSE;
00299
00300 <span class="keyword">const</span> QPointArray &pa = <a class="code" href="class_qwt_picker.html#a24">selection</a>();
00301 <span class="keywordflow">if</span> ( pa.count() == 0 )
00302 <span class="keywordflow">return</span> FALSE;
00303
00304 <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_picker.html#a4">selectionFlags</a>() & PointSelection )
00305 {
00306 <span class="keyword">const</span> <a class="code" href="class_qwt_double_point.html">QwtDoublePoint</a> pos = <a class="code" href="class_qwt_plot_picker.html#b1">invTransform</a>(pa[0]);
00307 emit <a class="code" href="class_qwt_plot_picker.html#l0">selected</a>(pos);
00308 }
00309 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( (<a class="code" href="class_qwt_picker.html#a4">selectionFlags</a>() & RectSelection) && pa.count() >= 2 )
00310 {
00311 QPoint p1 = pa[0];
00312 QPoint p2 = pa[int(pa.count() - 1)];
00313
00314 <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_picker.html#a4">selectionFlags</a>() & CenterToCorner )
00315 {
00316 p1.setX(p1.x() - (p2.x() - p1.x()));
00317 p1.setY(p1.y() - (p2.y() - p1.y()));
00318 }
00319 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_picker.html#a4">selectionFlags</a>() & CenterToRadius )
00320 {
00321 <span class="keyword">const</span> <span class="keywordtype">int</span> radius = QMAX(QABS(p2.x() - p1.x()),
00322 QABS(p2.y() - p1.y()));
00323 p2.setX(p1.x() + radius);
00324 p2.setY(p1.y() + radius);
00325 p1.setX(p1.x() - radius);
00326 p1.setY(p1.y() - radius);
00327 }
00328
00329 emit <a class="code" href="class_qwt_plot_picker.html#l0">selected</a>(<a class="code" href="class_qwt_plot_picker.html#b1">invTransform</a>(QRect(p1, p2)).normalize());
00330 }
00331 <span class="keywordflow">else</span>
00332 {
00333 QwtArray<QwtDoublePoint> dpa(pa.count());
00334 <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i < int(pa.count()); i++ )
00335 dpa[i] = <a class="code" href="class_qwt_plot_picker.html#b1">invTransform</a>(pa[i]);
00336
00337 emit <a class="code" href="class_qwt_plot_picker.html#l0">selected</a>(dpa);
00338 }
00339
00340 <span class="keywordflow">return</span> TRUE;
00341 }
00342
<a name="l00349"></a><a class="code" href="class_qwt_plot_picker.html#b1">00349</a> <a class="code" href="class_qwt_double_rect.html">QwtDoubleRect</a> <a class="code" href="class_qwt_plot_picker.html#b1">QwtPlotPicker::invTransform</a>(<span class="keyword">const</span> QRect &rect)<span class="keyword"> const</span>
00350 <span class="keyword"></span>{
00351 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> xMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_xAxis);
00352 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> yMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_yAxis);
00353
00354 <span class="keywordflow">return</span> <a class="code" href="class_qwt_double_rect.html">QwtDoubleRect</a>(
00355 xMap.<a class="code" href="class_qwt_di_map.html#a8">invTransform</a>(rect.left()),
00356 xMap.<a class="code" href="class_qwt_di_map.html#a8">invTransform</a>(rect.right()),
00357 yMap.<a class="code" href="class_qwt_di_map.html#a8">invTransform</a>(rect.top()),
00358 yMap.<a class="code" href="class_qwt_di_map.html#a8">invTransform</a>(rect.bottom())
00359 );
00360 }
00361
<a name="l00367"></a><a class="code" href="class_qwt_plot_picker.html#b2">00367</a> QRect <a class="code" href="class_qwt_plot_picker.html#b2">QwtPlotPicker::transform</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_double_rect.html">QwtDoubleRect</a> &rect)<span class="keyword"> const</span>
00368 <span class="keyword"></span>{
00369 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> xMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_xAxis);
00370 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> yMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_yAxis);
00371
00372 <span class="keyword">const</span> <span class="keywordtype">int</span> x1 = xMap.<a class="code" href="class_qwt_di_map.html#a7">transform</a>(rect.<a class="code" href="class_qwt_double_rect.html#a7">x1</a>());
00373 <span class="keyword">const</span> <span class="keywordtype">int</span> x2 = xMap.<a class="code" href="class_qwt_di_map.html#a7">transform</a>(rect.<a class="code" href="class_qwt_double_rect.html#a8">x2</a>());
00374 <span class="keyword">const</span> <span class="keywordtype">int</span> y1 = yMap.<a class="code" href="class_qwt_di_map.html#a7">transform</a>(rect.<a class="code" href="class_qwt_double_rect.html#a9">y1</a>());
00375 <span class="keyword">const</span> <span class="keywordtype">int</span> y2 = yMap.<a class="code" href="class_qwt_di_map.html#a7">transform</a>(rect.<a class="code" href="class_qwt_double_rect.html#a10">y2</a>());
00376
00377 <span class="keywordflow">return</span> QRect(x1, y1, x2 - x1, y2 - y1);
00378 }
00379
<a name="l00385"></a><a class="code" href="class_qwt_plot_picker.html#b3">00385</a> <a class="code" href="class_qwt_double_point.html">QwtDoublePoint</a> <a class="code" href="class_qwt_plot_picker.html#b1">QwtPlotPicker::invTransform</a>(<span class="keyword">const</span> QPoint &pos)<span class="keyword"> const</span>
00386 <span class="keyword"></span>{
00387 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> xMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_xAxis);
00388 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> yMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_yAxis);
00389
00390 <span class="keywordflow">return</span> <a class="code" href="class_qwt_double_point.html">QwtDoublePoint</a>(
00391 xMap.<a class="code" href="class_qwt_di_map.html#a8">invTransform</a>(pos.x()),
00392 yMap.<a class="code" href="class_qwt_di_map.html#a8">invTransform</a>(pos.y())
00393 );
00394 }
00395
<a name="l00401"></a><a class="code" href="class_qwt_plot_picker.html#b4">00401</a> QPoint <a class="code" href="class_qwt_plot_picker.html#b2">QwtPlotPicker::transform</a>(<span class="keyword">const</span> <a class="code" href="class_qwt_double_point.html">QwtDoublePoint</a> &pos)<span class="keyword"> const</span>
00402 <span class="keyword"></span>{
00403 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> xMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_xAxis);
00404 <a class="code" href="class_qwt_di_map.html">QwtDiMap</a> yMap = <a class="code" href="class_qwt_plot_picker.html#a6">plot</a>()-><a class="code" href="class_qwt_plot.html#a39">canvasMap</a>(d_yAxis);
00405
00406 <span class="keywordflow">return</span> QPoint(
00407 xMap.<a class="code" href="class_qwt_di_map.html#a7">transform</a>(pos.<a class="code" href="class_qwt_double_point.html#a4">x</a>()),
00408 yMap.<a class="code" href="class_qwt_di_map.html#a7">transform</a>(pos.<a class="code" href="class_qwt_double_point.html#a5">y</a>())
00409 );
00410 }
00411
00412 <span class="comment">// Local Variables:</span>
00413 <span class="comment">// mode: C++</span>
00414 <span class="comment">// c-file-style: "stroustrup"</span>
00415 <span class="comment">// indent-tabs-mode: nil</span>
00416 <span class="comment">// End:</span>
</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>
|