Isis Developer Reference
MosaicTool.h
Go to the documentation of this file.
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:
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.
Definition MosaicSceneWidget.h:153
Base class for the MosaicTools.
Definition MosaicTool.h:37
MosaicTool(MosaicSceneWidget *)
Definition MosaicTool.cpp:16
MosaicSceneWidget * getWidget()
Definition MosaicTool.h:96
virtual void mouseMove(QPointF)
Definition MosaicTool.cpp:122
virtual void mouseEnter()
Definition MosaicTool.h:81
virtual QString projectPvlObjectName() const
Definition MosaicTool.cpp:110
QPixmap getIcon(QString iconName) const
returns the path to the icon directory.
Definition MosaicTool.cpp:115
virtual void addTo(QMenu *menu)
Definition MosaicTool.h:63
virtual QAction * getPrimaryAction()=0
This method returns an action that is used to activate this tool.
virtual QList< QAction * > getViewActions()
Definition MosaicTool.cpp:84
~MosaicTool()
Definition MosaicTool.cpp:43
virtual void mouseButtonRelease(QPointF, Qt::MouseButton s)
Definition MosaicTool.cpp:134
virtual void updateTool()
Definition MosaicTool.h:80
void toolBarDestroyed(QObject *obj)
Definition MosaicTool.cpp:165
virtual void rubberBandComplete(QRectF r, Qt::MouseButton s)
Definition MosaicTool.h:88
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.
Definition MosaicTool.cpp:192
void activate(bool)
Activates the tool.
Definition MosaicTool.cpp:148
virtual PvlObject toPvl() const
Definition MosaicTool.cpp:89
virtual void mouseDoubleClick(QPointF)
Definition MosaicTool.cpp:126
virtual void mouseButtonPress(QPointF, Qt::MouseButton s)
Definition MosaicTool.cpp:130
virtual void fromPvl(const PvlObject &obj)
Definition MosaicTool.cpp:101
virtual void mouseWheel(QPointF, int delta)
Definition MosaicTool.cpp:139
void activated(bool)
virtual void mouseLeave()
Definition MosaicTool.h:83
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
Definition ToolPad.h:14
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16