USGS

Isis 3.0 Developer's Reference (API)

Home

ZoomTool.h

Go to the documentation of this file.
00001 #ifndef ZoomTool_h
00002 #define ZoomTool_h
00003 
00025 // This should be the only include in this file!
00026 #include "Tool.h"
00027 
00028 // FIXME: remove this include
00029 #include <QCursor>
00030 
00031 class QAction;
00032 class QLineEdit;
00033 
00034 namespace Isis {
00065   class ZoomTool : public Tool {
00066       Q_OBJECT
00067 
00068     public:
00069       ZoomTool(QWidget *parent);
00070       void addTo(QMenu *menu);
00071 
00072     protected slots:
00073       void rubberBandComplete();
00074 
00075     protected:
00076       QAction *toolPadAction(ToolPad *toolpad);
00078       QString menuName() const {
00079         return "&View";
00080       };
00081       void updateTool();
00082       QWidget *createToolBarWidget(QStackedWidget *parent);
00083       void enableRubberBandTool();
00084 
00085     private slots:
00086       void zoomIn2X();
00087       void zoomIn4X();
00088       void zoomIn8X();
00089 
00090       void zoomOut2X();
00091       void zoomOut4X();
00092       void zoomOut8X();
00093 
00094       void zoomActual();
00095       void zoomFit();
00096       void zoomFitWidth();
00097       void zoomFitHeight();
00098       void zoomManual();
00099 
00100 
00101       double setScale(MdiCubeViewport *d, double newScale);
00102       double setScale(MdiCubeViewport *d, double newScale, int x, int y);
00103       double setScale(MdiCubeViewport *d, double newScale, double samp, double line);
00104 
00105     private:
00106       void zoomBy(double factor);
00107 
00108       QAction *p_zoomIn2X; 
00109       QAction *p_zoomIn4X; 
00110       QAction *p_zoomIn8X; 
00111 
00112       QAction *p_zoomOut2X; 
00113       QAction *p_zoomOut4X; 
00114       QAction *p_zoomOut8X; 
00115 
00116       QAction *p_zoomActual;  
00117       QAction *p_zoomFit; 
00118 
00119       QLineEdit *p_zoomLineEdit; 
00120       double p_lastScale;
00121   };
00122 };
00123 
00124 #endif
00125