~l3on/ubuntu/oneiric/qwt/fix-921430

« back to all changes in this revision

Viewing changes to qwt-5.0.1/src/qwt_plot_zoomer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2007-10-05 15:20:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071005152041-qmybqh4fj9jejyo2
Tags: 5.0.2-2
* Handle nostrip build option. (Closes: #437877)
* Build libqwt5-doc package in binary-indep target. (Closes: #443110)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2
 
 * Qwt Widget Library
3
 
 * Copyright (C) 1997   Josef Wilgen
4
 
 * Copyright (C) 2002   Uwe Rathmann
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the Qwt License, Version 1.0
8
 
 *****************************************************************************/
9
 
 
10
 
// vim: expandtab
11
 
 
12
 
#include <math.h>
13
 
#include "qwt_plot.h"
14
 
#include "qwt_plot_canvas.h"
15
 
#include "qwt_plot_zoomer.h"
16
 
#include "qwt_scale_div.h"
17
 
#if QT_VERSION < 0x040000
18
 
typedef QValueStack<QwtDoubleRect> QwtZoomStack;
19
 
#else
20
 
typedef QStack<QwtDoubleRect> QwtZoomStack;
21
 
#endif
22
 
 
23
 
class QwtPlotZoomer::PrivateData
24
 
{
25
 
public:
26
 
    uint zoomRectIndex;
27
 
    QwtZoomStack zoomStack;
28
 
 
29
 
    int maxStackDepth;
30
 
};
31
 
 
32
 
/*!
33
 
  \brief Create a zoomer for a plot canvas.
34
 
 
35
 
  The zoomer is set to those x- and y-axis of the parent plot of the
36
 
  canvas that are enabled. If both or no x-axis are enabled, the picker
37
 
  is set to QwtPlot::xBottom. If both or no y-axis are
38
 
  enabled, it is set to QwtPlot::yLeft.
39
 
 
40
 
  The selectionFlags() are set to 
41
 
  QwtPicker::RectSelection & QwtPicker::ClickSelection, the
42
 
  tracker mode to QwtPicker::ActiveOnly.
43
 
 
44
 
  \param canvas Plot canvas to observe, also the parent object
45
 
  \param doReplot Call replot for the attached plot before initializing
46
 
                  the zoomer with its scales. This might be necessary, 
47
 
                  when the plot is in a state with pending scale changes.
48
 
 
49
 
  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::setZoomBase()
50
 
*/
51
 
QwtPlotZoomer::QwtPlotZoomer(QwtPlotCanvas *canvas, bool doReplot):
52
 
    QwtPlotPicker(canvas)
53
 
{
54
 
    if ( canvas )
55
 
        init(RectSelection & ClickSelection, ActiveOnly, doReplot);
56
 
}
57
 
 
58
 
/*!
59
 
  \brief Create a zoomer for a plot canvas.
60
 
 
61
 
  The selectionFlags() are set to 
62
 
  QwtPicker::RectSelection & QwtPicker::ClickSelection, the
63
 
  tracker mode to QwtPicker::ActiveOnly. 
64
 
 
65
 
  \param xAxis X axis of the zoomer
66
 
  \param yAxis Y axis of the zoomer
67
 
  \param canvas Plot canvas to observe, also the parent object
68
 
  \param doReplot Call replot for the attached plot before initializing
69
 
                  the zoomer with its scales. This might be necessary, 
70
 
                  when the plot is in a state with pending scale changes.
71
 
 
72
 
  \sa QwtPlot::autoReplot(), QwtPlot::replot(), QwtPlotPicker::setZoomBase()
73
 
*/
74
 
 
75
 
QwtPlotZoomer::QwtPlotZoomer(int xAxis, int yAxis,
76
 
        QwtPlotCanvas *canvas, bool doReplot):
77
 
    QwtPlotPicker(xAxis, yAxis, canvas)
78
 
{
79
 
    if ( canvas )
80
 
        init(RectSelection & ClickSelection, ActiveOnly, doReplot);
81
 
}
82
 
 
83
 
/*!
84
 
  Create a zoomer for a plot canvas.
85
 
 
86
 
  \param xAxis X axis of the zoomer
87
 
  \param yAxis Y axis of the zoomer
88
 
  \param selectionFlags Or'd value of QwtPicker::RectSelectionType and
89
 
                        QwtPicker::SelectionMode. 
90
 
                        QwtPicker::RectSelection will be auto added.
91
 
  \param trackerMode Tracker mode
92
 
  \param canvas Plot canvas to observe, also the parent object
93
 
  \param doReplot Call replot for the attached plot before initializing
94
 
                  the zoomer with its scales. This might be necessary, 
95
 
                  when the plot is in a state with pending scale changes.
96
 
 
97
 
  \sa QwtPicker, QwtPicker::setSelectionFlags(), QwtPicker::setRubberBand(),
98
 
      QwtPicker::setTrackerMode
99
 
 
100
 
  \sa QwtPlot::autoReplot(), QwtPlot::replot(), setZoomBase()
101
 
*/
102
 
 
103
 
QwtPlotZoomer::QwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
104
 
        DisplayMode trackerMode, QwtPlotCanvas *canvas, bool doReplot):
105
 
    QwtPlotPicker(xAxis, yAxis, canvas)
106
 
{
107
 
    if ( canvas )
108
 
        init(selectionFlags, trackerMode, doReplot);
109
 
}
110
 
 
111
 
//! Init the zoomer, used by the constructors
112
 
void QwtPlotZoomer::init(int selectionFlags, 
113
 
    DisplayMode trackerMode, bool doReplot)
114
 
{
115
 
    d_data = new PrivateData;
116
 
 
117
 
    d_data->maxStackDepth = -1;
118
 
 
119
 
    setSelectionFlags(selectionFlags);
120
 
    setTrackerMode(trackerMode);
121
 
    setRubberBand(RectRubberBand);
122
 
 
123
 
    if ( doReplot && plot() )
124
 
        plot()->replot();
125
 
 
126
 
    setZoomBase(scaleRect());
127
 
}
128
 
 
129
 
QwtPlotZoomer::~QwtPlotZoomer()
130
 
{
131
 
    delete d_data;
132
 
}
133
 
 
134
 
/*!
135
 
  \brief Limit the number of recursive zoom operations to depth.
136
 
 
137
 
  A value of -1 set the depth to unlimited, 0 disables zooming.
138
 
  If the current zoom rectangle is below depth, the plot is unzoomed.
139
 
 
140
 
  \param depth Maximum for the stack depth
141
 
  \sa maxStackDepth()
142
 
  \note depth doesn't include the zoom base, so zoomStack().count() might be
143
 
              maxStackDepth() + 1.
144
 
*/
145
 
void QwtPlotZoomer::setMaxStackDepth(int depth)
146
 
{
147
 
    d_data->maxStackDepth = depth;
148
 
 
149
 
    if ( depth >= 0 )
150
 
    {
151
 
        // unzoom if the current depth is below d_data->maxStackDepth
152
 
 
153
 
        const int zoomOut = 
154
 
            int(d_data->zoomStack.count()) - 1 - depth; // -1 for the zoom base
155
 
 
156
 
        if ( zoomOut > 0 )
157
 
        {
158
 
            zoom(-zoomOut);
159
 
            for ( int i = int(d_data->zoomStack.count()) - 1; 
160
 
                i > int(d_data->zoomRectIndex); i-- )
161
 
            {
162
 
                (void)d_data->zoomStack.pop(); // remove trailing rects
163
 
            }
164
 
        }
165
 
    }
166
 
}
167
 
 
168
 
/*!
169
 
  \return Maximal depth of the zoom stack.
170
 
  \sa setMaxStackDepth()
171
 
*/
172
 
int QwtPlotZoomer::maxStackDepth() const
173
 
{
174
 
    return d_data->maxStackDepth;
175
 
}
176
 
 
177
 
/*!
178
 
  Return the zoom stack. zoomStack()[0] is the zoom base,
179
 
  zoomStack()[1] the first zoomed rectangle.
180
 
*/
181
 
const QwtZoomStack &QwtPlotZoomer::zoomStack() const
182
 
{
183
 
    return d_data->zoomStack;
184
 
}
185
 
 
186
 
/*!
187
 
  \return Initial rectangle of the zoomer
188
 
  \sa setZoomBase(), zoomRect()
189
 
*/
190
 
QwtDoubleRect QwtPlotZoomer::zoomBase() const
191
 
{
192
 
    return d_data->zoomStack[0];
193
 
}
194
 
 
195
 
/*!
196
 
  Reinitialized the zoom stack with scaleRect() as base.
197
 
 
198
 
  \sa zoomBase(), scaleRect()
199
 
 
200
 
  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is false
201
 
           leaves the axis in an 'intermediate' state.
202
 
           In this case, to prevent buggy behaviour, you must call
203
 
           QwtPlot::replot() before calling QwtPlotZoomer::setZoomBase().
204
 
           This quirk will be removed in a future release.
205
 
 
206
 
  \sa QwtPlot::autoReplot(), QwtPlot::replot().
207
 
*/
208
 
void QwtPlotZoomer::setZoomBase()
209
 
{
210
 
    const QwtPlot *plt = plot();
211
 
    if ( !plt )
212
 
        return;
213
 
 
214
 
    d_data->zoomStack.clear();
215
 
    d_data->zoomStack.push(scaleRect());
216
 
    d_data->zoomRectIndex = 0;
217
 
 
218
 
    rescale();
219
 
}
220
 
 
221
 
/*!
222
 
  \brief Set the initial size of the zoomer.
223
 
 
224
 
  base is united with the current scaleRect() and the zoom stack is
225
 
  reinitalized with it as zoom base. plot is zoomed to scaleRect().
226
 
  
227
 
  \param base Zoom base
228
 
  
229
 
  \sa zoomBase(), scaleRect()
230
 
*/
231
 
void QwtPlotZoomer::setZoomBase(const QwtDoubleRect &base)
232
 
{
233
 
    const QwtPlot *plt = plot();
234
 
    if ( !plt )
235
 
        return;
236
 
 
237
 
    const QwtDoubleRect sRect = scaleRect();
238
 
    const QwtDoubleRect bRect = base | sRect;
239
 
 
240
 
    d_data->zoomStack.clear();
241
 
    d_data->zoomStack.push(bRect);
242
 
    d_data->zoomRectIndex = 0;
243
 
 
244
 
    if ( base != sRect )
245
 
    {
246
 
        d_data->zoomStack.push(sRect);
247
 
        d_data->zoomRectIndex++;
248
 
    }
249
 
 
250
 
    rescale();
251
 
}
252
 
 
253
 
/*! 
254
 
  Rectangle at the current position on the zoom stack. 
255
 
 
256
 
  \sa QwtPlotZoomer::zoomRectIndex(), QwtPlotZoomer::scaleRect().
257
 
*/
258
 
QwtDoubleRect QwtPlotZoomer::zoomRect() const
259
 
{
260
 
    return d_data->zoomStack[d_data->zoomRectIndex];
261
 
}
262
 
 
263
 
/*! 
264
 
  \return Index of current position of zoom stack.
265
 
*/
266
 
uint QwtPlotZoomer::zoomRectIndex() const
267
 
{
268
 
    return d_data->zoomRectIndex;
269
 
}
270
 
 
271
 
/*!
272
 
  \brief Zoom in
273
 
 
274
 
  Clears all rectangles above the current position of the
275
 
  zoom stack and pushs the intersection of zoomRect() and 
276
 
  the normalized rect on it.
277
 
 
278
 
  \note If the maximal stack depth is reached, zoom is ignored.
279
 
  \note The zoomed signal is emitted.
280
 
*/
281
 
 
282
 
void QwtPlotZoomer::zoom(const QwtDoubleRect &rect)
283
 
{   
284
 
    if ( d_data->maxStackDepth >= 0 && 
285
 
        int(d_data->zoomRectIndex) >= d_data->maxStackDepth )
286
 
    {
287
 
        return;
288
 
    }
289
 
 
290
 
    const QwtDoubleRect zoomRect = d_data->zoomStack[0] & rect.normalized();
291
 
    if ( zoomRect != d_data->zoomStack[d_data->zoomRectIndex] )
292
 
    {
293
 
        for ( uint i = int(d_data->zoomStack.count()) - 1; 
294
 
           i > d_data->zoomRectIndex; i-- )
295
 
        {
296
 
            (void)d_data->zoomStack.pop();
297
 
        }
298
 
 
299
 
        d_data->zoomStack.push(zoomRect);
300
 
        d_data->zoomRectIndex++;
301
 
 
302
 
        rescale();
303
 
 
304
 
        emit zoomed(zoomRect);
305
 
    }
306
 
}
307
 
 
308
 
/*!
309
 
  \brief Zoom in or out
310
 
 
311
 
  Activate a rectangle on the zoom stack with an offset relative
312
 
  to the current position. Negative values of offest will zoom out,
313
 
  positive zoom in. A value of 0 zooms out to the zoom base.
314
 
 
315
 
  \param offset Offset relative to the current position of the zoom stack.
316
 
  \note The zoomed signal is emitted.
317
 
  \sa zoomRectIndex()
318
 
*/
319
 
void QwtPlotZoomer::zoom(int offset)
320
 
{
321
 
    if ( offset == 0 )
322
 
        d_data->zoomRectIndex = 0;
323
 
    else
324
 
    {
325
 
        int newIndex = d_data->zoomRectIndex + offset;
326
 
        newIndex = qwtMax(0, newIndex);
327
 
        newIndex = qwtMin(int(d_data->zoomStack.count()) - 1, newIndex);
328
 
 
329
 
        d_data->zoomRectIndex = uint(newIndex);
330
 
    }
331
 
 
332
 
    rescale();
333
 
 
334
 
    emit zoomed(zoomRect());
335
 
}
336
 
 
337
 
/*! 
338
 
  Adjust the observed plot to zoomRect()
339
 
 
340
 
  \note Initiates QwtPlot::replot
341
 
*/
342
 
 
343
 
void QwtPlotZoomer::rescale()
344
 
{
345
 
    QwtPlot *plt = plot();
346
 
    if ( !plt )
347
 
        return;
348
 
 
349
 
    const QwtDoubleRect &rect = d_data->zoomStack[d_data->zoomRectIndex];
350
 
    if ( rect != scaleRect() )
351
 
    {
352
 
        const bool doReplot = plt->autoReplot();
353
 
        plt->setAutoReplot(false);
354
 
 
355
 
        double x1 = rect.left();
356
 
        double x2 = rect.right();
357
 
        if ( plt->axisScaleDiv(xAxis())->lBound() > 
358
 
            plt->axisScaleDiv(xAxis())->hBound() )
359
 
        {
360
 
            qSwap(x1, x2);
361
 
        }
362
 
 
363
 
        plt->setAxisScale(xAxis(), x1, x2);
364
 
 
365
 
        double y1 = rect.top();
366
 
        double y2 = rect.bottom();
367
 
        if ( plt->axisScaleDiv(yAxis())->lBound() > 
368
 
            plt->axisScaleDiv(yAxis())->hBound() )
369
 
        {
370
 
            qSwap(y1, y2);
371
 
        }
372
 
        plt->setAxisScale(yAxis(), y1, y2);
373
 
 
374
 
        plt->setAutoReplot(doReplot);
375
 
 
376
 
        plt->replot();
377
 
    }
378
 
}
379
 
 
380
 
/*!
381
 
  Reinitialize the axes, and set the zoom base to their scales.
382
 
 
383
 
  \param xAxis X axis 
384
 
  \param yAxis Y axis
385
 
*/
386
 
 
387
 
void QwtPlotZoomer::setAxis(int xAxis, int yAxis)
388
 
{
389
 
    if ( xAxis != QwtPlotPicker::xAxis() || yAxis != QwtPlotPicker::yAxis() )
390
 
    {
391
 
        QwtPlotPicker::setAxis(xAxis, yAxis);
392
 
        setZoomBase(scaleRect());
393
 
    }
394
 
}
395
 
 
396
 
/*!
397
 
   Qt::MidButton zooms out one position on the zoom stack,
398
 
   Qt::RightButton to the zoom base.
399
 
 
400
 
   Changes the current position on the stack, but doesn't pop
401
 
   any rectangle.
402
 
 
403
 
   \note The mouse events can be changed, using
404
 
         QwtEventPattern::setMousePattern: 2, 1
405
 
*/
406
 
void QwtPlotZoomer::widgetMouseReleaseEvent(QMouseEvent *me)
407
 
{
408
 
    if ( mouseMatch(MouseSelect2, me) )
409
 
        zoom(0);
410
 
    else if ( mouseMatch(MouseSelect3, me) )
411
 
        zoom(-1);
412
 
    else if ( mouseMatch(MouseSelect6, me) )
413
 
        zoom(+1);
414
 
    else 
415
 
        QwtPlotPicker::widgetMouseReleaseEvent(me);
416
 
}
417
 
 
418
 
/*!
419
 
   Qt::Key_Plus zooms out, Qt::Key_Minus zooms in one position on the 
420
 
   zoom stack, Qt::Key_Escape zooms out to the zoom base.
421
 
 
422
 
   Changes the current position on the stack, but doesn't pop
423
 
   any rectangle.
424
 
 
425
 
   \note The keys codes can be changed, using
426
 
         QwtEventPattern::setKeyPattern: 3, 4, 5
427
 
*/
428
 
 
429
 
void QwtPlotZoomer::widgetKeyPressEvent(QKeyEvent *ke)
430
 
{
431
 
    if ( !isActive() )
432
 
    {
433
 
        if ( keyMatch(KeyUndo, ke) )
434
 
            zoom(-1);
435
 
        else if ( keyMatch(KeyRedo, ke) )
436
 
            zoom(+1);
437
 
        else if ( keyMatch(KeyHome, ke) )
438
 
            zoom(0);
439
 
    }
440
 
 
441
 
    QwtPlotPicker::widgetKeyPressEvent(ke);
442
 
}
443
 
 
444
 
/*!
445
 
  Move the current zoom rectangle.
446
 
 
447
 
  \param dx X offset
448
 
  \param dy Y offset
449
 
 
450
 
  \note The changed rectangle is limited by the zoom base
451
 
*/
452
 
void QwtPlotZoomer::moveBy(double dx, double dy)
453
 
{
454
 
    const QwtDoubleRect &rect = d_data->zoomStack[d_data->zoomRectIndex];
455
 
    move(rect.left() + dx, rect.top() + dy);
456
 
}
457
 
 
458
 
/*!
459
 
  Move the the current zoom rectangle.
460
 
 
461
 
  \param x X value
462
 
  \param y Y value
463
 
 
464
 
  \sa QwtDoubleRect::move
465
 
  \note The changed rectangle is limited by the zoom base
466
 
*/
467
 
void QwtPlotZoomer::move(double x, double y)
468
 
{
469
 
    if ( x < zoomBase().left() )
470
 
        x = zoomBase().left();
471
 
    if ( x > zoomBase().right() - zoomRect().width() )
472
 
        x = zoomBase().right() - zoomRect().width();
473
 
 
474
 
    if ( y < zoomBase().top() )
475
 
        y = zoomBase().top();
476
 
    if ( y > zoomBase().bottom() - zoomRect().height() )
477
 
        y = zoomBase().bottom() - zoomRect().height();
478
 
 
479
 
    if ( x != zoomRect().left() || y != zoomRect().top() )
480
 
    {
481
 
        d_data->zoomStack[d_data->zoomRectIndex].moveTo(x, y);
482
 
        rescale();
483
 
    }
484
 
}
485
 
 
486
 
/*!
487
 
  \brief Check and correct a selected rectangle
488
 
 
489
 
  Reject rectangles with a hight or width < 2, otherwise
490
 
  expand the selected rectangle to a minimum size of 11x11
491
 
  and accept it.
492
 
  
493
 
  \return true If rect is accepted, or has been changed
494
 
          to a accepted rectangle. 
495
 
*/
496
 
 
497
 
bool QwtPlotZoomer::accept(QwtPolygon &pa) const
498
 
{
499
 
    if ( pa.count() < 2 )
500
 
        return false;
501
 
 
502
 
    QRect rect = QRect(pa[0], pa[int(pa.count()) - 1]);
503
 
#if QT_VERSION < 0x040000
504
 
    rect = rect.normalize();
505
 
#else
506
 
    rect = rect.normalized();
507
 
#endif
508
 
 
509
 
    const int minSize = 2;
510
 
    if (rect.width() < minSize && rect.height() < minSize )
511
 
        return false; 
512
 
 
513
 
    const int minZoomSize = 11;
514
 
 
515
 
    const QPoint center = rect.center();
516
 
    rect.setSize(rect.size().expandedTo(QSize(minZoomSize, minZoomSize)));
517
 
    rect.moveCenter(center);
518
 
 
519
 
    pa.resize(2);
520
 
    pa[0] = rect.topLeft();
521
 
    pa[1] = rect.bottomRight();
522
 
 
523
 
    return true;
524
 
}
525
 
 
526
 
/*!
527
 
  \brief Limit zooming by a minimum rectangle
528
 
 
529
 
  \return zoomBase().width() / 10e4, zoomBase().height() / 10e4
530
 
*/
531
 
QwtDoubleSize QwtPlotZoomer::minZoomSize() const
532
 
{
533
 
    return QwtDoubleSize(
534
 
        d_data->zoomStack[0].width() / 10e4,
535
 
        d_data->zoomStack[0].height() / 10e4
536
 
    );
537
 
}
538
 
 
539
 
/*! 
540
 
  Rejects selections, when the stack depth is too deep, or
541
 
  the zoomed rectangle is minZoomSize().
542
 
 
543
 
  \sa minZoomSize(), maxStackDepth()
544
 
*/
545
 
void QwtPlotZoomer::begin()
546
 
{
547
 
    if ( d_data->maxStackDepth >= 0 )
548
 
    {
549
 
        if ( d_data->zoomRectIndex >= uint(d_data->maxStackDepth) )
550
 
            return;
551
 
    }
552
 
 
553
 
    const QwtDoubleSize minSize = minZoomSize();
554
 
    if ( minSize.isValid() )
555
 
    {
556
 
        const QwtDoubleSize sz = 
557
 
            d_data->zoomStack[d_data->zoomRectIndex].size() * 0.9999;
558
 
 
559
 
        if ( minSize.width() >= sz.width() &&
560
 
            minSize.height() >= sz.height() )
561
 
        {
562
 
            return;
563
 
        }
564
 
    }
565
 
 
566
 
    QwtPlotPicker::begin();
567
 
}
568
 
 
569
 
/*!
570
 
  Expand the selected rectangle to minZoomSize() and zoom in
571
 
  if accepted.
572
 
 
573
 
  \sa QwtPlotZoomer::accept()a, QwtPlotZoomer::minZoomSize()
574
 
*/
575
 
bool QwtPlotZoomer::end(bool ok)
576
 
{
577
 
    ok = QwtPlotPicker::end(ok);
578
 
    if (!ok)
579
 
        return false;
580
 
 
581
 
    QwtPlot *plot = QwtPlotZoomer::plot();
582
 
    if ( !plot )
583
 
        return false;
584
 
 
585
 
    const QwtPolygon &pa = selection();
586
 
    if ( pa.count() < 2 )
587
 
        return false;
588
 
 
589
 
    QRect rect = QRect(pa[0], pa[int(pa.count() - 1)]);
590
 
#if QT_VERSION < 0x040000
591
 
    rect = rect.normalize();
592
 
#else
593
 
    rect = rect.normalized();
594
 
#endif
595
 
 
596
 
 
597
 
    QwtDoubleRect zoomRect = invTransform(rect).normalized();
598
 
 
599
 
    const QwtDoublePoint center = zoomRect.center();
600
 
    zoomRect.setSize(zoomRect.size().expandedTo(minZoomSize()));
601
 
    zoomRect.moveCenter(center);
602
 
 
603
 
    zoom(zoomRect);
604
 
 
605
 
    return true;
606
 
}
607
 
 
608
 
/*!
609
 
  Set the selection flags
610
 
  
611
 
  \param flags Or'd value of QwtPicker::RectSelectionType and
612
 
               QwtPicker::SelectionMode. The default value is 
613
 
               QwtPicker::RectSelection & QwtPicker::ClickSelection.
614
 
 
615
 
  \sa selectionFlags(), SelectionType, RectSelectionType, SelectionMode
616
 
  \note QwtPicker::RectSelection will be auto added.
617
 
*/
618
 
 
619
 
void QwtPlotZoomer::setSelectionFlags(int flags)
620
 
{
621
 
    // we accept only rects
622
 
    flags &= ~(PointSelection | PolygonSelection);
623
 
    flags |= RectSelection;
624
 
 
625
 
    QwtPlotPicker::setSelectionFlags(flags);
626
 
}