Isis 3 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 
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 
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 
virtual void mouseLeave()
Definition: MosaicTool.h:83
virtual void mouseDoubleClick(QPointF)
Definition: MosaicTool.cpp:126
This widget encompasses the entire mosaic scene.
Definition: MosaicSceneWidget.h:153
virtual void mouseButtonPress(QPointF, Qt::MouseButton s)
Definition: MosaicTool.cpp:130
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 activated(bool)
virtual void addTo(QMenu *menu)
Definition: MosaicTool.h:63
virtual QList< QAction * > getViewActions()
Definition: MosaicTool.cpp:84
~MosaicTool()
Definition: MosaicTool.cpp:43
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 void fromPvl(const PvlObject &obj)
Definition: MosaicTool.cpp:101
MosaicTool(MosaicSceneWidget *)
Definition: MosaicTool.cpp:16
MosaicSceneWidget * getWidget()
Definition: MosaicTool.h:96
void toolBarDestroyed(QObject *obj)
Definition: MosaicTool.cpp:165
virtual PvlObject toPvl() const
Definition: MosaicTool.cpp:89
virtual void mouseMove(QPointF)
Definition: MosaicTool.cpp:122
void activate(bool)
Activates the tool.
Definition: MosaicTool.cpp:148
virtual void mouseButtonRelease(QPointF, Qt::MouseButton s)
Definition: MosaicTool.cpp:134
QPixmap getIcon(QString iconName) const
returns the path to the icon directory.
Definition: MosaicTool.cpp:115
virtual QString projectPvlObjectName() const
Definition: MosaicTool.cpp:110
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
virtual void mouseEnter()
Definition: MosaicTool.h:81
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
virtual void mouseWheel(QPointF, int delta)
Definition: MosaicTool.cpp:139
virtual void updateTool()
Definition: MosaicTool.h:80
Definition: ToolPad.h:14
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