2015-10-12 01:12:12 +02:00
|
|
|
#ifndef ELEVATIONGRAPH_H
|
|
|
|
#define ELEVATIONGRAPH_H
|
|
|
|
|
2016-06-24 00:55:44 +02:00
|
|
|
#include "graphtab.h"
|
2015-10-12 01:12:12 +02:00
|
|
|
|
2019-08-25 10:54:25 +02:00
|
|
|
class ElevationGraphItem;
|
|
|
|
|
2016-06-24 00:55:44 +02:00
|
|
|
class ElevationGraph : public GraphTab
|
2015-10-12 01:12:12 +02:00
|
|
|
{
|
2015-10-13 00:27:49 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2015-10-12 01:12:12 +02:00
|
|
|
public:
|
2015-10-17 01:33:02 +02:00
|
|
|
ElevationGraph(QWidget *parent = 0);
|
2019-08-25 10:54:25 +02:00
|
|
|
~ElevationGraph();
|
2015-10-12 01:12:12 +02:00
|
|
|
|
2016-06-24 00:55:44 +02:00
|
|
|
QString label() const {return tr("Elevation");}
|
2018-05-04 19:36:37 +02:00
|
|
|
QList<GraphItem*> loadData(const Data &data);
|
2015-10-12 01:12:12 +02:00
|
|
|
void clear();
|
2015-12-19 20:23:07 +01:00
|
|
|
void setUnits(enum Units units);
|
2016-08-16 00:27:54 +02:00
|
|
|
void showTracks(bool show);
|
|
|
|
void showRoutes(bool show);
|
2015-10-12 01:12:12 +02:00
|
|
|
|
2016-06-24 00:55:44 +02:00
|
|
|
private:
|
2020-03-25 23:08:26 +01:00
|
|
|
enum PathType {TrackPath, RoutePath};
|
2016-08-16 00:27:54 +02:00
|
|
|
|
|
|
|
qreal max() const;
|
|
|
|
qreal min() const;
|
|
|
|
qreal ascent() const;
|
|
|
|
qreal descent() const;
|
2015-10-19 00:35:08 +02:00
|
|
|
|
2017-10-04 23:15:39 +02:00
|
|
|
void setYUnits(Units units);
|
2016-08-09 01:16:19 +02:00
|
|
|
void setInfo();
|
|
|
|
|
2020-03-25 23:08:26 +01:00
|
|
|
GraphItem *loadGraph(const Graph &graph, PathType type, const QColor &color,
|
|
|
|
bool primary);
|
2019-08-25 10:54:25 +02:00
|
|
|
void showItems(const QList<ElevationGraphItem *> &list, bool show);
|
2016-08-16 00:27:54 +02:00
|
|
|
|
|
|
|
qreal _trackAscent, _trackDescent;
|
|
|
|
qreal _routeAscent, _routeDescent;
|
|
|
|
qreal _trackMax, _routeMax;
|
|
|
|
qreal _trackMin, _routeMin;
|
2015-12-19 20:23:07 +01:00
|
|
|
|
2016-08-16 00:27:54 +02:00
|
|
|
bool _showTracks, _showRoutes;
|
2019-08-25 10:54:25 +02:00
|
|
|
QList<ElevationGraphItem *> _tracks, _routes;
|
2015-10-12 01:12:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ELEVATIONGRAPH_H
|