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 
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 
FileName.h
QWidget
Isis::MosaicTool::toPvl
virtual PvlObject toPvl() const
Definition: MosaicTool.cpp:89
Isis::MosaicTool::addTo
virtual void addTo(QMenu *menu)
Definition: MosaicTool.h:63
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::MosaicTool::getIcon
QPixmap getIcon(QString iconName) const
returns the path to the icon directory.
Definition: MosaicTool.cpp:115
MosaicSceneWidget.h
QList< QAction * >
Isis::MosaicTool::projectPvlObjectName
virtual QString projectPvlObjectName() const
Definition: MosaicTool.cpp:110
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::MosaicTool::updateTool
virtual void updateTool()
Definition: MosaicTool.h:80
QMenu
Isis::MosaicTool::getWidget
MosaicSceneWidget * getWidget()
Definition: MosaicTool.h:96
Isis::MosaicTool::mouseDoubleClick
virtual void mouseDoubleClick(QPointF)
Definition: MosaicTool.cpp:126
Isis::MosaicSceneWidget
This widget encompasses the entire mosaic scene.
Definition: MosaicSceneWidget.h:153
Isis::MosaicTool::getToolBarWidget
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
Isis::MosaicTool::rubberBandComplete
virtual void rubberBandComplete(QRectF r, Qt::MouseButton s)
Definition: MosaicTool.h:88
ToolPad.h
Isis::MosaicTool::fromPvl
virtual void fromPvl(const PvlObject &obj)
Definition: MosaicTool.cpp:101
Isis::MosaicTool
Base class for the MosaicTools.
Definition: MosaicTool.h:37
QToolBar
Isis::MosaicTool::activate
void activate(bool)
Activates the tool.
Definition: MosaicTool.cpp:148
IString.h
QGraphicsView
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::MosaicTool::getPrimaryAction
virtual QAction * getPrimaryAction()=0
This method returns an action that is used to activate this tool.
Isis::MosaicTool::activated
void activated(bool)
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::MosaicTool::~MosaicTool
~MosaicTool()
Definition: MosaicTool.cpp:43
Isis::MosaicTool::toolBarDestroyed
void toolBarDestroyed(QObject *obj)
Definition: MosaicTool.cpp:165
Isis::ToolPad
Definition: ToolPad.h:14
Isis::MosaicTool::getViewActions
virtual QList< QAction * > getViewActions()
Definition: MosaicTool.cpp:84
Isis::MosaicTool::isActive
bool isActive() const
Returns the activeness of this toool.
Definition: MosaicTool.h:50
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::MosaicTool::mouseLeave
virtual void mouseLeave()
Definition: MosaicTool.h:83
Isis::ToolPad::addAction
void addAction(QAction *action)
Adds an action to the action group and tool bar.
Definition: ToolPad.h:38
Isis::MosaicTool::mouseButtonPress
virtual void mouseButtonPress(QPointF, Qt::MouseButton s)
Definition: MosaicTool.cpp:130
Isis::MosaicTool::MosaicTool
MosaicTool(MosaicSceneWidget *)
Definition: MosaicTool.cpp:16
Isis::MosaicTool::mouseWheel
virtual void mouseWheel(QPointF, int delta)
Definition: MosaicTool.cpp:139
PvlObject.h
QObject
MosaicTool.h
Isis::MosaicTool::mouseEnter
virtual void mouseEnter()
Definition: MosaicTool.h:81
QAction
Isis::MosaicTool::mouseButtonRelease
virtual void mouseButtonRelease(QPointF, Qt::MouseButton s)
Definition: MosaicTool.cpp:134
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::MosaicTool::mouseMove
virtual void mouseMove(QPointF)
Definition: MosaicTool.cpp:122