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 
Isis::MosaicPanTool::getPrimaryAction
QAction * getPrimaryAction()
Adds the action to the toolpad.
Definition: MosaicPanTool.cpp:31
Isis::MosaicPanTool::MosaicPanTool
MosaicPanTool(MosaicSceneWidget *)
MosaicPanTool constructor.
Definition: MosaicPanTool.cpp:19
QWidget
Isis::MosaicTool::getIcon
QPixmap getIcon(QString iconName) const
returns the path to the icon directory.
Definition: MosaicTool.cpp:115
Isis::MosaicSceneWidget
This widget encompasses the entire mosaic scene.
Definition: MosaicSceneWidget.h:153
Isis::MosaicPanTool::createToolBarWidget
QWidget * createToolBarWidget()
Creates the widget to add to the tool bar.
Definition: MosaicPanTool.cpp:55
Isis::MosaicTool
Base class for the MosaicTools.
Definition: MosaicTool.h:37
Isis::MosaicTool::isActive
bool isActive() const
Returns the activeness of this toool.
Definition: MosaicTool.h:50
QAction
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16