QwtPlotZoomer 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 maxStackDepth() or minZoomSize(). Each rectangle is pushed on a stack.
Zoom rectangles can be selected depending on selectionFlags() using the mouse or keyboard (QwtEventPattern, QwtPickerMachine). 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.
QwtPlotZoomer is tailored for plots with one x and y axis, but it is allowed to attach a second QwtPlotZoomer for the other axes.
Definition at line 57 of file qwt_plot_zoomer.h.
Public Slots | |
void | moveBy (double x, double y) |
virtual void | move (double x, double y) |
virtual void | zoom (const QwtDoubleRect &) |
virtual void | zoom (int up) |
Signals | |
void | zoomed (const QwtDoubleRect &rect) |
Public Member Functions | |
QwtPlotZoomer (QwtPlotCanvas *) | |
QwtPlotZoomer (int xAxis, int yAxis, QwtPlotCanvas *) | |
QwtPlotZoomer (int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *) | |
virtual void | setZoomBase () |
virtual void | setZoomBase (const QwtDoubleRect &) |
QwtDoubleRect | zoomBase () const |
QwtDoubleRect | zoomRect () const |
virtual void | setAxis (int xAxis, int yAxis) |
void | setMaxStackDepth (int) |
int | maxStackDepth () const |
const QValueStack< QwtDoubleRect > & | zoomStack () const |
uint | zoomRectIndex () const |
virtual void | setSelectionFlags (int) |
Protected Member Functions | |
QValueStack< QwtDoubleRect > & | zoomStack () |
virtual void | rescale () |
virtual QwtDoubleSize | minZoomSize () const |
virtual void | widgetMouseReleaseEvent (QMouseEvent *) |
virtual void | widgetKeyPressEvent (QKeyEvent *) |
virtual void | begin () |
virtual bool | end (bool ok=true) |
virtual bool | accept (SelectedPoints &) const |
|
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. The selectionFlags() are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
Definition at line 55 of file qwt_plot_zoomer.cpp. |
|
Create a zoomer for a plot canvas. The selectionFlags() are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
Definition at line 83 of file qwt_plot_zoomer.cpp. |
|
Create a zoomer for a plot canvas.
Definition at line 116 of file qwt_plot_zoomer.cpp. |
|
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.
Reimplemented from QwtPicker. Definition at line 485 of file qwt_plot_zoomer.cpp. References minZoomSize(). |
|
Rejects selections, when the stack depth is too deep, or the zoomed rectangle is minZoomSize().
Reimplemented from QwtPicker. Definition at line 542 of file qwt_plot_zoomer.cpp. References QwtPicker::begin(), QwtDoubleSize::height(), QwtDoubleSize::isValid(), minZoomSize(), and QwtDoubleSize::width(). |
|
Expand the selected rectangle to minZoomSize() and zoom in if accepted.
Reimplemented from QwtPlotPicker. Definition at line 573 of file qwt_plot_zoomer.cpp. References QwtDoubleRect::center(), QwtPlotPicker::end(), QwtDoubleSize::expandedTo(), QwtPlotPicker::invTransform(), minZoomSize(), QwtDoubleRect::moveCenter(), QwtDoubleRect::normalized(), QwtPlotPicker::plot(), QwtPicker::selection(), QwtDoubleRect::setSize(), QwtDoubleRect::size(), zoom(), zoomed(), and zoomRect(). |
|
Definition at line 183 of file qwt_plot_zoomer.cpp. |
|
Limit zooming by a minimum rectangle. Tries to stop zooming, when the precision of the axes label string conversion leads to identical values.
Definition at line 522 of file qwt_plot_zoomer.cpp. References QwtPlot::axisLabelFormat(), QwtPlotPicker::plot(), QwtPlotPicker::xAxis(), and QwtPlotPicker::yAxis(). |
|
Move the the current zoom rectangle.
Definition at line 459 of file qwt_plot_zoomer.cpp. References rescale(), zoomBase(), and zoomRect(). Referenced by moveBy(). |
|
Move the current zoom rectangle.
Definition at line 444 of file qwt_plot_zoomer.cpp. References QwtDoubleRect::left(), move(), and QwtDoubleRect::top(). |
|
Adjust the observed plot to zoomRect()
Definition at line 351 of file qwt_plot_zoomer.cpp. References QwtPlot::autoReplot(), QwtDoubleRect::bottom(), QwtDoubleRect::left(), QwtPlotPicker::plot(), QwtPlot::replot(), QwtDoubleRect::right(), QwtPlotPicker::scaleRect(), QwtPlot::setAutoReplot(), QwtPlot::setAxisScale(), QwtDoubleRect::top(), QwtPlotPicker::xAxis(), and QwtPlotPicker::yAxis(). Referenced by move(), setZoomBase(), and zoom(). |
|
Reinitialize the axes, and set the zoom base to their scales.
Reimplemented from QwtPlotPicker. Definition at line 379 of file qwt_plot_zoomer.cpp. References QwtPlotPicker::scaleRect(), QwtPlotPicker::setAxis(), and setZoomBase(). |
|
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.
Definition at line 156 of file qwt_plot_zoomer.cpp. References zoom(). |
|
Set the selection flags
Reimplemented from QwtPicker. Definition at line 618 of file qwt_plot_zoomer.cpp. References QwtPicker::setSelectionFlags(). |
|
Set the initial size of the zoomer. base is united with the current scaleRect() and the zoom stack is reinitalized with it as zoom base. plot is zoomed to scaleRect().
Definition at line 251 of file qwt_plot_zoomer.cpp. References QwtPlotPicker::plot(), rescale(), and QwtPlotPicker::scaleRect(). |
|
Reinitialized the zoom stack with scaleRect() as base.
Definition at line 228 of file qwt_plot_zoomer.cpp. References QwtPlot::clear(), QwtPlotPicker::plot(), rescale(), and QwtPlotPicker::scaleRect(). Referenced by setAxis(). |
|
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. Changes the current position on the stack, but doesnīt pop any rectangle.
Reimplemented from QwtPicker. Definition at line 421 of file qwt_plot_zoomer.cpp. References QwtPicker::isActive(), QwtEventPattern::keyMatch(), QwtPicker::widgetKeyPressEvent(), and zoom(). |
|
Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base. Changes the current position on the stack, but doesnīt pop any rectangle.
Reimplemented from QwtPicker. Definition at line 398 of file qwt_plot_zoomer.cpp. References QwtEventPattern::mouseMatch(), QwtPicker::widgetMouseReleaseEvent(), and zoom(). |
|
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.
Definition at line 329 of file qwt_plot_zoomer.cpp. References rescale(). |
|
Zoom in. Clears all rectangles above the current position of the zoom stack and pushs the intersection of zoomRect() and the normalized rect on it.
Definition at line 301 of file qwt_plot_zoomer.cpp. References QwtDoubleRect::normalized(), rescale(), and zoomRect(). Referenced by end(), setMaxStackDepth(), widgetKeyPressEvent(), and widgetMouseReleaseEvent(). |
|
Definition at line 210 of file qwt_plot_zoomer.cpp. Referenced by move(). |
|
A signal emitting the zoomRect(), when the plot has been zoomed in or out.
Referenced by end(). |
|
Rectangle at the current position on the zoom stack.
Definition at line 278 of file qwt_plot_zoomer.cpp. |
|
Definition at line 286 of file qwt_plot_zoomer.cpp. |
|
Return the zoom stack. zoomStack()[0] is the zoom base, zoomStack()[1] the first zoomed rectangle. Definition at line 201 of file qwt_plot_zoomer.cpp. |
|
Return the zoom stack. zoomStack()[0] is the zoom base, zoomStack()[1] the first zoomed rectangle. Definition at line 192 of file qwt_plot_zoomer.cpp. |