mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
0146a0c892
The only time the TankItem is replot is when new data is set. Therefore, replot() can be folded into setData(). The good thing is that setData() is passed the dive to be plot. So the data can be extracted from there instead of the global displayed_dive variable. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
27 lines
610 B
C++
27 lines
610 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef TANKITEM_H
|
|
#define TANKITEM_H
|
|
|
|
#include "profile-widget/divelineitem.h"
|
|
#include "core/gas.h"
|
|
#include <QGraphicsRectItem>
|
|
#include <QBrush>
|
|
|
|
struct dive;
|
|
class DiveCartesianAxis;
|
|
|
|
class TankItem : public QGraphicsRectItem
|
|
{
|
|
public:
|
|
explicit TankItem(const DiveCartesianAxis &axis);
|
|
void setData(struct plot_info *plotInfo, struct dive *d);
|
|
|
|
private:
|
|
void createBar(int startTime, int stopTime, struct gasmix gas);
|
|
const DiveCartesianAxis &hAxis;
|
|
int plotEndTime;
|
|
QBrush air, nitrox, oxygen, trimix;
|
|
QList<QGraphicsRectItem *> rects;
|
|
};
|
|
|
|
#endif // TANKITEM_H
|