Isis 3 Developer Reference
Isis::EditTool Class Reference

Interactive image edit tool. More...

#include <EditTool.h>

Inheritance diagram for Isis::EditTool:
Inheritance graph
Collaboration diagram for Isis::EditTool:
Collaboration graph

Public Types

enum  EditShape {
  Point, HorizLine, VertLine, StartEndLine,
  Rectangle
}
 Enum for possible shapes. More...
 
enum  ReplacementValue {
  UserDnComboValue, NullComboValue, HrsComboValue, LrsComboValue,
  HisComboValue, LisComboValue
}
 Enum for DN values. More...
 

Public Slots

void activate (bool)
 Activates the tool. More...
 
void setCubeViewport (MdiCubeViewport *cvp)
 Sets the current viewport to the given cvp. More...
 

Signals

void cubeChanged (bool)
 Emitted when cube changed. More...
 
void save ()
 Emitted when cube should be saved. More...
 
void saveAs ()
 Emitted when cube should be saved as another file. More...
 
void clearWarningSignal ()
 
void toolActivated ()
 
void viewportChanged ()
 

Public Member Functions

 EditTool (QWidget *parent)
 Constructs and EditTool object. More...
 
void addTo (Workspace *)
 Adds the given workspace to the cubeviewport list. More...
 
void addTo (ViewportMainWindow *mw)
 Adds the tool to the application. More...
 
void addTo (ToolPad *toolpad)
 Adds the tool to the toolpad. More...
 
virtual void addTo (QMenu *menu)
 
virtual QString menuName () const
 Anytime a tool is created, you must give it a name for the menu. More...
 
virtual void addToPermanent (QToolBar *toolbar)
 
void addToActive (QToolBar *toolbar)
 
QString toolIconDir () const
 returns the path to the icon directory. More...
 
virtual void paintViewport (MdiCubeViewport *vp, QPainter *painter)
 
RubberBandToolrubberBandTool ()
 
void setList (ToolList *currentList)
 

Protected Types

typedef QVector< MdiCubeViewport *> CubeViewportList
 A list of cubeviewports. More...
 

Protected Slots

void mouseButtonRelease (QPoint p, Qt::MouseButton m)
 This is a slot called when any mouse button is released inside of a viewport. More...
 
virtual void enableRubberBandTool ()
 This method sets up the RubberBandTool depending on which mode is enabled. More...
 
void rubberBandComplete ()
 This method is called any time the RubberBandTool is complete. More...
 
virtual void screenPixelsChanged ()
 This is called when actions change which pixels from the cube are displayed. More...
 
virtual void mouseEnter ()
 
virtual void mouseMove (QPoint p)
 
virtual void mouseMove (QPoint p, Qt::MouseButton)
 
virtual void mouseLeave ()
 

Protected Member Functions

QActiontoolPadAction (ToolPad *pad)
 Adds the EditTool to the tool pad. More...
 
QWidgetcreateToolBarWidget (QStackedWidget *active)
 Creates the toolbar containing the edit tool widgets. More...
 
void updateTool ()
 This is a virtual function belonging to the Tool class which is called when the user selects a different viewport. More...
 
virtual void mouseDoubleClick (QPoint p)
 
virtual void mouseButtonPress (QPoint p, Qt::MouseButton s)
 
virtual void updateMeasure ()
 
virtual void scaleChanged ()
 
virtual void stretchRequested (MdiCubeViewport *, int)
 
void registerTool (MdiCubeViewport *viewport)
 Registers the tool to the viewport. More...
 
MdiCubeViewportcubeViewport () const
 Return the current cubeviewport. More...
 
CubeViewportListcubeViewportList () const
 Return the list of cubeviewports. More...
 
virtual void addConnections (MdiCubeViewport *cvp)
 Anytime a tool is created, you must add the connections for it. More...
 
virtual void removeConnections (MdiCubeViewport *cvp)
 Anytime a tool is created, you must be able to remove it's connections. More...
 
Workspaceworkspace ()
 

Detailed Description

Interactive image edit tool.

This tool is part of the Qisis namespace and allows interactive editing of displayed images.

Author
2006-06-09 Tracie Sucharski

Member Typedef Documentation

◆ CubeViewportList

typedef QVector< MdiCubeViewport * > Isis::Tool::CubeViewportList
protectedinherited

A list of cubeviewports.

Member Enumeration Documentation

◆ EditShape

Enum for possible shapes.

Enumerator
Point 

point

HorizLine 

horizontal line

VertLine 

vertical line

StartEndLine 

start-end line

Rectangle 

rectangle

◆ ReplacementValue

Enum for DN values.

Enumerator
UserDnComboValue 

User Selected DN value.

NullComboValue 

Null DN value.

HrsComboValue 

High representation saturation DN value.

LrsComboValue 

Low representation saturation DN value.

HisComboValue 

High instrument saturation DN value.

LisComboValue 

Low instrument satruation DN value.

Constructor & Destructor Documentation

◆ EditTool()

Isis::EditTool::EditTool ( QWidget parent)

Constructs and EditTool object.

Parameters
parentParent widget

References Isis::Null.

Member Function Documentation

◆ activate

◆ addConnections()

virtual void Isis::Tool::addConnections ( MdiCubeViewport cvp)
inlineprotectedvirtualinherited

Anytime a tool is created, you must add the connections for it.

Parameters
cvp

Reimplemented in Isis::TrackTool, and Isis::WindowTool.

◆ addTo() [1/4]

◆ addTo() [2/4]

void Isis::Tool::addTo ( ToolPad toolpad)
inherited

Adds the tool to the toolpad.

Parameters
toolpad

References Isis::Tool::activate(), Isis::ToolPad::addAction(), and Isis::Tool::toolPadAction().

◆ addTo() [3/4]

◆ addTo() [4/4]

void Isis::EditTool::addTo ( Workspace ws)
virtual

Adds the given workspace to the cubeviewport list.

Parameters
ws

Reimplemented from Isis::Tool.

References Isis::Tool::addTo(), and Isis::Tool::workspace().

◆ addToActive()

void Isis::Tool::addToActive ( QToolBar toolbar)
inherited

◆ addToPermanent()

virtual void Isis::Tool::addToPermanent ( QToolBar toolbar)
inlinevirtualinherited

◆ clearWarningSignal

void Isis::Tool::clearWarningSignal ( )
signalinherited

◆ createToolBarWidget()

QWidget * Isis::EditTool::createToolBarWidget ( QStackedWidget *  active)
protectedvirtual

Creates the toolbar containing the edit tool widgets.

Parameters
activeinput The widget that will contain the edit tool specific widgets
History:
2007-08-31 Tracie Sucharski - Changed signal on dn line edit from returnPressed to editingFinished.
Returns
QWidget*

Reimplemented from Isis::Tool.

References enableRubberBandTool(), HisComboValue, HrsComboValue, LisComboValue, LrsComboValue, NullComboValue, save(), saveAs(), Isis::Tool::toolIconDir(), and UserDnComboValue.

◆ cubeChanged

void Isis::EditTool::cubeChanged ( bool  )
signal

Emitted when cube changed.

◆ cubeViewport()

MdiCubeViewport* Isis::Tool::cubeViewport ( ) const
inlineprotectedinherited

Return the current cubeviewport.

Returns
CubeViewport*

Referenced by Isis::WindowTool::addConnections(), Isis::TrackTool::addConnections(), Isis::FileTool::discard(), Isis::FileTool::exportToList(), Isis::FileTool::exportView(), Isis::SunShadowTool::mouseButtonPress(), Isis::PanTool::mouseButtonRelease(), Isis::ControlNetTool::mouseButtonRelease(), Isis::RubberBandTool::mouseButtonRelease(), mouseButtonRelease(), Isis::FeatureNomenclatureTool::mouseButtonRelease(), Isis::FindTool::mouseButtonRelease(), Isis::StretchTool::mouseButtonRelease(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::AdvancedTrackTool::mouseLeave(), Isis::ScatterPlotTool::mouseMove(), Isis::SunShadowTool::mouseMove(), Isis::TrackTool::mouseMove(), Isis::RubberBandTool::mouseMove(), Isis::SunShadowTool::paintViewport(), Isis::RubberBandTool::paintViewport(), Isis::FindTool::paintViewport(), Isis::FileTool::print(), Isis::HistogramTool::refreshPlot(), Isis::SpatialPlotTool::refreshPlot(), Isis::SpectralPlotTool::refreshPlot(), Isis::WindowTool::removeConnections(), Isis::TrackTool::removeConnections(), Isis::HistogramTool::rubberBandComplete(), Isis::MeasureTool::rubberBandComplete(), Isis::ZoomTool::rubberBandComplete(), Isis::StereoTool::rubberBandComplete(), rubberBandComplete(), Isis::StretchTool::rubberBandComplete(), Isis::FileTool::save(), Isis::FileTool::saveAs(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveInfo(), Isis::ScatterPlotTool::showNewScatterPlotConfig(), Isis::StretchTool::stretchGlobal(), Isis::StretchTool::stretchGlobalAllBands(), Isis::StretchTool::stretchRegional(), Isis::StretchTool::updateAdvStretchDialogforAll(), Isis::StretchTool::updateHistograms(), Isis::MeasureTool::updateMeasure(), Isis::WindowTool::updateTool(), Isis::BlinkTool::updateTool(), Isis::SpecialPixelTool::updateTool(), Isis::BandTool::updateTool(), Isis::SunShadowTool::updateTool(), Isis::AbstractPlotTool::updateTool(), Isis::ZoomTool::updateTool(), Isis::FileTool::updateTool(), updateTool(), Isis::FindTool::updateTool(), Isis::StretchTool::updateTool(), and Isis::AbstractPlotTool::viewportsToPlot().

◆ cubeViewportList()

◆ enableRubberBandTool

void Isis::EditTool::enableRubberBandTool ( )
protectedvirtualslot

◆ menuName()

virtual QString Isis::Tool::menuName ( ) const
inlinevirtualinherited

◆ mouseButtonPress()

void Isis::Tool::mouseButtonPress ( QPoint  p,
Qt::MouseButton  s 
)
protectedvirtualinherited
Parameters
p
s

References Isis::Tool::clearWarningSignal().

◆ mouseButtonRelease

void Isis::EditTool::mouseButtonRelease ( QPoint  p,
Qt::MouseButton  m 
)
protectedslot

This is a slot called when any mouse button is released inside of a viewport.

Parameters
pinput The point under the cursor
minput Mouse button released (left,middle,right)
History:

2007-03-02 Tracie Sucharski - Reopen cube read/write Workspace::addCubeViewport was opening cube read/write, changed to open read only so that the cube date was not changed unless EditTool is invoked.

2007-02-26 Tracie Sucharski - Remove test for off image editing. It is no longer needed since the bug in the Cube class is fixed.

2008-05-23 Noah Hilt - Removed the rectangle and start/end line functionality from the mouseButtonRelease and moved it to the rubberBandComplete method.

2017-08-11 Adam Goins - Added a "vp->cube()->open("r")" call to reopen the cube with "r" permissions if the attempted "rw" permission didn't succeed. Fixes segfault issue if editing is attempted on cube without "w" access. (ref # 2097)

References Isis::CubeViewport::cube(), Isis::CubeViewport::cubeLines(), Isis::CubeViewport::cubeSamples(), Isis::Tool::cubeViewport(), Isis::Cube::fileName(), Isis::CubeViewport::grayBand(), HorizLine, Isis::CubeViewport::isColor(), Isis::Cube::isReadOnly(), Isis::Cube::lineCount(), Isis::Cube::open(), Isis::Cube::pixelType(), Point, Isis::Cube::read(), Isis::Cube::reopen(), Isis::Cube::sampleCount(), Isis::Brick::SetBasePosition(), UserDnComboValue, VertLine, and Isis::CubeViewport::viewportToCube().

◆ mouseDoubleClick()

void Isis::Tool::mouseDoubleClick ( QPoint  p)
protectedvirtualinherited
Parameters
p

References Isis::Tool::clearWarningSignal().

◆ mouseEnter

virtual void Isis::Tool::mouseEnter ( )
inlineprotectedvirtualslotinherited

◆ mouseLeave

virtual void Isis::Tool::mouseLeave ( )
inlineprotectedvirtualslotinherited

◆ mouseMove [1/2]

void Isis::Tool::mouseMove ( QPoint  p)
protectedvirtualslotinherited
Parameters
p

◆ mouseMove [2/2]

virtual void Isis::Tool::mouseMove ( QPoint  p,
Qt::MouseButton   
)
inlineprotectedvirtualslotinherited

◆ paintViewport()

virtual void Isis::Tool::paintViewport ( MdiCubeViewport vp,
QPainter *  painter 
)
inlinevirtualinherited

◆ registerTool()

void Isis::Tool::registerTool ( MdiCubeViewport viewport)
protectedinherited

Registers the tool to the viewport.

Parameters
viewport

References Isis::MdiCubeViewport::registerTool(), and Isis::Tool::stretchRequested().

Referenced by Isis::Tool::addTo().

◆ removeConnections()

virtual void Isis::Tool::removeConnections ( MdiCubeViewport cvp)
inlineprotectedvirtualinherited

Anytime a tool is created, you must be able to remove it's connections.

Parameters
cvp

Reimplemented in Isis::MeasureTool, Isis::TrackTool, and Isis::WindowTool.

◆ rubberBandComplete

void Isis::EditTool::rubberBandComplete ( )
protectedslot

◆ rubberBandTool()

◆ save

void Isis::EditTool::save ( )
signal

Emitted when cube should be saved.

Referenced by createToolBarWidget().

◆ saveAs

void Isis::EditTool::saveAs ( )
signal

Emitted when cube should be saved as another file.

Referenced by createToolBarWidget().

◆ scaleChanged()

virtual void Isis::Tool::scaleChanged ( )
inlineprotectedvirtualinherited

Reimplemented in Isis::RubberBandTool.

◆ screenPixelsChanged

virtual void Isis::Tool::screenPixelsChanged ( )
inlineprotectedvirtualslotinherited

This is called when actions change which pixels from the cube are displayed.

◆ setCubeViewport

void Isis::Tool::setCubeViewport ( MdiCubeViewport cvp)
slotinherited

Sets the current viewport to the given cvp.

Parameters
cvp

References Isis::Tool::updateTool(), and Isis::Tool::viewportChanged().

Referenced by Isis::Tool::addTo(), and Isis::FileTool::closeAll().

◆ setList()

void Isis::Tool::setList ( ToolList currentList)
inherited

Referenced by Isis::ToolList::append().

◆ stretchRequested()

virtual void Isis::Tool::stretchRequested ( MdiCubeViewport ,
int   
)
inlineprotectedvirtualinherited

Reimplemented in Isis::StretchTool.

Referenced by Isis::Tool::registerTool().

◆ toolActivated

◆ toolIconDir()

◆ toolPadAction()

QAction * Isis::EditTool::toolPadAction ( ToolPad pad)
protectedvirtual

Adds the EditTool to the tool pad.

Parameters
padinput The tool pad that EditTool is to be added to
Returns
QAction*

Reimplemented from Isis::Tool.

References Isis::Tool::toolIconDir().

◆ updateMeasure()

virtual void Isis::Tool::updateMeasure ( )
inlineprotectedvirtualinherited

◆ updateTool()

void Isis::EditTool::updateTool ( )
protectedvirtual

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.

Reimplemented from Isis::Tool.

References Isis::Tool::cubeViewport().

◆ viewportChanged

◆ workspace()

Workspace * Isis::Tool::workspace ( )
protectedinherited

The documentation for this class was generated from the following files: