DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
harboursstatplot.h
Go to the documentation of this file.
1 #ifndef HARBOURSSTATPLOT_H
2 #define HARBOURSSTATPLOT_H
3 
4 #include "StatsPlot.h"
5 
6 #include "plottypes.h"
7 #include <palettemanager.h>
8 
9 #include <QPen>
10 #include <QColor>
11 
13 
14 class DisplaceModel;
15 class QCustomPlot;
16 class QCPItemLine;
17 
19 {
20  QCustomPlot *plot;
21  QCPItemLine *timeline;
22  double timelineMax = 1e20;
23  double timelineMin = -1e20;
24  Palette mPalette;
25 
26  DisplaceModel *lastModel;
28 public:
29  HarboursStatPlot(QCustomPlot *plotNations);
30 
31  void update(DisplaceModel *model, QCustomPlot *theplot = nullptr);
33 
34  void setCurrentTimeStep(double t);
35  void setStat(displace::plot::HarboursStat stat) { lastStat = stat; invalidate(); }
36 
37  void update() override;
38 
39 protected:
40  void update (QCustomPlot *);
41  void doUpdate() override;
42 
43 private:
44  void saveTo();
45  std::tuple<QVector<double>,QVector<double>> getData(DisplaceModel *model, displace::plot::HarboursStat stat, int harbour);
46 };
47 
48 #endif // HARBOURSSTATPLOT_H
HarboursStat
Definition: plottypes.h:23
void update() override
Definition: harboursstatplot.cpp:24
void invalidate()
Definition: StatsPlot.h:26
Definition: StatsPlot.h:13
void createPopup(GraphInteractionController::PopupMenuLocation location, QMenu *menu)
Definition: harboursstatplot.cpp:185
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:3582
void setStat(displace::plot::HarboursStat stat)
Definition: harboursstatplot.h:35
Definition: displacemodel.h:71
HarboursStatPlot(QCustomPlot *plotNations)
Definition: harboursstatplot.cpp:15
void setCurrentTimeStep(double t)
Definition: harboursstatplot.cpp:233
void doUpdate() override
Definition: harboursstatplot.cpp:29
PopupMenuLocation
Definition: graphinteractioncontroller.h:56
A line from one point to another.
Definition: qcustomplot.h:6123
Definition: harboursstatplot.h:18
Definition: palettemanager.h:62