mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
505e4e47eb
The tissue percentages were realized as 16 independent polygons. That didn't work at all with the new absolute scaling. Reimplement the item and blast it onto a pixmap. Not only is this artifact-free, it also should (hopefully) be quite a bit more efficient than painting numerous lines. In contrast to the old code, this does access the plot_info structure directly instead of using the model. Not so much for performance reason, but rather to make things more robust: We have a strongly typed language. Why would we shoehorn data through the weakly typed QVariant and mess with wierd index-arithmetics. Makes no sense to me. Qt-model have to be used for interfacing with Qt. They are terrible for intra-application data transfer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
23 lines
546 B
C++
23 lines
546 B
C++
#ifndef DIVEPERCENTAGEITEM_H
|
|
#define DIVEPERCENTAGEITEM_H
|
|
|
|
#include <QGraphicsPixmapItem>
|
|
|
|
struct dive;
|
|
struct divecomputer;
|
|
struct plot_info;
|
|
class DivePlotDataModel;
|
|
class DiveCartesianAxis;
|
|
|
|
class DivePercentageItem : public QGraphicsPixmapItem {
|
|
public:
|
|
DivePercentageItem(const DiveCartesianAxis &hAxis, const DiveCartesianAxis &vAxis, double dpr);
|
|
void replot(const dive *d, const divecomputer *dc, const plot_info &pi);
|
|
private:
|
|
const DiveCartesianAxis &hAxis;
|
|
const DiveCartesianAxis &vAxis;
|
|
int hDataColumn;
|
|
double dpr;
|
|
};
|
|
|
|
#endif
|