Isis 3 Programmer Reference
ScatterPlotWindow.h
1#ifndef ScatterPlotWindow_h
2#define ScatterPlotWindow_h
3
4// Only Parents of classes defined in this file should be included in this file!
5#include "PlotWindow.h"
6
7#include <QList>
8#include <QScopedPointer>
9
10class QwtPlotSpectrogram;
11class QwtPlotMarker;
12
13namespace Isis {
14 class Cube;
15 class ScatterPlotTool;
16
29 Q_OBJECT
30
31 public:
42
43 ScatterPlotWindow(QString title,
44 Cube *xAxisCube, int xAxisBand, int xAxisBinCount,
45 Cube *yAxisCube, int yAxisBand, int yAxisBinCount,
46 QwtInterval sampleRange, QwtInterval lineRange,
47 QWidget *parent);
48 virtual ~ScatterPlotWindow();
49
50 bool alarmingPlot() const;
51 bool alarmingViewport() const;
52 QPair<int, int> alarmPlotBoxSize() const;
53 AlarmRangeUnits alarmViewportUnits() const;
54 QPair<int, int> alarmViewportScreenBoxSize() const;
55 QPair<double, double> alarmViewportDnBoxSize() const;
56
57 bool eventFilter(QObject *o, QEvent *e);
58
59 virtual void paint(MdiCubeViewport *vp, QPainter *painter);
60
61 void setMousePosition(MdiCubeViewport *vp, QPoint mouseLoc);
62
63 void setAlarmingPlot(bool);
64 void setAlarmingViewport(bool);
65 void setAlarmPlotBoxSize(int, int);
66 void setAlarmViewportUnits(AlarmRangeUnits);
67 void setAlarmViewportScreenBoxSize(int, int);
68 void setAlarmViewportDnBoxSize(double, double);
69
70 public slots:
71 void forgetCubes();
72
73 protected slots:
74 void colorPlot();
75 void showHideContour();
76
77 private:
78 bool isXCube(MdiCubeViewport *vp) const;
79 bool isYCube(MdiCubeViewport *vp) const;
80
81 void mouseMoveEvent(QMouseEvent *e);
82 void mouseLeaveEvent(QMouseEvent *e);
83 void updateContourPen();
84
85 private slots:
86 void configureAlarming();
87
88 private:
90 QwtPlotSpectrogram *m_spectrogram;
91
93 QPointer<QAction> m_colorize;
95 QPointer<QAction> m_contour;
96
102 QPair<double, double> m_xCubeDnAlarmRange;
104 QPair<double, double> m_yCubeDnAlarmRange;
110 QwtInterval m_sampleRange;
112 QwtInterval m_lineRange;
113
118
123
134 };
135}
136
137#endif
138
IO Handler for Isis Cubes.
Definition Cube.h:168
Cube display widget for certain Isis MDI applications.
Scatter Plot Window.
QPointer< QAction > m_contour
The action for switching on and off contour lines.
int m_alarmViewportScreenHeight
Alarm plot->viewport Y (screen pixels) box size.
QPair< double, double > m_xCubeDnAlarmRange
The DN range of the X-Axis Cube to be alarmed when painting.
ScatterPlotWindow(QString title, Cube *xAxisCube, int xAxisBand, int xAxisBinCount, Cube *yAxisCube, int yAxisBand, int yAxisBinCount, QwtInterval sampleRange, QwtInterval lineRange, QWidget *parent)
Create a scatter plot window with the given data.
void setAlarmViewportScreenBoxSize(int, int)
This sets the screen pixel box size for alarming plot->viewport.
Cube * m_xAxisCube
The cube associated with the X-Axis DN values.
Cube * m_yAxisCube
The cube associated with the Y-Axis DN values.
virtual void paint(MdiCubeViewport *vp, QPainter *painter)
If the viewport is showing the x axis cube data or y axis cube data, and alarming is enabled,...
QPointer< QAction > m_colorize
The action for switching the scatter plot from B/W to color.
void setAlarmingViewport(bool)
This enables or disables alarming plot->viewport.
bool m_alarmPlot
Alarm onto plot... aka alarm viewport->plot.
int m_alarmViewportScreenWidth
Alarm plot->viewport X (screen pixels) box size.
void updateContourPen()
This sets the contour pen to an appropriate color based on the color of the plot (B/W v.
bool alarmingPlot() const
This indicates if we are alarming from viewport to plot.
QPair< double, double > alarmViewportDnBoxSize() const
This is the alarming box size for plot->viewport in cube units (number of samples/lines).
AlarmRangeUnits
This enumeration differentiates alarming a strict cube DN box size from a screen region.
@ ScreenUnits
Alarming is a visible area around the mouse.
@ CubeUnits
Alarming is a DN range around the mouse.
void colorPlot()
This method switches the color mode of the scatter plot from black and white to color and visa versa.
QPair< double, double > m_yCubeDnAlarmRange
The DN range of the Y-Axis Cube to be alarmed when painting.
void mouseMoveEvent(QMouseEvent *e)
When the mosue moves, this updates the alarming information and causes repaints on the cube viewports...
bool alarmingViewport() const
This indicates if we are alarming from plot to viewport.
void setAlarmPlotBoxSize(int, int)
This sets the box size for alarming viewport->plot in cube samples/lines.
void setMousePosition(MdiCubeViewport *vp, QPoint mouseLoc)
Saves the current mouse position in the viewport so that the plot can be alarmed around that position...
QwtInterval m_sampleRange
The sample range (1-based inclusive) of data used for the scatter plot.
QPair< int, int > alarmPlotBoxSize() const
This is the sample/line box sizes for alarming from viewport to plot.
void setAlarmViewportDnBoxSize(double, double)
This sets the cube DN box size for alarming plot->viewport.
int m_yAxisCubeBand
The band on the Y-Axis cube used for the scatter plot.
bool isXCube(MdiCubeViewport *vp) const
Returns true if the viewport's cube is the cube currently being used on the x-axis.
int m_xAxisCubeBand
The band on the X-Axis cube used for the scatter plot.
double m_alarmViewportYDnBoxSize
Alarm plot->viewport Y (Cube DN) box size.
void configureAlarming()
Give the users an alarm config dialog to change the alarming settings.
double m_alarmViewportXDnBoxSize
Alarm plot->viewport X (Cube DN) box size.
bool eventFilter(QObject *o, QEvent *e)
We override events done on the plot canvas for alarming purposes.
QwtInterval m_lineRange
The line range (1-based inclusive) of data used for the scatter plot.
void forgetCubes()
This causes the window to lose it's pointers to the input cubes.
bool isYCube(MdiCubeViewport *vp) const
Returns true if the viewport's cube is the cube currently being used on the y-axis.
void showHideContour()
This method hides or displays the contour lines on the spectrogram.
QPair< int, int > alarmViewportScreenBoxSize() const
This is the alarming box size for plot->viewport in screen units.
void setAlarmingPlot(bool)
This enables or disables alarming viewport->plot.
AlarmRangeUnits m_alarmViewportUnits
Alarm plot->viewport current units.
bool m_alarmViewport
Alarm onto viewport... aka alarm plot->viewport.
void mouseLeaveEvent(QMouseEvent *e)
When the mouse leaves the plot canvas we disable all alarming from plot->viewport.
void setAlarmViewportUnits(AlarmRangeUnits)
This sets the units to be used for alarming plot->viewport.
int m_alarmPlotSamples
Alarm viewport->plot viewport sample box size.
QwtPlotSpectrogram * m_spectrogram
This is the scatter plot's Qwt plot item.
int m_alarmPlotLines
Alarm viewport->plot viewport line box size.
AlarmRangeUnits alarmViewportUnits() const
This is the active alarming units for plot->viewport.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16