Isis Developer Reference
CubePlotCurve.h
Go to the documentation of this file.
1 #ifndef CubePlotCurve_h
2 #define CubePlotCurve_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QObject>
13 #include <QPointer>
14 
15 // This is needed for the QVariant macro
16 #include <QMetaType>
17 
18 #include "PlotCurve.h"
19 
20 class QMimeData;
21 class QMouseEvent;
22 
23 namespace Isis {
24  class CubeViewport;
25 
53  class CubePlotCurve : public QObject, public PlotCurve {
54  Q_OBJECT
55 
56  public:
58  CubePlotCurve(const QByteArray &parentAndChildData);
59 
60  bool eventFilter(QObject *o, QEvent *e);
61  void paint(CubeViewport *vp, QPainter *painter);
63  virtual QWidget *legendItem() const;
64  QStringList sourceCube() const;
65 
66  void enableAutoRenaming(bool);
67  void copySource(const CubePlotCurve &other);
68  void setSource(CubeViewport *cvp, QList<QPoint> screenPoints,
69  int band = -1);
71  QList< QList<QPoint> > screenPoints, QList<int> band);
72 
73  signals:
78  void needsRepaint();
83  void removing();
84 
85  public slots:
87 
88  private:
89  QMimeData *createMimeData() const;
90  QByteArray toByteArray() const;
91  void mousePressEvent(QMouseEvent *e);
92 
93  void clearSource();
94  void addSource(CubeViewport *cvp, QList<QPoint> screenPoints,
95  int band = -1);
96 
97  private:
99  QPointer<QWidget> m_legendItem;
100 
102  QString m_originalName;
103 
108  bool m_renameAutomatically;
109 
111  QList<QList <QPointF> > m_pointList;
112 
114  QStringList m_sourceCube;
115  };
116 };
117 
120 
121 #endif
QwtPlot
CubePlotCurve.h
FileName.h
QWidget
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Cube.h
Isis::CubePlotCurve::updateLegendItemWidget
void updateLegendItemWidget(QWidget *legendItem)
This creates a legend item and overrides events from it.
Definition: CubePlotCurve.cpp:345
QList< QPointF >
Isis::CubePlotCurve::copySource
void copySource(const CubePlotCurve &other)
This copies the source data from another CubePlotCurve.
Definition: CubePlotCurve.cpp:258
Isis::CubePlotCurve::removing
void removing()
This is emitted just before the cube plot curve is deleted.
Isis::CubePlotCurve
This is a plot curve with information relating it to a particular cube or region of a cube.
Definition: CubePlotCurve.h:53
Isis::PlotCurve::yUnits
Units yUnits() const
Get the units of the y-axis double data.
Definition: PlotCurve.cpp:86
QMenu
Isis::CubePlotCurve::legendItem
virtual QWidget * legendItem() const
This method is necessary for getting the correct (event filter altered) legend item.
Definition: CubePlotCurve.cpp:224
Isis::CubePlotCurve::paint
void paint(CubeViewport *vp, QPainter *painter)
Use information inside of the plot curve to paint onto a cube viewport.
Definition: CubePlotCurve.cpp:171
Isis::PlotCurve
Definition: PlotCurve.h:44
Isis::CubePlotCurve::CubePlotCurve
CubePlotCurve(Units xUnits, Units yUnits)
This constructs a CubePlotCurve...
Definition: CubePlotCurve.cpp:50
Isis::CubePlotCurve::enableAutoRenaming
void enableAutoRenaming(bool)
This enables/disables the plot curve from changing it's title when the source data changes.
Definition: CubePlotCurve.cpp:247
Isis::PlotCurve::Units
Units
These are all the possible units for the x or y data in a plot curve.
Definition: PlotCurve.h:54
Isis::CubePlotCurve::setSource
void setSource(CubeViewport *cvp, QList< QPoint > screenPoints, int band=-1)
Tell this plot curve from where its data originated.
Definition: CubePlotCurve.cpp:323
QStringList
IString.h
CubeViewport.h
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Isis::CubePlotCurve *)
This allows CubePlotCurves to be stored inside of QVariants.
Isis::CubeViewport::cubeToViewport
void cubeToViewport(double sample, double line, int &x, int &y) const
Turns a cube into a viewport.
Definition: CubeViewport.cpp:852
CubePlotCurveConfigureDialog.h
Isis::CubePlotCurve::needsRepaint
void needsRepaint()
This is emitted when the curve is modified in such a way that it would paint a viewport differently.
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
PlotCurve.h
Isis::CubePlotCurve::eventFilter
bool eventFilter(QObject *o, QEvent *e)
This will start the drag & drop operation for these curves.
Definition: CubePlotCurve.cpp:139
Isis::CubePlotCurve::sourceCube
QStringList sourceCube() const
This method returns the cube view port associated with the curve.
Definition: CubePlotCurve.cpp:235
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
ASSERT
#define ASSERT(x)
Definition: IsisDebug.h:134
Isis::CubePlotCurve::sourceVertices
QList< QList< QPointF > > sourceVertices() const
This method returns a list of points which are the vertices of the selected area (by the rubberband) ...
Definition: CubePlotCurve.cpp:213
Isis::PlotCurve::setColor
void setColor(const QColor &color)
Set the color of this curve and it's markers.
Definition: PlotCurve.cpp:97
Isis::PlotCurve::toByteArray
QByteArray toByteArray() const
Definition: PlotCurve.cpp:262
Isis::PlotCurve::xUnits
Units xUnits() const
Get the units of the x-axis double data.
Definition: PlotCurve.cpp:76
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::PlotCurve::fromByteArray
QByteArray fromByteArray(const QByteArray &classData)
Construct the plot curve given the past results of toByteArray(...).
Definition: PlotCurve.cpp:145
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
QObject
IsisDebug.h
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::PlotCurve::color
QColor color() const
This method returns the color of the curve.
Definition: PlotCurve.cpp:56