DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
metiersstatsplot.h
Go to the documentation of this file.
1 #ifndef METIERSSTATSPLOT_H
2 #define METIERSSTATSPLOT_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 
18 {
19  QCustomPlot *plot;
20  QCPItemLine *timeline;
21  double timelineMax = 1e20;
22  double timelineMin = -1e20;
23  Palette mPalette;
24 
25  DisplaceModel *lastModel;
27 public:
28  explicit MetiersStatsPlot(QCustomPlot *plot_);
29 
30  void update(DisplaceModel *model, QCustomPlot *theplot = nullptr);
32 
33  void setCurrentTimeStep(double t);
34  void setStat(displace::plot::MetiersStat stat) { metStat = stat; invalidate(); }
35 private:
36  void update(QCustomPlot *);
37  void saveTo();
38  std::tuple<QVector<double>,QVector<double>> getData(DisplaceModel *model, displace::plot::MetiersStat stat, int metier);
39 
40 protected:
41  void doUpdate() override;
42 };
43 
44 #endif // METIERSSTATSPLOT_H
MetiersStatsPlot(QCustomPlot *plot_)
Definition: metiersstatsplot.cpp:15
void invalidate()
Definition: StatsPlot.h:26
Definition: StatsPlot.h:13
void setCurrentTimeStep(double t)
Definition: metiersstatsplot.cpp:163
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::MetiersStat stat)
Definition: metiersstatsplot.h:34
void doUpdate() override
Definition: metiersstatsplot.cpp:218
Definition: displacemodel.h:71
MetiersStat
Definition: plottypes.h:26
virtual void update()
Definition: StatsPlot.h:19
PopupMenuLocation
Definition: graphinteractioncontroller.h:56
void createPopup(GraphInteractionController::PopupMenuLocation location, QMenu *menu)
A line from one point to another.
Definition: qcustomplot.h:6123
Definition: metiersstatsplot.h:17
Definition: palettemanager.h:62