Isis 3 Programmer Reference
Isis::PlotWindow Class Reference

#include <PlotWindow.h>

Inheritance diagram for Isis::PlotWindow:
Inheritance graph
Collaboration diagram for Isis::PlotWindow:
Collaboration graph

Public Types

enum  MenuOptions {
  ShowHideMarkersMenuOption = 1 , ShowHideCurvesMenuOption = 2 , ShowTableMenuOption = 4 , SaveMenuOption = 8 ,
  PrintMenuOption = 16 , TrackMenuOption = 32 , BackgroundSwitchMenuOption = 64 , ShowHideGridMenuOption = 128 ,
  RenameLabelsMenuOption = 256 , SetDisplayRangeMenuOption = 512 , ResetScaleMenuOption = 1024 , ClearPlotMenuOption = 2048 ,
  DefaultHelpMenuOption = 4096 , LineFitMenuOption = 8192 , ConfigurePlotMenuOption = 16384 , AllMenuOptions
}
 There is a menu option for everything in the plot window's menu. More...
 

Public Slots

void clearPlot ()
 This method completely clears the plot of all plot items.
 
void configurePlotCurves ()
 This method creates a CubePlotCurveConfigureDialog object.
 
void createBestFitLine ()
 This method prompts the user to select the best fit line criterea.
 
void printPlot ()
 Provides printing support of the plot image.
 
void changePlotLabels ()
 This method creates the dialog box which allows the user to relabel the plot window.
 
void savePlot ()
 This method allows the user to save the plot as a png, jpg, or tif image file.
 
void setDefaultRange ()
 Resets the x/y min/max to the defaults.
 
void setLabels ()
 Makes the user specified changes to the plot labels.
 
void setUserValues ()
 This method sets the scale for the axis according to the user specified numbers.
 
void showHideAllMarkers ()
 Shows/Hides all the markers(symbols)
 
void showHideAllCurves ()
 This method shows or hides all of the curves in the plotWindow.
 
void resetScale ()
 Sets plot scale back to the defaults.
 
void showHideGrid ()
 This method hides/shows the grid on the plotWindow and changes the text for the action.
 
void showHelp ()
 This method creates and shows the help dialog box for the plot window.
 
void showTable ()
 This method is called from the showTable action on the tool bar There are some checks done to make sure there are data to fill the table.
 
void switchBackground ()
 This method toggles the plot background color between black and white.
 
void trackerEnabled ()
 Enables the plot mouse tracker.
 
void scheduleFillTable ()
 Fills in the table with the data from the current curves in the plotWindow once all current actions/activations are done.
 
void fillTable ()
 Fills in the table with the data from the current curves in the plotWindow immediately.
 

Signals

void closed ()
 Emitted when there is a close event on this window that will be accepted.
 
void plotChanged ()
 Emitted every time there is a change to the plot window.
 
void requestFillTable ()
 

Public Member Functions

 PlotWindow (QString title, PlotCurve::Units xAxisUnits, PlotCurve::Units yAxisUnits, QWidget *parent, MenuOptions optionsToProvide=AllMenuOptions)
 This constructs a plot window.
 
virtual void add (CubePlotCurve *pc)
 This method adds the curves to the plot.
 
virtual void clearPlotCurves ()
 This method also clears the plot of all plot items, but does not call the table delete stuff This method is called from plotTool each time the changePlot() method is called.
 
bool canAdd (CubePlotCurve *curveToTest) const
 This method tests whethere or not a CubePlotCurve can be successfully added to this window.
 
QColor plotBackgroundColor () const
 Returns the plot's background color.
 
QList< CubePlotCurve * > plotCurves ()
 Get a comprehensive list of the plot curves inside of this plot window, excluding plot curves that are in the process of being removed.
 
QList< const CubePlotCurve * > plotCurves () const
 Get a comprehensive const list of the plot curves inside of this plot window, excluding plot curves that are in the process of being removed.
 
QList< QwtPlotSpectrogram * > plotSpectrograms ()
 Get a comprehensive list of the scatter plots (spectrograms) inside of this plot window.
 
QList< const QwtPlotSpectrogram * > plotSpectrograms () const
 Get a comprehensive const list of the scatter plots (spectrograms) inside of this plot window.
 
QString plotTitle () const
 Returns the plot title.
 
bool userCanAddCurves () const
 Ask if a user action can add this curve to this window in general.
 
PlotCurve::Units xAxisUnits () const
 This is the data-type of the curves' x data in this plot window.
 
PlotCurve::Units yAxisUnits () const
 This is the data-type of the curves' y data in this plot window.
 
virtual void paint (MdiCubeViewport *vp, QPainter *painter)
 Paint plot curve information onto the viewport.
 
void replot ()
 Reset the scale of the plot, replot it and emit plot changed.
 
void setAxisLabel (int axisId, QString title)
 Sets the plots given axis title to the given string.
 
void setPlotBackground (QColor c)
 Sets the plot background color to the given color.
 
void setPlotTitle (QString pt)
 Sets the plot title to the given string.
 
void setUserCanAddCurves (bool)
 Allow or disallow users from manually putting curves into this plot window through either copy-and-paste or drag-and-drop.
 
void showWindow ()
 Shows the plot window, and raises it to the front of any overlapping sibling widgets.
 
virtual void update (MdiCubeViewport *activeViewport)
 This is provided to allow children to react to tool updates.
 

Static Public Member Functions

static QString defaultWindowTitle ()
 This is the typical suffix for plot windows, it's here in case we want to update all plot windows to have a different ending than just 'Plot' on them (for example, 'Plot Window').
 
static QString settingsFileName (QString objectTitle)
 

Protected Member Functions

void createWidgets (MenuOptions optionsToProvide)
 This method is called by the constructor to create the plot, legend.
 
void disableAxisAutoScale ()
 This turns off scaling the x/y axes automatically.
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 When a user drags data into our plot window, we need to indicate whether or not this data is compatible with this window.
 
virtual void dropEvent (QDropEvent *event)
 This is called when a user drops data into our window.
 
virtual bool eventFilter (QObject *o, QEvent *e)
 This method filters the events of the objects it is connected to.
 
void mousePressEvent (QObject *object, QMouseEvent *e)
 This is a helper method for the eventFilter() method.
 
QwtPlotplot ()
 Get the plot encapsulated by this PlotWindow.
 
void setMenus (QList< QMenu * > menus, QList< QAction * > actions)
 Sets up the menus added from a parent object.
 
QwtPlotZoomer * zoomer ()
 Get this window's plot's zoomer.
 
QString settingsFileName () const
 
virtual void closeEvent (QCloseEvent *event)
 This method is overridden so that we can be sure to write the current settings of the Main window.
 
virtual void readSettings (QSize defaultSize=QSize())
 This method ensure that the settings get written even if the Main window was only hidden, not closed.
 

Private Slots

void autoScaleCheckboxToggled ()
 This is a helper method for the set scale configuration dialog.
 
void onClipboardChanged ()
 This slot will be called when the system clipboard is changed.
 
void pasteCurve ()
 When the user pastes a curve try to put it into this plot window.
 

Private Member Functions

QPair< double, double > findDataRange (int axisId) const
 This calculates the data range of the specified axis (works with xBottom and yLeft only).
 
bool userCanAddCurve (const QMimeData *curve)
 Ask if a user action can add this curve to this window.
 
void updateVisibility (PlotCurve *curve)
 This method sets the visibility states in the curve (and it's symbols) to match with this window's current visibility settings.
 
void setupDefaultMenu (MenuOptions optionsToProvide)
 The user can add menu items from parent classes, but there are some menu items that are common between many types of plot windows.
 
virtual void writeSettings () const
 This method is called when the Main window is closed or hidden to write the size and location settings to a config file in the user's home directory.
 

Static Private Member Functions

static bool numericStringLessThan (QString left, QString right)
 

Private Attributes

QWidgetm_parent
 Parent widget.
 
QwtPlotZoomer * m_zoomer
 Plot Zoomer.
 
QwtPlotGrid * m_grid
 Plot grid lines.
 
QCheckBox * m_autoScaleCheckBox
 Set Scale Dialog's checkbox for enabling automatic scaling on x & y.
 
QCheckBox * m_xLogCheckBox
 Set Scale Dialog's checkbox for using logarithmic scale for the x axis.
 
QCheckBox * m_yLogCheckBox
 Set Scale Dialog's checkbox for using logarithmic scale for the y axis.
 
QLineEdit * m_xMinEdit
 Set Scale Dialog's edit for the min X-axis value.
 
QLineEdit * m_xMaxEdit
 Set Scale Dialog's edit for the max X-axis value.
 
QLineEdit * m_yMinEdit
 Set Scale Dialog's edit for the min Y-axis value.
 
QLineEdit * m_yMaxEdit
 Set Scale Dialog's edit for the max Y-axis value.
 
QLineEdit * m_xAxisText
 Set Labels Dialog's edit for the x-axis label.
 
QLineEdit * m_yAxisText
 Set Labels Dialog's edit for the y-axis label.
 
QLineEdit * m_plotTitleText
 Set Labels Dialog's edit for the plot title.
 
QMenuBar * m_menubar
 Plot window's menu bar.
 
QActionm_pasteAct
 This is the paste action in the edit menu to paste a curve into the plot window.
 
QPointer< QActionm_action
 Plot window's action.
 
QPointer< QActionm_showHideAllCurves
 Hide all curves action.
 
QPointer< QActionm_showHideAllMarkers
 Hide all markers action.
 
QPointer< QActionm_showHideGrid
 Show plot grid lines action.
 
PlotCurve::Units m_xAxisUnits
 The units of the data on the x-bottom axis.
 
PlotCurve::Units m_yAxisUnits
 The units of the data on the y-left axis.
 
bool m_allowUserToAddCurves
 Is the window showing the curve markers?
 
bool m_autoscaleAxes
 True if we are autoscaling the x-bottom and y-left axes.
 
QwtPlotm_plot
 The plot in this window.
 
QwtLegend * m_legend
 The legend inserted in this plot.
 
bool m_plotXLogScale
 Tracks if the plot X axis is using a log (true) or linear (false) scale.
 
bool m_plotYLogScale
 Tracks if the plot Y axis is using a log (true) or linear (false) scale.
 
TableMainWindowm_tableWindow
 Table window.
 
QToolBarm_toolBar
 Tool bar on the plot window.
 
bool m_scheduledFillTable
 

Detailed Description

Author
????-??-?? Stacy Alley
History

2010-11-08 Eric Hyer - Added replot method

2011-03-18 Sharmila Prasad - Connect the viewport's close signal

2011-03-23 Sharmila Prasad - PlotWindow to be ontop even when it loses focus. This works for both histogram and plot tools.

2011-09-21 Steven Lambright - Removed the fixed size from the configure curve dialog. Fixes #203.

2012-07-03 Steven Lambright - Added labels for Meters/Kilometers units.

2013-02-21 Steven Lambright - Added methods requestFillTable(), scheduleFillTable() in order to increase performance. References #710.

2014-06-23 Ian Humphrey - Modified hard coded /usgs/cpkgs/ paths to relative pathnames. Fixes #2054.

2014-07-02 Ian Humphrey - Added method configurePlotCurves() to create a configure tool that allows user to select which curve to configure from a combo box. Added MenuOption ConfigurePlotMenuOption. Fixes #2089.

2014-07-24 Ian Humphrey - Modified plotCurves() and plotSpectrograms() methods to return a list of curves/spectrograms in the order they appear in the plot (instead of reversed). Used for refactoring. References #2089.

2016-09-14 Ian Humphrey - Modified printPlot() and save() - replaced deprecated static QPixmap::grabWidget with QWidget::grab. References #4304.

2017-05-19 Adam Paquette - Uncommented and modified code for a help menu in the plotting tools. Fixes #2126

Definition at line 88 of file PlotWindow.h.

Member Enumeration Documentation

◆ MenuOptions

There is a menu option for everything in the plot window's menu.

This is provided so that you can enable/disable any given option.

Enumerator
ShowHideMarkersMenuOption 

This option is titled 'Hide All Symbols' which hides all markers.

ShowHideCurvesMenuOption 

This option is titled 'Hide All Curves' which makes all curves invisible.

ShowTableMenuOption 

This option brings up the table.

No table will be available without this option.

SaveMenuOption 

This option exports the plot into a standard image format.

No conversion to a standard image format file will be available without this option, but printing will still be available.

PrintMenuOption 

This option sends the plot to a printer.

TrackMenuOption 

This option enables mouse tracking on the plot area (displays next to the mouse which x/y point you are hovering over).

This option is by default disabled.

BackgroundSwitchMenuOption 

This option enables the ability for a user to change the background color of the plot from black to white.

ShowHideGridMenuOption 

This option enables the ability for a user to enable a grid over the plot area.

RenameLabelsMenuOption 

This option enables the ability for a user to change the x/y axis labels and plot title.

SetDisplayRangeMenuOption 

This option allows the user to set the x/y axis display value ranges.

ResetScaleMenuOption 

This option provides the user with an alternative zoom out button.

ClearPlotMenuOption 

This option allows the user to delete all of the data inside the plot.

If you don't want the user deleting a custom plot item, you should disable this option.

DefaultHelpMenuOption 

Not implemented.

LineFitMenuOption 

This option allows the user to create a best fit line for any of the scatter plot data or cube plot curve data in the window.

This allows the user to create new plot curves.

ConfigurePlotMenuOption 

This option allows the user to change the curve name, color, style size, and symbol of the curve.

AllMenuOptions 

This is all of the available menu options.

Definition at line 96 of file PlotWindow.h.

Constructor & Destructor Documentation

◆ PlotWindow()

Isis::PlotWindow::PlotWindow ( QString title,
PlotCurve::Units xAxisUnits,
PlotCurve::Units yAxisUnits,
QWidget * parent,
MenuOptions optionsToProvide = AllMenuOptions )

This constructs a plot window.

The plot window graphs any curve sent to it via the addPlotCurve() method.

Parameters
titleThe window title and default plot title
xAxisUnitsThe x-bottom axis data's units, which must match any curves' units that are added to this window.
yAxisUnitsThe y-left axis data's units, which must match any curves' units that are added to this window.
parentThe Qt parent widget
optionsToProvideA bit-flag containing information on which options to provide to the users.

Definition at line 65 of file PlotWindow.cpp.

References Isis::PlotCurve::Band, createWidgets(), Isis::PlotCurve::CubeDN, Isis::PlotCurve::Elevation, fillTable(), Isis::PlotCurve::Kilometers, m_allowUserToAddCurves, m_autoscaleAxes, m_menubar, m_parent, m_pasteAct, m_tableWindow, m_toolBar, m_xAxisUnits, m_yAxisUnits, Isis::PlotCurve::Meters, onClipboardChanged(), Isis::PlotCurve::Percentage, Isis::PlotCurve::PixelNumber, plot(), plotChanged(), Isis::IException::Programmer, Isis::MainWindow::readSettings(), scheduleFillTable(), setPlotBackground(), setPlotTitle(), Isis::PlotCurve::Wavelength, xAxisUnits(), and yAxisUnits().

◆ ~PlotWindow()

Isis::PlotWindow::~PlotWindow ( )

Definition at line 130 of file PlotWindow.cpp.

Member Function Documentation

◆ add()

void Isis::PlotWindow::add ( CubePlotCurve * pc)
virtual

This method adds the curves to the plot.

Parameters
pc

Reimplemented in Isis::HistogramPlotWindow.

Definition at line 435 of file PlotWindow.cpp.

References canAdd(), fillTable(), m_legend, m_plot, plot(), plotChanged(), replot(), resetScale(), and updateVisibility().

Referenced by dropEvent(), and pasteCurve().

◆ autoScaleCheckboxToggled

void Isis::PlotWindow::autoScaleCheckboxToggled ( )
privateslot

This is a helper method for the set scale configuration dialog.

This enables or disables options inside of the dialog when a checkbox is clicked in the dialog. This does not change the state of the plot or plot zoomer.

Definition at line 1674 of file PlotWindow.cpp.

References m_autoScaleCheckBox, m_xMaxEdit, m_xMinEdit, m_yMaxEdit, and m_yMinEdit.

Referenced by setDefaultRange().

◆ canAdd()

bool Isis::PlotWindow::canAdd ( CubePlotCurve * curveToTest) const

This method tests whethere or not a CubePlotCurve can be successfully added to this window.

Plot curves with mismatched X/Y data from the plot's x/y axis types can not be added to the window. This does not test whether or not a user is allowed to add the curve manually, just if the curve can be added programatically.

Parameters
curveToTestThe plot curve to test for compatibility with this window
Returns
True if the curve is compatible with this window, false otherwise

Definition at line 304 of file PlotWindow.cpp.

References m_xAxisUnits, and m_yAxisUnits.

Referenced by add(), and userCanAddCurve().

◆ changePlotLabels

void Isis::PlotWindow::changePlotLabels ( )
slot

This method creates the dialog box which allows the user to relabel the plot window.

Definition at line 853 of file PlotWindow.cpp.

References m_plot, m_plotTitleText, m_xAxisText, m_yAxisText, plot(), and setLabels().

Referenced by setupDefaultMenu().

◆ clearPlot

void Isis::PlotWindow::clearPlot ( )
slot

This method completely clears the plot of all plot items.

i.e. curves and markers, which also deletes the legend also calls the necessary method to delete the table stuff

Definition at line 491 of file PlotWindow.cpp.

References clearPlotCurves(), m_tableWindow, and Isis::TableMainWindow::table().

Referenced by setupDefaultMenu().

◆ clearPlotCurves()

void Isis::PlotWindow::clearPlotCurves ( )
virtual

This method also clears the plot of all plot items, but does not call the table delete stuff This method is called from plotTool each time the changePlot() method is called.

Definition at line 539 of file PlotWindow.cpp.

References m_plot, and replot().

Referenced by clearPlot().

◆ closed

void Isis::PlotWindow::closed ( )
signal

Emitted when there is a close event on this window that will be accepted.

Referenced by eventFilter().

◆ closeEvent()

void Isis::MainWindow::closeEvent ( QCloseEvent * event)
protectedvirtualinherited

This method is overridden so that we can be sure to write the current settings of the Main window.

Parameters
event

Reimplemented in Isis::TableMainWindow, and Isis::ViewportMainWindow.

Definition at line 37 of file MainWindow.cpp.

References Isis::MainWindow::writeSettings().

Referenced by Isis::TableMainWindow::closeEvent(), and Isis::ViewportMainWindow::closeEvent().

◆ configurePlotCurves

void Isis::PlotWindow::configurePlotCurves ( )
slot

This method creates a CubePlotCurveConfigureDialog object.

When there are no curves in this PlotWindow, the dialog will not be created.

Definition at line 507 of file PlotWindow.cpp.

References plotChanged(), and plotCurves().

Referenced by setupDefaultMenu().

◆ createBestFitLine

void Isis::PlotWindow::createBestFitLine ( )
slot

This method prompts the user to select the best fit line criterea.

The PlotWindowBestFitDialog will create the best fit line automatically when the user asks for one, so we don't need to worry about doing any more than showing a dialog here.

Definition at line 528 of file PlotWindow.cpp.

References plot().

Referenced by setupDefaultMenu().

◆ createWidgets()

void Isis::PlotWindow::createWidgets ( MenuOptions optionsToProvide)
protected

This method is called by the constructor to create the plot, legend.

zoomer, and main window.

Parameters
optionsToProvideThis is a bit-flag containing information on which menu options to give the user/put in the GUI.

Definition at line 144 of file PlotWindow.cpp.

References m_grid, m_legend, m_plot, m_zoomer, and setupDefaultMenu().

Referenced by PlotWindow().

◆ defaultWindowTitle()

QString Isis::PlotWindow::defaultWindowTitle ( )
static

This is the typical suffix for plot windows, it's here in case we want to update all plot windows to have a different ending than just 'Plot' on them (for example, 'Plot Window').

Returns
A string to be appended to your window title

Definition at line 1809 of file PlotWindow.cpp.

Referenced by Isis::HistogramTool::createWindow(), Isis::SpatialPlotTool::createWindow(), and Isis::SpectralPlotTool::createWindow().

◆ disableAxisAutoScale()

void Isis::PlotWindow::disableAxisAutoScale ( )
protected

This turns off scaling the x/y axes automatically.

Use this if you have a very specific axis range you want to use, but keep in mind that users (potentially) have an option to re-enable axis auto scaling if they want to.

Definition at line 1663 of file PlotWindow.cpp.

References m_autoscaleAxes.

Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().

◆ dragEnterEvent()

void Isis::PlotWindow::dragEnterEvent ( QDragEnterEvent * event)
protectedvirtual

When a user drags data into our plot window, we need to indicate whether or not this data is compatible with this window.

This checks userCanAddCurve() on the drag & drop data and allows or disallowed the event accordingly.

Parameters
eventThe drag event to test

Definition at line 1822 of file PlotWindow.cpp.

References m_legend, and userCanAddCurve().

◆ dropEvent()

void Isis::PlotWindow::dropEvent ( QDropEvent * event)
protectedvirtual

This is called when a user drops data into our window.

The dragEnterEvent() must have said that this curve is compatible with this window. This provides all of the available options to the user (if any) set by the creator of the drag & drop event (i.e. whether or not we can move or just copy). If there are options, we create a context menu - otherwise the default action is taken.

Parameters
eventThe drop event containing the curve to put into the current window.

Definition at line 1843 of file PlotWindow.cpp.

References add(), m_allowUserToAddCurves, and plotChanged().

◆ eventFilter()

bool Isis::PlotWindow::eventFilter ( QObject * o,
QEvent * e )
protectedvirtual

This method filters the events of the objects it is connected to.

In this case, the eventFilter has been installed on the m_plot and m_legend.

Parameters
o
e
Returns
bool

Reimplemented in Isis::ScatterPlotWindow.

Definition at line 1589 of file PlotWindow.cpp.

References closed(), mousePressEvent(), and plot().

Referenced by Isis::ScatterPlotWindow::eventFilter().

◆ fillTable

void Isis::PlotWindow::fillTable ( )
slot

Fills in the table with the data from the current curves in the plotWindow immediately.

Definition at line 1410 of file PlotWindow.cpp.

References Isis::TableMainWindow::addToTable(), Isis::IsSpecial(), Isis::TableMainWindow::listWidget(), m_plot, m_tableWindow, Isis::Null, plotCurves(), Isis::TableMainWindow::table(), Isis::toDouble(), and Isis::toString().

Referenced by add(), PlotWindow(), and showTable().

◆ findDataRange()

QPair< double, double > Isis::PlotWindow::findDataRange ( int axisId) const
private

This calculates the data range of the specified axis (works with xBottom and yLeft only).

This is used to provide unit context (band #'s shouldn't ever pad) and to fix the lack of an axis when only one value exists (if there is only one x-value, this will always pad with +/- 0.5).

Parameters
axisIdThis must be yLeft or xBottom
Returns
The double range of the data contained by the given axis.

Definition at line 1721 of file PlotWindow.cpp.

References plotCurves().

Referenced by resetScale().

◆ mousePressEvent()

void Isis::PlotWindow::mousePressEvent ( QObject * object,
QMouseEvent * event )
protected

This is a helper method for the eventFilter() method.

When a mouse press event is seen, this handles it. For example, if the user right clicks and the clipboard contains compatible data then this will give a paste option.

Parameters
objectThe object which was pressed
eventThe mouse event which contains button information

Definition at line 1627 of file PlotWindow.cpp.

References pasteCurve(), and userCanAddCurve().

Referenced by eventFilter().

◆ numericStringLessThan()

bool Isis::PlotWindow::numericStringLessThan ( QString left,
QString right )
staticprivate

Definition at line 1767 of file PlotWindow.cpp.

◆ onClipboardChanged

void Isis::PlotWindow::onClipboardChanged ( )
privateslot

This slot will be called when the system clipboard is changed.

Definition at line 1685 of file PlotWindow.cpp.

References m_pasteAct, and userCanAddCurve().

Referenced by PlotWindow().

◆ paint()

void Isis::PlotWindow::paint ( MdiCubeViewport * vp,
QPainter * painter )
virtual

Paint plot curve information onto the viewport.

Parameters
vpThe cube viewport to paint onto
painterThe painter to use for painting

Reimplemented in Isis::ScatterPlotWindow.

Definition at line 1786 of file PlotWindow.cpp.

References plotCurves().

Referenced by Isis::ScatterPlotWindow::paint(), and Isis::AbstractPlotTool::paintViewport().

◆ pasteCurve

void Isis::PlotWindow::pasteCurve ( )
privateslot

When the user pastes a curve try to put it into this plot window.

This shouldn't be called when the curve on the system clipboard isn't compatible.

Definition at line 1696 of file PlotWindow.cpp.

References add(), m_allowUserToAddCurves, and plotChanged().

Referenced by mousePressEvent(), and setupDefaultMenu().

◆ plot()

◆ plotBackgroundColor()

QColor Isis::PlotWindow::plotBackgroundColor ( ) const

Returns the plot's background color.

Returns
QColor

Definition at line 316 of file PlotWindow.cpp.

References m_plot.

◆ plotChanged

void Isis::PlotWindow::plotChanged ( )
signal

◆ plotCurves() [1/2]

QList< CubePlotCurve * > Isis::PlotWindow::plotCurves ( )

Get a comprehensive list of the plot curves inside of this plot window, excluding plot curves that are in the process of being removed.

Returns
The plot curves contained inside of this plot window

Definition at line 327 of file PlotWindow.cpp.

References m_plot.

Referenced by configurePlotCurves(), fillTable(), findDataRange(), paint(), and showTable().

◆ plotCurves() [2/2]

QList< const CubePlotCurve * > Isis::PlotWindow::plotCurves ( ) const

Get a comprehensive const list of the plot curves inside of this plot window, excluding plot curves that are in the process of being removed.

Returns
The const plot curves contained inside of this plot window

Definition at line 353 of file PlotWindow.cpp.

References m_plot.

◆ plotSpectrograms() [1/2]

QList< QwtPlotSpectrogram * > Isis::PlotWindow::plotSpectrograms ( )

Get a comprehensive list of the scatter plots (spectrograms) inside of this plot window.

Returns
The spectrograms (scatter plots) contained inside of this plot window

Definition at line 380 of file PlotWindow.cpp.

References m_plot.

◆ plotSpectrograms() [2/2]

QList< const QwtPlotSpectrogram * > Isis::PlotWindow::plotSpectrograms ( ) const

Get a comprehensive const list of the scatter plots (spectrograms) inside of this plot window.

Returns
The const spectrograms (scatter plots) contained inside of this plot window

Definition at line 408 of file PlotWindow.cpp.

References m_plot.

◆ plotTitle()

QString Isis::PlotWindow::plotTitle ( ) const

Returns the plot title.

Returns
QwtText

Definition at line 240 of file PlotWindow.cpp.

References m_plot.

◆ printPlot

void Isis::PlotWindow::printPlot ( )
slot

Provides printing support of the plot image.

Definition at line 572 of file PlotWindow.cpp.

References m_plot.

Referenced by setupDefaultMenu().

◆ readSettings()

void Isis::MainWindow::readSettings ( QSize defaultSize = QSize())
protectedvirtualinherited

This method ensure that the settings get written even if the Main window was only hidden, not closed.

Parameters
eventThis method is called from the constructor so that when the Main window is created, it know's it's size and location.

Reimplemented in Isis::MosaicMainWindow.

Definition at line 80 of file MainWindow.cpp.

Referenced by PlotWindow(), Isis::TableMainWindow::TableMainWindow(), and Isis::ViewportMainWindow::ViewportMainWindow().

◆ replot()

void Isis::PlotWindow::replot ( )

◆ resetScale

void Isis::PlotWindow::resetScale ( )
slot

Sets plot scale back to the defaults.

Definition at line 659 of file PlotWindow.cpp.

References Isis::PlotCurve::Band, findDataRange(), m_autoscaleAxes, m_plot, m_xAxisUnits, m_yAxisUnits, and m_zoomer.

Referenced by add(), replot(), and setupDefaultMenu().

◆ savePlot

void Isis::PlotWindow::savePlot ( )
slot

This method allows the user to save the plot as a png, jpg, or tif image file.

Definition at line 604 of file PlotWindow.cpp.

References m_plot.

Referenced by setupDefaultMenu().

◆ scheduleFillTable

void Isis::PlotWindow::scheduleFillTable ( )
slot

Fills in the table with the data from the current curves in the plotWindow once all current actions/activations are done.

This is provided for performance reasons - re-plotting 4 curves only requires one fillTable at the end, instead of after each curve change.

Definition at line 1398 of file PlotWindow.cpp.

Referenced by PlotWindow().

◆ setAxisLabel()

void Isis::PlotWindow::setAxisLabel ( int axisId,
QString title )

Sets the plots given axis title to the given string.

Parameters
axisId
title

Definition at line 207 of file PlotWindow.cpp.

References m_plot.

◆ setDefaultRange

void Isis::PlotWindow::setDefaultRange ( )
slot

◆ setLabels

void Isis::PlotWindow::setLabels ( )
slot

Makes the user specified changes to the plot labels.

Definition at line 909 of file PlotWindow.cpp.

References m_plot, m_plotTitleText, m_xAxisText, and m_yAxisText.

Referenced by changePlotLabels().

◆ setMenus()

void Isis::PlotWindow::setMenus ( QList< QMenu * > menu,
QList< QAction * > actions )
protected

Sets up the menus added from a parent object.

Parameters
menu
actions

Definition at line 1357 of file PlotWindow.cpp.

References m_menubar, and m_toolBar.

Referenced by setupDefaultMenu().

◆ setPlotBackground()

void Isis::PlotWindow::setPlotBackground ( QColor c)

Sets the plot background color to the given color.

Parameters
c

Definition at line 288 of file PlotWindow.cpp.

References m_plot.

Referenced by Isis::HistogramPlotWindow::HistogramPlotWindow(), and PlotWindow().

◆ setPlotTitle()

void Isis::PlotWindow::setPlotTitle ( QString pt)

Sets the plot title to the given string.

This does not update the window title.

Parameters
ptThe plot title to use

Definition at line 218 of file PlotWindow.cpp.

References m_plot.

Referenced by PlotWindow().

◆ settingsFileName() [1/2]

QString Isis::MainWindow::settingsFileName ( ) const
protectedinherited

Definition at line 96 of file MainWindow.cpp.

◆ settingsFileName() [2/2]

QString Isis::MainWindow::settingsFileName ( QString objectTitle)
staticinherited

Definition at line 43 of file MainWindow.cpp.

◆ setupDefaultMenu()

void Isis::PlotWindow::setupDefaultMenu ( MenuOptions optionsToProvide)
private

◆ setUserCanAddCurves()

void Isis::PlotWindow::setUserCanAddCurves ( bool userHasControl)

Allow or disallow users from manually putting curves into this plot window through either copy-and-paste or drag-and-drop.

Parameters
userHasControlTrue if users can add curves manually, false otherwise

Definition at line 230 of file PlotWindow.cpp.

References m_allowUserToAddCurves.

◆ setUserValues

void Isis::PlotWindow::setUserValues ( )
slot

This method sets the scale for the axis according to the user specified numbers.

Definition at line 693 of file PlotWindow.cpp.

References m_autoscaleAxes, m_autoScaleCheckBox, m_plot, m_plotXLogScale, m_plotYLogScale, m_xLogCheckBox, m_xMaxEdit, m_xMinEdit, m_yLogCheckBox, m_yMaxEdit, m_yMinEdit, m_zoomer, and replot().

Referenced by setDefaultRange().

◆ showHelp

void Isis::PlotWindow::showHelp ( )
slot

This method creates and shows the help dialog box for the plot window.

this is called from the Help-->Basic Help menu.

Definition at line 998 of file PlotWindow.cpp.

References m_plot.

Referenced by setupDefaultMenu().

◆ showHideAllCurves

void Isis::PlotWindow::showHideAllCurves ( )
slot

This method shows or hides all of the curves in the plotWindow.

Definition at line 966 of file PlotWindow.cpp.

References m_plot, and m_showHideAllCurves.

Referenced by setupDefaultMenu().

◆ showHideAllMarkers

void Isis::PlotWindow::showHideAllMarkers ( )
slot

Shows/Hides all the markers(symbols)

Definition at line 938 of file PlotWindow.cpp.

References m_plot, and m_showHideAllMarkers.

Referenced by setupDefaultMenu().

◆ showHideGrid

void Isis::PlotWindow::showHideGrid ( )
slot

This method hides/shows the grid on the plotWindow and changes the text for the action.

Definition at line 922 of file PlotWindow.cpp.

References m_grid, m_plot, and m_showHideGrid.

Referenced by setupDefaultMenu().

◆ showTable

void Isis::PlotWindow::showTable ( )
slot

This method is called from the showTable action on the tool bar There are some checks done to make sure there are data to fill the table.

Definition at line 1565 of file PlotWindow.cpp.

References fillTable(), m_parent, m_tableWindow, plotCurves(), Isis::TableMainWindow::setTrackListItems(), and Isis::TableMainWindow::syncColumns().

Referenced by setupDefaultMenu().

◆ showWindow()

void Isis::PlotWindow::showWindow ( )

Shows the plot window, and raises it to the front of any overlapping sibling widgets.

Definition at line 184 of file PlotWindow.cpp.

Referenced by Isis::AbstractPlotTool::selectedWindowChanged(), and Isis::AbstractPlotTool::showPlotWindow().

◆ switchBackground

void Isis::PlotWindow::switchBackground ( )
slot

This method toggles the plot background color between black and white.

Definition at line 634 of file PlotWindow.cpp.

References m_grid, m_plot, and m_zoomer.

Referenced by setupDefaultMenu().

◆ trackerEnabled

void Isis::PlotWindow::trackerEnabled ( )
slot

Enables the plot mouse tracker.

Definition at line 559 of file PlotWindow.cpp.

References m_zoomer.

Referenced by setupDefaultMenu().

◆ update()

void Isis::PlotWindow::update ( MdiCubeViewport * activeViewport)
virtual

This is provided to allow children to react to tool updates.

This is useful for example for band markers in the spectral plots.

Parameters
activeViewportThe currently selected viewport

Reimplemented in Isis::SpectralPlotWindow.

Definition at line 196 of file PlotWindow.cpp.

◆ updateVisibility()

void Isis::PlotWindow::updateVisibility ( PlotCurve * curve)
private

This method sets the visibility states in the curve (and it's symbols) to match with this window's current visibility settings.

Every means of adding a curve to the window needs to call this with the curve that is being added, otherwise visibility states will not be consistent.

Parameters
curveCurve (with symbols) to set the visibility states on

Definition at line 1329 of file PlotWindow.cpp.

References m_showHideAllCurves, m_showHideAllMarkers, and plotChanged().

Referenced by add().

◆ userCanAddCurve()

bool Isis::PlotWindow::userCanAddCurve ( const QMimeData * curve)
private

Ask if a user action can add this curve to this window.

This verifies that the user is allowed to add curves to this window and that programmatically the curve can be added (i.e. things such as the X/Y data units match).

Parameters
curveMime-data containing a plot curve to be added
Returns
True if the user should be allowed to paste/drop the curve into this window

Definition at line 1305 of file PlotWindow.cpp.

References canAdd(), and m_allowUserToAddCurves.

Referenced by dragEnterEvent(), mousePressEvent(), and onClipboardChanged().

◆ userCanAddCurves()

bool Isis::PlotWindow::userCanAddCurves ( ) const

Ask if a user action can add this curve to this window in general.

This verifies that the user is allowed to add curves to this window but not that a particular curve is compatible with this window.

Returns
True if the user should be allowed to paste/drop curves in general into this window

Definition at line 253 of file PlotWindow.cpp.

References m_allowUserToAddCurves.

◆ writeSettings()

void Isis::MainWindow::writeSettings ( ) const
privatevirtualinherited

This method is called when the Main window is closed or hidden to write the size and location settings to a config file in the user's home directory.

Definition at line 124 of file MainWindow.cpp.

Referenced by Isis::MainWindow::closeEvent().

◆ xAxisUnits()

PlotCurve::Units Isis::PlotWindow::xAxisUnits ( ) const

This is the data-type of the curves' x data in this plot window.

All of the cube plot curves must have the same units for x axis data or the display will not make sense.

Returns
X-Axis Curve Data Units

Definition at line 265 of file PlotWindow.cpp.

References m_xAxisUnits.

Referenced by Isis::SpectralPlotWindow::drawBandMarkers(), and PlotWindow().

◆ yAxisUnits()

PlotCurve::Units Isis::PlotWindow::yAxisUnits ( ) const

This is the data-type of the curves' y data in this plot window.

All of the cube plot curves must have the same units for y-left axis data (y-right sometimes has different units) or the display will not make sense.

Returns
Left Y-Axis Data Units

Definition at line 277 of file PlotWindow.cpp.

References m_yAxisUnits.

Referenced by PlotWindow().

◆ zoomer()

QwtPlotZoomer * Isis::PlotWindow::zoomer ( )
protected

Get this window's plot's zoomer.

Returns
A QwtPlotZoomer which is associated with this PlotWindow's QwtPlot

Definition at line 1387 of file PlotWindow.cpp.

References m_zoomer.

Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().

Member Data Documentation

◆ m_action

QPointer<QAction> Isis::PlotWindow::m_action
private

Plot window's action.

Definition at line 312 of file PlotWindow.h.

◆ m_allowUserToAddCurves

bool Isis::PlotWindow::m_allowUserToAddCurves
private

Is the window showing the curve markers?

Definition at line 326 of file PlotWindow.h.

Referenced by dropEvent(), pasteCurve(), PlotWindow(), setUserCanAddCurves(), userCanAddCurve(), and userCanAddCurves().

◆ m_autoscaleAxes

bool Isis::PlotWindow::m_autoscaleAxes
private

True if we are autoscaling the x-bottom and y-left axes.

Definition at line 328 of file PlotWindow.h.

Referenced by disableAxisAutoScale(), PlotWindow(), resetScale(), setDefaultRange(), and setUserValues().

◆ m_autoScaleCheckBox

QCheckBox* Isis::PlotWindow::m_autoScaleCheckBox
private

Set Scale Dialog's checkbox for enabling automatic scaling on x & y.

Definition at line 281 of file PlotWindow.h.

Referenced by autoScaleCheckboxToggled(), setDefaultRange(), and setUserValues().

◆ m_grid

QwtPlotGrid* Isis::PlotWindow::m_grid
private

Plot grid lines.

Definition at line 279 of file PlotWindow.h.

Referenced by createWidgets(), showHideGrid(), and switchBackground().

◆ m_legend

QwtLegend* Isis::PlotWindow::m_legend
private

The legend inserted in this plot.

Definition at line 331 of file PlotWindow.h.

Referenced by add(), createWidgets(), and dragEnterEvent().

◆ m_menubar

QMenuBar* Isis::PlotWindow::m_menubar
private

Plot window's menu bar.

Definition at line 302 of file PlotWindow.h.

Referenced by PlotWindow(), and setMenus().

◆ m_parent

QWidget* Isis::PlotWindow::m_parent
private

Parent widget.

Definition at line 275 of file PlotWindow.h.

Referenced by PlotWindow(), and showTable().

◆ m_pasteAct

QAction* Isis::PlotWindow::m_pasteAct
private

This is the paste action in the edit menu to paste a curve into the plot window.

This is enabled or disabled based on what is in the clipboard.

Definition at line 309 of file PlotWindow.h.

Referenced by onClipboardChanged(), PlotWindow(), and setupDefaultMenu().

◆ m_plot

◆ m_plotTitleText

QLineEdit* Isis::PlotWindow::m_plotTitleText
private

Set Labels Dialog's edit for the plot title.

Definition at line 299 of file PlotWindow.h.

Referenced by changePlotLabels(), and setLabels().

◆ m_plotXLogScale

bool Isis::PlotWindow::m_plotXLogScale
private

Tracks if the plot X axis is using a log (true) or linear (false) scale.

Definition at line 332 of file PlotWindow.h.

Referenced by setDefaultRange(), and setUserValues().

◆ m_plotYLogScale

bool Isis::PlotWindow::m_plotYLogScale
private

Tracks if the plot Y axis is using a log (true) or linear (false) scale.

Definition at line 333 of file PlotWindow.h.

Referenced by setDefaultRange(), and setUserValues().

◆ m_scheduledFillTable

bool Isis::PlotWindow::m_scheduledFillTable
private

Definition at line 337 of file PlotWindow.h.

◆ m_showHideAllCurves

QPointer<QAction> Isis::PlotWindow::m_showHideAllCurves
private

Hide all curves action.

Definition at line 314 of file PlotWindow.h.

Referenced by setupDefaultMenu(), showHideAllCurves(), and updateVisibility().

◆ m_showHideAllMarkers

QPointer<QAction> Isis::PlotWindow::m_showHideAllMarkers
private

Hide all markers action.

Definition at line 316 of file PlotWindow.h.

Referenced by setupDefaultMenu(), showHideAllMarkers(), and updateVisibility().

◆ m_showHideGrid

QPointer<QAction> Isis::PlotWindow::m_showHideGrid
private

Show plot grid lines action.

Definition at line 318 of file PlotWindow.h.

Referenced by setupDefaultMenu(), and showHideGrid().

◆ m_tableWindow

TableMainWindow* Isis::PlotWindow::m_tableWindow
private

Table window.

Definition at line 334 of file PlotWindow.h.

Referenced by clearPlot(), fillTable(), PlotWindow(), and showTable().

◆ m_toolBar

QToolBar* Isis::PlotWindow::m_toolBar
private

Tool bar on the plot window.

Definition at line 335 of file PlotWindow.h.

Referenced by PlotWindow(), and setMenus().

◆ m_xAxisText

QLineEdit* Isis::PlotWindow::m_xAxisText
private

Set Labels Dialog's edit for the x-axis label.

Definition at line 295 of file PlotWindow.h.

Referenced by changePlotLabels(), and setLabels().

◆ m_xAxisUnits

PlotCurve::Units Isis::PlotWindow::m_xAxisUnits
private

The units of the data on the x-bottom axis.

Definition at line 321 of file PlotWindow.h.

Referenced by canAdd(), PlotWindow(), resetScale(), and xAxisUnits().

◆ m_xLogCheckBox

QCheckBox* Isis::PlotWindow::m_xLogCheckBox
private

Set Scale Dialog's checkbox for using logarithmic scale for the x axis.

Definition at line 283 of file PlotWindow.h.

Referenced by setDefaultRange(), and setUserValues().

◆ m_xMaxEdit

QLineEdit* Isis::PlotWindow::m_xMaxEdit
private

Set Scale Dialog's edit for the max X-axis value.

Definition at line 289 of file PlotWindow.h.

Referenced by autoScaleCheckboxToggled(), setDefaultRange(), and setUserValues().

◆ m_xMinEdit

QLineEdit* Isis::PlotWindow::m_xMinEdit
private

Set Scale Dialog's edit for the min X-axis value.

Definition at line 287 of file PlotWindow.h.

Referenced by autoScaleCheckboxToggled(), setDefaultRange(), and setUserValues().

◆ m_yAxisText

QLineEdit* Isis::PlotWindow::m_yAxisText
private

Set Labels Dialog's edit for the y-axis label.

Definition at line 297 of file PlotWindow.h.

Referenced by changePlotLabels(), and setLabels().

◆ m_yAxisUnits

PlotCurve::Units Isis::PlotWindow::m_yAxisUnits
private

The units of the data on the y-left axis.

Definition at line 323 of file PlotWindow.h.

Referenced by canAdd(), PlotWindow(), resetScale(), and yAxisUnits().

◆ m_yLogCheckBox

QCheckBox* Isis::PlotWindow::m_yLogCheckBox
private

Set Scale Dialog's checkbox for using logarithmic scale for the y axis.

Definition at line 285 of file PlotWindow.h.

Referenced by setDefaultRange(), and setUserValues().

◆ m_yMaxEdit

QLineEdit* Isis::PlotWindow::m_yMaxEdit
private

Set Scale Dialog's edit for the max Y-axis value.

Definition at line 293 of file PlotWindow.h.

Referenced by autoScaleCheckboxToggled(), setDefaultRange(), and setUserValues().

◆ m_yMinEdit

QLineEdit* Isis::PlotWindow::m_yMinEdit
private

Set Scale Dialog's edit for the min Y-axis value.

Definition at line 291 of file PlotWindow.h.

Referenced by autoScaleCheckboxToggled(), setDefaultRange(), and setUserValues().

◆ m_zoomer

QwtPlotZoomer* Isis::PlotWindow::m_zoomer
private

Plot Zoomer.

Definition at line 277 of file PlotWindow.h.

Referenced by createWidgets(), resetScale(), setUserValues(), switchBackground(), trackerEnabled(), and zoomer().


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