DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
populationsstatplot.h
Go to the documentation of this file.
1 #ifndef POPULATIONSSTATPLOT_H
2 #define POPULATIONSSTATPLOT_H
3 
4 #include "StatsPlot.h"
5 #include "plottypes.h"
6 #include <palettemanager.h>
7 
8 #include <QPen>
9 #include <QColor>
10 
12 
13 class DisplaceModel;
14 class QCustomPlot;
15 class QCPItemLine;
16 
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  explicit PopulationsStatPlot(QCustomPlot *plot);
30 
31  void doUpdate() override;
32  void update(DisplaceModel *model, displace::plot::PopulationStat stat, QCustomPlot *plot = nullptr);
34 
35  void setCurrentTimeStep(double t);
36 private:
38  void update (QCustomPlot *plot);
39  void saveTo();
40  std::tuple<QVector<double>,QVector<double>> getData(DisplaceModel *model, displace::plot::PopulationStat stattype,
41  displace::plot::AggregationType aggtype, int popid,
42  std::vector<int> szid);
43  std::tuple<QVector<double>,QVector<double>> getData(DisplaceModel *model, displace::plot::PopulationStat stattype,
45  displace::plot::AggregationType aggtype, int popid,
46  std::vector<int> szid);
47 };
48 
49 #endif // POPULATIONSSTATPLOT_H
void createPopup(GraphInteractionController::PopupMenuLocation location, QMenu *menu)
Definition: populationsstatplot.cpp:273
void setCurrentTimeStep(double t)
Definition: populationsstatplot.cpp:223
Definition: StatsPlot.h:13
void doUpdate() override
Definition: populationsstatplot.cpp:41
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:3582
AggregationType
Definition: plottypes.h:29
Definition: populationsstatplot.h:18
Definition: displacemodel.h:71
virtual void update()
Definition: StatsPlot.h:19
PopupMenuLocation
Definition: graphinteractioncontroller.h:56
NationsStat
Definition: plottypes.h:17
A line from one point to another.
Definition: qcustomplot.h:6123
PopulationStat
Definition: plottypes.h:7
PopulationsStatPlot(QCustomPlot *plot)
Definition: populationsstatplot.cpp:16
Definition: palettemanager.h:62