mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
f713858ba4
The printFontScale is used to scale up fonts (and icons) when rendering to high-DPI devices. With absolute scaling, this will also be used to scale the size of different chart regions, line thickness, etc. Therefore, give it an more appropriate name. "Device pixel ratio", which is a well established term, seems to appropriately describe the concept. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
101 lines
3.2 KiB
C++
101 lines
3.2 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// Displays the dive profile. Used by the interactive profile widget
|
|
// and the printing/exporting code.
|
|
#ifndef PROFILESCENE_H
|
|
#define PROFILESCENE_H
|
|
|
|
#include "core/color.h"
|
|
#include "core/display.h"
|
|
|
|
#include <QGraphicsScene>
|
|
#include <QPainter>
|
|
|
|
class DivePlannerPointsModel;
|
|
class DivePlotDataModel;
|
|
|
|
class AbstractProfilePolygonItem;
|
|
class DepthAxis;
|
|
class DiveCartesianAxis;
|
|
class DiveCalculatedCeiling;
|
|
class DiveCalculatedTissue;
|
|
class DiveCartesianAxis;
|
|
class DiveEventItem;
|
|
class DiveGasPressureItem;
|
|
class DiveHeartrateItem;
|
|
class DiveMeanDepthItem;
|
|
class DivePercentageItem;
|
|
class DiveProfileItem;
|
|
class DiveReportedCeiling;
|
|
class DiveTemperatureItem;
|
|
class DiveTextItem;
|
|
class PartialGasPressureAxis;
|
|
class PartialPressureGasItem;
|
|
class TankItem;
|
|
class TemperatureAxis;
|
|
class TimeAxis;
|
|
|
|
class ProfileScene : public QGraphicsScene {
|
|
public:
|
|
ProfileScene(double dpr, bool printMode, bool isGrayscale);
|
|
~ProfileScene();
|
|
|
|
void updateAxes(bool instant); // Update axes according to preferences
|
|
void clear();
|
|
bool isPointOutOfBoundaries(const QPointF &point) const;
|
|
|
|
// If a plannerModel is passed, the deco-information is taken from there.
|
|
void plotDive(const struct dive *d, int dc, DivePlannerPointsModel *plannerModel = nullptr, bool inPlanner = false,
|
|
bool instant = false, bool calcMax = true);
|
|
|
|
void draw(QPainter *painter, const QRect &pos);
|
|
QImage toImage(QSize size);
|
|
|
|
const struct dive *d;
|
|
int dc;
|
|
private:
|
|
template<typename T, class... Args> T *createItem(const DiveCartesianAxis &vAxis, int vColumn, int z, Args&&... args);
|
|
PartialPressureGasItem *createPPGas(int column, color_index_t color, color_index_t colorAlert,
|
|
const double *thresholdSettingsMin, const double *thresholdSettingsMax);
|
|
void updateVisibility(); // Update visibility of non-interactive chart features according to preferences
|
|
|
|
friend class ProfileWidget2; // For now, give the ProfileWidget full access to the objects on the scene
|
|
double dpr; // Device Pixel Ratio. A DPR of one corresponds to a "standard" PC screen.
|
|
bool printMode;
|
|
bool isGrayscale;
|
|
int maxtime;
|
|
int maxdepth;
|
|
|
|
DivePlotDataModel *dataModel;
|
|
struct plot_info plotInfo;
|
|
DepthAxis *profileYAxis;
|
|
PartialGasPressureAxis *gasYAxis;
|
|
TemperatureAxis *temperatureAxis;
|
|
TimeAxis *timeAxis;
|
|
DiveCartesianAxis *cylinderPressureAxis;
|
|
DiveCartesianAxis *heartBeatAxis;
|
|
DiveCartesianAxis *percentageAxis;
|
|
std::vector<AbstractProfilePolygonItem *> profileItems;
|
|
DiveProfileItem *diveProfileItem;
|
|
DiveTemperatureItem *temperatureItem;
|
|
DiveMeanDepthItem *meanDepthItem;
|
|
DiveGasPressureItem *gasPressureItem;
|
|
QList<DiveEventItem *> eventItems;
|
|
DiveTextItem *diveComputerText;
|
|
DiveReportedCeiling *reportedCeiling;
|
|
PartialPressureGasItem *pn2GasItem;
|
|
PartialPressureGasItem *pheGasItem;
|
|
PartialPressureGasItem *po2GasItem;
|
|
PartialPressureGasItem *o2SetpointGasItem;
|
|
PartialPressureGasItem *ccrsensor1GasItem;
|
|
PartialPressureGasItem *ccrsensor2GasItem;
|
|
PartialPressureGasItem *ccrsensor3GasItem;
|
|
PartialPressureGasItem *ocpo2GasItem;
|
|
DiveCalculatedCeiling *diveCeiling;
|
|
DiveTextItem *decoModelParameters;
|
|
QList<DiveCalculatedTissue *> allTissues;
|
|
DiveHeartrateItem *heartBeatItem;
|
|
QList<DivePercentageItem *> allPercentages;
|
|
TankItem *tankItem;
|
|
};
|
|
|
|
#endif
|