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);
|
|
|
|
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;
|
|
|
|
struct dive *dive;
|
|
|
|
struct plot_info *pInfo;
|
2014-08-15 03:40:47 +00:00
|
|
|
qreal yPos, height;
|
|
|
|
QBrush air, nitrox, trimix;
|
2014-08-15 00:22:27 +00:00
|
|
|
QList<QGraphicsRectItem *> rects;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TANKITEM_H
|