2014-08-15 00:22:27 +00:00
|
|
|
#ifndef TANKITEM_H
|
|
|
|
#define TANKITEM_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
#include <QModelIndex>
|
2014-08-15 03:40:47 +00:00
|
|
|
#include <QBrush>
|
2014-08-15 00:22:27 +00:00
|
|
|
#include "divelineitem.h"
|
|
|
|
#include "divecartesianaxis.h"
|
|
|
|
#include "dive.h"
|
|
|
|
|
|
|
|
class TankItem : public QObject, public QGraphicsRectItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_INTERFACES(QGraphicsItem)
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TankItem(QObject *parent = 0);
|
2014-12-18 07:47:53 +00:00
|
|
|
~TankItem();
|
2014-08-15 00:22:27 +00:00
|
|
|
void setHorizontalAxis(DiveCartesianAxis *horizontal);
|
|
|
|
void setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
|
|
|
|
|
|
|
|
private:
|
2014-08-15 03:40:47 +00:00
|
|
|
void createBar(qreal x, qreal w, struct gasmix *gas);
|
2014-08-15 00:22:27 +00:00
|
|
|
DivePlotDataModel *dataModel;
|
|
|
|
DiveCartesianAxis *hAxis;
|
|
|
|
int hDataColumn;
|
2014-08-23 14:13:37 +00:00
|
|
|
struct dive diveCylinderStore;
|
|
|
|
struct plot_data *pInfoEntry;
|
|
|
|
int pInfoNr;
|
2014-08-15 03:40:47 +00:00
|
|
|
qreal yPos, height;
|
2015-01-05 19:24:34 +00:00
|
|
|
QBrush air, nitrox, oxygen, trimix;
|
2014-08-15 00:22:27 +00:00
|
|
|
QList<QGraphicsRectItem *> rects;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TANKITEM_H
|