Isis 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.
 
void setCubeViewport (MdiCubeViewport *cvp)
 Sets the current viewport to the given cvp.
 

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.
 
void clearWarningSignal ()
 
void toolActivated ()
 
void viewportChanged ()
 

Public Member Functions

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

Protected Types

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

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.
 
virtual void screenPixelsChanged ()
 This is called when actions change which pixels from the cube are displayed.
 
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.
 
QWidgetcreateToolBarWidget (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.
 
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.
 
MdiCubeViewportcubeViewport () const
 Return the current cubeviewport.
 
CubeViewportListcubeViewportList () const
 Return the list of cubeviewports.
 
virtual void addConnections (MdiCubeViewport *cvp)
 Anytime a tool is created, you must add the connections for it.
 
virtual void removeConnections (MdiCubeViewport *cvp)
 Anytime a tool is created, you must be able to remove it's connections.
 
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(), 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
Parameters
toolbar

References Isis::Tool::createToolBarWidget(), and Isis::ToolList::toolBarStack().

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

◆ 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::TrackTool::addConnections(), Isis::WindowTool::addConnections(), Isis::StretchTool::deleteFromCube(), Isis::FileTool::discard(), Isis::FileTool::exportToList(), Isis::FileTool::exportView(), Isis::StretchTool::loadStretchFromCube(), Isis::SunShadowTool::mouseButtonPress(), mouseButtonRelease(), Isis::ControlNetTool::mouseButtonRelease(), Isis::FeatureNomenclatureTool::mouseButtonRelease(), Isis::FindTool::mouseButtonRelease(), Isis::MatchTool::mouseButtonRelease(), Isis::PanTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::RubberBandTool::mouseButtonRelease(), Isis::StretchTool::mouseButtonRelease(), Isis::AdvancedTrackTool::mouseLeave(), Isis::SunShadowTool::mouseMove(), Isis::TrackTool::mouseMove(), Isis::RubberBandTool::mouseMove(), Isis::ScatterPlotTool::mouseMove(), Isis::LatLonGridTool::paintViewport(), Isis::FindTool::paintViewport(), Isis::RubberBandTool::paintViewport(), Isis::SunShadowTool::paintViewport(), Isis::FileTool::print(), Isis::HistogramTool::refreshPlot(), Isis::SpatialPlotTool::refreshPlot(), Isis::SpectralPlotTool::refreshPlot(), Isis::TrackTool::removeConnections(), Isis::WindowTool::removeConnections(), rubberBandComplete(), Isis::HistogramTool::rubberBandComplete(), Isis::MeasureTool::rubberBandComplete(), Isis::StereoTool::rubberBandComplete(), Isis::StretchTool::rubberBandComplete(), Isis::ZoomTool::rubberBandComplete(), Isis::FileTool::save(), Isis::FileTool::saveAs(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveInfo(), Isis::StretchTool::saveStretchToCube(), Isis::ScatterPlotTool::showNewScatterPlotConfig(), Isis::StretchTool::stretchGlobal(), Isis::StretchTool::stretchGlobalAllBands(), Isis::StretchTool::stretchRegional(), Isis::StretchTool::updateAdvStretchDialogforAll(), Isis::StretchTool::updateHistograms(), Isis::MeasureTool::updateMeasure(), Isis::AbstractPlotTool::updateTool(), Isis::BandTool::updateTool(), Isis::BlinkTool::updateTool(), updateTool(), Isis::FileTool::updateTool(), Isis::FindTool::updateTool(), Isis::LatLonGridTool::updateTool(), Isis::SpecialPixelTool::updateTool(), Isis::StretchTool::updateTool(), Isis::SunShadowTool::updateTool(), Isis::WindowTool::updateTool(), Isis::ZoomTool::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::Tool::cubeViewport(), HorizLine, Point, UserDnComboValue, and VertLine.

◆ 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

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.

References Isis::Tool::cubeViewport(), Rectangle, Isis::RubberBandTool::rectangle(), Isis::Tool::rubberBandTool(), and StartEndLine.

◆ 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

◆ 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: