![]() |
Isis 3 Programmer Reference
|
This is the QwtRasterData for a scatter plot. More...
#include <ScatterPlotData.h>
Public Member Functions | |
ScatterPlotData (Cube *xCube, int xCubeBand, int xBinCount, Cube *yCube, int yCubeBand, int yBinCount, QwtInterval sampleRange, QwtInterval lineRange) | |
ScatterPlotDataConstructor. More... | |
ScatterPlotData (const ScatterPlotData &other) | |
This is an optimized copy constructor. More... | |
~ScatterPlotData () | |
Destructor. More... | |
virtual QwtRasterData * | copy () const |
Returns a copy of the ScatterPlotData object. More... | |
virtual double | value (double x, double y) const |
This gets called every time the scatter plot is re-drawn. More... | |
double | xCubeMin () const |
Return the min DN value for the x-axis cube's data range. More... | |
double | xCubeMax () const |
Return the max DN value for the y-axis cube's data range. More... | |
double | yCubeMin () const |
Return the min DN value for the y-axis cube's data range. More... | |
double | yCubeMax () const |
Return the max DN value for the y-axis cube's data range. More... | |
void | swap (ScatterPlotData &other) |
This is part of the copy-and-swap paradigm. More... | |
QPair< double, double > | binXY (int binIndex) const |
Get the center X/Y Dn values for the bin at index. More... | |
int | binCount (int binIndex) const |
Get the count (number of values) which fall into the bin at index. More... | |
int | numberOfBins () const |
Get the total number of bins (bin count in x * bin count in y). More... | |
QVector< double > | discreteXValues () const |
Get a list of all of the x-bin center values for this scatter plot. More... | |
void | alarm (double x, double y) |
Alarm the bin (highlight it) at the given x/y DN value. More... | |
void | clearAlarms () |
Forget all alarmed bins (viewport->plot). More... | |
QRectF | pixelHint (const QRectF &area) const |
This is a hint given to qwt for how to render a pixel in the spectrogram. More... | |
ScatterPlotData & | operator= (const ScatterPlotData &other) |
Take the data from other and copy it into this. More... | |
Private Member Functions | |
int | binCount (int xIndex, int yIndex) const |
Get the count (number of values) which fall into the bin at xIndex, yIndex. More... | |
int | binIndex (int xIndex, int yIndex) const |
Get the single-index position given an x/y index position. More... | |
int | binIndex (double x, double y) const |
Get the single-index position given an x/y dn value. More... | |
QPair< int, int > | binXYIndices (int binIndex) const |
Get the 2D index index position given a 1D (flat) index position. More... | |
QPair< int, int > | binXYIndices (double x, double y) const |
Get the 2D (x/y) index position given an x/y dn value. More... | |
Private Attributes | |
QScopedPointer< Stretch > | m_xDnToBinStretch |
Stretch 1. More... | |
QScopedPointer< Stretch > | m_yDnToBinStretch |
Stretch 2. More... | |
QScopedPointer< QVector< QVector< int > > > | m_counts |
The bin counts stored by 2D (x/y) index position. More... | |
int | m_maxCount |
The maximum value in m_counts, stored for efficiency. More... | |
QScopedPointer< QMap< int, bool > > | m_alarmedBins |
map from bin index to alarm state (true for alarmed) More... | |
double | m_xCubeMin |
The minimum DN value for the x cube. More... | |
double | m_xCubeMax |
The maximum DN value for the x cube. More... | |
double | m_yCubeMin |
The minimum DN value for the y cube. More... | |
double | m_yCubeMax |
The maximum DN value for the y cube. More... | |
This is the QwtRasterData for a scatter plot.
This gives Qwt values to put in each bin for a spectrogram, effectively making the scatter plot.
Definition at line 28 of file ScatterPlotData.h.
Isis::ScatterPlotData::ScatterPlotData | ( | Cube * | xCube, |
int | xCubeBand, | ||
int | xBinCount, | ||
Cube * | yCube, | ||
int | yCubeBand, | ||
int | yBinCount, | ||
QwtInterval | sampleRange, | ||
QwtInterval | lineRange | ||
) |
ScatterPlotDataConstructor.
xCube | The x-axis cube |
xCubeBand | The x-axis cube's band to get DN values from |
xBinCount | The resolution of the x-axis |
yCube | The y-axis cube |
yCubeBand | The y-axis cube's band to get DN values from |
yBinCount | The resolution of the y-axis |
sampleRange | The sample range to gather the histogram from, this is the same for the x cube and y cube. |
lineRange | The line range to gather the histogram from, this is the same for the x cube and y cube. |
Definition at line 26 of file ScatterPlotData.cpp.
References Isis::IsSpecial(), Isis::Cube::lineCount(), m_maxCount, m_xCubeMax, m_xCubeMin, m_xDnToBinStretch, m_yCubeMax, m_yCubeMin, m_yDnToBinStretch, Isis::Statistics::Maximum(), Isis::Statistics::Minimum(), Isis::Cube::pixelType(), Isis::Cube::read(), Isis::Cube::sampleCount(), and value().
Referenced by copy().
Isis::ScatterPlotData::ScatterPlotData | ( | const ScatterPlotData & | other | ) |
This is an optimized copy constructor.
Copies are not zero-time, but they are pretty quick.
other | The ScatterPlotData to copy. |
Definition at line 112 of file ScatterPlotData.cpp.
References m_alarmedBins, m_counts, m_maxCount, m_xCubeMax, m_xCubeMin, m_xDnToBinStretch, m_yCubeMax, m_yCubeMin, and m_yDnToBinStretch.
Isis::ScatterPlotData::~ScatterPlotData | ( | ) |
Destructor.
Definition at line 129 of file ScatterPlotData.cpp.
void Isis::ScatterPlotData::alarm | ( | double | x, |
double | y | ||
) |
Alarm the bin (highlight it) at the given x/y DN value.
This is for viewport->plot alarming.
x | The x-dn value of the bin to alarm |
y | The y-dn value of the bin to alarm |
Definition at line 323 of file ScatterPlotData.cpp.
References binIndex().
Referenced by Isis::ScatterPlotWindow::setMousePosition().
int Isis::ScatterPlotData::binCount | ( | int | binIndex | ) | const |
Get the count (number of values) which fall into the bin at index.
binIndex | The bin we're getting the data from |
Definition at line 269 of file ScatterPlotData.cpp.
References binIndex(), and binXYIndices().
Referenced by Isis::PlotWindowBestFitDialog::refreshWidgetStates(), and value().
|
private |
Get the count (number of values) which fall into the bin at xIndex, yIndex.
xIndex | The x index of the bin we're getting our data from |
yIndex | The y index of the bin we're getting our data from |
Definition at line 381 of file ScatterPlotData.cpp.
References m_counts.
|
private |
Get the single-index position given an x/y index position.
That is, get a 1D (flat) index from a 2D (x/y based) index.
xIndex | The x index of the bin we're translating into a 1D index |
yIndex | The y index of the bin we're translating into a 1D index |
Definition at line 402 of file ScatterPlotData.cpp.
References m_counts.
Referenced by alarm(), binCount(), binIndex(), binXYIndices(), and value().
|
private |
Get the single-index position given an x/y dn value.
x | The x-dn value of the bin |
y | The y-dn value of the bin |
Definition at line 425 of file ScatterPlotData.cpp.
References binIndex(), and binXYIndices().
QPair< double, double > Isis::ScatterPlotData::binXY | ( | int | index | ) | const |
Get the center X/Y Dn values for the bin at index.
index | The bin to get the center X/Y DN Values for |
Definition at line 232 of file ScatterPlotData.cpp.
References _FILEINFO_, binXYIndices(), m_counts, m_xCubeMax, m_xCubeMin, m_yCubeMax, m_yCubeMin, numberOfBins(), and Isis::IException::Programmer.
Referenced by Isis::PlotWindowBestFitDialog::refreshWidgetStates().
|
private |
Get the 2D index index position given a 1D (flat) index position.
binIndex | The 1D (flat) index of the bin |
Definition at line 437 of file ScatterPlotData.cpp.
References _FILEINFO_, binIndex(), m_counts, numberOfBins(), and Isis::IException::Programmer.
Referenced by binCount(), binIndex(), binXY(), and value().
|
private |
Get the 2D (x/y) index position given an x/y dn value.
x | The x-dn value of the bin |
y | The y-dn value of the bin |
Definition at line 467 of file ScatterPlotData.cpp.
References Isis::IsSpecial(), m_counts, m_xDnToBinStretch, and m_yDnToBinStretch.
void Isis::ScatterPlotData::clearAlarms | ( | ) |
Forget all alarmed bins (viewport->plot).
Definition at line 333 of file ScatterPlotData.cpp.
References m_alarmedBins.
Referenced by Isis::ScatterPlotWindow::setMousePosition().
|
virtual |
Returns a copy of the ScatterPlotData object.
Definition at line 138 of file ScatterPlotData.cpp.
References ScatterPlotData().
QVector< double > Isis::ScatterPlotData::discreteXValues | ( | ) | const |
Get a list of all of the x-bin center values for this scatter plot.
Definition at line 297 of file ScatterPlotData.cpp.
References m_counts, m_xCubeMax, and m_xCubeMin.
Referenced by Isis::PlotWindowBestFitDialog::createBestFitLine().
int Isis::ScatterPlotData::numberOfBins | ( | ) | const |
Get the total number of bins (bin count in x * bin count in y).
Definition at line 280 of file ScatterPlotData.cpp.
References m_counts.
Referenced by binXY(), binXYIndices(), and Isis::PlotWindowBestFitDialog::refreshWidgetStates().
ScatterPlotData & Isis::ScatterPlotData::operator= | ( | const ScatterPlotData & | other | ) |
Take the data from other and copy it into this.
This uses the copy-and-swap paradigm for exception safety.
other | The scatter plot data which needs copied to this |
Definition at line 365 of file ScatterPlotData.cpp.
References swap().
QRectF Isis::ScatterPlotData::pixelHint | ( | const QRectF & | area | ) | const |
This is a hint given to qwt for how to render a pixel in the spectrogram.
area | This is ignored |
Definition at line 344 of file ScatterPlotData.cpp.
References m_xCubeMin, m_xDnToBinStretch, m_yCubeMin, and m_yDnToBinStretch.
void Isis::ScatterPlotData::swap | ( | ScatterPlotData & | other | ) |
This is part of the copy-and-swap paradigm.
Swap member data with other.
other | The class to trade member data with |
Definition at line 212 of file ScatterPlotData.cpp.
References m_alarmedBins, m_counts, m_maxCount, m_xCubeMax, m_xCubeMin, m_xDnToBinStretch, m_yCubeMax, m_yCubeMin, and m_yDnToBinStretch.
Referenced by operator=().
|
virtual |
This gets called every time the scatter plot is re-drawn.
This returns the counts for each DN (x), DN (y), or if the bin is alarmed this returns the max count.
x | The X-Dn value |
y | The Y-Dn value |
Definition at line 152 of file ScatterPlotData.cpp.
References binCount(), binIndex(), binXYIndices(), m_alarmedBins, and m_maxCount.
Referenced by ScatterPlotData().
double Isis::ScatterPlotData::xCubeMax | ( | ) | const |
Return the max DN value for the y-axis cube's data range.
Definition at line 182 of file ScatterPlotData.cpp.
References m_xCubeMax.
Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().
double Isis::ScatterPlotData::xCubeMin | ( | ) | const |
Return the min DN value for the x-axis cube's data range.
Definition at line 172 of file ScatterPlotData.cpp.
References m_xCubeMin.
Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().
double Isis::ScatterPlotData::yCubeMax | ( | ) | const |
Return the max DN value for the y-axis cube's data range.
Definition at line 202 of file ScatterPlotData.cpp.
References m_yCubeMax.
Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().
double Isis::ScatterPlotData::yCubeMin | ( | ) | const |
Return the min DN value for the y-axis cube's data range.
Definition at line 192 of file ScatterPlotData.cpp.
References m_yCubeMin.
Referenced by Isis::ScatterPlotWindow::ScatterPlotWindow().
|
private |
map from bin index to alarm state (true for alarmed)
Definition at line 81 of file ScatterPlotData.h.
Referenced by clearAlarms(), ScatterPlotData(), swap(), and value().
The bin counts stored by 2D (x/y) index position.
The first dimension is the y-index.
Definition at line 73 of file ScatterPlotData.h.
Referenced by binCount(), binIndex(), binXY(), binXYIndices(), discreteXValues(), numberOfBins(), ScatterPlotData(), and swap().
|
private |
The maximum value in m_counts, stored for efficiency.
Definition at line 76 of file ScatterPlotData.h.
Referenced by ScatterPlotData(), swap(), and value().
|
private |
The maximum DN value for the x cube.
Definition at line 86 of file ScatterPlotData.h.
Referenced by binXY(), discreteXValues(), ScatterPlotData(), swap(), and xCubeMax().
|
private |
The minimum DN value for the x cube.
Definition at line 84 of file ScatterPlotData.h.
Referenced by binXY(), discreteXValues(), pixelHint(), ScatterPlotData(), swap(), and xCubeMin().
|
private |
Stretch 1.
Definition at line 66 of file ScatterPlotData.h.
Referenced by binXYIndices(), pixelHint(), ScatterPlotData(), and swap().
|
private |
The maximum DN value for the y cube.
Definition at line 90 of file ScatterPlotData.h.
Referenced by binXY(), ScatterPlotData(), swap(), and yCubeMax().
|
private |
The minimum DN value for the y cube.
Definition at line 88 of file ScatterPlotData.h.
Referenced by binXY(), pixelHint(), ScatterPlotData(), swap(), and yCubeMin().
|
private |
Stretch 2.
Definition at line 67 of file ScatterPlotData.h.
Referenced by binXYIndices(), pixelHint(), ScatterPlotData(), and swap().
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the USGS Astrogeology Discussion Board To report a bug, or suggest a feature go to: ISIS Github File Modified: 07/13/2023 00:19:20 |