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 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548
|
.TH "QwtPlotZoomer" 3 "Thu Dec 11 2014" "Version 6.1.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotZoomer \-
.PP
\fBQwtPlotZoomer\fP provides stacked zooming for a plot widget\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_zoomer\&.h>\fP
.PP
Inherits \fBQwtPlotPicker\fP\&.
.SS "Public Slots"
.in +1c
.ti -1c
.RI "void \fBmoveBy\fP (double x, double y)"
.br
.ti -1c
.RI "virtual void \fBmoveTo\fP (const QPointF &)"
.br
.ti -1c
.RI "virtual void \fBzoom\fP (const QRectF &)"
.br
.RI "\fIZoom in\&. \fP"
.ti -1c
.RI "virtual void \fBzoom\fP (int up)"
.br
.RI "\fIZoom in or out\&. \fP"
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.RI "void \fBzoomed\fP (const QRectF &rect)"
.br
.in -1c
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBQwtPlotZoomer\fP (QWidget *, bool doReplot=true)"
.br
.RI "\fICreate a zoomer for a plot canvas\&. \fP"
.ti -1c
.RI "\fBQwtPlotZoomer\fP (int \fBxAxis\fP, int \fByAxis\fP, QWidget *, bool doReplot=true)"
.br
.RI "\fICreate a zoomer for a plot canvas\&. \fP"
.ti -1c
.RI "virtual void \fBsetZoomBase\fP (bool doReplot=true)"
.br
.ti -1c
.RI "virtual void \fBsetZoomBase\fP (const QRectF &)"
.br
.RI "\fISet the initial size of the zoomer\&. \fP"
.ti -1c
.RI "QRectF \fBzoomBase\fP () const "
.br
.ti -1c
.RI "QRectF \fBzoomRect\fP () const "
.br
.ti -1c
.RI "virtual void \fBsetAxis\fP (int \fBxAxis\fP, int \fByAxis\fP)"
.br
.ti -1c
.RI "void \fBsetMaxStackDepth\fP (int)"
.br
.RI "\fILimit the number of recursive zoom operations to depth\&. \fP"
.ti -1c
.RI "int \fBmaxStackDepth\fP () const "
.br
.ti -1c
.RI "const QStack< QRectF > & \fBzoomStack\fP () const "
.br
.ti -1c
.RI "void \fBsetZoomStack\fP (const QStack< QRectF > &, int \fBzoomRectIndex\fP=-1)"
.br
.RI "\fIAssign a zoom stack\&. \fP"
.ti -1c
.RI "uint \fBzoomRectIndex\fP () const "
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual void \fBrescale\fP ()"
.br
.ti -1c
.RI "virtual QSizeF \fBminZoomSize\fP () const "
.br
.RI "\fILimit zooming by a minimum rectangle\&. \fP"
.ti -1c
.RI "virtual void \fBwidgetMouseReleaseEvent\fP (QMouseEvent *)"
.br
.ti -1c
.RI "virtual void \fBwidgetKeyPressEvent\fP (QKeyEvent *)"
.br
.ti -1c
.RI "virtual void \fBbegin\fP ()"
.br
.ti -1c
.RI "virtual bool \fBend\fP (bool ok=true)"
.br
.ti -1c
.RI "virtual bool \fBaccept\fP (QPolygon &) const "
.br
.RI "\fICheck and correct a selected rectangle\&. \fP"
.in -1c
.SS "Additional Inherited Members"
.SH "Detailed Description"
.PP
\fBQwtPlotZoomer\fP provides stacked zooming for a plot widget\&.
\fBQwtPlotZoomer\fP selects rectangles from user inputs ( mouse or keyboard ) translates them into plot coordinates and adjusts the axes to them\&. The selection is supported by a rubber band and optionally by displaying the coordinates of the current mouse position\&.
.PP
Zooming can be repeated as often as possible, limited only by \fBmaxStackDepth()\fP or \fBminZoomSize()\fP\&. Each rectangle is pushed on a stack\&.
.PP
The default setting how to select rectangles is a \fBQwtPickerDragRectMachine\fP with the following bindings:
.PP
.IP "\(bu" 2
\fBQwtEventPattern::MouseSelect1\fP
.br
The first point of the zoom rectangle is selected by a mouse press, the second point from the position, where the mouse is released\&.
.IP "\(bu" 2
\fBQwtEventPattern::KeySelect1\fP
.br
The first key press selects the first, the second key press selects the second point\&.
.IP "\(bu" 2
\fBQwtEventPattern::KeyAbort\fP
.br
Discard the selection in the state, where the first point is selected\&.
.PP
.PP
To traverse the zoom stack the following bindings are used:
.PP
.IP "\(bu" 2
\fBQwtEventPattern::MouseSelect3\fP, \fBQwtEventPattern::KeyUndo\fP
.br
Zoom out one position on the zoom stack
.IP "\(bu" 2
\fBQwtEventPattern::MouseSelect6\fP, \fBQwtEventPattern::KeyRedo\fP
.br
Zoom in one position on the zoom stack
.IP "\(bu" 2
\fBQwtEventPattern::MouseSelect2\fP, \fBQwtEventPattern::KeyHome\fP
.br
Zoom to the zoom base
.PP
.PP
The \fBsetKeyPattern()\fP and \fBsetMousePattern()\fP functions can be used to configure the zoomer actions\&. The following example shows, how to configure the 'I' and 'O' keys for zooming in and out one position on the zoom stack\&. The 'Home' key is used to 'unzoom' the plot\&.
.PP
.PP
.nf
zoomer = new QwtPlotZoomer( plot );
zoomer->setKeyPattern( QwtEventPattern::KeyRedo, Qt::Key_I, Qt::ShiftModifier );
zoomer->setKeyPattern( QwtEventPattern::KeyUndo, Qt::Key_O, Qt::ShiftModifier );
zoomer->setKeyPattern( QwtEventPattern::KeyHome, Qt::Key_Home );
.fi
.PP
.PP
\fBQwtPlotZoomer\fP is tailored for plots with one x and y axis, but it is allowed to attach a second \fBQwtPlotZoomer\fP ( without rubber band and tracker ) for the other axes\&.
.PP
\fBNote:\fP
.RS 4
The realtime example includes an derived zoomer class that adds scrollbars to the plot canvas\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotPanner\fP, \fBQwtPlotMagnifier\fP
.RE
.PP
.SH "Constructor & Destructor Documentation"
.PP
.SS "QwtPlotZoomer::QwtPlotZoomer (QWidget *canvas, booldoReplot = \fCtrue\fP)\fC [explicit]\fP"
.PP
Create a zoomer for a plot canvas\&. 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 \fBQwtPlot::xBottom\fP\&. If both or no y-axis are enabled, it is set to \fBQwtPlot::yLeft\fP\&.
.PP
The zoomer is initialized with a \fBQwtPickerDragRectMachine\fP, the tracker mode is set to \fBQwtPicker::ActiveOnly\fP and the rubber band is set to \fBQwtPicker::RectRubberBand\fP
.PP
\fBParameters:\fP
.RS 4
\fIcanvas\fP Plot canvas to observe, also the parent object
.br
\fIdoReplot\fP Call \fBQwtPlot::replot()\fP 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\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, \fBsetZoomBase()\fP
.RE
.PP
.SS "QwtPlotZoomer::QwtPlotZoomer (intxAxis, intyAxis, QWidget *canvas, booldoReplot = \fCtrue\fP)\fC [explicit]\fP"
.PP
Create a zoomer for a plot canvas\&. The zoomer is initialized with a \fBQwtPickerDragRectMachine\fP, the tracker mode is set to \fBQwtPicker::ActiveOnly\fP and the rubber band is set to \fBQwtPicker\fP;;RectRubberBand
.PP
\fBParameters:\fP
.RS 4
\fIxAxis\fP X axis of the zoomer
.br
\fIyAxis\fP Y axis of the zoomer
.br
\fIcanvas\fP Plot canvas to observe, also the parent object
.br
\fIdoReplot\fP Call \fBQwtPlot::replot()\fP 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\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, \fBsetZoomBase()\fP
.RE
.PP
.SH "Member Function Documentation"
.PP
.SS "bool QwtPlotZoomer::accept (QPolygon &pa) const\fC [protected]\fP, \fC [virtual]\fP"
.PP
Check and correct a selected rectangle\&. Reject rectangles with a height or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it\&.
.PP
\fBReturns:\fP
.RS 4
true If the rectangle is accepted, or has been changed to an accepted one\&.
.RE
.PP
.PP
Reimplemented from \fBQwtPicker\fP\&.
.SS "void QwtPlotZoomer::begin ()\fC [protected]\fP, \fC [virtual]\fP"
Rejects selections, when the stack depth is too deep, or the zoomed rectangle is \fBminZoomSize()\fP\&.
.PP
\fBSee Also:\fP
.RS 4
\fBminZoomSize()\fP, \fBmaxStackDepth()\fP
.RE
.PP
.PP
Reimplemented from \fBQwtPicker\fP\&.
.SS "bool QwtPlotZoomer::end (boolok = \fCtrue\fP)\fC [protected]\fP, \fC [virtual]\fP"
Expand the selected rectangle to \fBminZoomSize()\fP and zoom in if accepted\&.
.PP
\fBParameters:\fP
.RS 4
\fIok\fP If true, complete the selection and emit selected signals otherwise discard the selection\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBaccept()\fP, \fBminZoomSize()\fP
.RE
.PP
\fBReturns:\fP
.RS 4
True if the selection has been accepted, false otherwise
.RE
.PP
.PP
Reimplemented from \fBQwtPlotPicker\fP\&.
.SS "int QwtPlotZoomer::maxStackDepth () const"
.PP
\fBReturns:\fP
.RS 4
Maximal depth of the zoom stack\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetMaxStackDepth()\fP
.RE
.PP
.SS "QSizeF QwtPlotZoomer::minZoomSize () const\fC [protected]\fP, \fC [virtual]\fP"
.PP
Limit zooming by a minimum rectangle\&.
.PP
\fBReturns:\fP
.RS 4
\fBzoomBase()\fP\&.width() / 10e4, \fBzoomBase()\fP\&.height() / 10e4
.RE
.PP
.SS "void QwtPlotZoomer::moveBy (doubledx, doubledy)\fC [slot]\fP"
Move the current zoom rectangle\&.
.PP
\fBParameters:\fP
.RS 4
\fIdx\fP X offset
.br
\fIdy\fP Y offset
.RE
.PP
\fBNote:\fP
.RS 4
The changed rectangle is limited by the zoom base
.RE
.PP
.SS "void QwtPlotZoomer::moveTo (const QPointF &pos)\fC [virtual]\fP, \fC [slot]\fP"
Move the the current zoom rectangle\&.
.PP
\fBParameters:\fP
.RS 4
\fIpos\fP New position
.RE
.PP
\fBSee Also:\fP
.RS 4
QRectF::moveTo()
.RE
.PP
\fBNote:\fP
.RS 4
The changed rectangle is limited by the zoom base
.RE
.PP
.SS "void QwtPlotZoomer::rescale ()\fC [protected]\fP, \fC [virtual]\fP"
Adjust the observed plot to \fBzoomRect()\fP
.PP
\fBNote:\fP
.RS 4
Initiates \fBQwtPlot::replot()\fP
.RE
.PP
.SS "void QwtPlotZoomer::setAxis (intxAxis, intyAxis)\fC [virtual]\fP"
Reinitialize the axes, and set the zoom base to their scales\&.
.PP
\fBParameters:\fP
.RS 4
\fIxAxis\fP X axis
.br
\fIyAxis\fP Y axis
.RE
.PP
.PP
Reimplemented from \fBQwtPlotPicker\fP\&.
.SS "void QwtPlotZoomer::setMaxStackDepth (intdepth)"
.PP
Limit the number of recursive zoom operations to depth\&. A value of -1 set the depth to unlimited, 0 disables zooming\&. If the current zoom rectangle is below depth, the plot is unzoomed\&.
.PP
\fBParameters:\fP
.RS 4
\fIdepth\fP Maximum for the stack depth
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmaxStackDepth()\fP
.RE
.PP
\fBNote:\fP
.RS 4
depth doesn't include the zoom base, so \fBzoomStack()\fP\&.count() might be \fBmaxStackDepth()\fP + 1\&.
.RE
.PP
.SS "void QwtPlotZoomer::setZoomBase (booldoReplot = \fCtrue\fP)\fC [virtual]\fP"
Reinitialized the zoom stack with \fBscaleRect()\fP as base\&.
.PP
\fBParameters:\fP
.RS 4
\fIdoReplot\fP Call \fBQwtPlot::replot()\fP 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\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBzoomBase()\fP, \fBscaleRect()\fP \fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP\&.
.RE
.PP
.SS "void QwtPlotZoomer::setZoomBase (const QRectF &base)\fC [virtual]\fP"
.PP
Set the initial size of the zoomer\&. base is united with the current \fBscaleRect()\fP and the zoom stack is reinitialized with it as zoom base\&. plot is zoomed to \fBscaleRect()\fP\&.
.PP
\fBParameters:\fP
.RS 4
\fIbase\fP Zoom base
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBzoomBase()\fP, \fBscaleRect()\fP
.RE
.PP
.SS "void QwtPlotZoomer::setZoomStack (const QStack< QRectF > &zoomStack, intzoomRectIndex = \fC-1\fP)"
.PP
Assign a zoom stack\&. In combination with other types of navigation it might be useful to modify to manipulate the complete zoom stack\&.
.PP
\fBParameters:\fP
.RS 4
\fIzoomStack\fP New zoom stack
.br
\fIzoomRectIndex\fP Index of the current position of zoom stack\&. In case of -1 the current position is at the top of the stack\&.
.RE
.PP
\fBNote:\fP
.RS 4
The zoomed signal might be emitted\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBzoomStack()\fP, \fBzoomRectIndex()\fP
.RE
.PP
.SS "void QwtPlotZoomer::widgetKeyPressEvent (QKeyEvent *ke)\fC [protected]\fP, \fC [virtual]\fP"
Qt::Key_Plus zooms in, Qt::Key_Minus zooms out one position on the zoom stack, Qt::Key_Escape zooms out to the zoom base\&.
.PP
Changes the current position on the stack, but doesn't pop any rectangle\&.
.PP
\fBNote:\fP
.RS 4
The keys codes can be changed, using \fBQwtEventPattern::setKeyPattern\fP: 3, 4, 5
.RE
.PP
.PP
Reimplemented from \fBQwtPicker\fP\&.
.SS "void QwtPlotZoomer::widgetMouseReleaseEvent (QMouseEvent *me)\fC [protected]\fP, \fC [virtual]\fP"
Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base\&.
.PP
Changes the current position on the stack, but doesn't pop any rectangle\&.
.PP
\fBNote:\fP
.RS 4
The mouse events can be changed, using \fBQwtEventPattern::setMousePattern\fP: 2, 1
.RE
.PP
.PP
Reimplemented from \fBQwtPicker\fP\&.
.SS "void QwtPlotZoomer::zoom (const QRectF &rect)\fC [virtual]\fP, \fC [slot]\fP"
.PP
Zoom in\&. Clears all rectangles above the current position of the zoom stack and pushes the normalized rectangle on it\&.
.PP
\fBNote:\fP
.RS 4
If the maximal stack depth is reached, zoom is ignored\&.
.PP
The zoomed signal is emitted\&.
.RE
.PP
.SS "void QwtPlotZoomer::zoom (intoffset)\fC [virtual]\fP, \fC [slot]\fP"
.PP
Zoom in or out\&. Activate a rectangle on the zoom stack with an offset relative to the current position\&. Negative values of offset will zoom out, positive zoom in\&. A value of 0 zooms out to the zoom base\&.
.PP
\fBParameters:\fP
.RS 4
\fIoffset\fP Offset relative to the current position of the zoom stack\&.
.RE
.PP
\fBNote:\fP
.RS 4
The zoomed signal is emitted\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBzoomRectIndex()\fP
.RE
.PP
.SS "QRectF QwtPlotZoomer::zoomBase () const"
.PP
\fBReturns:\fP
.RS 4
Initial rectangle of the zoomer
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetZoomBase()\fP, \fBzoomRect()\fP
.RE
.PP
.SS "void QwtPlotZoomer::zoomed (const QRectF &rect)\fC [signal]\fP"
A signal emitting the \fBzoomRect()\fP, when the plot has been zoomed in or out\&.
.PP
\fBParameters:\fP
.RS 4
\fIrect\fP Current zoom rectangle\&.
.RE
.PP
.SS "QRectF QwtPlotZoomer::zoomRect () const"
.PP
\fBReturns:\fP
.RS 4
Rectangle at the current position on the zoom stack\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBzoomRectIndex()\fP, \fBscaleRect()\fP\&.
.RE
.PP
.SS "uint QwtPlotZoomer::zoomRectIndex () const"
.PP
\fBReturns:\fP
.RS 4
Index of current position of zoom stack\&.
.RE
.PP
.SS "const QStack< QRectF > & QwtPlotZoomer::zoomStack () const"
.PP
\fBReturns:\fP
.RS 4
The zoom stack\&. \fBzoomStack()\fP[0] is the zoom base, \fBzoomStack()\fP[1] the first zoomed rectangle\&.
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetZoomStack()\fP, \fBzoomRectIndex()\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|