Isis 3 Programmer Reference
Isis::ScatterPlotConfigDialog Class Reference

This configuration dialog is for users to determine the scatter plot parameters required to create a scatter plot. More...

#include <ScatterPlotConfigDialog.h>

Inheritance diagram for Isis::ScatterPlotConfigDialog:
Inheritance graph
Collaboration diagram for Isis::ScatterPlotConfigDialog:
Collaboration graph

Public Member Functions

 ScatterPlotConfigDialog (MdiCubeViewport *activeViewport, Workspace *workspace, QWidget *parent=NULL)
 This method creates all the dialog boxes required for the scatter plot window.
 
virtual QSize sizeHint () const
 This is overridden to give a better default size than what Qt calculates by default.
 
CubexAxisCube () const
 The current user selection for a cube for the x-axis data for a scatter plot.
 
CubeyAxisCube () const
 The current user selection for a cube for the x-axis data for a scatter plot.
 
int xAxisCubeBand () const
 The current user selection for the band in the x-axis cube to get data from.
 
int yAxisCubeBand () const
 The current user selection for the band in the y-axis cube to get data from.
 
int xAxisBinCount () const
 The current user selection for the resolution of the scatter plot's x data.
 
int yAxisBinCount () const
 The current user selection for the resolution of the scatter plot's y data.
 
QwtInterval sampleRange () const
 This is the sample range from which the scatter plot should be created.
 
QwtInterval lineRange () const
 This is the line range from which the scatter plot should be created.
 
MdiCubeViewportxAxisCubeViewport () const
 This returns a viewport which contains the x-axis cube.
 
MdiCubeViewportyAxisCubeViewport () const
 This returns a viewport which contains the y-axis cube.
 

Private Types

enum  RangeType { SampleRange , LineRange }
 This is used internally to differentiate range accessors. More...
 

Private Slots

void refreshWidgetStates ()
 Update the enabled/disabled states of the various widgets based on the current user inputs' states.
 

Private Member Functions

QList< Cube * > removeFromList (QList< Cube * > list, QList< Cube * > itemsToRemove)
 This is a helper method.
 
QwtInterval range (RangeType) const
 This returns the sample/line ranges indicated by the user for the scatter plot to be created on.
 

Private Attributes

Workspacem_workspace
 This is the workspace containing all of the viewports.
 
QPointer< QComboBoxm_xAxisCubeCombo
 A user-selection for the x axis cube.
 
QPointer< QSpinBoxm_xAxisCubeBandSpinBox
 A user-selection for the x axis cube's band to plot.
 
QPointer< QSpinBoxm_xAxisBinCountSpinBox
 A user-selection for the x axis cube's resolution.
 
QPointer< QCheckBox > m_useViewportRangesCheckBox
 A user-selection for using only the visible range of the viewport.
 
QPointer< QComboBoxm_yAxisCubeCombo
 A user-selection for the y axis cube.
 
QPointer< QSpinBoxm_yAxisCubeBandSpinBox
 A user-selection for the y axis cube's band to plot.
 
QPointer< QSpinBoxm_yAxisBinCountSpinBox
 A user-selection for the y axis cube's resolution.
 
QPointer< QPushButton > m_createButton
 This button triggers an accepted() signal.
 
Cubem_oldXAxisCube
 This is used to detect when a user changes the x-axis cube.
 

Detailed Description

This configuration dialog is for users to determine the scatter plot parameters required to create a scatter plot.

Author
2012-01-18 Steven Lambright
History
2016-06-21 Kris Becker - Properly forward declare QPair as struct not class

Definition at line 29 of file ScatterPlotConfigDialog.h.

Member Enumeration Documentation

◆ RangeType

This is used internally to differentiate range accessors.

Enumerator
SampleRange 

This is used to get the sample range in a generic way.

LineRange 

This is used to get the line range in a generic way.

Definition at line 55 of file ScatterPlotConfigDialog.h.

Constructor & Destructor Documentation

◆ ScatterPlotConfigDialog()

Isis::ScatterPlotConfigDialog::ScatterPlotConfigDialog ( MdiCubeViewport * activeViewport,
Workspace * workspace,
QWidget * parent = NULL )

This method creates all the dialog boxes required for the scatter plot window.

Parameters
activeViewportThe current user-selected viewport
workspaceThe workspace containing all of the viewports
parentThe Qt-parent for this dialog

The layout is shown below:

|-----------------------------------------------------------—|

Text rowspan=1, colspan=3
Config X rowspan=1, colspan=3
-----------------------------------------------------------—

| | Cube | Input Edit rowspan=1, colspan=1 | |-----------------------------------------------------------—| | | Band | Input Edit rowspan=1, colspan=1 | |-----------------------------------------------------------—| | | Bins (resolution) | Input Edit rowspan=1, colspan=1 | |-----------------------------------------------------------—| | | Use Viewport Ranges | Checkbox rowspan=1, colspan=1 | |-----------------------------------------------------------—| | Config Y rowspan=1, colspan=3 | |-----------------------------------------------------------—| | | Cube | Input Edit rowspan=1, colspan=1 | |-----------------------------------------------------------—| | | Band | Input Edit rowspan=1, colspan=1 | |-----------------------------------------------------------—| | | Bins (resolution) | Input Edit rowspan=1, colspan=1 | |-----------------------------------------------------------—| | Ok Cancel rowspan=1, colspan=3 | |-----------------------------------------------------------—|

Definition at line 28 of file ScatterPlotConfigDialog.cpp.

References m_createButton, m_oldXAxisCube, m_useViewportRangesCheckBox, m_workspace, m_xAxisBinCountSpinBox, m_xAxisCubeBandSpinBox, m_xAxisCubeCombo, m_yAxisBinCountSpinBox, m_yAxisCubeBandSpinBox, m_yAxisCubeCombo, and refreshWidgetStates().

Member Function Documentation

◆ lineRange()

QwtInterval Isis::ScatterPlotConfigDialog::lineRange ( ) const

This is the line range from which the scatter plot should be created.

The return value is 1-based (lines start at 1) and inclusive. The range 1 and nlines is the entire line range.

Returns
The line range for the scatter plot data

Definition at line 300 of file ScatterPlotConfigDialog.cpp.

References LineRange, and range().

Referenced by range().

◆ range()

QwtInterval Isis::ScatterPlotConfigDialog::range ( RangeType rangeType) const
private

This returns the sample/line ranges indicated by the user for the scatter plot to be created on.

This is a helper method for sampleRange() and lineRange(). NOTE: If a cube if opened twice, and we're using the viewport visible range, it's currently ambiguous which viewport to use.

Parameters
rangeTypeThe range type we're getting: sample range or line range
Returns
The sample or line range to create a scatter plot on. The information is 1-based and inclusive, so a result of [1, nsamples] is the entire sample range.

Definition at line 490 of file ScatterPlotConfigDialog.cpp.

References lineRange(), m_useViewportRangesCheckBox, Isis::Null, sampleRange(), SampleRange, xAxisCube(), and xAxisCubeViewport().

Referenced by lineRange(), and sampleRange().

◆ refreshWidgetStates

void Isis::ScatterPlotConfigDialog::refreshWidgetStates ( )
privateslot

Update the enabled/disabled states of the various widgets based on the current user inputs' states.

This also updates the cube lists based on what exists and what is selected.

Definition at line 344 of file ScatterPlotConfigDialog.cpp.

References Isis::CubeViewport::cube(), Isis::Workspace::cubeViewportList(), Isis::Cube::lineCount(), m_createButton, m_oldXAxisCube, m_useViewportRangesCheckBox, m_workspace, m_xAxisBinCountSpinBox, m_xAxisCubeBandSpinBox, m_xAxisCubeCombo, m_yAxisBinCountSpinBox, m_yAxisCubeBandSpinBox, m_yAxisCubeCombo, removeFromList(), Isis::Cube::sampleCount(), xAxisCube(), and yAxisCube().

Referenced by ScatterPlotConfigDialog().

◆ removeFromList()

QList< Cube * > Isis::ScatterPlotConfigDialog::removeFromList ( QList< Cube * > list,
QList< Cube * > itemsToRemove )
private

This is a helper method.

It takes all of the itemsToRemove out of list and returns the result.

Parameters
listThe original list of cubes
itemsToRemoveA list of cubes to take out of the original list of cubes
Returns
The result of list - itemsToRemove

Definition at line 469 of file ScatterPlotConfigDialog.cpp.

Referenced by refreshWidgetStates().

◆ sampleRange()

QwtInterval Isis::ScatterPlotConfigDialog::sampleRange ( ) const

This is the sample range from which the scatter plot should be created.

The return value is 1-based (samples start at 1) and inclusive. The range 1 and nsamples is the entire sample range.

Returns
The sample range for the scatter plot data

Definition at line 288 of file ScatterPlotConfigDialog.cpp.

References range(), and SampleRange.

Referenced by range().

◆ sizeHint()

QSize Isis::ScatterPlotConfigDialog::sizeHint ( ) const
virtual

This is overridden to give a better default size than what Qt calculates by default.

Returns
The recommended size for this dialog

Definition at line 209 of file ScatterPlotConfigDialog.cpp.

◆ xAxisBinCount()

int Isis::ScatterPlotConfigDialog::xAxisBinCount ( ) const

The current user selection for the resolution of the scatter plot's x data.

Returns
The x-axis data's bin count for a histogram/spectrogram

Definition at line 266 of file ScatterPlotConfigDialog.cpp.

References m_xAxisBinCountSpinBox.

◆ xAxisCube()

Cube * Isis::ScatterPlotConfigDialog::xAxisCube ( ) const

The current user selection for a cube for the x-axis data for a scatter plot.

This never returns null if the dialog was accepted().

Returns
The x-axis cube or NULL if there isn't one selected.

Definition at line 221 of file ScatterPlotConfigDialog.cpp.

References m_xAxisCubeCombo.

Referenced by range(), refreshWidgetStates(), and xAxisCubeViewport().

◆ xAxisCubeBand()

int Isis::ScatterPlotConfigDialog::xAxisCubeBand ( ) const

The current user selection for the band in the x-axis cube to get data from.

This isn't valid unless there is an xAxisCube().

Returns
The x-axis cube's band to get data from.

Definition at line 245 of file ScatterPlotConfigDialog.cpp.

References m_xAxisCubeBandSpinBox.

◆ xAxisCubeViewport()

MdiCubeViewport * Isis::ScatterPlotConfigDialog::xAxisCubeViewport ( ) const

This returns a viewport which contains the x-axis cube.

Returns
a viewport which contains the x-axis cube

Definition at line 310 of file ScatterPlotConfigDialog.cpp.

References Isis::CubeViewport::cube(), Isis::Workspace::cubeViewportList(), m_workspace, and xAxisCube().

Referenced by range().

◆ yAxisBinCount()

int Isis::ScatterPlotConfigDialog::yAxisBinCount ( ) const

The current user selection for the resolution of the scatter plot's y data.

Returns
The y-axis data's bin count for a histogram/spectrogram

Definition at line 276 of file ScatterPlotConfigDialog.cpp.

References m_yAxisBinCountSpinBox.

◆ yAxisCube()

Cube * Isis::ScatterPlotConfigDialog::yAxisCube ( ) const

The current user selection for a cube for the x-axis data for a scatter plot.

This never returns null if the dialog was accepted().

Returns
The y-axis cube or NULL if there isn't one selected.

Definition at line 233 of file ScatterPlotConfigDialog.cpp.

References m_yAxisCubeCombo.

Referenced by refreshWidgetStates(), and yAxisCubeViewport().

◆ yAxisCubeBand()

int Isis::ScatterPlotConfigDialog::yAxisCubeBand ( ) const

The current user selection for the band in the y-axis cube to get data from.

This isn't valid unless there is an yAxisCube().

Returns
The y-axis cube's band to get data from.

Definition at line 256 of file ScatterPlotConfigDialog.cpp.

References m_yAxisCubeBandSpinBox.

◆ yAxisCubeViewport()

MdiCubeViewport * Isis::ScatterPlotConfigDialog::yAxisCubeViewport ( ) const

This returns a viewport which contains the y-axis cube.

Returns
a viewport which contains the y-axis cube

Definition at line 327 of file ScatterPlotConfigDialog.cpp.

References Isis::CubeViewport::cube(), Isis::Workspace::cubeViewportList(), m_workspace, and yAxisCube().

Member Data Documentation

◆ m_createButton

QPointer<QPushButton> Isis::ScatterPlotConfigDialog::m_createButton
private

This button triggers an accepted() signal.

This is only enabled when the user inputs make sense.

Definition at line 89 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), and ScatterPlotConfigDialog().

◆ m_oldXAxisCube

Cube* Isis::ScatterPlotConfigDialog::m_oldXAxisCube
private

This is used to detect when a user changes the x-axis cube.

Definition at line 92 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), and ScatterPlotConfigDialog().

◆ m_useViewportRangesCheckBox

QPointer<QCheckBox> Isis::ScatterPlotConfigDialog::m_useViewportRangesCheckBox
private

A user-selection for using only the visible range of the viewport.

Definition at line 76 of file ScatterPlotConfigDialog.h.

Referenced by range(), refreshWidgetStates(), and ScatterPlotConfigDialog().

◆ m_workspace

Workspace* Isis::ScatterPlotConfigDialog::m_workspace
private

This is the workspace containing all of the viewports.

Definition at line 67 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), xAxisCubeViewport(), and yAxisCubeViewport().

◆ m_xAxisBinCountSpinBox

QPointer<QSpinBox> Isis::ScatterPlotConfigDialog::m_xAxisBinCountSpinBox
private

A user-selection for the x axis cube's resolution.

Definition at line 74 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), and xAxisBinCount().

◆ m_xAxisCubeBandSpinBox

QPointer<QSpinBox> Isis::ScatterPlotConfigDialog::m_xAxisCubeBandSpinBox
private

A user-selection for the x axis cube's band to plot.

Definition at line 72 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), and xAxisCubeBand().

◆ m_xAxisCubeCombo

QPointer<QComboBox> Isis::ScatterPlotConfigDialog::m_xAxisCubeCombo
private

A user-selection for the x axis cube.

Definition at line 70 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), and xAxisCube().

◆ m_yAxisBinCountSpinBox

QPointer<QSpinBox> Isis::ScatterPlotConfigDialog::m_yAxisBinCountSpinBox
private

A user-selection for the y axis cube's resolution.

Definition at line 83 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), and yAxisBinCount().

◆ m_yAxisCubeBandSpinBox

QPointer<QSpinBox> Isis::ScatterPlotConfigDialog::m_yAxisCubeBandSpinBox
private

A user-selection for the y axis cube's band to plot.

Definition at line 81 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), and yAxisCubeBand().

◆ m_yAxisCubeCombo

QPointer<QComboBox> Isis::ScatterPlotConfigDialog::m_yAxisCubeCombo
private

A user-selection for the y axis cube.

Definition at line 79 of file ScatterPlotConfigDialog.h.

Referenced by refreshWidgetStates(), ScatterPlotConfigDialog(), and yAxisCube().


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