QWT 7.0.1
Loading...
Searching...
No Matches
qwt_plot_axis_zoomer.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_AXIS_ZOOMER_H
28#define QWT_PLOT_AXIS_ZOOMER_H
29
30#include "qwt_global.h"
31#include "qwt_plot_picker.h"
32
33class QSizeF;
34template< typename T >
35class QStack;
36
131class QWT_EXPORT QwtPlotAxisZoomer : public QwtPlotPicker
132{
133 Q_OBJECT
134public:
135 explicit QwtPlotAxisZoomer(QWidget*, bool doReplot = true);
136 explicit QwtPlotAxisZoomer(QwtAxisId xAxis, QwtAxisId yAxis, QWidget*, bool doReplot = true);
137
138 virtual ~QwtPlotAxisZoomer();
139
140 virtual void setZoomBase(bool doReplot = true);
141 virtual void setZoomBase(const QRectF&);
142
143 QRectF zoomBase() const;
144 QRectF zoomRect() const;
145
146 virtual void setAxes(QwtAxisId xAxis, QwtAxisId yAxis) QWT_OVERRIDE;
147
148 void setMaxStackDepth(int);
149 int maxStackDepth() const;
150
151 const QStack< QRectF >& zoomStack() const;
152 void setZoomStack(const QStack< QRectF >&, int zoomRectIndex = -1);
153
154 uint zoomRectIndex() const;
155
156public Q_SLOTS:
157 void moveBy(double dx, double dy);
158 virtual void moveTo(const QPointF&);
159
160 virtual void zoom(const QRectF&);
161 virtual void zoom(int offset);
162
163Q_SIGNALS:
171 void zoomed(const QRectF& rect);
172
173protected:
174 virtual void rescale();
175
176 virtual QSizeF minZoomSize() const;
177
178 virtual void widgetMouseReleaseEvent(QMouseEvent*) QWT_OVERRIDE;
179 virtual void widgetKeyPressEvent(QKeyEvent*) QWT_OVERRIDE;
180
181 virtual void begin() QWT_OVERRIDE;
182 virtual bool end(bool ok = true) QWT_OVERRIDE;
183 virtual bool accept(QPolygon&) const QWT_OVERRIDE;
184
185private:
186 void init(bool doReplot);
187
188 class PrivateData;
189 PrivateData* m_data;
190};
191
192#endif
Definition qwt_plot_axis_zoomer.h:35
virtual void begin()
Open a selection setting the state to active.
Definition qwt_picker.cpp:1185
virtual void widgetMouseReleaseEvent(QMouseEvent *)
Handle a mouse release event for the observed widget.
Definition qwt_picker.cpp:1011
virtual void widgetKeyPressEvent(QKeyEvent *)
Handle a key press event for the observed widget.
Definition qwt_picker.cpp:1072
QwtAxisZoomer provides stacked zooming for a plot widget.
Definition qwt_plot_axis_zoomer.h:132
void zoomed(const QRectF &rect)
A signal emitting the zoomRect(), when the plot has been zoomed in or out.
QwtPlotPicker provides selections on a plot canvas/QwtPlotPicker提供绘图画布上的选择功能
Definition qwt_plot_picker.h:32
virtual void setAxes(QwtAxisId xAxisId, QwtAxisId yAxisId)
Set the x and y axes of the picker.
Definition qwt_plot_picker.cpp:161