Isis Developer Reference
EditTool.h
Go to the documentation of this file.
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 
19 class QToolButton;
20 class QLine;
21 class QLineEdit;
22 class QComboBox;
23 
24 namespace Isis {
25  class Brick;
26  class Cube;
27  class MdiCubeViewport;
28 
70  class EditTool : public Tool {
71  Q_OBJECT
72 
73  public:
77  enum EditShape {
82  Rectangle
83  };
84 
85 
96  };
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);
130  QComboBox *p_shapeComboBox;
131  QComboBox *p_valTypeComboBox;
132  QLineEdit *p_dnLineEdit;
133  QToolButton *p_undoButton;
134  QToolButton *p_redoButton;
135  QToolButton *p_saveButton;
136  QToolButton *p_saveAsButton;
137 QWidget *m_container;
138  double p_dn;
139 
142  QMap <CubeViewport *, int> p_saveMarker;
143  };
144 };
145 
146 #endif
Isis::CubeViewport::cubeLines
int cubeLines() const
Return the number of lines in the cube.
Definition: CubeViewport.cpp:439
Isis::Brick::SetBasePosition
void SetBasePosition(const int start_sample, const int start_line, const int start_band)
This method is used to set the base position of the shape buffer.
Definition: Brick.h:120
Isis::CubeViewport::setCaption
void setCaption()
Change the caption on the viewport title bar.
Definition: CubeViewport.cpp:985
Isis::EditTool::EditTool
EditTool(QWidget *parent)
Constructs and EditTool object.
Definition: EditTool.cpp:41
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Cube.h
Isis::Buffer::SampleDimension
int SampleDimension() const
Returns the number of samples in the shape buffer.
Definition: Buffer.h:70
Isis::EditTool::NullComboValue
@ NullComboValue
Null DN value.
Definition: EditTool.h:91
QStack
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:17
Isis::EditTool::updateTool
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
MdiCubeViewport.h
Isis::RubberBandTool::setDrawActiveViewportOnly
void setDrawActiveViewportOnly(bool activeOnly=false)
This called to set whether rubber band is drawn on active viewport only rather than all linked viewpo...
Definition: RubberBandTool.cpp:333
Isis::RubberBandTool::RectangleMode
@ RectangleMode
Definition: RubberBandTool.h:62
Isis::CubeViewport::cubeContentsChanged
void cubeContentsChanged(QRect rect)
Calle dhwen the contents of the cube changes.
Definition: CubeViewport.cpp:2312
Isis::EditTool::EditShape
EditShape
Enum for possible shapes.
Definition: EditTool.h:77
Isis::EditTool::HrsComboValue
@ HrsComboValue
High representation saturation DN value.
Definition: EditTool.h:92
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::EditTool::UserDnComboValue
@ UserDnComboValue
User Selected DN value.
Definition: EditTool.h:90
Isis::Cube::read
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::His
const double His
Value for an Isis High Instrument Saturation pixel.
Definition: SpecialPixel.h:111
Isis::EditTool::ReplacementValue
ReplacementValue
Enum for DN values.
Definition: EditTool.h:89
SpecialPixel.h
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::CubeViewport::isColor
bool isColor() const
Definition: CubeViewport.h:184
Isis::RubberBandTool::enable
void enable(RubberBandMode mode, bool showIndicatorColors=false)
This is called when changing modes or turning on.
Definition: RubberBandTool.cpp:302
Isis::Tool::rubberBandTool
RubberBandTool * rubberBandTool()
Definition: Tool.cpp:57
Isis::EditTool::LrsComboValue
@ LrsComboValue
Low representation saturation DN value.
Definition: EditTool.h:93
Isis::EditTool::HorizLine
@ HorizLine
horizontal line
Definition: EditTool.h:79
Tool.h
Isis::EditTool::rubberBandComplete
void rubberBandComplete()
This method is called any time the RubberBandTool is complete.
Definition: EditTool.cpp:263
Isis::EditTool::saveAs
void saveAs()
Emitted when cube should be saved as another file.
ToolPad.h
Isis::EditTool::enableRubberBandTool
virtual void enableRubberBandTool()
This method sets up the RubberBandTool depending on which mode is enabled.
Definition: EditTool.cpp:926
EditTool.h
Isis::Brick
Buffer for containing a three dimensional section of an image.
Definition: Brick.h:45
QComboBox
Isis::Hrs
const double Hrs
Value for an Isis High Representation Saturation pixel.
Definition: SpecialPixel.h:117
Isis::EditTool::LisComboValue
@ LisComboValue
Low instrument satruation DN value.
Definition: EditTool.h:95
Isis::Lrs
const double Lrs
Value for an Isis Low Representation Saturation pixel.
Definition: SpecialPixel.h:99
Isis::EditTool::addTo
void addTo(Workspace *)
Adds the given workspace to the cubeviewport list.
Definition: EditTool.cpp:45
Isis::EditTool::createToolBarWidget
QWidget * createToolBarWidget(QStackedWidget *active)
Creates the toolbar containing the edit tool widgets.
Definition: EditTool.cpp:84
Isis::EditTool::Point
@ Point
point
Definition: EditTool.h:78
Isis::CubeViewport::grayBand
int grayBand() const
Definition: CubeViewport.h:194
Isis::EditTool::HisComboValue
@ HisComboValue
High instrument saturation DN value.
Definition: EditTool.h:94
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
Isis::Tool::workspace
Workspace * workspace()
Definition: Tool.cpp:344
Isis::Buffer::LineDimension
int LineDimension() const
Returns the number of lines in the shape buffer.
Definition: Buffer.h:79
Isis::Tool::addTo
void addTo(ViewportMainWindow *mw)
Adds the tool to the application.
Definition: Tool.cpp:78
Isis::EditTool::VertLine
@ VertLine
vertical line
Definition: EditTool.h:80
Workspace.h
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::EditTool::mouseButtonRelease
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
Isis::EditTool::Rectangle
@ Rectangle
rectangle
Definition: EditTool.h:82
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::CubeViewport::cubeSamples
int cubeSamples() const
Return the number of samples in the cube.
Definition: CubeViewport.cpp:433
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::EditTool::save
void save()
Emitted when cube should be saved.
Isis::EditTool
Interactive image edit tool.
Definition: EditTool.h:70
Brick.h
Isis::ToolPad
Definition: ToolPad.h:14
Isis::Lis
const double Lis
Value for an Isis Low Instrument Saturation pixel.
Definition: SpecialPixel.h:105
Isis::Cube::isReadOnly
bool isReadOnly() const
Test if the opened cube is read-only, that is write operations will fail if this is true.
Definition: Cube.cpp:213
Isis::Cube::pixelType
PixelType pixelType() const
Definition: Cube.cpp:1758
Isis::CubeViewport::cubeChanged
void cubeChanged(bool changed)
This method is called when the cube has changed or changes have been finalized.
Definition: CubeViewport.cpp:561
Isis::EditTool::toolPadAction
QAction * toolPadAction(ToolPad *pad)
Adds the EditTool to the tool pad.
Definition: EditTool.cpp:59
Isis::Cube::write
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition: Cube.cpp:971
RubberBandTool.h
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Isis::Buffer::size
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
Isis::CubeViewport::viewportToCube
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
Isis::RubberBandTool::LineMode
@ LineMode
Definition: RubberBandTool.h:61
Isis::Workspace
Definition: Workspace.h:78
QObject
Isis::Buffer::Sample
int Sample(const int index=0) const
Returns the sample position associated with a shape buffer index.
Definition: Buffer.cpp:127
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
Isis::EditTool::StartEndLine
@ StartEndLine
start-end line
Definition: EditTool.h:81
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis::EditTool::cubeChanged
void cubeChanged(bool)
Emitted when cube changed.
Isis::Buffer::Line
int Line(const int index=0) const
Returns the line position associated with a shape buffer index.
Definition: Buffer.cpp:145
Isis::RubberBandTool::rectangle
QRect rectangle()
This method returns a rectangle from the vertices set by the RubberBandTool.
Definition: RubberBandTool.cpp:966
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis::RubberBandTool::disable
void disable()
This is called when something is not using me, so turn off events, reset & repaint to clear the clear...
Definition: RubberBandTool.cpp:322
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Cube::reopen
void reopen(QString access="r")
This method will reopen an isis sube for reading or reading/writing.
Definition: Cube.cpp:774