Isis Developer Reference
PanTool.h
Go to the documentation of this file.
1 #ifndef PanTool_h
2 #define PanTool_h
3 
4 #include "Tool.h"
5 
6 
7 class QComboBox;
8 class QLineEdit;
9 
10 namespace Isis {
18  class PanTool : public Tool {
19  Q_OBJECT
20 
21  public:
22  PanTool(QWidget *parent);
23  void addTo(QMenu *);
24 
25  QString menuName() const {
26  return "&View";
27  }
28 
29  protected:
31  QWidget *createToolBarWidget(QStackedWidget *parent);
32 
33  protected slots:
34  void mouseButtonPress(QPoint p, Qt::MouseButton s);
35  void mouseMove(QPoint p);
36  void mouseButtonRelease(QPoint p, Qt::MouseButton s);
37 
38  private slots:
39  void panRight() {
40  pan(panRate(true), 0);
41  };
42  void panLeft() {
43  pan(-panRate(true), 0);
44  };
45  void panUp() {
46  pan(0, -panRate(false));
47  };
48  void panDown() {
49  pan(0, panRate(false));
50  };
51  void setCustom();
52  void updateLineEdit();
53  void writeSettings();
54  void readSettings();
55 
56  private:
57  void pan(int x, int y);
58  int panRate(bool horz);
59 
60  QAction *p_panRight;
61  QAction *p_panLeft;
62  QAction *p_panUp;
63  QAction *p_panDown;
64 
65  QComboBox *p_panRateBox;
66  QLineEdit *p_lineEdit;
67 
68  bool p_dragPan;
69  QPoint p_lastPoint;
70  };
71 };
72 
73 #endif
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
MdiCubeViewport.h
Isis::PanTool::menuName
QString menuName() const
Anytime a tool is created, you must give it a name for the menu.
Definition: PanTool.h:25
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
Isis::PanTool::mouseMove
void mouseMove(QPoint p)
Definition: PanTool.cpp:216
MainWindow.h
Isis::CubeViewport::center
void center(int x, int y)
Bring the cube pixel under viewport x/y to the center.
Definition: CubeViewport.cpp:730
QMenu
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::PanTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Anytime a tool is created, you must setup a tool pad action with it.
Definition: PanTool.cpp:48
Isis::PanTool::mouseButtonRelease
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Definition: PanTool.cpp:224
Tool.h
Isis::PanTool::addTo
void addTo(QMenu *)
Definition: PanTool.cpp:60
ToolPad.h
IString.h
QComboBox
Isis::PanTool
Definition: PanTool.h:18
Isis::MdiCubeViewport::isLinked
bool isLinked() const
Is the viewport linked with other viewports.
Definition: MdiCubeViewport.h:50
Isis::PanTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *parent)
Anytime a tool is created, you must add it to the tool bar.
Definition: PanTool.cpp:67
Isis::ToolPad
Definition: ToolPad.h:14
Isis::PanTool::mouseButtonPress
void mouseButtonPress(QPoint p, Qt::MouseButton s)
Definition: PanTool.cpp:209
Isis::CubeViewport::viewportToCube
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
Isis::PanTool::PanTool
PanTool(QWidget *parent)
Definition: PanTool.cpp:20
PanTool.h
QAction
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16