1 #ifndef OSMSCOUT_CLIENT_QT_ELEVATIONCHARTWIDGET_H 2 #define OSMSCOUT_CLIENT_QT_ELEVATIONCHARTWIDGET_H 28 #include <QQuickPaintedItem> 35 Q_PROPERTY(QObject *way READ getWay WRITE setWay NOTIFY wayChanged)
36 Q_PROPERTY(
bool loading READ isLoading NOTIFY loadingChanged)
37 Q_PROPERTY(QColor lineColor READ getLineColor WRITE setLineColor NOTIFY lineColorChanged)
38 Q_PROPERTY(qreal lineWidth READ getLineWidth WRITE setLineWidth NOTIFY lineWidthChanged)
39 Q_PROPERTY(QColor gradientTopColor READ getGradientTopColor WRITE setGradientTopColor NOTIFY gradientTopColorChanged)
40 Q_PROPERTY(QColor gradientBottomColor READ getGradientBottomColor WRITE setGradientBottomColor NOTIFY gradientBottomColorChanged)
41 Q_PROPERTY(QColor textColor READ getTextColor WRITE setTextColor NOTIFY textColorChanged)
42 Q_PROPERTY(
int textPixelSize READ getTextPixelSize WRITE setTextPixelSize NOTIFY textPixelSizeChanged)
43 Q_PROPERTY(
int textPadding READ getTextPadding WRITE setTextPadding NOTIFY textPaddingChanged)
45 Q_PROPERTY(qint64 pointCount READ getPointCount NOTIFY pointsUpdated)
46 Q_PROPERTY(
double lowestElevation READ getLowestElevation NOTIFY pointsUpdated)
47 Q_PROPERTY(
double highestElevation READ getHighestElevation NOTIFY pointsUpdated)
48 Q_PROPERTY(
double ascent READ getAscent NOTIFY pointsUpdated)
49 Q_PROPERTY(
double descent READ getDescent NOTIFY pointsUpdated)
53 void loadingChanged();
57 void lineColorChanged();
58 void lineWidthChanged();
59 void gradientTopColorChanged();
60 void gradientBottomColorChanged();
61 void textColorChanged();
62 void textPixelSizeChanged();
63 void textPaddingChanged();
67 void onError(
int requestId);
68 void onElevationProfileAppend(
ElevationModule::ElevationPoints points,
int requestId);
69 void onLoadingFinished(
int requestId);
75 void paint(QPainter *painter) override;
77 QObject* getWay() const;
78 void setWay(QObject* o);
80 bool isLoading()
const 90 void setLineColor(
const QColor &color);
97 void setLineWidth(qreal w);
101 return gradientTopColor;
104 void setGradientTopColor(
const QColor &c);
108 return gradientBottomColor;
111 void setGradientBottomColor(
const QColor &c);
118 void setTextColor(
const QColor &c);
122 return textPixelSize;
125 void setTextPixelSize(
int size);
132 void setTextPadding(
int size);
136 return points.size();
141 if (lowest.has_value()) {
142 return lowest->elevation.AsMeter();
149 if (highest.has_value()) {
150 return highest->elevation.AsMeter();
157 return ascent.AsMeter();
162 return descent.AsMeter();
170 std::shared_ptr<OverlayWay> way;
176 std::optional<ElevationPoint> lowest;
177 std::optional<ElevationPoint> highest;
178 osmscout::Distance ascent;
179 osmscout::Distance descent;
181 QColor lineColor=Qt::darkBlue;
182 QColor textColor=Qt::darkBlue;
183 QColor gradientTopColor=QColor(lineColor.red(), lineColor.green(), lineColor.blue(), 0xA0);
184 QColor gradientBottomColor=Qt::transparent;
186 int textPixelSize=14;
189 Locale locale=Locale::ByEnvironment();
194 #endif // OSMSCOUT_CLIENT_QT_ELEVATIONCHARTWIDGET_H #define OSMSCOUT_CLIENT_QT_API
Definition: ClientQtImportExport.h:45
std::vector< osmscout::ElevationPoint > ElevationPoints
Definition: ElevationModule.h:41
std::shared_ptr< Breaker > BreakerRef
Definition: Breaker.h:65
Definition: OverlayObject.h:189
Definition: ElevationModule.h:37