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. | |
ScatterPlotData (const ScatterPlotData &other) | |
This is an optimized copy constructor. | |
~ScatterPlotData () | |
Destructor. | |
virtual QwtRasterData * | copy () const |
Returns a copy of the ScatterPlotData object. | |
virtual double | value (double x, double y) const |
This gets called every time the scatter plot is re-drawn. | |
double | xCubeMin () const |
Return the min DN value for the x-axis cube's data range. | |
double | xCubeMax () const |
Return the max DN value for the y-axis cube's data range. | |
double | yCubeMin () const |
Return the min DN value for the y-axis cube's data range. | |
double | yCubeMax () const |
Return the max DN value for the y-axis cube's data range. | |
void | swap (ScatterPlotData &other) |
This is part of the copy-and-swap paradigm. | |
QPair< double, double > | binXY (int binIndex) const |
Get the center X/Y Dn values for the bin at index. | |
int | binCount (int binIndex) const |
Get the count (number of values) which fall into the bin at index. | |
int | numberOfBins () const |
Get the total number of bins (bin count in x * bin count in y). | |
QVector< double > | discreteXValues () const |
Get a list of all of the x-bin center values for this scatter plot. | |
void | alarm (double x, double y) |
Alarm the bin (highlight it) at the given x/y DN value. | |
void | clearAlarms () |
Forget all alarmed bins (viewport->plot). | |
QRectF | pixelHint (const QRectF &area) const |
This is a hint given to qwt for how to render a pixel in the spectrogram. | |
ScatterPlotData & | operator= (const ScatterPlotData &other) |
Take the data from other and copy it into this. | |
Private Member Functions | |
int | binCount (int xIndex, int yIndex) const |
Get the count (number of values) which fall into the bin at xIndex, yIndex. | |
int | binIndex (int xIndex, int yIndex) const |
Get the single-index position given an x/y index position. | |
int | binIndex (double x, double y) const |
Get the single-index position given an x/y dn value. | |
QPair< int, int > | binXYIndices (int binIndex) const |
Get the 2D index index position given a 1D (flat) index position. | |
QPair< int, int > | binXYIndices (double x, double y) const |
Get the 2D (x/y) index position given an x/y dn value. | |
Private Attributes | |
QScopedPointer< Stretch > | m_xDnToBinStretch |
Stretch 1. | |
QScopedPointer< Stretch > | m_yDnToBinStretch |
Stretch 2. | |
QScopedPointer< QVector< QVector< int > > > | m_counts |
The bin counts stored by 2D (x/y) index position. | |
int | m_maxCount |
The maximum value in m_counts, stored for efficiency. | |
QScopedPointer< QMap< int, bool > > | m_alarmedBins |
map from bin index to alarm state (true for alarmed) | |
double | m_xCubeMin |
The minimum DN value for the x cube. | |
double | m_xCubeMax |
The maximum DN value for the x cube. | |
double | m_yCubeMin |
The minimum DN value for the y cube. | |
double | m_yCubeMax |
The maximum DN value for the y cube. | |
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 28 of file ScatterPlotData.cpp.
References Isis::IsSpecial(), m_maxCount, m_xCubeMax, m_xCubeMin, m_xDnToBinStretch, m_yCubeMax, m_yCubeMin, m_yDnToBinStretch, 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 111 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 128 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 322 of file ScatterPlotData.cpp.
References binIndex().
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 268 of file ScatterPlotData.cpp.
References binCount(), binIndex(), and binXYIndices().
Referenced by binCount(), 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 380 of file ScatterPlotData.cpp.
References m_counts.
|
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 424 of file ScatterPlotData.cpp.
References binIndex(), and binXYIndices().
|
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 401 of file ScatterPlotData.cpp.
References m_counts.
Referenced by alarm(), binCount(), binIndex(), binXYIndices(), and value().
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 231 of file ScatterPlotData.cpp.
References 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 (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 466 of file ScatterPlotData.cpp.
References Isis::IsSpecial(), m_counts, m_xDnToBinStretch, and m_yDnToBinStretch.
|
private |
Get the 2D index index position given a 1D (flat) index position.
binIndex | The 1D (flat) index of the bin |
Definition at line 436 of file ScatterPlotData.cpp.
References binIndex(), m_counts, numberOfBins(), and Isis::IException::Programmer.
Referenced by binCount(), binIndex(), binXY(), and value().
void Isis::ScatterPlotData::clearAlarms | ( | ) |
Forget all alarmed bins (viewport->plot).
Definition at line 332 of file ScatterPlotData.cpp.
References m_alarmedBins.
Referenced by Isis::ScatterPlotWindow::setMousePosition().
|
virtual |
Returns a copy of the ScatterPlotData object.
Definition at line 137 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 296 of file ScatterPlotData.cpp.
References m_counts, m_xCubeMax, and m_xCubeMin.
int Isis::ScatterPlotData::numberOfBins | ( | ) | const |
Get the total number of bins (bin count in x * bin count in y).
Definition at line 279 of file ScatterPlotData.cpp.
References m_counts.
Referenced by binXY(), and binXYIndices().
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 364 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 343 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 211 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 151 of file ScatterPlotData.cpp.
References binCount(), binIndex(), binXYIndices(), m_alarmedBins, m_maxCount, and value().
Referenced by ScatterPlotData(), and value().
double Isis::ScatterPlotData::xCubeMax | ( | ) | const |
Return the max DN value for the y-axis cube's data range.
Definition at line 181 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 171 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 201 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 191 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(), 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(), 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(), 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(), ScatterPlotData(), swap(), and xCubeMin().
|
private |
Stretch 1.
Definition at line 66 of file ScatterPlotData.h.
Referenced by binXYIndices(), pixelHint(), ScatterPlotData(), ScatterPlotData(), and swap().
|
private |
The maximum DN value for the y cube.
Definition at line 90 of file ScatterPlotData.h.
Referenced by binXY(), ScatterPlotData(), 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(), ScatterPlotData(), swap(), and yCubeMin().
|
private |
Stretch 2.
Definition at line 67 of file ScatterPlotData.h.
Referenced by binXYIndices(), pixelHint(), ScatterPlotData(), ScatterPlotData(), and swap().