Isis 3 Programmer Reference
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 wants the best fit line. More...
 
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. More...
 

Public Member Functions

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

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. More...
 

Private Member Functions

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

Private Attributes

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

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 30 of file PlotWindowBestFitDialog.h.

Constructor & Destructor Documentation

◆ PlotWindowBestFitDialog() [1/2]

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 33 of file PlotWindowBestFitDialog.cpp.

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

◆ PlotWindowBestFitDialog() [2/2]

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

Copy constructing this class is disabled.

Parameters
otherNothing.

Member Function Documentation

◆ createBestFitLine

void Isis::PlotWindowBestFitDialog::createBestFitLine ( )
slot

This is called when the user 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 112 of file PlotWindowBestFitDialog.cpp.

References Isis::PlotCurve::color(), Isis::CubePlotCurve::copySource(), Isis::ScatterPlotData::discreteXValues(), Isis::IsSpecial(), m_curveMultivariateStats, m_plotWindowWithCurves, 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().

◆ operator=()

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

Assignments with this class are not allowed.

Parameters
otherNothing.
Returns
Nothing.

◆ readCurvesFromWindow

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 203 of file PlotWindowBestFitDialog.cpp.

References m_curvesCombo, and m_plotWindowWithCurves.

Referenced by PlotWindowBestFitDialog().

◆ refreshWidgetStates

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 230 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(), selectedSpectrogram(), and Isis::IString::ToQt().

Referenced by PlotWindowBestFitDialog().

◆ selectedCurve()

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 308 of file PlotWindowBestFitDialog.cpp.

References m_curvesCombo, and m_plotWindowWithCurves.

Referenced by createBestFitLine(), and refreshWidgetStates().

◆ selectedSpectrogram()

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 334 of file PlotWindowBestFitDialog.cpp.

References m_curvesCombo, and m_plotWindowWithCurves.

Referenced by createBestFitLine(), and refreshWidgetStates().

Member Data Documentation

◆ m_correlationLabel

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

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

Definition at line 70 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

◆ m_curveMultivariateStats

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

The MV stats which is doing our regression calculations.

Definition at line 84 of file PlotWindowBestFitDialog.h.

Referenced by createBestFitLine(), and refreshWidgetStates().

◆ m_curvesCombo

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

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

Definition at line 66 of file PlotWindowBestFitDialog.h.

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

◆ m_determinationLabel

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

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

Definition at line 72 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

◆ m_equationLabel

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

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

Definition at line 68 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

◆ m_okayButton

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 78 of file PlotWindowBestFitDialog.h.

Referenced by PlotWindowBestFitDialog(), and refreshWidgetStates().

◆ m_plotWindowWithCurves

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

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

Definition at line 81 of file PlotWindowBestFitDialog.h.

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


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