Isis 3 Programmer Reference
ZoomTool.h
Go to the documentation of this file.
1 #ifndef ZoomTool_h
2 #define ZoomTool_h
3 
25 // This should be the only include in this file!
26 #include "Tool.h"
27 
28 // FIXME: remove this include
29 #include <QCursor>
30 
31 class QAction;
32 class QLineEdit;
33 
34 namespace Isis {
67  class ZoomTool : public Tool {
68  Q_OBJECT
69 
70  public:
71  ZoomTool(QWidget *parent);
72  void addTo(QMenu *menu);
73 
77  QString menuName() const {
78  return "&View";
79  }
80 
81  protected slots:
82  void rubberBandComplete();
83 
84  protected:
85  QAction *toolPadAction(ToolPad *toolpad);
86  void updateTool();
87  QWidget *createToolBarWidget(QStackedWidget *parent);
88  void enableRubberBandTool();
89 
90  private slots:
91  void zoomIn2X();
92  void zoomIn4X();
93  void zoomIn8X();
94 
95  void zoomOut2X();
96  void zoomOut4X();
97  void zoomOut8X();
98 
99  void zoomActual();
100  void zoomFit();
101  void zoomFitWidth();
102  void zoomFitHeight();
103  void zoomManual();
104 
105 
106  double setScale(MdiCubeViewport *d, double newScale);
107  double setScale(MdiCubeViewport *d, double newScale, int x, int y);
108  double setScale(MdiCubeViewport *d, double newScale, double samp, double line);
109 
110  private:
111  void zoomBy(double factor);
112 
116 
120 
123 
124  QLineEdit *p_zoomLineEdit;
125  double p_lastScale;
126  };
127 };
128 
129 #endif
Cube display widget for certain Isis MDI applications.
QAction * p_zoomActual
Zoom to actual size action.
Definition: ZoomTool.h:121
QAction * p_zoomIn8X
Zoom in 8 times.
Definition: ZoomTool.h:115
void zoomFit()
Fits the cube in the viewport.
Definition: ZoomTool.cpp:379
void updateTool()
This method updates the line edits text to the correct zoom value.
Definition: ZoomTool.cpp:482
QAction * p_zoomOut8X
Zoom out 8 times.
Definition: ZoomTool.h:119
QAction * p_zoomFit
Fit the cube in the viewport action.
Definition: ZoomTool.h:122
void zoomManual()
This method zooms by the value input in the line edit next to the zoom tools.
Definition: ZoomTool.cpp:458
void zoomIn2X()
Zooms in 2 times.
Definition: ZoomTool.cpp:269
QAction * p_zoomOut4X
Zoom out 4 times.
Definition: ZoomTool.h:118
Handles zoom operations for Isis qt apps.
Definition: ZoomTool.h:67
double p_lastScale
Last scale.
Definition: ZoomTool.h:125
QLineEdit * p_zoomLineEdit
Line edit for manual zoom factor.
Definition: ZoomTool.h:124
void zoomOut2X()
Zoom out 2 times.
Definition: ZoomTool.cpp:296
void zoomIn8X()
Zooms in 8 times.
Definition: ZoomTool.cpp:287
QAction * p_zoomOut2X
Zoom out 2 times.
Definition: ZoomTool.h:117
QString menuName() const
Definition: ZoomTool.h:77
void zoomFitHeight()
Slot for the "Fit to Heighth" menu item on the Fit button.
Definition: ZoomTool.cpp:431
ZoomTool(QWidget *parent)
ZoomTool constructor.
Definition: ZoomTool.cpp:51
void addTo(QMenu *menu)
Adds the zoom action to the given menu.
Definition: ZoomTool.cpp:128
void enableRubberBandTool()
This methods enables the RubberBandTool, it also sets the RubberBandTool to allow points and to allow...
Definition: ZoomTool.cpp:601
void zoomOut4X()
Zoom out 4 times.
Definition: ZoomTool.cpp:305
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
Definition: ZoomTool.cpp:507
void zoomActual()
Zoom back to 1 to 1.
Definition: ZoomTool.cpp:323
void zoomBy(double factor)
Zoom by the given factor.
Definition: ZoomTool.cpp:341
QAction * p_zoomIn4X
Zoom in 4 times.
Definition: ZoomTool.h:114
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
void zoomFitWidth()
Slot for the "Fit to Width" menu item on the Fit button.
Definition: ZoomTool.cpp:405
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
Definition: ZoomTool.cpp:154
QAction * toolPadAction(ToolPad *toolpad)
Adds the action to the toolpad.
Definition: ZoomTool.cpp:107
void zoomOut8X()
Zoom out 8 times.
Definition: ZoomTool.cpp:314
double setScale(MdiCubeViewport *d, double newScale)
This method will attempt to reset the scale for the given MdiCubeViewport using the new scale value...
Definition: ZoomTool.cpp:625
void zoomIn4X()
Zooms in 4 times.
Definition: ZoomTool.cpp:278
QAction * p_zoomIn2X
Zoom in 2 times.
Definition: ZoomTool.h:113