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