1
.TH "QwtPlotZoomer" 3 "11 Jun 2007" "Version 5.0.2" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtPlotPicker\fP.
11
.SH "Detailed Description"
13
\fBQwtPlotZoomer\fP provides stacked zooming for a plot widget.
15
\fBQwtPlotZoomer\fP offers rubberband selections on the plot canvas, translating the selected rectangles into plot coordinates and adjusting the axes to them. Zooming can repeated as often as possible, limited only by \fBmaxStackDepth()\fP or \fBminZoomSize()\fP. Each rectangle is pushed on a stack.
17
Zoom rectangles can be selected depending on \fBselectionFlags()\fP using the mouse or keyboard (\fBQwtEventPattern\fP, \fBQwtPickerMachine\fP). QwtEventPattern::MouseSelect3/QwtEventPatternKeyUndo, or QwtEventPattern::MouseSelect6/QwtEventPatternKeyRedo walk up and down the zoom stack. QwtEventPattern::MouseSelect2 or QwtEventPattern::KeyHome unzoom to the initial size.
19
\fBQwtPlotZoomer\fP is tailored for plots with one x and y axis, but it is allowed to attach a second \fBQwtPlotZoomer\fP for the other axes.
23
The realtime example includes an derived zoomer class that adds scrollbars to the plot canvas.
28
Definition at line 49 of file qwt_plot_zoomer.h.
33
.RI "void \fBmoveBy\fP (double x, double y)"
36
.RI "virtual void \fBmove\fP (double x, double y)"
39
.RI "virtual void \fBzoom\fP (const QwtDoubleRect &)"
42
.RI "virtual void \fBzoom\fP (int up)"
49
.RI "void \fBzoomed\fP (const QwtDoubleRect &rect)"
52
.SS "Public Member Functions"
56
.RI "\fBQwtPlotZoomer\fP (\fBQwtPlotCanvas\fP *, bool doReplot=true)"
59
.RI "\fBQwtPlotZoomer\fP (int xAxis, int yAxis, \fBQwtPlotCanvas\fP *, bool doReplot=true)"
62
.RI "\fBQwtPlotZoomer\fP (int xAxis, int yAxis, int selectionFlags, \fBDisplayMode\fP trackerMode, \fBQwtPlotCanvas\fP *, bool doReplot=true)"
65
.RI "virtual \fB~QwtPlotZoomer\fP ()"
68
.RI "virtual void \fBsetZoomBase\fP ()"
71
.RI "virtual void \fBsetZoomBase\fP (const QwtDoubleRect &)"
74
.RI "QwtDoubleRect \fBzoomBase\fP () const "
77
.RI "QwtDoubleRect \fBzoomRect\fP () const "
80
.RI "virtual void \fBsetAxis\fP (int xAxis, int yAxis)"
83
.RI "void \fBsetMaxStackDepth\fP (int)"
86
.RI "int \fBmaxStackDepth\fP () const "
89
.RI "const QStack< QwtDoubleRect > & \fBzoomStack\fP () const "
92
.RI "uint \fBzoomRectIndex\fP () const "
95
.RI "virtual void \fBsetSelectionFlags\fP (int)"
98
.SS "Protected Member Functions"
102
.RI "virtual void \fBrescale\fP ()"
105
.RI "virtual QwtDoubleSize \fBminZoomSize\fP () const "
108
.RI "virtual void \fBwidgetMouseReleaseEvent\fP (QMouseEvent *)"
111
.RI "virtual void \fBwidgetKeyPressEvent\fP (QKeyEvent *)"
114
.RI "virtual void \fBbegin\fP ()"
117
.RI "virtual bool \fBend\fP (bool ok=true)"
120
.RI "virtual bool \fBaccept\fP (QwtPolygon &) const "
123
.SH "Constructor & Destructor Documentation"
125
.SS "QwtPlotZoomer::QwtPlotZoomer (\fBQwtPlotCanvas\fP * canvas, bool doReplot = \fCtrue\fP)\fC [explicit]\fP"
127
Create a zoomer for a plot canvas.
129
The zoomer is set to those x- and y-axis of the parent plot of the canvas that are enabled. If both or no x-axis are enabled, the picker is set to QwtPlot::xBottom. If both or no y-axis are enabled, it is set to QwtPlot::yLeft.
131
The \fBselectionFlags()\fP are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
135
\fIcanvas\fP Plot canvas to observe, also the parent object
137
\fIdoReplot\fP Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.
142
\fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, QwtPlotPicker::setZoomBase()
147
Definition at line 51 of file qwt_plot_zoomer.cpp.
149
References QwtPlotPicker::canvas().
150
.SS "QwtPlotZoomer::QwtPlotZoomer (int xAxis, int yAxis, \fBQwtPlotCanvas\fP * canvas, bool doReplot = \fCtrue\fP)\fC [explicit]\fP"
152
Create a zoomer for a plot canvas.
154
The \fBselectionFlags()\fP are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
158
\fIxAxis\fP X axis of the zoomer
160
\fIyAxis\fP Y axis of the zoomer
162
\fIcanvas\fP Plot canvas to observe, also the parent object
164
\fIdoReplot\fP Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.
169
\fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, QwtPlotPicker::setZoomBase()
174
Definition at line 75 of file qwt_plot_zoomer.cpp.
176
References QwtPlotPicker::canvas().
177
.SS "QwtPlotZoomer::QwtPlotZoomer (int xAxis, int yAxis, int selectionFlags, \fBDisplayMode\fP trackerMode, \fBQwtPlotCanvas\fP * canvas, bool doReplot = \fCtrue\fP)\fC [explicit]\fP"
179
Create a zoomer for a plot canvas.
183
\fIxAxis\fP X axis of the zoomer
185
\fIyAxis\fP Y axis of the zoomer
187
\fIselectionFlags\fP Or'd value of \fBQwtPicker::RectSelectionType\fP and \fBQwtPicker::SelectionMode\fP. QwtPicker::RectSelection will be auto added.
189
\fItrackerMode\fP Tracker mode
191
\fIcanvas\fP Plot canvas to observe, also the parent object
193
\fIdoReplot\fP Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.
198
\fBQwtPicker\fP, \fBQwtPicker::setSelectionFlags()\fP, \fBQwtPicker::setRubberBand()\fP, \fBQwtPicker::setTrackerMode\fP
200
\fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, \fBsetZoomBase()\fP
205
Definition at line 103 of file qwt_plot_zoomer.cpp.
207
References QwtPlotPicker::canvas().
208
.SH "Member Function Documentation"
210
.SS "bool QwtPlotZoomer::accept (QwtPolygon & pa) const\fC [protected, virtual]\fP"
212
Check and correct a selected rectangle.
214
Reject rectangles with a hight or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it.
218
true If rect is accepted, or has been changed to a accepted rectangle.
223
Reimplemented from \fBQwtPicker\fP.
225
Definition at line 497 of file qwt_plot_zoomer.cpp.
227
References minZoomSize().
228
.SS "void QwtPlotZoomer::begin ()\fC [protected, virtual]\fP"
230
Rejects selections, when the stack depth is too deep, or the zoomed rectangle is \fBminZoomSize()\fP.
234
\fBminZoomSize()\fP, \fBmaxStackDepth()\fP
239
Reimplemented from \fBQwtPicker\fP.
241
Definition at line 545 of file qwt_plot_zoomer.cpp.
243
References minZoomSize().
244
.SS "bool QwtPlotZoomer::end (bool ok = \fCtrue\fP)\fC [protected, virtual]\fP"
246
Expand the selected rectangle to \fBminZoomSize()\fP and zoom in if accepted.
250
\fBQwtPlotZoomer::accept()\fPa, \fBQwtPlotZoomer::minZoomSize()\fP
255
Reimplemented from \fBQwtPlotPicker\fP.
257
Definition at line 575 of file qwt_plot_zoomer.cpp.
259
References QwtPlotPicker::end(), QwtPlotPicker::invTransform(), minZoomSize(), QwtPlotPicker::plot(), QwtPicker::selection(), zoom(), and zoomRect().
260
.SS "int QwtPlotZoomer::maxStackDepth () const"
264
Maximal depth of the zoom stack.
269
\fBsetMaxStackDepth()\fP
274
Definition at line 172 of file qwt_plot_zoomer.cpp.
275
.SS "QwtDoubleSize QwtPlotZoomer::minZoomSize () const\fC [protected, virtual]\fP"
277
Limit zooming by a minimum rectangle.
281
\fBzoomBase()\fP.width() / 10e4, \fBzoomBase()\fP.height() / 10e4
286
Definition at line 531 of file qwt_plot_zoomer.cpp.
288
Referenced by accept(), begin(), and end().
289
.SS "void QwtPlotZoomer::move (double x, double y)\fC [virtual, slot]\fP"
291
Move the the current zoom rectangle.
307
The changed rectangle is limited by the zoom base
312
Definition at line 467 of file qwt_plot_zoomer.cpp.
314
References rescale(), zoomBase(), and zoomRect().
316
Referenced by moveBy().
317
.SS "void QwtPlotZoomer::moveBy (double dx, double dy)\fC [slot]\fP"
319
Move the current zoom rectangle.
330
The changed rectangle is limited by the zoom base
335
Definition at line 452 of file qwt_plot_zoomer.cpp.
338
.SS "void QwtPlotZoomer::rescale ()\fC [protected, virtual]\fP"
340
Adjust the observed plot to \fBzoomRect()\fP
344
Initiates \fBQwtPlot::replot\fP
349
Definition at line 343 of file qwt_plot_zoomer.cpp.
351
References QwtPlot::autoReplot(), QwtPlot::axisScaleDiv(), QwtScaleDiv::hBound(), QwtScaleDiv::lBound(), QwtPlotPicker::plot(), QwtPlotPicker::scaleRect(), QwtPlot::setAutoReplot(), QwtPlot::setAxisScale(), QwtPlotPicker::xAxis(), and QwtPlotPicker::yAxis().
353
Referenced by move(), setZoomBase(), and zoom().
354
.SS "void QwtPlotZoomer::setAxis (int xAxis, int yAxis)\fC [virtual]\fP"
356
Reinitialize the axes, and set the zoom base to their scales.
367
Reimplemented from \fBQwtPlotPicker\fP.
369
Definition at line 387 of file qwt_plot_zoomer.cpp.
371
References QwtPlotPicker::scaleRect(), QwtPlotPicker::setAxis(), setZoomBase(), QwtPlotPicker::xAxis(), and QwtPlotPicker::yAxis().
372
.SS "void QwtPlotZoomer::setMaxStackDepth (int depth)"
374
Limit the number of recursive zoom operations to depth.
376
A value of -1 set the depth to unlimited, 0 disables zooming. If the current zoom rectangle is below depth, the plot is unzoomed.
380
\fIdepth\fP Maximum for the stack depth
385
\fBmaxStackDepth()\fP
390
depth doesn't include the zoom base, so \fBzoomStack()\fP.count() might be \fBmaxStackDepth()\fP + 1.
395
Definition at line 145 of file qwt_plot_zoomer.cpp.
398
.SS "void QwtPlotZoomer::setSelectionFlags (int flags)\fC [virtual]\fP"
400
Set the selection flags
404
\fIflags\fP Or'd value of \fBQwtPicker::RectSelectionType\fP and \fBQwtPicker::SelectionMode\fP. The default value is QwtPicker::RectSelection & QwtPicker::ClickSelection.
409
\fBselectionFlags()\fP, \fBSelectionType\fP, \fBRectSelectionType\fP, \fBSelectionMode\fP
414
QwtPicker::RectSelection will be auto added.
419
Reimplemented from \fBQwtPicker\fP.
421
Definition at line 619 of file qwt_plot_zoomer.cpp.
423
References QwtPicker::setSelectionFlags().
424
.SS "void QwtPlotZoomer::setZoomBase (const QwtDoubleRect & base)\fC [virtual]\fP"
426
Set the initial size of the zoomer.
428
base is united with the current \fBscaleRect()\fP and the zoom stack is reinitalized with it as zoom base. plot is zoomed to \fBscaleRect()\fP.
437
\fBzoomBase()\fP, \fBscaleRect()\fP
442
Definition at line 231 of file qwt_plot_zoomer.cpp.
444
References QwtPlotPicker::plot(), rescale(), and QwtPlotPicker::scaleRect().
445
.SS "void QwtPlotZoomer::setZoomBase ()\fC [virtual]\fP"
447
Reinitialized the zoom stack with \fBscaleRect()\fP as base.
451
\fBzoomBase()\fP, \fBscaleRect()\fP
456
Calling \fBQwtPlot::setAxisScale()\fP while \fBQwtPlot::autoReplot()\fP is false leaves the axis in an 'intermediate' state. In this case, to prevent buggy behaviour, you must call \fBQwtPlot::replot()\fP before calling \fBQwtPlotZoomer::setZoomBase()\fP. This quirk will be removed in a future release.
461
\fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP.
466
Definition at line 208 of file qwt_plot_zoomer.cpp.
468
References QwtPlotPicker::plot(), rescale(), and QwtPlotPicker::scaleRect().
470
Referenced by setAxis().
471
.SS "void QwtPlotZoomer::widgetKeyPressEvent (QKeyEvent * ke)\fC [protected, virtual]\fP"
473
Qt::Key_Plus zooms out, Qt::Key_Minus zooms in one position on the zoom stack, Qt::Key_Escape zooms out to the zoom base.
475
Changes the current position on the stack, but doesn't pop any rectangle.
479
The keys codes can be changed, using \fBQwtEventPattern::setKeyPattern\fP: 3, 4, 5
484
Reimplemented from \fBQwtPicker\fP.
486
Definition at line 429 of file qwt_plot_zoomer.cpp.
488
References QwtPicker::isActive(), QwtEventPattern::keyMatch(), QwtPicker::widgetKeyPressEvent(), and zoom().
489
.SS "void QwtPlotZoomer::widgetMouseReleaseEvent (QMouseEvent * me)\fC [protected, virtual]\fP"
491
Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base.
493
Changes the current position on the stack, but doesn't pop any rectangle.
497
The mouse events can be changed, using \fBQwtEventPattern::setMousePattern\fP: 2, 1
502
Reimplemented from \fBQwtPicker\fP.
504
Definition at line 406 of file qwt_plot_zoomer.cpp.
506
References QwtEventPattern::mouseMatch(), QwtPicker::widgetMouseReleaseEvent(), and zoom().
507
.SS "void QwtPlotZoomer::zoom (int offset)\fC [virtual, slot]\fP"
511
Activate a rectangle on the zoom stack with an offset relative to the current position. Negative values of offest will zoom out, positive zoom in. A value of 0 zooms out to the zoom base.
515
\fIoffset\fP Offset relative to the current position of the zoom stack.
520
The zoomed signal is emitted.
525
\fBzoomRectIndex()\fP
530
Definition at line 319 of file qwt_plot_zoomer.cpp.
532
References rescale(), zoomed(), and zoomRect().
533
.SS "void QwtPlotZoomer::zoom (const QwtDoubleRect & rect)\fC [virtual, slot]\fP"
537
Clears all rectangles above the current position of the zoom stack and pushs the intersection of \fBzoomRect()\fP and the normalized rect on it.
541
If the maximal stack depth is reached, zoom is ignored.
543
The zoomed signal is emitted.
548
Definition at line 282 of file qwt_plot_zoomer.cpp.
550
References rescale(), zoomed(), and zoomRect().
552
Referenced by end(), setMaxStackDepth(), widgetKeyPressEvent(), and widgetMouseReleaseEvent().
553
.SS "QwtDoubleRect QwtPlotZoomer::zoomBase () const"
557
Initial rectangle of the zoomer
562
\fBsetZoomBase()\fP, \fBzoomRect()\fP
567
Definition at line 190 of file qwt_plot_zoomer.cpp.
569
Referenced by move().
570
.SS "void QwtPlotZoomer::zoomed (const QwtDoubleRect & rect)\fC [signal]\fP"
572
A signal emitting the \fBzoomRect()\fP, when the plot has been zoomed in or out.
576
\fIrect\fP Current zoom rectangle.
581
Referenced by zoom().
582
.SS "QwtDoubleRect QwtPlotZoomer::zoomRect () const"
584
Rectangle at the current position on the zoom stack.
588
\fBQwtPlotZoomer::zoomRectIndex()\fP, \fBQwtPlotZoomer::scaleRect()\fP.
593
Definition at line 258 of file qwt_plot_zoomer.cpp.
595
Referenced by end(), move(), and zoom().
596
.SS "uint QwtPlotZoomer::zoomRectIndex () const"
600
Index of current position of zoom stack.
605
Definition at line 266 of file qwt_plot_zoomer.cpp.
606
.SS "const QwtZoomStack & QwtPlotZoomer::zoomStack () const"
608
Return the zoom stack. \fBzoomStack()\fP[0] is the zoom base, \fBzoomStack()\fP[1] the first zoomed rectangle.
610
Definition at line 181 of file qwt_plot_zoomer.cpp.
614
Generated automatically by Doxygen for Qwt User's Guide from the source code.