1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/poi.h

47 lines
906 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 <QStringList>
#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);
2016-03-19 17:24:53 +01:00
const 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;
const QStringList &files() const {return _files;}
void enableFile(const QString &fileName, bool enable);
2015-10-05 01:43:48 +02:00
void clear();
private:
typedef RTree<size_t, qreal, 2> POITree;
typedef struct {
int start;
int end;
bool enabled;
} FileIndex;
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;
QStringList _files;
QList<FileIndex> _indexes;
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