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

44 lines
711 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 "rtree.h"
class Entry
{
public:
QPointF coordinates;
QString description;
bool operator==(const Entry &other) const
{return this->description == other.description
&& this->coordinates == other.coordinates;}
};
inline uint qHash(const Entry &key)
{
return ::qHash(key.description);
}
class POI
{
public:
bool loadFile(const QString &fileName);
QString errorString() const {return _error;}
QVector<Entry> points(const QVector<QPointF> &path) const;
void clear();
private:
typedef RTree<const Entry*, qreal, 2> POITree;
POITree _tree;
QVector<Entry> _data;
QString _error;
};
#endif // POI_H