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