USGS

Isis 3.0 Object Programmers' Reference

Home

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