Eneboo - Documentación para desarrolladores
|
QwtPlotZoomer provides stacked zooming for a plot widget. Más...
#include <qwt_plot_zoomer.h>
Clases | |
class | PrivateData |
Slots públicos | |
void | moveBy (double x, double y) |
virtual void | move (double x, double y) |
virtual void | zoom (const QwtDoubleRect &) |
Zoom in. | |
virtual void | zoom (int up) |
Zoom in or out. | |
Señales | |
void | zoomed (const QwtDoubleRect &rect) |
Métodos públicos | |
QwtPlotZoomer (QwtPlotCanvas *, bool doReplot=true) | |
Create a zoomer for a plot canvas. | |
QwtPlotZoomer (int xAxis, int yAxis, QwtPlotCanvas *, bool doReplot=true) | |
Create a zoomer for a plot canvas. | |
QwtPlotZoomer (int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *, bool doReplot=true) | |
virtual | ~QwtPlotZoomer () |
virtual void | setZoomBase (bool doReplot=true) |
virtual void | setZoomBase (const QwtDoubleRect &) |
Set the initial size of the zoomer. | |
QwtDoubleRect | zoomBase () const |
QwtDoubleRect | zoomRect () const |
virtual void | setAxis (int xAxis, int yAxis) |
void | setMaxStackDepth (int) |
Limit the number of recursive zoom operations to depth. | |
int | maxStackDepth () const |
const QValueStack < QwtDoubleRect > & | zoomStack () const |
void | setZoomStack (const QValueStack< QwtDoubleRect > &, int zoomRectIndex=-1) |
Assign a zoom stack. | |
uint | zoomRectIndex () const |
virtual void | setSelectionFlags (int) |
Métodos protegidos | |
virtual void | rescale () |
virtual QwtDoubleSize | minZoomSize () const |
Limit zooming by a minimum rectangle. | |
virtual void | widgetMouseReleaseEvent (QMouseEvent *) |
virtual void | widgetKeyPressEvent (QKeyEvent *) |
virtual void | begin () |
virtual bool | end (bool ok=true) |
virtual bool | accept (QwtPolygon &) const |
Check and correct a selected rectangle. |
QwtPlotZoomer provides stacked zooming for a plot widget.
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.
QwtPlotZoomer::QwtPlotZoomer | ( | QwtPlotCanvas * | canvas, |
bool | doReplot = true |
||
) | [explicit] |
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.
canvas | Plot canvas to observe, also the parent object |
doReplot | 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. |
QwtPlotZoomer::QwtPlotZoomer | ( | int | xAxis, |
int | yAxis, | ||
QwtPlotCanvas * | canvas, | ||
bool | doReplot = true |
||
) | [explicit] |
Create a zoomer for a plot canvas.
The selectionFlags() are set to QwtPicker::RectSelection & QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
xAxis | X axis of the zoomer |
yAxis | Y axis of the zoomer |
canvas | Plot canvas to observe, also the parent object |
doReplot | 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. |
QwtPlotZoomer::QwtPlotZoomer | ( | int | xAxis, |
int | yAxis, | ||
int | selectionFlags, | ||
DisplayMode | trackerMode, | ||
QwtPlotCanvas * | canvas, | ||
bool | doReplot = true |
||
) | [explicit] |
Create a zoomer for a plot canvas.
xAxis | X axis of the zoomer |
yAxis | Y axis of the zoomer |
selectionFlags | Or'd value of QwtPicker::RectSelectionType and QwtPicker::SelectionMode. QwtPicker::RectSelection will be auto added. |
trackerMode | Tracker mode |
canvas | Plot canvas to observe, also the parent object |
doReplot | 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. |
QwtPlotZoomer::~QwtPlotZoomer | ( | ) | [virtual] |
bool QwtPlotZoomer::accept | ( | QwtPolygon & | pa | ) | const [protected, virtual] |
void QwtPlotZoomer::begin | ( | ) | [protected, virtual] |
Rejects selections, when the stack depth is too deep, or the zoomed rectangle is minZoomSize().
Reimplementado de QwtPicker.
Expand the selected rectangle to minZoomSize() and zoom in if accepted.
Reimplementado de QwtPlotPicker.
int QwtPlotZoomer::maxStackDepth | ( | ) | const |
QwtDoubleSize QwtPlotZoomer::minZoomSize | ( | ) | const [protected, virtual] |
Limit zooming by a minimum rectangle.
void QwtPlotZoomer::move | ( | double | x, |
double | y | ||
) | [virtual, slot] |
Move the the current zoom rectangle.
x | X value |
y | Y value |
void QwtPlotZoomer::moveBy | ( | double | dx, |
double | dy | ||
) | [slot] |
Move the current zoom rectangle.
dx | X offset |
dy | Y offset |
void QwtPlotZoomer::rescale | ( | ) | [protected, virtual] |
Adjust the observed plot to zoomRect()
Reinitialize the axes, and set the zoom base to their scales.
xAxis | X axis |
yAxis | Y axis |
Reimplementado de QwtPlotPicker.
void QwtPlotZoomer::setMaxStackDepth | ( | int | depth | ) |
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.
depth | Maximum for the stack depth |
void QwtPlotZoomer::setSelectionFlags | ( | int | flags | ) | [virtual] |
Set the selection flags
flags | Or'd value of QwtPicker::RectSelectionType and QwtPicker::SelectionMode. The default value is QwtPicker::RectSelection & QwtPicker::ClickSelection. |
Reimplementado de QwtPicker.
void QwtPlotZoomer::setZoomBase | ( | bool | doReplot = true | ) | [virtual] |
Reinitialized the zoom stack with scaleRect() as base.
doReplot | 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. |
void QwtPlotZoomer::setZoomBase | ( | const QwtDoubleRect & | base | ) | [virtual] |
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().
base | Zoom base |
void QwtPlotZoomer::setZoomStack | ( | const QValueStack< QwtDoubleRect > & | zoomStack, |
int | zoomRectIndex = -1 |
||
) |
Assign a zoom stack.
In combination with other types of navigation it might be useful to modify to manipulate the complete zoom stack.
zoomStack | New zoom stack |
zoomRectIndex | Index of the current position of zoom stack. In case of -1 the current position is at the top of the stack. |
void QwtPlotZoomer::widgetKeyPressEvent | ( | QKeyEvent * | ke | ) | [protected, virtual] |
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.
Reimplementado de QwtPicker.
void QwtPlotZoomer::widgetMouseReleaseEvent | ( | QMouseEvent * | me | ) | [protected, virtual] |
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.
Reimplementado de QwtPicker.
void QwtPlotZoomer::zoom | ( | int | offset | ) | [virtual, slot] |
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.
offset | Offset relative to the current position of the zoom stack. |
void QwtPlotZoomer::zoom | ( | const QwtDoubleRect & | rect | ) | [virtual, slot] |
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.
QwtDoubleRect QwtPlotZoomer::zoomBase | ( | ) | const |
void QwtPlotZoomer::zoomed | ( | const QwtDoubleRect & | rect | ) | [signal] |
A signal emitting the zoomRect(), when the plot has been zoomed in or out.
rect | Current zoom rectangle. |
QwtDoubleRect QwtPlotZoomer::zoomRect | ( | ) | const |
Rectangle at the current position on the zoom stack.
const QwtZoomStack & QwtPlotZoomer::zoomStack | ( | ) | const |
Return the zoom stack. zoomStack()[0] is the zoom base, zoomStack()[1] the first zoomed rectangle.