Isis 3 Programmer Reference
MosaicTool.h
1 #ifndef MosaicTool_h
2 #define MosaicTool_h
3 
4 #include <QObject>
5 
6 // required since it's in a slot
7 #include <QPointF>
8 #include <QRectF>
9 
10 class QAction;
11 class QGraphicsView;
12 class QMenu;
13 class QPixmap;
14 class QPoint;
15 class QString;
16 class QToolBar;
17 
18 namespace Isis {
19  class MosaicSceneWidget;
20  class PvlObject;
21  class ToolPad;
22 
37  class MosaicTool : public QObject {
38  Q_OBJECT
39 
40  public:
42  ~MosaicTool();
43 
50  bool isActive() const {
51  return p_active;
52  };
53 
54 
61  QPixmap getIcon(QString iconName) const;
62 
63  virtual void addTo(QMenu *menu) {}
64  virtual void addTo(ToolPad *toolPad);
65  virtual void addTo(QToolBar *toolBar);
66 
67  virtual QList<QAction *> getViewActions();
68 
69  virtual PvlObject toPvl() const;
70  virtual void fromPvl(const PvlObject &obj);
71  virtual QString projectPvlObjectName() const;
72 
73  signals:
74  void activated(bool);
75 
76  public slots:
77  void activate(bool);
78 
79  protected slots:
80  virtual void updateTool() {};
81  virtual void mouseEnter() {};
82  virtual void mouseMove(QPointF);
83  virtual void mouseLeave() {};
84  virtual void mouseDoubleClick(QPointF);
85  virtual void mouseButtonPress(QPointF, Qt::MouseButton s);
86  virtual void mouseButtonRelease(QPointF, Qt::MouseButton s);
87  virtual void mouseWheel(QPointF, int delta);
88  virtual void rubberBandComplete(QRectF r, Qt::MouseButton s) {};
89 
90  void toolBarDestroyed(QObject *obj);
91 
92  signals:
93 
94 
95  protected:
96  MosaicSceneWidget *getWidget() {
97  return p_widget;
98  }
99 
106  virtual QAction *getPrimaryAction() = 0;
107 
115  virtual QWidget *getToolBarWidget();
116 
117  private:
118  void enableToolBar();
119  void disableToolBar();
120  bool p_active;
121 
122  MosaicSceneWidget *p_widget;
123 
124  QAction *p_primaryAction;
125  QAction *p_toolBarAction;
126  };
127 };
128 
129 #endif
130 
This widget encompasses the entire mosaic scene.
virtual QAction * getPrimaryAction()=0
This method returns an action that is used to activate this tool.
Base class for the MosaicTools.
Definition: MosaicTool.h:37
void enableToolBar()
Enables entire tool bar.
Definition: MosaicTool.cpp:185
void disableToolBar()
Disables entire tool bar.
Definition: MosaicTool.cpp:174
bool isActive() const
Returns the activeness of this toool.
Definition: MosaicTool.h:50
void activate(bool)
Activates the tool.
Definition: MosaicTool.cpp:148
bool p_active
Is the tool active?
Definition: MosaicTool.h:120
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
virtual QWidget * getToolBarWidget()
This method returns a widget that will be put in a tool bar when the tool is activated.
Definition: MosaicTool.cpp:192