1#include "SpectralPlotWindow.h"
9#include "MdiCubeViewport.h"
43 foreach (
QAction *menuAction, menuBar()->actions()) {
44 if (menuAction->text() ==
"&Options") {
45 QMenu *optsMenu = qobject_cast<QMenu *>(menuAction->parentWidget());
53 SpectralPlotWindow::~SpectralPlotWindow() {
79 QPen markerPen(color);
80 markerPen.setWidth(1);
82 QwtPlotMarker *newMarker =
new QwtPlotMarker;
83 newMarker->setLineStyle(QwtPlotMarker::LineStyle(2));
84 newMarker->setLinePen(markerPen);
85 newMarker->attach(
plot());
86 newMarker->setVisible(
false);
99 int redBand = 0, greenBand = 0, blueBand = 0, grayBand = 0;
105 if (pvl.
findObject(
"IsisCube").hasGroup(
"BandBin")) {
112 if (
m_cvp->isColor()) {
113 redBand =
m_cvp->redBand();
114 greenBand =
m_cvp->greenBand();
115 blueBand =
m_cvp->blueBand();
118 grayBand =
m_cvp->grayBand();
IO Handler for Isis Cubes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Cube display widget for certain Isis MDI applications.
Units
These are all the possible units for the x or y data in a plot curve.
@ Wavelength
The data is a wavelength.
void replot()
Reset the scale of the plot, replot it and emit plot changed.
PlotCurve::Units xAxisUnits() const
This is the data-type of the curves' x data in this plot window.
PlotWindow(QString title, PlotCurve::Units xAxisUnits, PlotCurve::Units yAxisUnits, QWidget *parent, MenuOptions optionsToProvide=AllMenuOptions)
This constructs a plot window.
QwtPlot * plot()
Get the plot encapsulated by this PlotWindow.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
QwtPlotMarker * m_grayBandLine
The band marker for the gray band.
void setViewport(MdiCubeViewport *cvp)
This class needs to know which viewport the user is looking at so it can appropriately draw in the ba...
QwtPlotMarker * createMarker(QColor color)
This is a helper method to create new band markers with the same line style and a custom color.
QwtPlotMarker * m_blueBandLine
The band marker for the blue band.
QAction * m_showHideBandMarkers
This action toggles band marker visibility.
SpectralPlotWindow(PlotCurve::Units xUnits, QWidget *parent)
This constructs a spectral plot window.
void nullify()
This initializes the class member data to NULL.
MdiCubeViewport * m_cvp
The viewport to be used as a reference for band markers.
bool bandMarkersVisible() const
void setBandMarkersVisible(bool visible)
QwtPlotMarker * m_greenBandLine
The band marker for the green band.
bool m_markersVisible
True if the visibile state of the active markers should be true.
QwtPlotMarker * m_redBandLine
The band marker for the red band.
void drawBandMarkers()
This method actually draws in the vertical band line(s) on the plot area.
void update(MdiCubeViewport *activeViewport)
This window can show markers for the currently visible bands.
This is free and unencumbered software released into the public domain.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Namespace for the standard library.