Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
Tool.h
1#ifndef Tool_h
2#define Tool_h
3
9
10/* SPDX-License-Identifier: CC0-1.0 */
11
12
13#include <QObject>
14
15#include <QDebug>
16#include <QPoint>
17
18class QAction;
19class QMenu;
20class QPainter;
21//class QPoint;
22class QStackedWidget;
23class QToolBar;
24
25
26namespace Isis {
27 class CubeViewport;
28 class MdiCubeViewport;
29 class RubberBandTool;
30 class ToolList;
31 class ToolPad;
33 class Workspace;
34
64
65 class Tool : public QObject {
66 Q_OBJECT
67
68 public:
69 Tool(QWidget *parent);
70
71 void addTo(ViewportMainWindow *mw);
72
73 void addTo(ToolPad *toolpad);
74
81 virtual QString menuName() const {
82 return "";
83 }
84
85
89 virtual void addTo(QMenu *menu) {};
90
91
95 virtual void addToPermanent(QToolBar *toolbar) {};
96
97 void addToActive(QToolBar *toolbar);
98
102 virtual void addTo(Workspace *ws);
103
104
111 QString toolIconDir() const {
112 return m_toolIconDir;
113 };
114
115
120 virtual void paintViewport(MdiCubeViewport *vp, QPainter *painter) {}
121
122 RubberBandTool *rubberBandTool();
123 void setList(ToolList *currentList);
124
125 public slots:
126 void activate(bool);
127 virtual void updateTool();
129
130
131 signals:
132 void clearWarningSignal();
133 void toolActivated();
134
135 protected slots:
136
139 virtual void rubberBandComplete() { }
140
141
146 virtual void screenPixelsChanged() {}
147
150 virtual void mouseEnter() {}
151
152 virtual void mouseMove(QPoint p);
153 virtual void mouseMove(QPoint p, Qt::MouseButton) {}
154
157 virtual void mouseLeave() {};
158
159 virtual void mouseDoubleClick(QPoint p);
160 virtual void mouseButtonPress(QPoint p, Qt::MouseButton s);
161 virtual void mouseButtonRelease(QPoint p, Qt::MouseButton s);
162
165 virtual void updateMeasure() {}
166
167
170 virtual void scaleChanged() {}
171
172
175 virtual void stretchRequested(MdiCubeViewport *, int) {}
176
177
181 void registerTool(MdiCubeViewport *viewport);
182
183
184 signals:
187 void viewportChanged();
188
189 protected:
196 return m_cvp;
197 }
198
199
204
206
207
215 virtual QAction *toolPadAction(ToolPad *toolpad) {
216 return NULL;
217 }
218
219
227 virtual QWidget *createToolBarWidget(QStackedWidget *parent) {
228 return NULL;
229 }
230
231
237 virtual void addConnections(MdiCubeViewport *cvp) {}
238
239
245 virtual void removeConnections(MdiCubeViewport *cvp) {}
246
247
249 virtual void enableRubberBandTool();
250
251 Workspace *workspace();
252
253 private:
256 void enableToolBar();
257 void disableToolBar();
258
260 Workspace *m_workspace;
261
262 bool m_active;
266 ToolList *m_toolList;
267 };
268}
269
270#endif
Widget to display Isis cubes for qt apps.
Cube display widget for certain Isis MDI applications.
Rubber banding tool.
virtual void removeConnections(MdiCubeViewport *cvp)
Anytime a tool is created, you must be able to remove it's connections.
Definition Tool.h:245
Tool(QWidget *parent)
Tool constructor.
Definition Tool.cpp:27
virtual QAction * toolPadAction(ToolPad *toolpad)
Anytime a tool is created, you must setup a tool pad action with it.
Definition Tool.h:215
QString m_toolIconDir
The pathway to the icon directory.
Definition Tool.h:265
void addTo(ViewportMainWindow *mw)
Adds the tool to the application.
Definition Tool.cpp:78
void removeViewportConnections()
Removes all the connections from the tool.
Definition Tool.cpp:238
QWidget * m_toolBarWidget
The tool bar on which this tool resides.
Definition Tool.h:263
virtual void enableRubberBandTool()
Anytime a tool is created, you may use the rubber band tool.
Definition Tool.cpp:339
virtual void addTo(QMenu *menu)
Definition Tool.h:89
QAction * m_toolPadAction
The tool pad on which this tool resides.
Definition Tool.h:264
virtual void screenPixelsChanged()
This is called when actions change which pixels from the cube are displayed.
Definition Tool.h:146
virtual QString menuName() const
Anytime a tool is created, you must give it a name for the menu.
Definition Tool.h:81
QVector< MdiCubeViewport * > CubeViewportList
A list of cubeviewports.
Definition Tool.h:203
MdiCubeViewport * m_cvp
current cubeviewport
Definition Tool.h:259
virtual void updateTool()
Updates the tool.
Definition Tool.cpp:318
virtual void mouseDoubleClick(QPoint p)
Definition Tool.cpp:358
void disableToolBar()
Disables entire tool bar.
Definition Tool.cpp:285
virtual QWidget * createToolBarWidget(QStackedWidget *parent)
Anytime a tool is created, you must add it to the tool bar.
Definition Tool.h:227
void addViewportConnections()
Makes all the connections for the tool.
Definition Tool.cpp:187
virtual void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Resets the Warning to Nowarning when a different activity occurs on the application.
Definition Tool.cpp:380
void activate(bool)
Activates the tool.
Definition Tool.cpp:131
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition Tool.cpp:390
virtual void mouseMove(QPoint p)
Definition Tool.cpp:352
void setCubeViewport(MdiCubeViewport *cvp)
Sets the current viewport to the given cvp.
Definition Tool.cpp:160
void enableToolBar()
Enables entire tool bar.
Definition Tool.cpp:297
virtual void addConnections(MdiCubeViewport *cvp)
Anytime a tool is created, you must add the connections for it.
Definition Tool.h:237
virtual void paintViewport(MdiCubeViewport *vp, QPainter *painter)
Definition Tool.h:120
virtual void addToPermanent(QToolBar *toolbar)
Definition Tool.h:95
void addToActive(QToolBar *toolbar)
Definition Tool.cpp:112
void registerTool(MdiCubeViewport *viewport)
Registers the tool to the viewport.
Definition Tool.cpp:327
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition Tool.h:195
virtual void mouseButtonPress(QPoint p, Qt::MouseButton s)
Definition Tool.cpp:367
QString toolIconDir() const
returns the path to the icon directory.
Definition Tool.h:111
bool m_active
Is the tool acitve?
Definition Tool.h:262
Allows tools to share data between each other.
Definition ToolList.h:32
This was called the Qisis MainWindow.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16