USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::PlotWindowBestFitDialog Class Reference

#include <PlotWindowBestFitDialog.h>

Inheritance diagram for Isis::PlotWindowBestFitDialog:
Inheritance graph
Collaboration diagram for Isis::PlotWindowBestFitDialog:
Collaboration graph

Public Slots

void createBestFitLine ()
 This is called when the user finally wants the best fit line.
 
void readCurvesFromWindow ()
 This populates the curve selection combo with all of the available information inside of the PlotWindow for which we're adding a best fit line to.
 

Public Member Functions

 PlotWindowBestFitDialog (PlotWindow *windowWithCurves, QWidget *parent)
 Create a PlotWindowBestFitDialog.
 

Private Slots

void refreshWidgetStates ()
 This updates all of the widgets in this window's visibility and text data based on what the user has entered so far.
 

Private Member Functions

CubePlotCurveselectedCurve ()
 If a curve is selected, this returns it.
 
QwtPlotSpectrogram * selectedSpectrogram ()
 If a spectrogram (scatter plot) is selected, this returns it.
 
 PlotWindowBestFitDialog (const PlotWindowBestFitDialog &other)
 Copy constructing this class is disabled.
 
PlotWindowBestFitDialogoperator= (const PlotWindowBestFitDialog &other)
 Assignments with this class are not allowed.
 

Private Attributes

QPointer< QComboBoxm_curvesCombo
 A combo box for the user to select a curve/spectrogram to best fit.
 
QPointer< QLabel > m_equationLabel
 A label populated with the resulting equation from a best fit.
 
QPointer< QLabel > m_correlationLabel
 A label populated with the resulting correlation from a best fit.
 
QPointer< QLabel > m_determinationLabel
 A label populated with the resulting determination from a best fit.
 
QPointer< QPushButton > m_okayButton
 The ok button which the user clicks to create the best fit curve.
 
QPointer< PlotWindowm_plotWindowWithCurves
 The plot window we're creating a best for line for.
 
QScopedPointer
< MultivariateStatistics
m_curveMultivariateStats
 The MV stats which is doing our regression calculations.
 

Detailed Description

Author
2012-01-18 Steven Lambright
History:
2014-07-24 Ian Humphrey - modified readCurvesFromWindow() to add curves/spectrograms to the dialog's combobox in sequential order (from first to last) as opposed to reverse order. References #2089.

Definition at line 29 of file PlotWindowBestFitDialog.h.

Constructor & Destructor Documentation

Isis::PlotWindowBestFitDialog::PlotWindowBestFitDialog ( PlotWindow windowWithCurves,
QWidget parent 
)

Create a PlotWindowBestFitDialog.

If a best fit line is accepted by the user, then the curve will be added directly to the plot window with no extra code in the plot window. This fully initializes the state of the dialog and no extra initialization should be required.

Parameters
windowWithCurvesThis must not be NULL. This is the plot window for which a best fit line should be calculated.
parentThe Qt-parent of this dialog.

Definition at line 32 of file PlotWindowBestFitDialog.cpp.

References createBestFitLine(), m_correlationLabel, m_curvesCombo, m_determinationLabel, m_equationLabel, m_okayButton, m_plotWindowWithCurves, readCurvesFromWindow(), and refreshWidgetStates().

Isis::PlotWindowBestFitDialog::PlotWindowBestFitDialog ( const PlotWindowBestFitDialog other)
private

Copy constructing this class is disabled.

Parameters
otherNothing.

Member Function Documentation

void Isis::PlotWindowBestFitDialog::createBestFitLine ( )
slot

This is called when the user finally wants the best fit line.

The already populated m_curveMultivariateStats is used to give us the current best-fit coefficients. We create y-data points based on the best fit for every x value inside of the curve we're fitting. The curve is then added directly to the plot window.

Definition at line 111 of file PlotWindowBestFitDialog.cpp.

References Isis::PlotCurve::color(), Isis::CubePlotCurve::copySource(), Isis::ScatterPlotData::discreteXValues(), Isis::IsSpecial(), m_curveMultivariateStats, m_plotWindowWithCurves, Isis::PlotCurve::markerSymbol(), Isis::Null, selectedCurve(), selectedSpectrogram(), Isis::PlotCurve::setColor(), Isis::PlotCurve::setData(), Isis::PlotCurve::setMarkerSymbol(), Isis::PlotCurve::setPen(), Isis::PlotCurve::xUnits(), and Isis::PlotCurve::yUnits().

Referenced by PlotWindowBestFitDialog().

PlotWindowBestFitDialog& Isis::PlotWindowBestFitDialog::operator= ( const PlotWindowBestFitDialog other)
private

Assignments with this class are not allowed.

Parameters
otherNothing.
Returns
Nothing.
void Isis::PlotWindowBestFitDialog::readCurvesFromWindow ( )
slot

This populates the curve selection combo with all of the available information inside of the PlotWindow for which we're adding a best fit line to.

Definition at line 206 of file PlotWindowBestFitDialog.cpp.

References m_curvesCombo, and m_plotWindowWithCurves.

Referenced by PlotWindowBestFitDialog().

void Isis::PlotWindowBestFitDialog::refreshWidgetStates ( )
privateslot

This updates all of the widgets in this window's visibility and text data based on what the user has entered so far.

This does not refresh the list of best fit-able curves/spectrograms.

Definition at line 233 of file PlotWindowBestFitDialog.cpp.

References Isis::ScatterPlotData::binCount(), Isis::ScatterPlotData::binXY(), Isis::IsSpecial(), m_correlationLabel, m_curveMultivariateStats, m_determinationLabel, m_equationLabel, m_okayButton, Isis::Null, Isis::ScatterPlotData::numberOfBins(), selectedCurve(), and selectedSpectrogram().

Referenced by PlotWindowBestFitDialog().

CubePlotCurve * Isis::PlotWindowBestFitDialog::selectedCurve ( )
private

If a curve is selected, this returns it.

If something else is selected, or nothing is selected, this returns NULL.

Returns
The user-selected curve to create a best fit line for

Definition at line 311 of file PlotWindowBestFitDialog.cpp.

References m_curvesCombo, and m_plotWindowWithCurves.

Referenced by createBestFitLine(), and refreshWidgetStates().

QwtPlotSpectrogram * Isis::PlotWindowBestFitDialog::selectedSpectrogram ( )
private

If a spectrogram (scatter plot) is selected, this returns it.

If something else is selected, or nothing is selected, this returns NULL.

Returns
The user-selected spectrogram (scatter plot) to create a best fit line for

Definition at line 337 of file PlotWindowBestFitDialog.cpp.

References m_curvesCombo, and m_plotWindowWithCurves.

Referenced by createBestFitLine(), and refreshWidgetStates().

Member Data Documentation

QPointer<QLabel> Isis::PlotWindowBestFitDialog::m_correlationLabel
private

A label populated with the resulting correlation from a best fit.

Definition at line 69 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

QScopedPointer<MultivariateStatistics> Isis::PlotWindowBestFitDialog::m_curveMultivariateStats
private

The MV stats which is doing our regression calculations.

Definition at line 83 of file PlotWindowBestFitDialog.h.

Referenced by createBestFitLine(), and refreshWidgetStates().

QPointer<QComboBox> Isis::PlotWindowBestFitDialog::m_curvesCombo
private

A combo box for the user to select a curve/spectrogram to best fit.

Definition at line 65 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), readCurvesFromWindow(), selectedCurve(), and selectedSpectrogram().

QPointer<QLabel> Isis::PlotWindowBestFitDialog::m_determinationLabel
private

A label populated with the resulting determination from a best fit.

Definition at line 71 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

QPointer<QLabel> Isis::PlotWindowBestFitDialog::m_equationLabel
private

A label populated with the resulting equation from a best fit.

Definition at line 67 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

QPointer<QPushButton> Isis::PlotWindowBestFitDialog::m_okayButton
private

The ok button which the user clicks to create the best fit curve.

This gets enabled/disabled based on whether or not a best fit was successful.

Definition at line 77 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

QPointer<PlotWindow> Isis::PlotWindowBestFitDialog::m_plotWindowWithCurves
private

The plot window we're creating a best for line for.

Definition at line 80 of file PlotWindowBestFitDialog.h.

Referenced by createBestFitLine(), PlotWindowBestFitDialog(), readCurvesFromWindow(), selectedCurve(), and selectedSpectrogram().


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