Isis 3 Programmer Reference
ZoomTool.h
1 #ifndef ZoomTool_h
2 #define ZoomTool_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 
13 
14 // This should be the only include in this file!
15 #include "Tool.h"
16 
17 // FIXME: remove this include
18 #include <QCursor>
19 
20 class QAction;
21 class QLineEdit;
22 
23 namespace Isis {
56  class ZoomTool : public Tool {
57  Q_OBJECT
58 
59  public:
60  ZoomTool(QWidget *parent);
61  void addTo(QMenu *menu);
62 
66  QString menuName() const {
67  return "&View";
68  }
69 
70  protected slots:
71  void rubberBandComplete();
72 
73  protected:
74  QAction *toolPadAction(ToolPad *toolpad);
75  void updateTool();
76  QWidget *createToolBarWidget(QStackedWidget *parent);
77  void enableRubberBandTool();
78 
79  private slots:
80  void zoomIn2X();
81  void zoomIn4X();
82  void zoomIn8X();
83 
84  void zoomOut2X();
85  void zoomOut4X();
86  void zoomOut8X();
87 
88  void zoomActual();
89  void zoomFit();
90  void zoomFitWidth();
91  void zoomFitHeight();
92  void zoomManual();
93 
94 
95  double setScale(MdiCubeViewport *d, double newScale);
96  double setScale(MdiCubeViewport *d, double newScale, int x, int y);
97  double setScale(MdiCubeViewport *d, double newScale, double samp, double line);
98 
99  private:
100  void zoomBy(double factor);
101 
105 
109 
112 
113  QLineEdit *p_zoomLineEdit;
114  double p_lastScale;
115  };
116 };
117 
118 #endif
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::ZoomTool::enableRubberBandTool
void enableRubberBandTool()
This methods enables the RubberBandTool, it also sets the RubberBandTool to allow points and to allow...
Definition: ZoomTool.cpp:590
Isis::ZoomTool::p_zoomIn4X
QAction * p_zoomIn4X
Zoom in 4 times.
Definition: ZoomTool.h:103
Isis::ZoomTool::zoomFitWidth
void zoomFitWidth()
Slot for the "Fit to Width" menu item on the Fit button.
Definition: ZoomTool.cpp:394
Isis::ZoomTool::p_zoomOut2X
QAction * p_zoomOut2X
Zoom out 2 times.
Definition: ZoomTool.h:106
Isis::ZoomTool::zoomActual
void zoomActual()
Zoom back to 1 to 1.
Definition: ZoomTool.cpp:312
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
QMenu
Isis::ZoomTool::p_zoomIn2X
QAction * p_zoomIn2X
Zoom in 2 times.
Definition: ZoomTool.h:102
Isis::ZoomTool::p_zoomOut4X
QAction * p_zoomOut4X
Zoom out 4 times.
Definition: ZoomTool.h:107
Isis::ZoomTool::addTo
void addTo(QMenu *menu)
Adds the zoom action to the given menu.
Definition: ZoomTool.cpp:117
Isis::ZoomTool::updateTool
void updateTool()
This method updates the line edits text to the correct zoom value.
Definition: ZoomTool.cpp:471
Isis::ZoomTool::zoomBy
void zoomBy(double factor)
Zoom by the given factor.
Definition: ZoomTool.cpp:330
Isis::ZoomTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
Definition: ZoomTool.cpp:143
Isis::ZoomTool::zoomOut8X
void zoomOut8X()
Zoom out 8 times.
Definition: ZoomTool.cpp:303
Isis::ZoomTool::toolPadAction
QAction * toolPadAction(ToolPad *toolpad)
Adds the action to the toolpad.
Definition: ZoomTool.cpp:96
Isis::ZoomTool::zoomManual
void zoomManual()
This method zooms by the value input in the line edit next to the zoom tools.
Definition: ZoomTool.cpp:447
Isis::ZoomTool::zoomIn4X
void zoomIn4X()
Zooms in 4 times.
Definition: ZoomTool.cpp:267
Isis::ZoomTool::zoomFitHeight
void zoomFitHeight()
Slot for the "Fit to Heighth" menu item on the Fit button.
Definition: ZoomTool.cpp:420
Isis::ZoomTool::zoomFit
void zoomFit()
Fits the cube in the viewport.
Definition: ZoomTool.cpp:368
Isis::ZoomTool::p_zoomIn8X
QAction * p_zoomIn8X
Zoom in 8 times.
Definition: ZoomTool.h:104
Isis::ZoomTool::p_zoomActual
QAction * p_zoomActual
Zoom to actual size action.
Definition: ZoomTool.h:110
Isis::ZoomTool::setScale
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:614
Isis::ZoomTool::p_lastScale
double p_lastScale
Last scale.
Definition: ZoomTool.h:114
Isis::ZoomTool
Handles zoom operations for Isis qt apps.
Definition: ZoomTool.h:56
Isis::ZoomTool::p_zoomLineEdit
QLineEdit * p_zoomLineEdit
Line edit for manual zoom factor.
Definition: ZoomTool.h:113
Isis::ZoomTool::zoomOut2X
void zoomOut2X()
Zoom out 2 times.
Definition: ZoomTool.cpp:285
Isis::ToolPad
Definition: ToolPad.h:14
Isis::ZoomTool::menuName
QString menuName() const
Definition: ZoomTool.h:66
Isis::ZoomTool::zoomIn2X
void zoomIn2X()
Zooms in 2 times.
Definition: ZoomTool.cpp:258
Isis::ZoomTool::ZoomTool
ZoomTool(QWidget *parent)
ZoomTool constructor.
Definition: ZoomTool.cpp:40
Isis::ZoomTool::p_zoomOut8X
QAction * p_zoomOut8X
Zoom out 8 times.
Definition: ZoomTool.h:108
Isis::ZoomTool::zoomIn8X
void zoomIn8X()
Zooms in 8 times.
Definition: ZoomTool.cpp:276
Isis::ZoomTool::p_zoomFit
QAction * p_zoomFit
Fit the cube in the viewport action.
Definition: ZoomTool.h:111
QAction
Isis::ZoomTool::rubberBandComplete
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
Definition: ZoomTool.cpp:496
Isis::ZoomTool::zoomOut4X
void zoomOut4X()
Zoom out 4 times.
Definition: ZoomTool.cpp:294
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16