1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 23:03:22 +02:00
GPXSee/src/poi.h

38 lines
649 B
C
Raw Normal View History

2015-10-05 01:43:48 +02:00
#ifndef POI_H
#define POI_H
#include <QVector>
#include <QPointF>
#include <QString>
#include "waypoint.h"
2015-10-05 01:43:48 +02:00
#include "rtree.h"
class POI
{
public:
2016-03-02 09:15:03 +01:00
POI() : _errorLine(0) {}
2015-10-05 01:43:48 +02:00
bool loadFile(const QString &fileName);
QString errorString() const {return _error;}
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:
typedef RTree<size_t, qreal, 2> POITree;
2015-10-05 01:43:48 +02: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;
int _errorLine;
2015-10-05 01:43:48 +02:00
};
#endif // POI_H