00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef QWT_PLOT_ZOOMER_H
00013 #define QWT_PLOT_ZOOMER_H
00014
00015 #include <qglobal.h>
00016 #if QT_VERSION < 0x040000
00017 #include <qvaluestack.h>
00018 #else
00019 #include <qstack.h>
00020 #endif
00021
00022 #include "qwt_double_rect.h"
00023 #include "qwt_plot_picker.h"
00024
00049 class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
00050 {
00051 Q_OBJECT
00052 public:
00053 explicit QwtPlotZoomer(QwtPlotCanvas *, bool doReplot = true);
00054 explicit QwtPlotZoomer(int xAxis, int yAxis,
00055 QwtPlotCanvas *, bool doReplot = true);
00056
00057 virtual ~QwtPlotZoomer();
00058
00059 virtual void setZoomBase(bool doReplot = true);
00060 virtual void setZoomBase(const QwtDoubleRect &);
00061
00062 QwtDoubleRect zoomBase() const;
00063 QwtDoubleRect zoomRect() const;
00064
00065 virtual void setAxis(int xAxis, int yAxis);
00066
00067 void setMaxStackDepth(int);
00068 int maxStackDepth() const;
00069
00070 #if QT_VERSION < 0x040000
00071 const QValueStack<QwtDoubleRect> &zoomStack() const;
00072 void setZoomStack(const QValueStack<QwtDoubleRect> &,
00073 int zoomRectIndex = -1);
00074 #else
00075 const QStack<QwtDoubleRect> &zoomStack() const;
00076 void setZoomStack(const QStack<QwtDoubleRect> &,
00077 int zoomRectIndex = -1);
00078 #endif
00079 uint zoomRectIndex() const;
00080
00081 public slots:
00082 void moveBy(double x, double y);
00083 virtual void move(double x, double y);
00084
00085 virtual void zoom(const QwtDoubleRect &);
00086 virtual void zoom(int up);
00087
00088 signals:
00096 void zoomed(const QwtDoubleRect &rect);
00097
00098 protected:
00099 virtual void rescale();
00100
00101 virtual QwtDoubleSize minZoomSize() const;
00102
00103 virtual void widgetMouseReleaseEvent(QMouseEvent *);
00104 virtual void widgetKeyPressEvent(QKeyEvent *);
00105
00106 virtual void begin();
00107 virtual bool end(bool ok = true);
00108 virtual bool accept(QwtPolygon &) const;
00109
00110 private:
00111 void init(bool doReplot);
00112
00113 class PrivateData;
00114 PrivateData *d_data;
00115 };
00116
00117 #endif