Isis Developer Reference
ZoomTool.h
Go to the documentation of this file.
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 
102  QAction *p_zoomIn2X;
103  QAction *p_zoomIn4X;
104  QAction *p_zoomIn8X;
105 
106  QAction *p_zoomOut2X;
107  QAction *p_zoomOut4X;
108  QAction *p_zoomOut8X;
109 
110  QAction *p_zoomActual;
111  QAction *p_zoomFit;
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
MdiCubeViewport.h
Isis::RubberBandTool::setDrawActiveViewportOnly
void setDrawActiveViewportOnly(bool activeOnly=false)
This called to set whether rubber band is drawn on active viewport only rather than all linked viewpo...
Definition: RubberBandTool.cpp:333
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::RubberBandTool::RectangleMode
@ RectangleMode
Definition: RubberBandTool.h:62
Isis::Tool::cubeViewportList
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
MainWindow.h
QMenu
Isis::CubeViewport::setScale
void setScale(double scale)
Change the scale of the cube to the given parameter value.
Definition: CubeViewport.cpp:588
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
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::RubberBandTool::enable
void enable(RubberBandMode mode, bool showIndicatorColors=false)
This is called when changing modes or turning on.
Definition: RubberBandTool.cpp:302
Isis::Tool::rubberBandTool
RubberBandTool * rubberBandTool()
Definition: Tool.cpp:57
Tool.h
ToolPad.h
Isis::ZoomTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Creates the widget to add to the tool bar.
Definition: ZoomTool.cpp:143
Isis::ZoomTool::toolPadAction
QAction * toolPadAction(ToolPad *toolpad)
Adds the action to the toolpad.
Definition: ZoomTool.cpp:96
Isis::RubberBandTool::mouseButton
Qt::MouseButton mouseButton()
This method returns the mouse button modifier.
Definition: RubberBandTool.cpp:1012
IString.h
Isis::RubberBandTool::enablePoints
void enablePoints(unsigned int pixTolerance=2)
Definition: RubberBandTool.cpp:1117
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::RubberBandTool::enableAllClicks
void enableAllClicks()
Definition: RubberBandTool.cpp:1171
Isis::MdiCubeViewport::isLinked
bool isLinked() const
Is the viewport linked with other viewports.
Definition: MdiCubeViewport.h:50
Workspace.h
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ZoomTool
Handles zoom operations for Isis qt apps.
Definition: ZoomTool.h:56
Isis::ToolPad
Definition: ToolPad.h:14
IException.h
Isis::ZoomTool::menuName
QString menuName() const
Definition: ZoomTool.h:66
RubberBandTool.h
Isis::ZoomTool::ZoomTool
ZoomTool(QWidget *parent)
ZoomTool constructor.
Definition: ZoomTool.cpp:40
Isis::CubeViewport::scale
double scale() const
Definition: CubeViewport.h:214
QAction
ZoomTool.h
Isis::RubberBandTool::rectangle
QRect rectangle()
This method returns a rectangle from the vertices set by the RubberBandTool.
Definition: RubberBandTool.cpp:966
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis::ZoomTool::rubberBandComplete
void rubberBandComplete()
This method is called when the RubberBandTool is complete.
Definition: ZoomTool.cpp:496
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::RubberBandTool::vertices
QList< QPoint > vertices()
This method returns the vertices.
Definition: RubberBandTool.cpp:672