DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
fishfarmsstatsplot.h
Go to the documentation of this file.
1 #ifndef FISHFARMSSTATSPLOT_H
2 #define FISHFARMSSTATSPLOT_H
3 
4 #include "BaseStatsPlotImpl.h"
5 #include "plottypes.h"
6 #include <palettemanager.h>
8 
9 #include <QPen>
10 #include <QColor>
11 
12 #include <vector>
13 
14 class DisplaceModel;
15 class QCustomPlot;
16 class QCPItemLine;
17 
19 {
20  QCustomPlot *mPlot = nullptr;
21  QCPItemLine *mTimeline = nullptr;
22  QCPItemText *textLabel = nullptr;
23  QPen pen;
24  double timelineMax = 1e20;
25  double timelineMin = -1e20;
26  Palette mPalette;
27 
28  DisplaceModel *lastModel = nullptr;
30 public:
31  FishfarmsStatsPlot(QCustomPlot *plot, QCPItemLine *timeLine);
32 
33  void setTimelineLimits(double min, double max) {
34  timelineMin = min;
35  timelineMax = max;
36  }
37 
40 
41 protected:
42  void update(QCustomPlot *plot) override;
43 
44 private:
45  void displayPlot(DisplaceModel *model, displace::plot::FishfarmsStat stat);
46  std::tuple<QVector<double>, QVector<double> > getData(DisplaceModel *model,
49  int popid, std::vector<int> szid);
50  void saveTo();
51 };
52 
53 
54 #endif // FISHFARMSSTATSPLOT_H
Definition: BaseStatsPlotImpl.h:13
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: fishfarmsstatsplot.h:18
Definition: displacemodel.h:71
FishfarmsStatsPlot(QCustomPlot *plot, QCPItemLine *timeLine)
Definition: fishfarmsstatsplot.cpp:10
FishfarmsStat
Definition: plottypes.h:11
void createPopup(GraphInteractionController::PopupMenuLocation location, QMenu *menu)
Definition: fishfarmsstatsplot.cpp:212
void setTimelineLimits(double min, double max)
Definition: fishfarmsstatsplot.h:33
virtual void update()
Definition: StatsPlot.h:19
PopupMenuLocation
Definition: graphinteractioncontroller.h:56
A text label.
Definition: qcustomplot.h:6283
A line from one point to another.
Definition: qcustomplot.h:6123
Definition: palettemanager.h:62