Isis 3 Programmer Reference
MosaicPanTool.cpp
1 #include "MosaicPanTool.h"
2 
3 #include <iostream>
4 
5 #include <QAction>
6 #include <QMenu>
7 
8 #include "IString.h"
9 #include "MosaicGraphicsView.h"
10 #include "MosaicSceneWidget.h"
11 
12 namespace Isis {
20  }
21 
22 
32  QAction *action = new QAction(this);
33  action->setIcon(getIcon("move.png"));
34  //action->setIcon(QPixmap("/work1/salley/icons/mActionMoveVertex.png"));
35  action->setToolTip("Pan (p)");
36  action->setShortcut(Qt::Key_P);
37  QString text =
38  "<b>Function:</b> Pan around the current mosaic.<br><br>"
39  "This tool gives you a <b>click and drag</b> to pan around the mosaic "
40  "scene."
41  "<p><b>Shortcut:</b> p</p> ";
42  action->setWhatsThis(text);
43  return action;
44  }
45 
46 
56  QWidget *widget = new QWidget();
57  return widget;
58  }
59 
60 
65  void MosaicPanTool::updateTool() {
66  if(isActive()) {
67  getWidget()->setCubesSelectable(false);
68  getWidget()->getView()->setDragMode(QGraphicsView::ScrollHandDrag);
69  }
70  else {
71  getWidget()->setCubesSelectable(true);
72  getWidget()->getView()->setDragMode(QGraphicsView::RubberBandDrag);
73  }
74  }
75 
76 }
77 
This widget encompasses the entire mosaic scene.
Base class for the MosaicTools.
Definition: MosaicTool.h:37
bool isActive() const
Returns the activeness of this toool.
Definition: MosaicTool.h:50
QAction * getPrimaryAction()
Adds the action to the toolpad.
QPixmap getIcon(QString iconName) const
returns the path to the icon directory.
Definition: MosaicTool.cpp:115
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
MosaicPanTool(MosaicSceneWidget *)
MosaicPanTool constructor.
QWidget * createToolBarWidget()
Creates the widget to add to the tool bar.