mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
254beef5d4
The DiveProfileItem contained much of the complexity and algorithms for almost all line-based items on the canvas, so I transformed that to a general abstraction and implemented a new DiveProfileItem that uses it. this should reduce a bit of code since the implementation of the PP Graphs, Temperature Cylinder Pressure and maybe a few others will only need to reimplement the paint() and the modelDataChanged() methods. The rest is ready. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
29 lines
No EOL
695 B
C++
29 lines
No EOL
695 B
C++
#ifndef DIVEEVENTITEM_H
|
|
#define DIVEEVENTITEM_H
|
|
|
|
#include "divepixmapitem.h"
|
|
|
|
class DiveCartesianAxis;
|
|
class DivePlotDataModel;
|
|
struct event;
|
|
|
|
class DiveEventItem : public DivePixmapItem {
|
|
Q_OBJECT
|
|
public:
|
|
DiveEventItem(QObject* parent = 0);
|
|
void setEvent(struct event *ev);
|
|
void eventVisibilityChanged(const QString& eventName, bool visible);
|
|
void setVerticalAxis(DiveCartesianAxis *axis);
|
|
void setHorizontalAxis(DiveCartesianAxis *axis);
|
|
void setModel(DivePlotDataModel *model);
|
|
private:
|
|
void setupToolTipString();
|
|
void recalculatePos();
|
|
void setupPixmap();
|
|
DiveCartesianAxis *vAxis;
|
|
DiveCartesianAxis *hAxis;
|
|
DivePlotDataModel *dataModel;
|
|
struct event* internalEvent;
|
|
};
|
|
|
|
#endif |