Go to the documentation of this file.00001 #ifndef PLOT_ZOOMER_H
00002 #define PLOT_ZOOMER_H
00003
00004 #include <QDateTime>
00005
00006 #include <qwt_plot_zoomer.h>
00007 #include <qwt_scale_div.h>
00008
00009 class PlotScrollData;
00010 class PlotScrollBar;
00011
00012 class PlotZoomer : public QwtPlotZoomer
00013 {
00014 Q_OBJECT
00015
00016
00017
00018
00019 public:
00020 enum ScrollBarPosition { AttachedToScale, OppositeToScale };
00021
00022
00023
00024
00025 public:
00026 PlotZoomer( QwtPlotCanvas* canvas, bool doReplot = true );
00027 PlotZoomer( int xAxis, int yAxis, QwtPlotCanvas* canvas, bool doReplot = true );
00028 PlotZoomer( int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode,
00029 QwtPlotCanvas* canvas, bool doReplot = true );
00030 virtual ~PlotZoomer();
00031
00032
00033
00034
00035 signals:
00036 void scrollBarMovedSignal( Qt::Orientation o, double min, double max,
00037 double minBase, double maxBase );
00038
00039
00040
00041
00042 public slots:
00043 virtual void zoom( const QwtDoubleRect& rect );
00044 virtual void zoom( int offset );
00045 void otherScrollBarMoved( Qt::Orientation o, double min, double max,
00046 double minBase, double maxBase );
00047
00048 private slots:
00049 void scrollBarMoved( Qt::Orientation o, double min, double max );
00050
00051
00052
00053
00054 public:
00055 PlotScrollBar* horizontalScrollBar() const;
00056 PlotScrollBar* verticalScrollBar() const;
00057 void setHScrollBarMode( Qt::ScrollBarPolicy );
00058 void setVScrollBarMode( Qt::ScrollBarPolicy );
00059 Qt::ScrollBarPolicy vScrollBarMode () const;
00060 Qt::ScrollBarPolicy hScrollBarMode () const;
00061 void setHScrollBarPosition( ScrollBarPosition );
00062 void setVScrollBarPosition( ScrollBarPosition );
00063 ScrollBarPosition hScrollBarPosition() const;
00064 ScrollBarPosition vScrollBarPosition() const;
00065 QWidget* cornerWidget() const;
00066 virtual void setCornerWidget( QWidget* );
00067 virtual bool eventFilter( QObject*, QEvent* );
00068 virtual void rescale();
00069 virtual void updateScrollBars();
00070
00071 protected:
00072 virtual PlotScrollBar* scrollBar( Qt::Orientation );
00073 virtual void layoutScrollBars( const QRect& );
00074 virtual void begin();
00075 virtual bool end( bool flag = true );
00076
00077 private:
00078 void init();
00079 bool needScrollBar( Qt::Orientation ) const;
00080 int oppositeAxis( int ) const;
00081 void storeAxesStates();
00082 void restoreAxesStates();
00083
00084
00085
00086
00087 private:
00088 bool m_xAxisAutoscale;
00089 double m_xAxisLowerBound;
00090 double m_xAxisUpperBound;
00091 bool m_yAxisAutoscale;
00092 double m_yAxisLowerBound;
00093 double m_yAxisUpperBound;
00094 QWidget* m_cornerWidget;
00095 PlotScrollData* m_hScrollData;
00096 PlotScrollData* m_vScrollData;
00097 bool m_inZoom;
00098 };
00099
00100 #endif