Isis 3.0 Programmer Reference
Back | Home
ScatterPlotData.h
1 #ifndef ScatterPlotData_h
2 #define ScatterPlotData_h
3 
4 #include <qwt_raster_data.h>
5 
6 #include <QScopedPointer>
7 #include <QVector>
8 
9 #include "Stretch.h"
10 
11 template <typename A, typename B> struct QPair;
12 template <typename T> class QVector;
13 
14 class QwtInterval;
15 
16 namespace Isis {
17  class Cube;
18 
28  class ScatterPlotData : public QwtRasterData {
29  public:
30  ScatterPlotData(Cube *xCube, int xCubeBand, int xBinCount,
31  Cube *yCube, int yCubeBand, int yBinCount,
32  QwtInterval sampleRange, QwtInterval lineRange);
33  ScatterPlotData(const ScatterPlotData &other);
34 
36  virtual QwtRasterData *copy() const;
37  virtual double value(double x, double y) const;
38 
39  double xCubeMin() const;
40  double xCubeMax() const;
41  double yCubeMin() const;
42  double yCubeMax() const;
43 
44  void swap(ScatterPlotData &other);
45 
47  int binCount(int binIndex) const;
48  int numberOfBins() const;
49 
51 
52  void alarm(double x, double y);
53  void clearAlarms();
54 
55  QRectF pixelHint(const QRectF &area) const;
56 
58 
59  private:
60  int binCount(int xIndex, int yIndex) const;
61  int binIndex(int xIndex, int yIndex) const;
62  int binIndex(double x, double y) const;
63  QPair<int, int> binXYIndices(int binIndex) const;
64  QPair<int, int> binXYIndices(double x, double y) const;
65 
66  QScopedPointer<Stretch> m_xDnToBinStretch;
67  QScopedPointer<Stretch> m_yDnToBinStretch;
68 
73  QScopedPointer< QVector< QVector<int> > > m_counts;
74 
77 
81  QScopedPointer< QMap<int, bool> > m_alarmedBins;
82 
84  double m_xCubeMin;
86  double m_xCubeMax;
88  double m_yCubeMin;
90  double m_yCubeMax;
91  };
92 };
93 
94 #endif
int m_maxCount
The maximum value in m_counts, stored for efficiency.
QVector< double > discreteXValues() const
Get a list of all of the x-bin center values for this scatter plot.
ScatterPlotData(Cube *xCube, int xCubeBand, int xBinCount, Cube *yCube, int yCubeBand, int yBinCount, QwtInterval sampleRange, QwtInterval lineRange)
ScatterPlotDataConstructor.
virtual double value(double x, double y) const
This gets called every time the scatter plot is re-drawn.
double yCubeMax() const
Return the max DN value for the y-axis cube&#39;s data range.
int numberOfBins() const
Get the total number of bins (bin count in x * bin count in y).
double m_xCubeMax
The maximum DN value for the x cube.
double m_yCubeMin
The minimum DN value for the y cube.
double xCubeMin() const
Return the min DN value for the x-axis cube&#39;s data range.
int binIndex(int xIndex, int yIndex) const
Get the single-index position given an x/y index position.
QPair< int, int > binXYIndices(int binIndex) const
Get the 2D index index position given a 1D (flat) index position.
~ScatterPlotData()
Destructor.
double yCubeMin() const
Return the min DN value for the y-axis cube&#39;s data range.
QRectF pixelHint(const QRectF &area) const
This is a hint given to qwt for how to render a pixel in the spectrogram.
double xCubeMax() const
Return the max DN value for the y-axis cube&#39;s data range.
void alarm(double x, double y)
Alarm the bin (highlight it) at the given x/y DN value.
int binCount(int binIndex) const
Get the count (number of values) which fall into the bin at index.
double m_yCubeMax
The maximum DN value for the y cube.
virtual QwtRasterData * copy() const
Returns a copy of the ScatterPlotData object.
QScopedPointer< Stretch > m_xDnToBinStretch
Stretch 1.
QScopedPointer< QVector< QVector< int > > > m_counts
The bin counts stored by 2D (x/y) index position.
This is the QwtRasterData for a scatter plot.
ScatterPlotData & operator=(const ScatterPlotData &other)
Take the data from other and copy it into this.
void clearAlarms()
Forget all alarmed bins (viewport-&gt;plot).
QScopedPointer< QMap< int, bool > > m_alarmedBins
map from bin index to alarm state (true for alarmed)
void swap(ScatterPlotData &other)
This is part of the copy-and-swap paradigm.
QScopedPointer< Stretch > m_yDnToBinStretch
Stretch 2.
QPair< double, double > binXY(int binIndex) const
Get the center X/Y Dn values for the bin at index.
IO Handler for Isis Cubes.
Definition: Cube.h:158
double m_xCubeMin
The minimum DN value for the x cube.

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 ISIS Support Center
File Modified: 07/12/2023 23:28:45