2015-10-05 01:43:48 +02:00
|
|
|
#ifndef POI_H
|
|
|
|
#define POI_H
|
|
|
|
|
|
|
|
#include <QVector>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QString>
|
2016-02-11 20:58:52 +01:00
|
|
|
#include "waypoint.h"
|
2015-10-05 01:43:48 +02:00
|
|
|
#include "rtree.h"
|
|
|
|
|
|
|
|
|
|
|
|
class POI
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool loadFile(const QString &fileName);
|
|
|
|
QString errorString() const {return _error;}
|
2015-11-26 19:13:59 +01:00
|
|
|
int errorLine() const {return _errorLine;}
|
|
|
|
|
2016-02-19 21:42:54 +01:00
|
|
|
QVector<Waypoint> points(const QVector<QPointF> &path,
|
2016-02-19 21:34:55 +01:00
|
|
|
qreal radius = 0.01) const;
|
2015-10-05 01:43:48 +02:00
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
private:
|
2015-11-26 19:13:59 +01:00
|
|
|
typedef RTree<size_t, qreal, 2> POITree;
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2016-02-11 20:58:52 +01:00
|
|
|
bool loadCSVFile(const QString &fileName);
|
|
|
|
bool loadGPXFile(const QString &fileName);
|
|
|
|
|
2015-10-05 01:43:48 +02:00
|
|
|
POITree _tree;
|
2016-02-19 21:42:54 +01:00
|
|
|
QVector<Waypoint> _data;
|
2016-02-19 21:34:55 +01:00
|
|
|
|
2015-10-05 01:43:48 +02:00
|
|
|
QString _error;
|
2015-11-26 19:13:59 +01:00
|
|
|
int _errorLine;
|
2015-10-05 01:43:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // POI_H
|