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"
|
|
|
|
|
|
|
|
class DiveCartesianAxis;
|
|
|
|
class DivePlotDataModel;
|
|
|
|
struct event;
|
|
|
|
|
|
|
|
class DiveEventItem : public DivePixmapItem {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-06-05 07:15:51 +00:00
|
|
|
DiveEventItem(const struct dive *d, struct event *ev, struct gasmix lastgasmix,
|
|
|
|
DivePlotDataModel *model, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis,
|
|
|
|
int speed, QGraphicsItem *parent = nullptr);
|
2018-07-31 05:41:19 +00:00
|
|
|
~DiveEventItem();
|
2014-02-25 20:27:12 +00:00
|
|
|
struct event *getEvent();
|
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);
|
|
|
|
void setModel(DivePlotDataModel *model);
|
2014-03-16 22:10:03 +00:00
|
|
|
bool shouldBeHidden();
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2019-07-10 19:57:51 +00:00
|
|
|
void recalculatePos(int animationSpeed);
|
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);
|
|
|
|
void setupPixmap(struct gasmix lastgasmix);
|
2019-03-20 15:29:27 +00:00
|
|
|
int depthAtTime(int time);
|
2014-01-16 17:02:32 +00:00
|
|
|
DiveCartesianAxis *vAxis;
|
|
|
|
DiveCartesianAxis *hAxis;
|
|
|
|
DivePlotDataModel *dataModel;
|
2014-02-28 04:09:57 +00:00
|
|
|
struct event *internalEvent;
|
2021-01-09 17:58:33 +00:00
|
|
|
const struct dive *dive;
|
2014-01-16 17:02:32 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEEVENTITEM_H
|