|
Isis 3.0 Object Programmers' Reference |
Home |
#include <EditTool.h>
Inheritance diagram for Qisis::EditTool:


This tool is part of the Qisis namespace and allows interactive editing of displayed images.
For internal use only.
Definition at line 65 of file EditTool.h.
Public Types | |
| Point | |
| point | |
| HorizLine | |
| horizontal line | |
| VertLine | |
| vertical line | |
| StartEndLine | |
| start-end line | |
| Rectangle | |
| rectangle | |
| UserDn | |
| User Selected DN value. | |
| Null | |
| Null DN value. | |
| Hrs | |
| High representation saturation DN value. | |
| Lrs | |
| Low representation saturation DN value. | |
| His | |
| High instrument saturation DN value. | |
| Lis | |
| Low instrument satruation DN value. | |
| enum | EditShape { Point, HorizLine, VertLine, StartEndLine, Rectangle } |
| Enum for possible shapes. More... | |
| enum | ReplacementValue { UserDn, Null, Hrs, Lrs, His, Lis } |
| Enum for DN values. More... | |
Signals | |
| void | cubeChanged (bool) |
| Emitted when cube changed. | |
| void | save () |
| Emitted when cube should be saved. | |
| void | saveAs () |
| Emitted when cube should be saved as another file. | |
Public Member Functions | |
| EditTool (QWidget *parent) | |
| Constructs and EditTool object. | |
Protected Slots | |
| void | mouseButtonRelease (QPoint p, Qt::MouseButton m) |
| This is a slot called when any mouse button is released inside of a viewport. | |
| virtual void | enableRubberBandTool () |
| This method sets up the RubberBandTool depending on which mode is enabled. | |
| void | rubberBandComplete () |
| This method is called any time the RubberBandTool is complete. | |
Protected Member Functions | |
| QAction * | toolPadAction (ToolPad *pad) |
| Adds the EditTool to the tool pad. | |
| QWidget * | createToolBarWidget (QStackedWidget *active) |
| Creates the toolbar containing the edit tool widgets. | |
| void | updateTool () |
| This is a virtual function belonging to the Tool class which is called when the user selects a different viewport. | |
Private Slots | |
| void | selectValType (int index) |
| This is a private slot which is called when the user selects a new dn type. | |
| void | changeDn () |
| This is a private slot called when the user hits the enter key after typing a value in the dnLineEdit field. | |
| void | undoEdit () |
| This is a private slot called when the user selects the undo button. | |
| void | undoAll (CubeViewport *vp) |
| This method is used to discard any changes made to this viewport. | |
| void | redoEdit () |
| This method is called to redo any edit operations that have been undone. | |
| void | save (CubeViewport *vp) |
| This method saves by removing any undo history for the viewport vp and reopening the cube. | |
| void | removeViewport (QObject *vp) |
| This is a private slot called to clean up when a viewport is destroyed. | |
Private Member Functions | |
| QList< QPoint * > * | LineToPoints (const QLine &line) |
| Convert rubber band line to points. | |
| void | writeToCube (int iesamp, int issamp, int ieline, int isline, QList< QPoint * > *linePts) |
Private Attributes | |
| QComboBox * | p_shapeComboBox |
| Shape combobox. | |
| QComboBox * | p_valTypeComboBox |
| Value type combobox. | |
| QLineEdit * | p_dnLineEdit |
| DN edit line. | |
| QToolButton * | p_undoButton |
| Undo button. | |
| QToolButton * | p_redoButton |
| Redo button. | |
| QToolButton * | p_saveButton |
| Save button. | |
| QToolButton * | p_saveAsButton |
| Save as button. | |
| double | p_dn |
| DN value. | |
| QMap< CubeViewport *, QStack< Isis::Brick * > * > | p_undoEdit |
| Viewport to brick map for undo. | |
| QMap< CubeViewport *, QStack< Isis::Brick * > * > | p_redoEdit |
| Viewport to brick map for redo. | |
| QMap< CubeViewport *, int > | p_saveMarker |
| Marker for last save. | |
Enum for possible shapes.
| Point | point |
| HorizLine | horizontal line |
| VertLine | vertical line |
| StartEndLine | start-end line |
| Rectangle | rectangle |
Definition at line 79 of file EditTool.h.
Enum for DN values.
Definition at line 91 of file EditTool.h.
| Qisis::EditTool::EditTool | ( | QWidget * | parent | ) |
Constructs and EditTool object.
| parent | Parent widget |
Definition at line 42 of file EditTool.cpp.
References Isis::Null, and p_dn.
| void Qisis::EditTool::changeDn | ( | ) | [private, slot] |
This is a private slot called when the user hits the enter key after typing a value in the dnLineEdit field.
Definition at line 213 of file EditTool.cpp.
References p_dn, and p_dnLineEdit.
Referenced by createToolBarWidget().
| QWidget * Qisis::EditTool::createToolBarWidget | ( | QStackedWidget * | active | ) | [protected] |
Creates the toolbar containing the edit tool widgets.
| active | input The widget that will contain the edit tool specific widgets |
Definition at line 78 of file EditTool.cpp.
References changeDn(), enableRubberBandTool(), p_dnLineEdit, p_redoButton, p_saveAsButton, p_saveButton, p_shapeComboBox, p_undoButton, p_valTypeComboBox, redoEdit(), save(), saveAs(), selectValType(), and undoEdit().
| void Qisis::EditTool::cubeChanged | ( | bool | ) | [signal] |
| void Qisis::EditTool::enableRubberBandTool | ( | ) | [protected, virtual, slot] |
This method sets up the RubberBandTool depending on which mode is enabled.
If a valid RubberBandTool mode is not enabled the RubberBandTool is disabled.
Definition at line 886 of file EditTool.cpp.
References Qisis::RubberBandTool::disable(), Qisis::RubberBandTool::enable(), and p_shapeComboBox.
Referenced by createToolBarWidget().
| QList< QPoint * > * Qisis::EditTool::LineToPoints | ( | const QLine & | line | ) | [private] |
Convert rubber band line to points.
This routine takes two points (sx,sy) and (ex,ey) and determines all the points which make up that line segment. This is useful for drawing graphic on a display or image
| line | input Line to be converted to points |
Definition at line 803 of file EditTool.cpp.
Referenced by rubberBandComplete().
| void Qisis::EditTool::mouseButtonRelease | ( | QPoint | p, | |
| Qt::MouseButton | m | |||
| ) | [protected, slot] |
This is a slot called when any mouse button is released inside of a viewport.
| p | input The point under the cursor | |
| m | input Mouse button released (left,middle,right) |
Definition at line 375 of file EditTool.cpp.
References Qisis::CubeViewport::cube(), Qisis::CubeViewport::cubeLines(), Qisis::CubeViewport::cubeSamples(), e, Qisis::CubeViewport::grayBand(), HorizLine, Qisis::CubeViewport::isColor(), Isis::Cube::IsReadOnly(), Isis::Cube::Lines(), p_dn, p_dnLineEdit, p_shapeComboBox, p_valTypeComboBox, Isis::Cube::PixelType(), Point, Isis::Cube::Read(), Isis::Cube::ReOpen(), Isis::Cube::Samples(), Isis::Brick::SetBasePosition(), UserDn, VertLine, Qisis::CubeViewport::viewportToCube(), and writeToCube().
| void Qisis::EditTool::redoEdit | ( | ) | [private, slot] |
This method is called to redo any edit operations that have been undone.
Definition at line 668 of file EditTool.cpp.
References Qisis::CubeViewport::cube(), cubeChanged(), Qisis::CubeViewport::cubeChanged(), Qisis::CubeViewport::cubeContentsChanged(), Qisis::CubeViewport::grayBand(), Isis::Cube::IsReadOnly(), Isis::Buffer::Line(), Isis::Buffer::LineDimension(), p_redoButton, p_redoEdit, p_saveButton, p_undoButton, p_undoEdit, Isis::Cube::PixelType(), Isis::Cube::Read(), Isis::Buffer::Sample(), Isis::Buffer::SampleDimension(), Isis::Brick::SetBasePosition(), Qisis::CubeViewport::setCaption(), and Isis::Cube::Write().
Referenced by createToolBarWidget().
| void Qisis::EditTool::removeViewport | ( | QObject * | vp | ) | [private, slot] |
This is a private slot called to clean up when a viewport is destroyed.
This viewport is removed from the undoEdit hash.
| vp | input Viewport to be removed from the undo edit hash |
Definition at line 767 of file EditTool.cpp.
References p_redoEdit, and p_undoEdit.
Referenced by updateTool().
| void Qisis::EditTool::rubberBandComplete | ( | ) | [protected, slot] |
This method is called any time the RubberBandTool is complete.
It checks if the viewport is writable, checks which mode it is in, either line or rectangle, and if RubberBandTool is valid. It then writes the data from the RubberBandTool to the cube.
Definition at line 262 of file EditTool.cpp.
References Qisis::CubeViewport::cube(), Qisis::CubeViewport::cubeLines(), Qisis::CubeViewport::cubeSamples(), e, Qisis::RubberBandTool::getVertices(), Qisis::CubeViewport::isColor(), Isis::Cube::IsReadOnly(), Qisis::RubberBandTool::isValid(), LineToPoints(), p_shapeComboBox, Qisis::RubberBandTool::rectangle(), Rectangle, Isis::Cube::ReOpen(), StartEndLine, Qisis::CubeViewport::viewportToCube(), and writeToCube().
| void Qisis::EditTool::save | ( | CubeViewport * | vp | ) | [private, slot] |
This method saves by removing any undo history for the viewport vp and reopening the cube.
These changes are finalized! There is no undoing after a save has been made.
| vp |
Definition at line 741 of file EditTool.cpp.
References Qisis::CubeViewport::cubeChanged(), p_saveButton, p_saveMarker, p_undoEdit, and Qisis::CubeViewport::setCaption().
| void Qisis::EditTool::save | ( | ) | [signal] |
| void Qisis::EditTool::saveAs | ( | ) | [signal] |
| void Qisis::EditTool::selectValType | ( | int | index | ) | [private, slot] |
This is a private slot which is called when the user selects a new dn type.
| index | input This is the index selected in the valType combo box |
Definition at line 192 of file EditTool.cpp.
References Isis::His, Isis::Hrs, Isis::Lis, Isis::Lrs, Isis::Null, p_dn, and p_dnLineEdit.
Referenced by createToolBarWidget().
| QAction * Qisis::EditTool::toolPadAction | ( | ToolPad * | pad | ) | [protected] |
Adds the EditTool to the tool pad.
| pad | input The tool pad that EditTool is to be added to |
Definition at line 53 of file EditTool.cpp.
| void Qisis::EditTool::undoAll | ( | CubeViewport * | vp | ) | [private, slot] |
This method is used to discard any changes made to this viewport.
If the viewport has been saved, then it will only discard changes to that save point.
| vp |
Definition at line 610 of file EditTool.cpp.
References Qisis::CubeViewport::cube(), Isis::Cube::IsReadOnly(), p_redoEdit, p_saveMarker, p_undoEdit, and Isis::Cube::Write().
| void Qisis::EditTool::undoEdit | ( | ) | [private, slot] |
This is a private slot called when the user selects the undo button.
With each call, another edit is reversed.
Definition at line 535 of file EditTool.cpp.
References Qisis::CubeViewport::cube(), Qisis::CubeViewport::cubeChanged(), cubeChanged(), Qisis::CubeViewport::cubeContentsChanged(), Qisis::CubeViewport::grayBand(), Isis::Cube::IsReadOnly(), Isis::Buffer::Line(), Isis::Buffer::LineDimension(), p_redoButton, p_redoEdit, p_saveButton, p_undoButton, p_undoEdit, Isis::Cube::PixelType(), Isis::Cube::Read(), Isis::Buffer::Sample(), Isis::Buffer::SampleDimension(), Isis::Brick::SetBasePosition(), Qisis::CubeViewport::setCaption(), and Isis::Cube::Write().
Referenced by createToolBarWidget().
| void Qisis::EditTool::updateTool | ( | ) | [protected] |
This is a virtual function belonging to the Tool class which is called when the user selects a different viewport.
This sets up the signal/slot for destruction of a viewport so the viewport is removed from the undoEdit hash.
For internal use only.
Definition at line 225 of file EditTool.cpp.
References p_redoButton, p_redoEdit, p_saveButton, p_undoButton, p_undoEdit, and removeViewport().
| void Qisis::EditTool::writeToCube | ( | int | iesamp, | |
| int | issamp, | |||
| int | ieline, | |||
| int | isline, | |||
| QList< QPoint * > * | linePts | |||
| ) | [private] |
| iesamp | input | |
| issamp | input | |
| ieline | input | |
| isline | input | |
| linePts | input If the input data is a line, this will be the list of points in the line. |
Definition at line 453 of file EditTool.cpp.
References Qisis::CubeViewport::cube(), Qisis::CubeViewport::cubeChanged(), cubeChanged(), Qisis::CubeViewport::cubeContentsChanged(), Qisis::CubeViewport::grayBand(), Isis::Buffer::Line(), Isis::Buffer::LineDimension(), p_dn, p_redoButton, p_redoEdit, p_saveButton, p_shapeComboBox, p_undoButton, p_undoEdit, Isis::Cube::PixelType(), Isis::Cube::Read(), Isis::Buffer::Sample(), Isis::Buffer::SampleDimension(), Isis::Brick::SetBasePosition(), Qisis::CubeViewport::setCaption(), Isis::Buffer::size(), StartEndLine, and Isis::Cube::Write().
Referenced by mouseButtonRelease(), and rubberBandComplete().
double Qisis::EditTool::p_dn [private] |
DN value.
Definition at line 131 of file EditTool.h.
Referenced by changeDn(), EditTool(), mouseButtonRelease(), selectValType(), and writeToCube().
QLineEdit* Qisis::EditTool::p_dnLineEdit [private] |
DN edit line.
Definition at line 125 of file EditTool.h.
Referenced by changeDn(), createToolBarWidget(), mouseButtonRelease(), and selectValType().
QToolButton* Qisis::EditTool::p_redoButton [private] |
Redo button.
Definition at line 127 of file EditTool.h.
Referenced by createToolBarWidget(), redoEdit(), undoEdit(), updateTool(), and writeToCube().
QMap<CubeViewport *, QStack <Isis::Brick *> *> Qisis::EditTool::p_redoEdit [private] |
Viewport to brick map for redo.
Definition at line 134 of file EditTool.h.
Referenced by redoEdit(), removeViewport(), undoAll(), undoEdit(), updateTool(), and writeToCube().
QToolButton* Qisis::EditTool::p_saveAsButton [private] |
QToolButton* Qisis::EditTool::p_saveButton [private] |
Save button.
Definition at line 128 of file EditTool.h.
Referenced by createToolBarWidget(), redoEdit(), save(), undoEdit(), updateTool(), and writeToCube().
QMap<CubeViewport *, int> Qisis::EditTool::p_saveMarker [private] |
QComboBox* Qisis::EditTool::p_shapeComboBox [private] |
Shape combobox.
Definition at line 123 of file EditTool.h.
Referenced by createToolBarWidget(), enableRubberBandTool(), mouseButtonRelease(), rubberBandComplete(), and writeToCube().
QToolButton* Qisis::EditTool::p_undoButton [private] |
Undo button.
Definition at line 126 of file EditTool.h.
Referenced by createToolBarWidget(), redoEdit(), undoEdit(), updateTool(), and writeToCube().
QMap<CubeViewport *, QStack <Isis::Brick *> *> Qisis::EditTool::p_undoEdit [private] |
Viewport to brick map for undo.
Definition at line 133 of file EditTool.h.
Referenced by redoEdit(), removeViewport(), save(), undoAll(), undoEdit(), updateTool(), and writeToCube().
QComboBox* Qisis::EditTool::p_valTypeComboBox [private] |
Value type combobox.
Definition at line 124 of file EditTool.h.
Referenced by createToolBarWidget(), and mouseButtonRelease().