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

59 lines
1.1 KiB
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"
#include "path.h"
2015-10-05 01:43:48 +02:00
class WaypointItem;
2016-10-09 23:46:30 +02:00
class POI : public QObject
2015-10-05 01:43:48 +02:00
{
2016-10-09 23:46:30 +02:00
Q_OBJECT
2015-10-05 01:43:48 +02:00
public:
2016-10-09 23:46:30 +02:00
POI(QObject *parent = 0);
2015-10-05 01:43:48 +02:00
bool loadFile(const QString &fileName);
2016-10-23 11:09:20 +02:00
const QString &errorString() const {return _errorString;}
int errorLine() const {return _errorLine;}
2016-12-06 01:48:26 +01:00
unsigned radius() const {return _radius;}
void setRadius(unsigned radius);
2016-10-09 23:46:30 +02:00
QVector<Waypoint> points(const Path &path) const;
2016-10-09 23:46:30 +02:00
QVector<Waypoint> points(const QList<WaypointItem*> &list) const;
QVector<Waypoint> points(const QList<Waypoint> &list) const;
const QStringList &files() const {return _files;}
void enableFile(const QString &fileName, bool enable);
2015-10-05 01:43:48 +02:00
void clear();
2016-10-09 23:46:30 +02:00
signals:
2016-10-11 00:19:42 +02:00
void pointsChanged();
2016-10-09 23:46:30 +02:00
2015-10-05 01:43:48 +02:00
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
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
2016-12-06 01:48:26 +01:00
unsigned _radius;
2016-10-09 23:46:30 +02:00
2016-10-23 11:09:20 +02:00
QString _errorString;
int _errorLine;
2015-10-05 01:43:48 +02:00
};
#endif // POI_H