2016-10-23 11:09:20 +02:00
|
|
|
#ifndef DATA_H
|
|
|
|
#define DATA_H
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2016-02-08 17:53:09 +01:00
|
|
|
#include <QList>
|
2016-10-26 20:17:05 +02:00
|
|
|
#include <QHash>
|
2015-10-05 01:43:48 +02:00
|
|
|
#include <QString>
|
2017-07-27 19:47:46 +02:00
|
|
|
#include <QStringList>
|
2016-02-11 20:58:52 +01:00
|
|
|
#include "waypoint.h"
|
|
|
|
#include "track.h"
|
2016-08-09 01:16:19 +02:00
|
|
|
#include "route.h"
|
2016-10-28 14:33:36 +02:00
|
|
|
#include "parser.h"
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2016-10-23 11:09:20 +02:00
|
|
|
|
2019-01-18 00:17:28 +01:00
|
|
|
class Data
|
2015-10-05 01:43:48 +02:00
|
|
|
{
|
|
|
|
public:
|
2019-01-22 23:01:40 +01:00
|
|
|
Data(const QString &fileName, bool poi = false);
|
2016-08-09 23:08:49 +02:00
|
|
|
|
2019-01-18 00:17:28 +01:00
|
|
|
bool isValid() const {return _valid;}
|
2016-10-23 11:09:20 +02:00
|
|
|
const QString &errorString() const {return _errorString;}
|
2015-11-26 19:13:59 +01:00
|
|
|
int errorLine() const {return _errorLine;}
|
2015-10-12 01:12:12 +02:00
|
|
|
|
2019-01-31 01:46:53 +01:00
|
|
|
const QList<Track> &tracks() const {return _tracks;}
|
|
|
|
const QList<Route> &routes() const {return _routes;}
|
2019-01-18 00:17:28 +01:00
|
|
|
const QVector<Waypoint> &waypoints() const {return _waypoints;}
|
2019-01-31 01:46:53 +01:00
|
|
|
const QList<Area> &areas() const {return _polygons;}
|
2017-07-27 19:47:46 +02:00
|
|
|
|
|
|
|
static QString formats();
|
|
|
|
static QStringList filter();
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2019-01-22 23:01:40 +01:00
|
|
|
static void useDEM(bool use);
|
2019-01-17 00:47:44 +01:00
|
|
|
|
2015-10-05 01:43:48 +02:00
|
|
|
private:
|
2019-08-29 20:15:03 +02:00
|
|
|
void processData(QList<TrackData> &trackData, QList<RouteData> &routeData);
|
2016-10-26 20:17:05 +02:00
|
|
|
|
2019-01-18 00:17:28 +01:00
|
|
|
bool _valid;
|
2016-10-23 11:09:20 +02:00
|
|
|
QString _errorString;
|
2015-11-26 19:13:59 +01:00
|
|
|
int _errorLine;
|
2016-02-11 20:58:52 +01:00
|
|
|
|
2019-01-31 01:46:53 +01:00
|
|
|
QList<Track> _tracks;
|
|
|
|
QList<Route> _routes;
|
|
|
|
QList<Area> _polygons;
|
2019-01-18 00:17:28 +01:00
|
|
|
QVector<Waypoint> _waypoints;
|
2016-08-09 23:08:49 +02:00
|
|
|
|
2017-07-27 19:47:46 +02:00
|
|
|
static QHash<QString, Parser*> _parsers;
|
2019-01-22 23:01:40 +01:00
|
|
|
static bool _useDEM;
|
2015-10-05 01:43:48 +02:00
|
|
|
};
|
|
|
|
|
2016-10-23 11:09:20 +02:00
|
|
|
#endif // DATA_H
|