Isis 3.0 Developer's Reference (API) |
Home |
#include <PlotWindow.h>
Inherits Isis::MainWindow.
Inherited by Isis::HistogramPlotWindow, Isis::ScatterPlotWindow, and Isis::SpectralPlotWindow.
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, AllMenuOptions } |
Public Slots | |
void | clearPlot () |
This method completely clears the plot of all plot items. | |
void | createBestFitLine () |
void | printPlot () |
Provids 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 | fillTable () |
Fills in the table with the data from the current curves in the plotWindow. | |
Signals | |
void | closed () |
void | plotChanged () |
Emitted every time there is a change to the plot window. | |
Public Member Functions | |
PlotWindow (QString title, PlotCurve::Units xAxisUnits, PlotCurve::Units yAxisUnits, QWidget *parent, MenuOptions optionsToProvide=AllMenuOptions) | |
This constructs a plot window. | |
~PlotWindow () | |
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 |
QColor | plotBackgroundColor () const |
Returns the plot's background color. | |
QList< CubePlotCurve * > | plotCurves () |
QList< const CubePlotCurve * > | plotCurves () const |
QList< QwtPlotSpectrogram * > | plotSpectrograms () |
QList< const QwtPlotSpectrogram * > | plotSpectrograms () const |
QString | plotTitle () const |
Returns the plot title. | |
bool | userCanAddCurves () const |
PlotCurve::Units | xAxisUnits () const |
PlotCurve::Units | yAxisUnits () const |
virtual void | paint (MdiCubeViewport *vp, QPainter *painter) |
void | replot () |
replot the plot | |
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) |
Returns the axis title of the given axis. | |
void | setUserCanAddCurves (bool) |
void | showWindow () |
Shows the plot window, and raises it to the front of any overlapping sibling widgets. | |
virtual void | update (MdiCubeViewport *activeViewport) |
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 | hideEvent (QHideEvent *event) |
This method ensure that the settings get written even if the Main window was only hidden, not closed. | |
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 Public Member Functions | |
static QString | defaultWindowTitle () |
Protected Slots | |
void | writeSettings () |
This overridden method is called when the mainwindow is closed or hidden to write the size and location settings (and tool bar location) to a config file in the user's home directory. | |
void | readSettings () |
This overridden method is called from the constructor so that when the mainwindow is created, it knows it's size and location and the tool bar location. | |
Protected Member Functions | |
void | createWidgets (MenuOptions optionsToProvide) |
This method is called by the constructor to create the plot, legend. | |
void | disableAxisAutoScale () |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
void | enableZoomer (bool enable) |
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) |
QString | menuName () const |
Returns the name of the menu. | |
QwtPlot * | plot () |
void | setMenus (QList< QMenu * > menus, QList< QAction * > actions) |
Sets up the menus added from a parent object. | |
QwtPlotZoomer * | zoomer () |
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.
title | ||
parent |
References _FILEINFO_, Isis::PlotCurve::Band, createWidgets(), Isis::PlotCurve::CubeDN, Isis::PlotCurve::Elevation, fillTable(), Isis::iException::Message(), Isis::PlotCurve::Percentage, Isis::PlotCurve::PixelNumber, plot(), plotChanged(), Isis::iException::Programmer, readSettings(), setPlotBackground(), setPlotTitle(), and Isis::PlotCurve::Wavelength.
Isis::PlotWindow::~PlotWindow | ( | ) |
void Isis::PlotWindow::add | ( | CubePlotCurve * | pc | ) | [virtual] |
This method adds the curves to the plot.
pc |
References Isis::PlotCurve::attachMarkers(), canAdd(), fillTable(), plotChanged(), replot(), and resetScale().
Referenced by dropEvent().
bool Isis::PlotWindow::canAdd | ( | CubePlotCurve * | curveToTest | ) | const |
References Isis::PlotCurve::xUnits(), and Isis::PlotCurve::yUnits().
Referenced by add().
void Isis::PlotWindow::changePlotLabels | ( | ) | [slot] |
This method creates the dialog box which allows the user to relabel the plot window.
References plot(), and setLabels().
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
References clearPlotCurves(), and Isis::TableMainWindow::table().
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.
keepScale |
References replot().
Referenced by clearPlot().
void Isis::PlotWindow::closed | ( | ) | [signal] |
Referenced by eventFilter().
void Isis::MainWindow::closeEvent | ( | QCloseEvent * | event | ) | [virtual, inherited] |
This method is overridden so that we can be sure to write the current settings of the Main window.
event |
Reimplemented in Isis::TableMainWindow, and Isis::ViewportMainWindow.
void Isis::PlotWindow::createBestFitLine | ( | ) | [slot] |
References plot().
void Isis::PlotWindow::createWidgets | ( | MenuOptions | optionsToProvide | ) | [protected] |
This method is called by the constructor to create the plot, legend.
zoomer, and main window
Referenced by PlotWindow().
QString Isis::PlotWindow::defaultWindowTitle | ( | ) | [static] |
Referenced by Isis::SpectralPlotTool::createWindow(), and Isis::SpatialPlotTool::createWindow().
void Isis::PlotWindow::disableAxisAutoScale | ( | ) | [protected] |
Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().
void Isis::PlotWindow::dragEnterEvent | ( | QDragEnterEvent * | event | ) | [protected, virtual] |
void Isis::PlotWindow::dropEvent | ( | QDropEvent * | event | ) | [protected, virtual] |
References add(), and plotChanged().
void Isis::PlotWindow::enableZoomer | ( | bool | enable | ) | [protected] |
bool Isis::PlotWindow::eventFilter | ( | QObject * | o, | |
QEvent * | e | |||
) | [protected, virtual] |
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.
o | ||
e |
Reimplemented from Isis::MainWindow.
Reimplemented in Isis::ScatterPlotWindow.
References ASSERT, closed(), mousePressEvent(), plot(), pos, and writeSettings().
void Isis::PlotWindow::fillTable | ( | ) | [slot] |
Fills in the table with the data from the current curves in the plotWindow.
References Isis::TableMainWindow::addToTable(), Isis::IsSpecial(), Isis::TableMainWindow::listWidget(), Isis::Null, plotCurves(), Isis::TableMainWindow::table(), and y.
Referenced by add(), PlotWindow(), and showTable().
void Isis::MainWindow::hideEvent | ( | QHideEvent * | event | ) | [virtual, inherited] |
This method ensure that the settings get written even if the Main window was only hidden, not closed.
event |
Reimplemented in Isis::TableMainWindow.
QString Isis::PlotWindow::menuName | ( | ) | const [inline, protected] |
Returns the name of the menu.
void Isis::PlotWindow::mousePressEvent | ( | QObject * | object, | |
QMouseEvent * | e | |||
) | [protected] |
Referenced by eventFilter().
void Isis::PlotWindow::paint | ( | MdiCubeViewport * | vp, | |
QPainter * | painter | |||
) | [virtual] |
Reimplemented in Isis::ScatterPlotWindow.
References Isis::CubePlotCurve::paint(), and plotCurves().
Referenced by Isis::AbstractPlotTool::paintViewport().
QwtPlot * Isis::PlotWindow::plot | ( | ) | [protected] |
Referenced by Isis::HistogramPlotWindow::add(), changePlotLabels(), Isis::ScatterPlotWindow::colorPlot(), createBestFitLine(), Isis::ScatterPlotWindow::eventFilter(), eventFilter(), PlotWindow(), Isis::ScatterPlotWindow::ScatterPlotWindow(), setDefaultRange(), and Isis::ScatterPlotWindow::setMousePosition().
QColor Isis::PlotWindow::plotBackgroundColor | ( | ) | const |
Returns the plot's background color.
void Isis::PlotWindow::plotChanged | ( | ) | [signal] |
Emitted every time there is a change to the plot window.
Referenced by add(), dropEvent(), PlotWindow(), and replot().
QList< const CubePlotCurve * > Isis::PlotWindow::plotCurves | ( | ) | const |
QList< CubePlotCurve * > Isis::PlotWindow::plotCurves | ( | ) |
References Isis::PlotCurve::color().
Referenced by fillTable(), paint(), and showTable().
QList< const QwtPlotSpectrogram * > Isis::PlotWindow::plotSpectrograms | ( | ) | const |
QList< QwtPlotSpectrogram * > Isis::PlotWindow::plotSpectrograms | ( | ) |
QString Isis::PlotWindow::plotTitle | ( | ) | const |
Returns the plot title.
void Isis::PlotWindow::printPlot | ( | ) | [slot] |
Provids printing support of the plot image.
References size.
void Isis::PlotWindow::readSettings | ( | ) | [protected, virtual, slot] |
This overridden method is called from the constructor so that when the mainwindow is created, it knows it's size and location and the tool bar location.
Reimplemented from Isis::MainWindow.
References Isis::Filename::Expanded().
Referenced by PlotWindow().
void Isis::PlotWindow::replot | ( | ) |
replot the plot
References plotChanged(), and resetScale().
Referenced by add(), clearPlotCurves(), Isis::ScatterPlotWindow::colorPlot(), Isis::SpectralPlotTool::refreshPlot(), Isis::SpatialPlotTool::refreshPlot(), Isis::ScatterPlotWindow::ScatterPlotWindow(), Isis::SpectralPlotWindow::setBandMarkersVisible(), setUserValues(), and Isis::ScatterPlotWindow::showHideContour().
void Isis::PlotWindow::resetScale | ( | ) | [slot] |
Sets plot scale back to the defaults.
References Isis::PlotCurve::Band.
void Isis::PlotWindow::savePlot | ( | ) | [slot] |
This method allows the user to save the plot as a png, jpg, or tif image file.
void Isis::PlotWindow::setAxisLabel | ( | int | axisId, | |
QString | title | |||
) |
Sets the plots given axis title to the given string.
axisId | ||
title |
void Isis::PlotWindow::setDefaultRange | ( | ) | [slot] |
Resets the x/y min/max to the defaults.
References plot(), and setUserValues().
void Isis::PlotWindow::setLabels | ( | ) | [slot] |
Makes the user specified changes to the plot labels.
Referenced by changePlotLabels().
Sets up the menus added from a parent object.
menu | ||
actions |
void Isis::PlotWindow::setPlotBackground | ( | QColor | c | ) |
void Isis::PlotWindow::setPlotTitle | ( | QString | pt | ) |
Returns the axis title of the given axis.
axisId |
pt |
Referenced by PlotWindow().
void Isis::PlotWindow::setUserCanAddCurves | ( | bool | userHasControl | ) |
void Isis::PlotWindow::setUserValues | ( | ) | [slot] |
This method sets the scale for the axis according to the user specified numbers.
References replot().
Referenced by setDefaultRange().
void Isis::PlotWindow::showHelp | ( | ) | [slot] |
void Isis::PlotWindow::showHideAllCurves | ( | ) | [slot] |
This method shows or hides all of the curves in the plotWindow.
void Isis::PlotWindow::showHideAllMarkers | ( | ) | [slot] |
Shows/Hides all the markers(symbols).
void Isis::PlotWindow::showHideGrid | ( | ) | [slot] |
This method hides/shows the grid on the plotWindow and changes the text for the action.
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.
References fillTable(), plotCurves(), Isis::TableMainWindow::setTrackListItems(), size, and Isis::TableMainWindow::syncColumns().
void Isis::PlotWindow::showWindow | ( | ) |
Shows the plot window, and raises it to the front of any overlapping sibling widgets.
Referenced by Isis::AbstractPlotTool::repaintViewports().
void Isis::PlotWindow::switchBackground | ( | ) | [slot] |
This method toggles the plot background color between black and white.
void Isis::PlotWindow::trackerEnabled | ( | ) | [slot] |
Enables the plot mouse tracker.
void Isis::PlotWindow::update | ( | MdiCubeViewport * | activeViewport | ) | [virtual] |
Reimplemented in Isis::SpectralPlotWindow.
Referenced by Isis::AbstractPlotTool::viewportsToPlot().
bool Isis::PlotWindow::userCanAddCurves | ( | ) | const |
void Isis::MainWindow::writeSettings | ( | ) | const [virtual, inherited] |
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.
void Isis::PlotWindow::writeSettings | ( | ) | [protected, slot] |
This overridden method is called when the mainwindow is closed or hidden to write the size and location settings (and tool bar location) to a config file in the user's home directory.
References Isis::Filename::Expanded().
Referenced by eventFilter().
PlotCurve::Units Isis::PlotWindow::xAxisUnits | ( | ) | const |
Referenced by Isis::SpectralPlotTool::refreshPlot().
PlotCurve::Units Isis::PlotWindow::yAxisUnits | ( | ) | const |
QwtPlotZoomer * Isis::PlotWindow::zoomer | ( | ) | [protected] |
Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().