1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00
GPXSee/src/poi.h
2016-03-19 17:24:53 +01:00

47 lines
906 B
C++

#ifndef POI_H
#define POI_H
#include <QVector>
#include <QPointF>
#include <QString>
#include <QStringList>
#include "waypoint.h"
#include "rtree.h"
class POI
{
public:
POI() : _errorLine(0) {}
bool loadFile(const QString &fileName);
const QString &errorString() const {return _error;}
int errorLine() const {return _errorLine;}
QVector<Waypoint> points(const QVector<QPointF> &path,
qreal radius = 0.01) const;
const QStringList &files() const {return _files;}
void enableFile(const QString &fileName, bool enable);
void clear();
private:
typedef RTree<size_t, qreal, 2> POITree;
typedef struct {
int start;
int end;
bool enabled;
} FileIndex;
bool loadCSVFile(const QString &fileName);
bool loadGPXFile(const QString &fileName);
POITree _tree;
QVector<Waypoint> _data;
QStringList _files;
QList<FileIndex> _indexes;
QString _error;
int _errorLine;
};
#endif // POI_H