Isis 3 Programmer Reference
EditTool.h
1#ifndef EditTool_h
2#define EditTool_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include "Tool.h"
13
14
15#include <QMap>
16#include <QStack>
17
18
19class QToolButton;
20class QLine;
21class QLineEdit;
22class QComboBox;
23
24namespace Isis {
25 class Brick;
26 class Cube;
27 class MdiCubeViewport;
28
70 class EditTool : public Tool {
71 Q_OBJECT
72
73 public:
84
85
97
98 EditTool(QWidget *parent);
99
100 void addTo(Workspace *);
101
102 signals:
103 void cubeChanged(bool);
104 void save();
105 void saveAs();
106
107 protected:
109 QWidget *createToolBarWidget(QStackedWidget *active);
110 void updateTool();
111
112 protected slots:
113 void mouseButtonRelease(QPoint p, Qt::MouseButton m);
114 virtual void enableRubberBandTool();
115 void rubberBandComplete();
116
117 private slots:
118 void listenToViewport(MdiCubeViewport *);
119 void selectValType(int index);
120 void changeDn();
121 void undoEdit();
122 void undoAll(CubeViewport *vp);
123 void redoEdit();
124 void save(CubeViewport *vp);
125 void removeViewport(QObject *vp);
126
127 private:
128 QList<QPoint *> *LineToPoints(const QLine &line);
129 void writeToCube(int iesamp, int issamp, int ieline, int isline, QList<QPoint *> *linePts);
132 QLineEdit *p_dnLineEdit;
133 QToolButton *p_undoButton;
134 QToolButton *p_redoButton;
135 QToolButton *p_saveButton;
136 QToolButton *p_saveAsButton;
137QWidget *m_container;
138 double p_dn;
139
140 QMap <CubeViewport *, QStack <Brick *> *> p_undoEdit;
141 QMap <CubeViewport *, QStack <Brick *> *> p_redoEdit;
142 QMap <CubeViewport *, int> p_saveMarker;
143 };
144};
145
146#endif
Widget to display Isis cubes for qt apps.
Interactive image edit tool.
Definition EditTool.h:70
void mouseButtonRelease(QPoint p, Qt::MouseButton m)
This is a slot called when any mouse button is released inside of a viewport.
Definition EditTool.cpp:397
QToolButton * p_redoButton
Redo button.
Definition EditTool.h:134
EditTool(QWidget *parent)
Constructs and EditTool object.
Definition EditTool.cpp:41
void redoEdit()
This method is called to redo any edit operations that have been undone.
Definition EditTool.cpp:703
EditShape
Enum for possible shapes.
Definition EditTool.h:77
@ StartEndLine
start-end line
Definition EditTool.h:81
@ HorizLine
horizontal line
Definition EditTool.h:79
@ Rectangle
rectangle
Definition EditTool.h:82
@ VertLine
vertical line
Definition EditTool.h:80
@ Point
point
Definition EditTool.h:78
QToolButton * p_saveAsButton
Save as button.
Definition EditTool.h:136
void changeDn()
This is a private slot called when the user hits the enter key after typing a value in the dnLineEdit...
Definition EditTool.cpp:217
void save()
Emitted when cube should be saved.
ReplacementValue
Enum for DN values.
Definition EditTool.h:89
@ HrsComboValue
High representation saturation DN value.
Definition EditTool.h:92
@ UserDnComboValue
User Selected DN value.
Definition EditTool.h:90
@ HisComboValue
High instrument saturation DN value.
Definition EditTool.h:94
@ NullComboValue
Null DN value.
Definition EditTool.h:91
@ LrsComboValue
Low representation saturation DN value.
Definition EditTool.h:93
@ LisComboValue
Low instrument satruation DN value.
Definition EditTool.h:95
void selectValType(int index)
This is a private slot which is called when the user selects a new dn type.
Definition EditTool.cpp:197
void rubberBandComplete()
This method is called any time the RubberBandTool is complete.
Definition EditTool.cpp:263
QLineEdit * p_dnLineEdit
DN edit line.
Definition EditTool.h:132
void cubeChanged(bool)
Emitted when cube changed.
QList< QPoint * > * LineToPoints(const QLine &line)
Convert rubber band line to points.
Definition EditTool.cpp:842
double p_dn
DN value.
Definition EditTool.h:138
QComboBox * p_shapeComboBox
Shape combobox.
Definition EditTool.h:130
QWidget * createToolBarWidget(QStackedWidget *active)
Creates the toolbar containing the edit tool widgets.
Definition EditTool.cpp:84
QComboBox * p_valTypeComboBox
Value type combobox.
Definition EditTool.h:131
void undoEdit()
This is a private slot called when the user selects the undo button.
Definition EditTool.cpp:568
void writeToCube(int iesamp, int issamp, int ieline, int isline, QList< QPoint * > *linePts)
Definition EditTool.cpp:485
QMap< CubeViewport *, QStack< Brick * > * > p_redoEdit
Viewport to brick map for redo.
Definition EditTool.h:141
QToolButton * p_undoButton
Undo button.
Definition EditTool.h:133
virtual void enableRubberBandTool()
This method sets up the RubberBandTool depending on which mode is enabled.
Definition EditTool.cpp:926
QMap< CubeViewport *, QStack< Brick * > * > p_undoEdit
Viewport to brick map for undo.
Definition EditTool.h:140
void addTo(Workspace *)
Adds the given workspace to the cubeviewport list.
Definition EditTool.cpp:45
QAction * toolPadAction(ToolPad *pad)
Adds the EditTool to the tool pad.
Definition EditTool.cpp:59
void updateTool()
This is a virtual function belonging to the Tool class which is called when the user selects a differ...
Definition EditTool.cpp:229
void saveAs()
Emitted when cube should be saved as another file.
QToolButton * p_saveButton
Save button.
Definition EditTool.h:135
void undoAll(CubeViewport *vp)
This method is used to discard any changes made to this viewport.
Definition EditTool.cpp:644
void removeViewport(QObject *vp)
This is a private slot called to clean up when a viewport is destroyed.
Definition EditTool.cpp:806
QMap< CubeViewport *, int > p_saveMarker
Marker for last save.
Definition EditTool.h:142
Cube display widget for certain Isis MDI applications.
Base class for the Qisis tools.
Definition Tool.h:67
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16