Isis 3.0 Object Programmers' Reference |
Home |
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 27 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(), 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 114 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 131 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 325 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 271 of file ScatterPlotData.cpp.
References 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 383 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 404 of file ScatterPlotData.cpp.
References m_counts.
Referenced by alarm(), 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 427 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 234 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 439 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 469 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 335 of file ScatterPlotData.cpp.
References m_alarmedBins.
Referenced by Isis::ScatterPlotWindow::setMousePosition().
|
virtual |
Returns a copy of the ScatterPlotData object.
Definition at line 140 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 299 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 282 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 367 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 346 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 214 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 154 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 184 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 174 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 204 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 194 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 80 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 72 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 75 of file ScatterPlotData.h.
Referenced by ScatterPlotData(), swap(), and value().
|
private |
The maximum DN value for the x cube.
Definition at line 85 of file ScatterPlotData.h.
Referenced by binXY(), discreteXValues(), ScatterPlotData(), swap(), and xCubeMax().
|
private |
The minimum DN value for the x cube.
Definition at line 83 of file ScatterPlotData.h.
Referenced by binXY(), discreteXValues(), pixelHint(), ScatterPlotData(), swap(), and xCubeMin().
|
private |
Stretch 1.
Definition at line 65 of file ScatterPlotData.h.
Referenced by binXYIndices(), pixelHint(), ScatterPlotData(), and swap().
|
private |
The maximum DN value for the y cube.
Definition at line 89 of file ScatterPlotData.h.
Referenced by binXY(), ScatterPlotData(), swap(), and yCubeMax().
|
private |
The minimum DN value for the y cube.
Definition at line 87 of file ScatterPlotData.h.
Referenced by binXY(), pixelHint(), ScatterPlotData(), swap(), and yCubeMin().
|
private |
Stretch 2.
Definition at line 66 of file ScatterPlotData.h.
Referenced by binXYIndices(), pixelHint(), ScatterPlotData(), and swap().