.TH "QwtPlotZoomer" 3 "Tue Nov 20 2012" "Version 5.2.3" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtPlotZoomer \- .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtPlotPicker\fP\&. .SS "Public Slots" .in +1c .ti -1c .RI "virtual void \fBmove\fP (double x, double y)" .br .ti -1c .RI "void \fBmoveBy\fP (double x, double y)" .br .ti -1c .RI "virtual void \fBzoom\fP (const QwtDoubleRect &)" .br .ti -1c .RI "virtual void \fBzoom\fP (int up)" .br .in -1c .SS "Signals" .in +1c .ti -1c .RI "void \fBzoomed\fP (const QwtDoubleRect &rect)" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtPlotZoomer\fP (\fBQwtPlotCanvas\fP *, bool doReplot=true)" .br .ti -1c .RI "\fBQwtPlotZoomer\fP (int \fBxAxis\fP, int \fByAxis\fP, \fBQwtPlotCanvas\fP *, bool doReplot=true)" .br .ti -1c .RI "\fBQwtPlotZoomer\fP (int \fBxAxis\fP, int \fByAxis\fP, int \fBselectionFlags\fP, \fBDisplayMode\fP \fBtrackerMode\fP, \fBQwtPlotCanvas\fP *, bool doReplot=true)" .br .ti -1c .RI "int \fBmaxStackDepth\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 .ti -1c .RI "virtual void \fBsetSelectionFlags\fP (int)" .br .ti -1c .RI "virtual void \fBsetZoomBase\fP (bool doReplot=true)" .br .ti -1c .RI "virtual void \fBsetZoomBase\fP (const QwtDoubleRect &)" .br .ti -1c .RI "void \fBsetZoomStack\fP (const QStack< QwtDoubleRect > &, int \fBzoomRectIndex\fP=-1)" .br .ti -1c .RI "QwtDoubleRect \fBzoomBase\fP () const " .br .ti -1c .RI "QwtDoubleRect \fBzoomRect\fP () const " .br .ti -1c .RI "uint \fBzoomRectIndex\fP () const " .br .ti -1c .RI "const QStack< QwtDoubleRect > & \fBzoomStack\fP () const " .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual bool \fBaccept\fP (QwtPolygon &) const " .br .ti -1c .RI "virtual void \fBbegin\fP ()" .br .ti -1c .RI "virtual bool \fBend\fP (bool ok=true)" .br .ti -1c .RI "virtual QwtDoubleSize \fBminZoomSize\fP () const " .br .ti -1c .RI "virtual void \fBrescale\fP ()" .br .ti -1c .RI "virtual void \fBwidgetKeyPressEvent\fP (QKeyEvent *)" .br .ti -1c .RI "virtual void \fBwidgetMouseReleaseEvent\fP (QMouseEvent *)" .br .in -1c .SH "Detailed Description" .PP \fBQwtPlotZoomer\fP provides stacked zooming for a plot widget\&. \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\&. .PP Zoom rectangles can be selected depending on \fBselectionFlags()\fP using the mouse or keyboard (\fBQwtEventPattern\fP, \fBQwtPickerMachine\fP)\&. QwtEventPattern::MouseSelect3/QwtEventPattern::KeyUndo, or QwtEventPattern::MouseSelect6/QwtEventPattern::KeyRedo walk up and down the zoom stack\&. QwtEventPattern::MouseSelect2 or QwtEventPattern::KeyHome unzoom to the initial size\&. .PP \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\&. .PP \fBNote:\fP .RS 4 The realtime example includes an derived zoomer class that adds scrollbars to the plot canvas\&. .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtPlotZoomer::QwtPlotZoomer (\fBQwtPlotCanvas\fP *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 QwtPlot::xBottom\&. If both or no y-axis are enabled, it is set to QwtPlot::yLeft\&. .PP The \fBselectionFlags()\fP are set to QwtPicker::RectSelection | QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly\&. .PP \fBParameters:\fP .RS 4 \fIcanvas\fP Plot canvas to observe, also the parent object .br \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\&. .RE .PP \fBSee also:\fP .RS 4 \fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, \fBsetZoomBase()\fP .RE .PP .SS "QwtPlotZoomer::QwtPlotZoomer (intxAxis, intyAxis, \fBQwtPlotCanvas\fP *canvas, booldoReplot = \fCtrue\fP)\fC [explicit]\fP" .PP Create a zoomer for a plot canvas\&. The \fBselectionFlags()\fP are set to QwtPicker::RectSelection | QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly\&. .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 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\&. .RE .PP \fBSee also:\fP .RS 4 \fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, \fBsetZoomBase()\fP .RE .PP .SS "QwtPlotZoomer::QwtPlotZoomer (intxAxis, intyAxis, intselectionFlags, \fBDisplayMode\fPtrackerMode, \fBQwtPlotCanvas\fP *canvas, booldoReplot = \fCtrue\fP)\fC [explicit]\fP" Create a zoomer for a plot canvas\&. .PP \fBParameters:\fP .RS 4 \fIxAxis\fP X axis of the zoomer .br \fIyAxis\fP Y axis of the zoomer .br \fIselectionFlags\fP Or'd value of \fBQwtPicker::RectSelectionType\fP and \fBQwtPicker::SelectionMode\fP\&. QwtPicker::RectSelection will be auto added\&. .br \fItrackerMode\fP Tracker mode .br \fIcanvas\fP Plot canvas to observe, also the parent object .br \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\&. .RE .PP \fBSee also:\fP .RS 4 \fBQwtPicker\fP, \fBQwtPicker::setSelectionFlags()\fP, \fBQwtPicker::setRubberBand()\fP, \fBQwtPicker::setTrackerMode()\fP .PP \fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP, \fBsetZoomBase()\fP .RE .PP .SH "Member Function Documentation" .PP .SS "bool QwtPlotZoomer::accept (QwtPolygon &pa) const\fC [protected]\fP, \fC [virtual]\fP" .PP Check and correct a selected rectangle\&. Reject rectangles with a hight or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it\&. .PP \fBReturns:\fP .RS 4 true If rect is accepted, or has been changed to a accepted rectangle\&. .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 \fBSee also:\fP .RS 4 \fBaccept()\fP, \fBminZoomSize()\fP .RE .PP .PP Reimplemented from \fBQwtPlotPicker\fP\&. .SS "int QwtPlotZoomer::maxStackDepth () const" \fBReturns:\fP .RS 4 Maximal depth of the zoom stack\&. .RE .PP \fBSee also:\fP .RS 4 \fBsetMaxStackDepth()\fP .RE .PP .SS "QwtDoubleSize QwtPlotZoomer::minZoomSize () const\fC [protected]\fP, \fC [virtual]\fP" .PP Limit zooming by a minimum rectangle\&. \fBReturns:\fP .RS 4 \fBzoomBase()\fP\&.width() / 10e4, \fBzoomBase()\fP\&.height() / 10e4 .RE .PP .SS "void QwtPlotZoomer::move (doublex, doubley)\fC [virtual]\fP, \fC [slot]\fP" Move the the current zoom rectangle\&. .PP \fBParameters:\fP .RS 4 \fIx\fP X value .br \fIy\fP Y value .RE .PP \fBSee also:\fP .RS 4 QwtDoubleRect::move() .RE .PP \fBNote:\fP .RS 4 The changed rectangle is limited by the zoom base .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::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::setSelectionFlags (intflags)\fC [virtual]\fP" Set the selection flags .PP \fBParameters:\fP .RS 4 \fIflags\fP Or'd value of \fBQwtPicker::RectSelectionType\fP and \fBQwtPicker::SelectionMode\fP\&. The default value is QwtPicker::RectSelection & QwtPicker::ClickSelection\&. .RE .PP \fBSee also:\fP .RS 4 \fBselectionFlags()\fP, \fBSelectionType\fP, \fBRectSelectionType\fP, \fBSelectionMode\fP .RE .PP \fBNote:\fP .RS 4 QwtPicker::RectSelection will be auto added\&. .RE .PP .PP Reimplemented from \fBQwtPicker\fP\&. .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 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\&. .RE .PP \fBSee also:\fP .RS 4 \fBzoomBase()\fP, \fBscaleRect()\fP \fBQwtPlot::autoReplot()\fP, \fBQwtPlot::replot()\fP\&. .RE .PP .SS "void QwtPlotZoomer::setZoomBase (const QwtDoubleRect &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 reinitalized 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< QwtDoubleRect > &, 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 QwtDoubleRect &rect)\fC [virtual]\fP, \fC [slot]\fP" .PP Zoom in\&. Clears all rectangles above the current position of the zoom stack and pushs the intersection of \fBzoomRect()\fP and the normalized rect 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 offest 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 "QwtDoubleRect QwtPlotZoomer::zoomBase () const" \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 QwtDoubleRect &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 "QwtDoubleRect QwtPlotZoomer::zoomRect () const" Rectangle at the current position on the zoom stack\&. .PP \fBSee also:\fP .RS 4 \fBzoomRectIndex()\fP, \fBscaleRect()\fP\&. .RE .PP .SS "uint QwtPlotZoomer::zoomRectIndex () const" \fBReturns:\fP .RS 4 Index of current position of zoom stack\&. .RE .PP .SS "const QwtZoomStack & QwtPlotZoomer::zoomStack () const" Return the zoom stack\&. \fBzoomStack()\fP[0] is the zoom base, \fBzoomStack()\fP[1] the first zoomed rectangle\&. .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\&.