2017-04-27 20:26:36 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-01-16 15:02:32 -02:00
|
|
|
#ifndef DIVEEVENTITEM_H
|
|
|
|
#define DIVEEVENTITEM_H
|
|
|
|
|
|
|
|
#include "divepixmapitem.h"
|
|
|
|
|
|
|
|
class DiveCartesianAxis;
|
2021-08-30 21:11:11 +02:00
|
|
|
class DivePixmaps;
|
2014-01-16 15:02:32 -02:00
|
|
|
struct event;
|
2021-08-31 20:44:37 +02:00
|
|
|
struct plot_info;
|
2014-01-16 15:02:32 -02:00
|
|
|
|
|
|
|
class DiveEventItem : public DivePixmapItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-06-05 09:15:51 +02:00
|
|
|
DiveEventItem(const struct dive *d, struct event *ev, struct gasmix lastgasmix,
|
2021-08-31 20:44:37 +02:00
|
|
|
const struct plot_info &pi, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis,
|
2021-08-30 21:11:11 +02:00
|
|
|
int speed, const DivePixmaps &pixmaps, QGraphicsItem *parent = nullptr);
|
2018-07-31 07:41:19 +02:00
|
|
|
~DiveEventItem();
|
2021-06-05 09:29:41 +02:00
|
|
|
const struct event *getEvent() const;
|
|
|
|
struct event *getEventMutable();
|
2014-02-27 20:09:57 -08:00
|
|
|
void eventVisibilityChanged(const QString &eventName, bool visible);
|
2019-07-10 21:57:51 +02:00
|
|
|
void setVerticalAxis(DiveCartesianAxis *axis, int speed);
|
2014-01-16 15:02:32 -02:00
|
|
|
void setHorizontalAxis(DiveCartesianAxis *axis);
|
2021-08-31 20:10:24 +02:00
|
|
|
static bool isInteresting(const struct dive *d, const struct divecomputer *dc,
|
2021-10-09 15:05:27 +02:00
|
|
|
const struct event *ev, const struct plot_info &pi,
|
|
|
|
int firstSecond, int lastSecond);
|
2014-02-27 20:09:57 -08:00
|
|
|
|
2014-01-16 15:02:32 -02:00
|
|
|
private:
|
2018-08-16 19:10:10 +02:00
|
|
|
void setupToolTipString(struct gasmix lastgasmix);
|
2021-08-30 21:11:11 +02:00
|
|
|
void setupPixmap(struct gasmix lastgasmix, const DivePixmaps &pixmaps);
|
2021-09-27 09:37:15 +02:00
|
|
|
void recalculatePos();
|
2014-01-16 15:02:32 -02:00
|
|
|
DiveCartesianAxis *vAxis;
|
|
|
|
DiveCartesianAxis *hAxis;
|
2021-06-05 09:29:41 +02:00
|
|
|
struct event *ev;
|
2021-01-09 18:58:33 +01:00
|
|
|
const struct dive *dive;
|
2021-08-31 20:44:37 +02:00
|
|
|
int depth;
|
2014-01-16 15:02:32 -02:00
|
|
|
};
|
|
|
|
|
2014-02-11 19:14:46 +01:00
|
|
|
#endif // DIVEEVENTITEM_H
|