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
10class QAction;
11class QGraphicsView;
12class QMenu;
13class QPixmap;
14class QPoint;
15class QString;
16class QToolBar;
17
18namespace Isis {
19 class MosaicSceneWidget;
20 class PvlObject;
21 class ToolPad;
22
37 class MosaicTool : public QObject {
38 Q_OBJECT
39
40 public:
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.
Base class for the MosaicTools.
Definition MosaicTool.h:37
QPixmap getIcon(QString iconName) const
returns the path to the icon directory.
bool p_active
Is the tool active?
Definition MosaicTool.h:120
virtual QAction * getPrimaryAction()=0
This method returns an action that is used to activate this tool.
void enableToolBar()
Enables entire tool bar.
void disableToolBar()
Disables entire tool bar.
bool isActive() const
Returns the activeness of this toool.
Definition MosaicTool.h:50
virtual QWidget * getToolBarWidget()
This method returns a widget that will be put in a tool bar when the tool is activated.
void activate(bool)
Activates the tool.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16