mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-07 16:02:51 +02:00
Code cleanup
This commit is contained in:
12
src/poi.cpp
12
src/poi.cpp
@ -6,8 +6,6 @@
|
||||
#include "poi.h"
|
||||
|
||||
|
||||
#define BOUNDING_RECT_SIZE 0.01
|
||||
|
||||
bool POI::loadFile(const QString &fileName)
|
||||
{
|
||||
QString error;
|
||||
@ -122,17 +120,17 @@ static bool cb(size_t data, void* context)
|
||||
return true;
|
||||
}
|
||||
|
||||
QVector<WayPoint> POI::points(const QVector<QPointF> &path) const
|
||||
QVector<WayPoint> POI::points(const QVector<QPointF> &path, qreal radius) const
|
||||
{
|
||||
QVector<WayPoint> ret;
|
||||
QSet<int> set;
|
||||
qreal min[2], max[2];
|
||||
|
||||
for (int i = 0; i < path.count(); i++) {
|
||||
min[0] = path.at(i).x() - BOUNDING_RECT_SIZE;
|
||||
min[1] = path.at(i).y() - BOUNDING_RECT_SIZE;
|
||||
max[0] = path.at(i).x() + BOUNDING_RECT_SIZE;
|
||||
max[1] = path.at(i).y() + BOUNDING_RECT_SIZE;
|
||||
min[0] = path.at(i).x() - radius;
|
||||
min[1] = path.at(i).y() - radius;
|
||||
max[0] = path.at(i).x() + radius;
|
||||
max[1] = path.at(i).y() + radius;
|
||||
_tree.Search(min, max, cb, &set);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user