Isis Developer Reference
ScatterPlotWindow.h
Go to the documentation of this file.
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 
10 class QwtPlotSpectrogram;
11 class QwtPlotMarker;
12 
13 namespace Isis {
14  class Cube;
15  class ScatterPlotTool;
16 
28  class ScatterPlotWindow : public PlotWindow {
29  Q_OBJECT
30 
31  public:
41  };
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;
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);
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 
98  Cube *m_xAxisCube;
100  Cube *m_yAxisCube;
102  QPair<double, double> m_xCubeDnAlarmRange;
104  QPair<double, double> m_yCubeDnAlarmRange;
106  int m_xAxisCubeBand;
108  int m_yAxisCubeBand;
110  QwtInterval m_sampleRange;
112  QwtInterval m_lineRange;
113 
115  bool m_alarmPlot;
117  bool m_alarmViewport;
118 
120  int m_alarmPlotSamples;
122  int m_alarmPlotLines;
123 
125  AlarmRangeUnits m_alarmViewportUnits;
127  int m_alarmViewportScreenWidth;
129  int m_alarmViewportScreenHeight;
131  double m_alarmViewportXDnBoxSize;
133  double m_alarmViewportYDnBoxSize;
134  };
135 }
136 
137 #endif
138 
Isis::ScatterPlotWindow::setAlarmViewportUnits
void setAlarmViewportUnits(AlarmRangeUnits)
This sets the units to be used for alarming plot->viewport.
Definition: ScatterPlotWindow.cpp:495
Isis::ViewportBuffer
Reads and stores visible DN values.
Definition: ViewportBuffer.h:63
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Portal.h
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Isis::ViewportBuffer::getLine
const std::vector< double > & getLine(int line)
Retrieves a line from the buffer.
Definition: ViewportBuffer.cpp:342
MdiCubeViewport.h
Isis::Portal
Buffer for containing a two dimensional section of an image.
Definition: Portal.h:36
QList< double >
Isis::ScatterPlotWindow::setAlarmingPlot
void setAlarmingPlot(bool)
This enables or disables alarming viewport->plot.
Definition: ScatterPlotWindow.cpp:460
ViewportMainWindow.h
Histogram.h
Isis::Cube::read
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::CubeViewport::isGray
bool isGray() const
Definition: CubeViewport.h:189
QMenu
Isis::ScatterPlotWindow::alarmPlotBoxSize
QPair< int, int > alarmPlotBoxSize() const
This is the sample/line box sizes for alarming from viewport to plot.
Definition: ScatterPlotWindow.cpp:228
Isis::PlotCurve
Definition: PlotCurve.h:44
ScatterPlotTool.h
Isis::PlotWindow::MenuOptions
MenuOptions
There is a menu option for everything in the plot window's menu.
Definition: PlotWindow.h:96
Isis::ScatterPlotData::xCubeMax
double xCubeMax() const
Return the max DN value for the y-axis cube's data range.
Definition: ScatterPlotData.cpp:182
Isis::ScatterPlotWindow::colorPlot
void colorPlot()
This method switches the color mode of the scatter plot from black and white to color and visa versa.
Definition: ScatterPlotWindow.cpp:551
PlotWindow.h
Isis::ScatterPlotData::clearAlarms
void clearAlarms()
Forget all alarmed bins (viewport->plot).
Definition: ScatterPlotData.cpp:333
Isis::ScatterPlotWindow::alarmViewportUnits
AlarmRangeUnits alarmViewportUnits() const
This is the active alarming units for plot->viewport.
Definition: ScatterPlotWindow.cpp:240
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
Isis::PlotWindow::zoomer
QwtPlotZoomer * zoomer()
Get this window's plot's zoomer.
Definition: PlotWindow.cpp:1388
ScatterPlotAlarmConfigDialog.h
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::ScatterPlotWindow::ScatterPlotWindow
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.
Definition: ScatterPlotWindow.cpp:44
Isis::CubeViewport::grayBand
int grayBand() const
Definition: CubeViewport.h:194
Isis::ScatterPlotWindow::alarmViewportScreenBoxSize
QPair< int, int > alarmViewportScreenBoxSize() const
This is the alarming box size for plot->viewport in screen units.
Definition: ScatterPlotWindow.cpp:254
Isis::ScatterPlotWindow
Scatter Plot Window.
Definition: ScatterPlotWindow.h:28
ScatterPlotWindow.h
Isis::ScatterPlotWindow::paint
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,...
Definition: ScatterPlotWindow.cpp:316
Isis::ScatterPlotWindow::setAlarmPlotBoxSize
void setAlarmPlotBoxSize(int, int)
This sets the box size for alarming viewport->plot in cube samples/lines.
Definition: ScatterPlotWindow.cpp:484
Isis::ScatterPlotWindow::alarmViewportDnBoxSize
QPair< double, double > alarmViewportDnBoxSize() const
This is the alarming box size for plot->viewport in cube units (number of samples/lines).
Definition: ScatterPlotWindow.cpp:270
Isis::ScatterPlotData::yCubeMin
double yCubeMin() const
Return the min DN value for the y-axis cube's data range.
Definition: ScatterPlotData.cpp:192
Isis::ScatterPlotWindow::setAlarmViewportDnBoxSize
void setAlarmViewportDnBoxSize(double, double)
This sets the cube DN box size for alarming plot->viewport.
Definition: ScatterPlotWindow.cpp:528
Isis::ScatterPlotWindow::AlarmRangeUnits
AlarmRangeUnits
This enumeration differentiates alarming a strict cube DN box size from a screen region.
Definition: ScatterPlotWindow.h:36
Workspace.h
Isis::ScatterPlotData
This is the QwtRasterData for a scatter plot.
Definition: ScatterPlotData.h:28
ScatterPlotData.h
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::ScatterPlotWindow::CubeUnits
@ CubeUnits
Alarming is a DN range around the mouse.
Definition: ScatterPlotWindow.h:38
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::PlotWindow::disableAxisAutoScale
void disableAxisAutoScale()
This turns off scaling the x/y axes automatically.
Definition: PlotWindow.cpp:1664
Isis::ViewportBuffer::bufferXYRect
QRect bufferXYRect()
Returns a rect, in screen pixels, of the area this buffer covers.
Definition: ViewportBuffer.cpp:1257
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::ScatterPlotData::xCubeMin
double xCubeMin() const
Return the min DN value for the x-axis cube's data range.
Definition: ScatterPlotData.cpp:172
Isis::PlotWindow::plot
QwtPlot * plot()
Get the plot encapsulated by this PlotWindow.
Definition: PlotWindow.cpp:1653
Isis::ScatterPlotWindow::forgetCubes
void forgetCubes()
This causes the window to lose it's pointers to the input cubes.
Definition: ScatterPlotWindow.cpp:540
Isis::ScatterPlotWindow::setAlarmViewportScreenBoxSize
void setAlarmViewportScreenBoxSize(int, int)
This sets the screen pixel box size for alarming plot->viewport.
Definition: ScatterPlotWindow.cpp:511
Isis::ScatterPlotWindow::alarmingViewport
bool alarmingViewport() const
This indicates if we are alarming from plot to viewport.
Definition: ScatterPlotWindow.cpp:218
Isis::ScatterPlotData::yCubeMax
double yCubeMax() const
Return the max DN value for the y-axis cube's data range.
Definition: ScatterPlotData.cpp:202
std
Namespace for the standard library.
Isis::Cube::pixelType
PixelType pixelType() const
Definition: Cube.cpp:1758
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis::ScatterPlotWindow::setMousePosition
void setMousePosition(MdiCubeViewport *vp, QPoint mouseLoc)
Saves the current mouse position in the viewport so that the plot can be alarmed around that position...
Definition: ScatterPlotWindow.cpp:405
ViewportBuffer.h
Isis::CubeViewport::viewportToCube
void viewportToCube(int x, int y, double &sample, double &line) const
Turns a viewport into a cube.
Definition: CubeViewport.cpp:815
Isis::ScatterPlotWindow::ScreenUnits
@ ScreenUnits
Alarming is a visible area around the mouse.
Definition: ScatterPlotWindow.h:40
QObject
Isis::CubeViewport::grayBuffer
ViewportBuffer * grayBuffer()
Returns the gray viewport buffer (Will be NULL if in RGB mode.)
Definition: CubeViewport.h:411
Isis::PlotWindow::replot
void replot()
Reset the scale of the plot, replot it and emit plot changed.
Definition: PlotWindow.cpp:1797
IsisDebug.h
Isis::PlotWindow
Definition: PlotWindow.h:88
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis::PlotWindow::eventFilter
virtual bool eventFilter(QObject *o, QEvent *e)
This method filters the events of the objects it is connected to.
Definition: PlotWindow.cpp:1590
Isis::PlotWindow::plotChanged
void plotChanged()
Emitted every time there is a change to the plot window.
Isis::ScatterPlotWindow::~ScatterPlotWindow
virtual ~ScatterPlotWindow()
Definition: ScatterPlotWindow.cpp:182
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ScatterPlotWindow::showHideContour
void showHideContour()
This method hides or displays the contour lines on the spectrogram.
Definition: ScatterPlotWindow.cpp:585
Isis::ScatterPlotWindow::eventFilter
bool eventFilter(QObject *o, QEvent *e)
We override events done on the plot canvas for alarming purposes.
Definition: ScatterPlotWindow.cpp:284
Isis::ScatterPlotData::alarm
void alarm(double x, double y)
Alarm the bin (highlight it) at the given x/y DN value.
Definition: ScatterPlotData.cpp:323
Isis::ScatterPlotWindow::alarmingPlot
bool alarmingPlot() const
This indicates if we are alarming from viewport to plot.
Definition: ScatterPlotWindow.cpp:208
Isis::PlotWindow::paint
virtual void paint(MdiCubeViewport *vp, QPainter *painter)
Paint plot curve information onto the viewport.
Definition: PlotWindow.cpp:1787
Isis::ViewportBuffer::working
bool working()
This tests if queued actions exist in the viewport buffer.
Definition: ViewportBuffer.cpp:759
Isis::ScatterPlotWindow::setAlarmingViewport
void setAlarmingViewport(bool)
This enables or disables alarming plot->viewport.
Definition: ScatterPlotWindow.cpp:471