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 explicit QwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
00057 DisplayMode trackerMode, QwtPlotCanvas *,
00058 bool doReplot = true);
00059
00060 virtual ~QwtPlotZoomer();
00061
00062 virtual void setZoomBase();
00063 virtual void setZoomBase(const QwtDoubleRect &);
00064
00065 QwtDoubleRect zoomBase() const;
00066 QwtDoubleRect zoomRect() const;
00067
00068 virtual void setAxis(int xAxis, int yAxis);
00069
00070 void setMaxStackDepth(int);
00071 int maxStackDepth() const;
00072
00073 #if QT_VERSION < 0x040000
00074 const QValueStack<QwtDoubleRect> &zoomStack() const;
00075 #else
00076 const QStack<QwtDoubleRect> &zoomStack() const;
00077 #endif
00078 uint zoomRectIndex() const;
00079
00080 virtual void setSelectionFlags(int);
00081
00082 public slots:
00083 void moveBy(double x, double y);
00084 virtual void move(double x, double y);
00085
00086 virtual void zoom(const QwtDoubleRect &);
00087 virtual void zoom(int up);
00088
00089 signals:
00097 void zoomed(const QwtDoubleRect &rect);
00098
00099 protected:
00100 virtual void rescale();
00101
00102 virtual QwtDoubleSize minZoomSize() const;
00103
00104 virtual void widgetMouseReleaseEvent(QMouseEvent *);
00105 virtual void widgetKeyPressEvent(QKeyEvent *);
00106
00107 virtual void begin();
00108 virtual bool end(bool ok = true);
00109 virtual bool accept(QwtPolygon &) const;
00110
00111 private:
00112 void init(int selectionFlags, DisplayMode trackerMode, bool doReplot);
00113
00114 class PrivateData;
00115 PrivateData *d_data;
00116 };
00117
00118 #endif