USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::SpatialPlotTool Class Reference

Spatial Plots. More...

#include <SpatialPlotTool.h>

Inherits Isis::AbstractPlotTool.

List of all members.

Public Slots

void refreshPlot ()
 This method replots the data, with current settings and rubber band, in the plot window.
void removeWindow (QObject *)
 When a user closes a window, we want to remove that window from our combo box for selecting the active window.
void repaintViewports (CubePlotCurve *)
 This method causes the viewports corresponding with the given CubePlotCurve to be repainted with all of the area's of interest associated with the CubePlotCurve's PlotWindow.
void showPlotWindow ()
 displays the plot window
void activate (bool)
 Activates the tool.
void setCubeViewport (MdiCubeViewport *cvp)
 Sets the current viewport to the given cvp.

Signals

void clearWarningSignal ()
void toolActivated ()
void viewportChanged ()

Public Member Functions

 SpatialPlotTool (QWidget *parent)
 Create a spatial plot tool.
virtual void paintViewport (MdiCubeViewport *vp, QPainter *painter)
 This method allows each plot window to paint any information it wants onto the cube viewports.
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)
 requires the programmer to have this member
virtual void addTo (Workspace *ws)
 requires the programmer to have this member
virtual void addToPermanent (QToolBar *toolbar)
 requires the programmer to have this member
void addToActive (QToolBar *toolbar)
QString toolIconDir () const
 returns the path to the icon directory.

Protected Types

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

Protected Slots

virtual void rubberBandComplete ()
 Called when the user has finished drawing with the rubber band.
void viewportSelected ()
 This protected slot is called when user selects a viewport.
void repaintViewports ()
 This method causes all of the viewports to be repainted.
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 ()
virtual void mouseDoubleClick (QPoint p)
virtual void mouseButtonPress (QPoint p, Qt::MouseButton s)
virtual void mouseButtonRelease (QPoint p, Qt::MouseButton s)
 Resets the Warning to Nowarning when a different activity occurs on the application.
virtual void updateMeasure ()
virtual void scaleChanged ()
virtual void stretchRequested (MdiCubeViewport *, int)
void registerTool (MdiCubeViewport *viewport)
 Registers the tool to the viewport.

Protected Member Functions

QWidgetcreateToolBarWidget (QStackedWidget *parent)
 Creates the widgets for the tool bar.
virtual PlotWindowcreateWindow ()
 Creates a new plot window compatible with the curves in this tool.
virtual void detachCurves ()
 Forget about all existing spatial plot curves.
void enableRubberBandTool ()
 This method is called when the tool is activated by the parent, or when the plot mode is changed.
QActiontoolPadAction (ToolPad *pad)
void updateTool ()
 Updates plot tool.
PlotWindowaddWindow ()
 This creates and initializes everything about a plot window.
QList< MdiCubeViewport * > viewportsToPlot ()
 Get a list of linked viewports that should be plotting when a new plot is requested.
QList< PlotWindow * > plotWindows ()
 Get a list of all of the instantiated plot windows.
PlotWindowselectedWindow (bool createIfNeeded=true)
 Get the 'active' plot window (the window selected by the user to contain new curves).
MdiCubeViewportcubeViewport () const
 Return the current cubeviewport.
CubeViewportListcubeViewportList () const
 Return the list of cubeviewports.
virtual QString menuName () const
 Anytime a tool is created, you must give it a name for the menu.
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.

Static Protected Member Functions

static CubePlotCurvecreateCurve (QString name, QPen pen, PlotCurve::Units xUnits, PlotCurve::Units yUnits)
 This is a helper method for children.

Protected Attributes

MdiCubeViewportp_cvp
 current cubeviewport
Workspacep_workspace

Detailed Description

Spatial Plots.

This tool provides spatial plots for the user.

Author:
????-??-?? Stacy Alley

Member Typedef Documentation

typedef QVector< MdiCubeViewport * > Isis::Tool::CubeViewportList [protected, inherited]

A list of cubeviewports.


Constructor & Destructor Documentation

Isis::SpatialPlotTool::SpatialPlotTool ( QWidget parent  ) 

Create a spatial plot tool.

Parameters:
parent The Qt-parent relationship parent widget

References Isis::Tool::toolIconDir(), Isis::Tool::viewportChanged(), and viewportSelected().


Member Function Documentation

void Tool::activate ( bool  on  )  [slot, inherited]
virtual void Isis::Tool::addConnections ( MdiCubeViewport cvp  )  [inline, protected, virtual, inherited]

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

Parameters:
cvp 

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

void Tool::addTo ( Workspace ws  )  [virtual, inherited]

requires the programmer to have this member

Adds the given workspace to the cubeviewport list.

Parameters:
ws 

Reimplemented in Isis::EditTool, Isis::FileTool, Isis::SpecialPixelTool, and Isis::WindowTool.

References Isis::Tool::p_workspace, Isis::Tool::registerTool(), and Isis::Tool::setCubeViewport().

virtual void Isis::Tool::addTo ( QMenu *  menu  )  [inline, virtual, inherited]
void Tool::addTo ( ToolPad toolpad  )  [inherited]

Adds the tool to the toolpad.

Parameters:
toolpad 

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

void Tool::addTo ( ViewportMainWindow pViewPortMnWin  )  [inherited]
void Tool::addToActive ( QToolBar toolbar  )  [inherited]
Parameters:
toolbar 

References Isis::Tool::createToolBarWidget().

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

virtual void Isis::Tool::addToPermanent ( QToolBar toolbar  )  [inline, virtual, inherited]

requires the programmer to have this member

Parameters:
toolbar 

Reimplemented in Isis::AdvancedTrackTool, Isis::BlinkTool, Isis::FileTool, Isis::HelpTool, Isis::SpecialPixelTool, and Isis::WindowTool.

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

PlotWindow * Isis::AbstractPlotTool::addWindow (  )  [protected, inherited]

This creates and initializes everything about a plot window.

This updates the window's title to be unique, adds it to the active plot window combo box, listens for the window to be removed and selects it in the active plot window combo box. Call this if you need a new plot window.

Returns:
The newly initialized plot window

References Isis::AbstractPlotTool::createWindow(), Isis::AbstractPlotTool::removeWindow(), and Isis::AbstractPlotTool::repaintViewports().

Referenced by Isis::SpectralPlotTool::refreshPlot(), refreshPlot(), and Isis::AbstractPlotTool::selectedWindow().

void Isis::Tool::clearWarningSignal (  )  [signal, inherited]
CubePlotCurve * Isis::AbstractPlotTool::createCurve ( QString  name,
QPen  pen,
PlotCurve::Units  xUnits,
PlotCurve::Units  yUnits 
) [static, protected, inherited]

This is a helper method for children.

Given a title, a color, and units a new CubePlotCurve is created.

Parameters:
name The title of the curve to be created
pen The color & thickness of the curve
xUnits The units of the x-axis associated with this curve. This must match the plot window's x axis.
yUnits The units of the y-axis associated with this curve. This must match the plot window's y axis.
Returns:
createCurve The requested plot curve

References Isis::PlotCurve::setColor(), and Isis::PlotCurve::setPen().

QWidget * Isis::SpatialPlotTool::createToolBarWidget ( QStackedWidget *  parent  )  [protected, virtual]
PlotWindow * Isis::SpatialPlotTool::createWindow (  )  [protected, virtual]

Creates a new plot window compatible with the curves in this tool.

Returns:
a newly allocated plot window, ownership is passed to the caller.

Implements Isis::AbstractPlotTool.

References Isis::PlotCurve::CubeDN, Isis::PlotWindow::defaultWindowTitle(), and Isis::toInt().

MdiCubeViewport* Isis::Tool::cubeViewport (  )  const [inline, protected, inherited]

Return the current cubeviewport.

Returns:
CubeViewport*

References Isis::Tool::p_cvp.

Referenced by Isis::WindowTool::addConnections(), Isis::TrackTool::addConnections(), Isis::FileTool::discard(), Isis::FileTool::exportView(), Isis::SunShadowTool::mouseButtonPress(), Isis::StretchTool::mouseButtonRelease(), Isis::RubberBandTool::mouseButtonRelease(), Isis::PanTool::mouseButtonRelease(), Isis::MatchTool::mouseButtonRelease(), Isis::FindTool::mouseButtonRelease(), Isis::FeatureNomenclatureTool::mouseButtonRelease(), Isis::EditTool::mouseButtonRelease(), Isis::AdvancedTrackTool::mouseLeave(), Isis::TrackTool::mouseMove(), Isis::SunShadowTool::mouseMove(), Isis::ScatterPlotTool::mouseMove(), Isis::RubberBandTool::mouseMove(), Isis::SunShadowTool::paintViewport(), Isis::RubberBandTool::paintViewport(), Isis::FindTool::paintViewport(), Isis::FileTool::print(), Isis::SpectralPlotTool::refreshPlot(), refreshPlot(), Isis::HistogramTool::refreshPlot(), Isis::WindowTool::removeConnections(), Isis::TrackTool::removeConnections(), Isis::ZoomTool::rubberBandComplete(), Isis::StretchTool::rubberBandComplete(), Isis::StereoTool::rubberBandComplete(), Isis::HistogramTool::rubberBandComplete(), Isis::EditTool::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::ZoomTool::updateTool(), Isis::WindowTool::updateTool(), Isis::SunShadowTool::updateTool(), Isis::StretchTool::updateTool(), Isis::SpecialPixelTool::updateTool(), Isis::FindTool::updateTool(), Isis::FileTool::updateTool(), Isis::EditTool::updateTool(), Isis::BlinkTool::updateTool(), Isis::BandTool::updateTool(), Isis::AbstractPlotTool::updateTool(), and Isis::AbstractPlotTool::viewportsToPlot().

Tool::CubeViewportList * Tool::cubeViewportList (  )  const [protected, inherited]
void Isis::SpatialPlotTool::detachCurves (  )  [protected, virtual]

Forget about all existing spatial plot curves.

Don't delete them, just forget them so that when the user requests a new one they get a brand new curve.

Implements Isis::AbstractPlotTool.

void Isis::SpatialPlotTool::enableRubberBandTool (  )  [protected, virtual]

This method is called when the tool is activated by the parent, or when the plot mode is changed.

It's used to activate or change the rubber banding mode to be either rectangle or line, depending on the current plot type.

Reimplemented from Isis::Tool.

References Isis::RubberBandTool::drawActiveViewportOnly().

virtual QString Isis::Tool::menuName (  )  const [inline, protected, virtual, inherited]
void Tool::mouseButtonPress ( QPoint  p,
Qt::MouseButton  s 
) [protected, virtual, slot, inherited]
Parameters:
p 
s 

Reimplemented in Isis::PanTool, Isis::RubberBandTool, and Isis::SunShadowTool.

References Isis::Tool::clearWarningSignal().

void Tool::mouseButtonRelease ( QPoint  p,
Qt::MouseButton  s 
) [protected, virtual, slot, inherited]

Resets the Warning to Nowarning when a different activity occurs on the application.

This is called by all the mouseButtonRelease events in all the tools.

Parameters:
p 
s 

Reimplemented in Isis::EditTool, Isis::FeatureNomenclatureTool, Isis::FindTool, Isis::MatchTool, Isis::PanTool, Isis::RubberBandTool, Isis::StatisticsTool, Isis::StretchTool, and Isis::SunShadowTool.

References Isis::Tool::clearWarningSignal().

void Tool::mouseDoubleClick ( QPoint  p  )  [protected, virtual, slot, inherited]
Parameters:
p 

Reimplemented in Isis::RubberBandTool.

References Isis::Tool::clearWarningSignal().

virtual void Isis::Tool::mouseEnter (  )  [inline, protected, virtual, slot, inherited]
virtual void Isis::Tool::mouseLeave (  )  [inline, protected, virtual, slot, inherited]
virtual void Isis::Tool::mouseMove ( QPoint  p,
Qt::MouseButton   
) [inline, protected, virtual, slot, inherited]
void Tool::mouseMove ( QPoint  p  )  [protected, virtual, slot, inherited]
void Isis::AbstractPlotTool::paintViewport ( MdiCubeViewport vp,
QPainter *  painter 
) [virtual, inherited]

This method allows each plot window to paint any information it wants onto the cube viewports.

For example, spatial plots can paint the originating selection in the color of the curve.

Parameters:
vp The viewport to paint onto
painter The painter to use for painting

Reimplemented from Isis::Tool.

Reimplemented in Isis::StereoTool.

References Isis::PlotWindow::paint().

QList< PlotWindow * > Isis::AbstractPlotTool::plotWindows (  )  [protected, inherited]

Get a list of all of the instantiated plot windows.

Returns:
All of the plot windows associated with this tool

Referenced by Isis::AbstractPlotTool::updateTool().

void Isis::SpatialPlotTool::refreshPlot (  )  [slot]
void Tool::registerTool ( MdiCubeViewport viewport  )  [protected, slot, inherited]

Registers the tool to the viewport.

Parameters:
viewport 

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

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

virtual void Isis::Tool::removeConnections ( MdiCubeViewport cvp  )  [inline, protected, virtual, inherited]

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.

void Isis::AbstractPlotTool::removeWindow ( QObject window  )  [slot, inherited]

When a user closes a window, we want to remove that window from our combo box for selecting the active window.

We also repaint all of the cube viewports so that the destroyed window leaves no visible artifacts.

Parameters:
window The plot window that is to be removed

References Isis::AbstractPlotTool::repaintViewports().

Referenced by Isis::AbstractPlotTool::addWindow().

void Isis::AbstractPlotTool::repaintViewports (  )  [protected, slot, inherited]

This method causes all of the viewports to be repainted.

This is useful because it removes visible artifacts from deleted plot windows/curves.

References Isis::Tool::cubeViewportList().

Referenced by Isis::AbstractPlotTool::addWindow(), and Isis::AbstractPlotTool::removeWindow().

void Isis::AbstractPlotTool::repaintViewports ( CubePlotCurve pc  )  [slot, inherited]

This method causes the viewports corresponding with the given CubePlotCurve to be repainted with all of the area's of interest associated with the CubePlotCurve's PlotWindow.

Parameters:
pc The plot curve which needs to repaint

References Isis::CubeViewport::cube(), Isis::Tool::cubeViewportList(), Isis::Cube::fileName(), and Isis::CubePlotCurve::sourceCube().

void Isis::SpatialPlotTool::rubberBandComplete (  )  [protected, virtual, slot]

Called when the user has finished drawing with the rubber band.

ChangePlot is called to plot the data within the rubber band.

Reimplemented from Isis::Tool.

References Isis::RubberBandTool::isValid(), refreshPlot(), and Isis::AbstractPlotTool::selectedWindow().

virtual void Isis::Tool::scaleChanged (  )  [inline, protected, virtual, slot, inherited]

Reimplemented in Isis::RubberBandTool.

virtual void Isis::Tool::screenPixelsChanged (  )  [inline, protected, virtual, slot, inherited]

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

Reimplemented in Isis::StretchTool.

PlotWindow * Isis::AbstractPlotTool::selectedWindow ( bool  createIfNeeded = true  )  [protected, inherited]

Get the 'active' plot window (the window selected by the user to contain new curves).

This may return NULL if and only if createIfNeeded is false. Windows are created by child classes.

Parameters:
createIfNeeded If this is true, and no window is selected in the active window combo box, then a window will be created and selected before this method returns.
Returns:
The user-selected active plot window

References Isis::AbstractPlotTool::addWindow().

Referenced by Isis::SpectralPlotTool::refreshPlot(), refreshPlot(), Isis::HistogramTool::refreshPlot(), Isis::SpectralPlotTool::rubberBandComplete(), rubberBandComplete(), Isis::HistogramTool::rubberBandComplete(), and Isis::AbstractPlotTool::showPlotWindow().

void Tool::setCubeViewport ( MdiCubeViewport cvp  )  [slot, inherited]

Sets the current viewport to the given cvp.

Parameters:
cvp 

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

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

void Isis::AbstractPlotTool::showPlotWindow (  )  [slot, inherited]
virtual void Isis::Tool::stretchRequested ( MdiCubeViewport ,
int   
) [inline, protected, virtual, slot, inherited]

Reimplemented in Isis::StretchTool.

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

void Isis::Tool::toolActivated (  )  [signal, inherited]
QString Isis::Tool::toolIconDir (  )  const [inline, inherited]
QAction * Isis::SpatialPlotTool::toolPadAction ( ToolPad toolpad  )  [protected, virtual]
Parameters:
toolpad 
Returns:
QAction*

Reimplemented from Isis::Tool.

virtual void Isis::Tool::updateMeasure (  )  [inline, protected, virtual, slot, inherited]

Reimplemented in Isis::MeasureTool.

void Isis::SpatialPlotTool::updateTool (  )  [protected, virtual]
void Isis::Tool::viewportChanged (  )  [signal, inherited]
void Isis::SpatialPlotTool::viewportSelected (  )  [protected, slot]

This protected slot is called when user selects a viewport.

Referenced by SpatialPlotTool().

QList< MdiCubeViewport * > Isis::AbstractPlotTool::viewportsToPlot (  )  [protected, inherited]

Get a list of linked viewports that should be plotting when a new plot is requested.

This is a utility for child classes. For example, a spatial plot will make a curve for each viewport.

Returns:
A list of viewports containing the active one and any that are linked to the active viewport.

References Isis::Tool::cubeViewport(), Isis::Tool::cubeViewportList(), and Isis::MdiCubeViewport::isLinked().

Referenced by Isis::SpectralPlotTool::refreshPlot(), refreshPlot(), Isis::SpectralPlotTool::updateTool(), and updateTool().


Member Data Documentation

MdiCubeViewport* Isis::Tool::p_cvp [protected, inherited]
Workspace* Isis::Tool::p_workspace [protected, inherited]

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