1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-26 19:19:16 +02:00

Added support for ENC maps

This commit is contained in:
2022-11-04 09:03:36 +01:00
parent a2e22cd93b
commit f8d856b7ee
28 changed files with 2204 additions and 47 deletions

View File

@ -3,6 +3,7 @@
#include <QList>
#include <QVector>
#include <QDebug>
#include "common/rectc.h"
class Polygon
@ -55,8 +56,19 @@ private:
return rect;
}
friend QDebug operator<<(QDebug dbg, const Polygon &poly);
QList<QVector<Coordinates> > _paths;
RectC _boundingRect;
};
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const Polygon &poly)
{
dbg.nospace() << "Polygon(" << poly._paths << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
#endif // POLYGON_H

View File

@ -113,6 +113,16 @@ double Util::niceNum(double x, bool round)
return nf * pow(10.0, expv);
}
int Util::log2i(unsigned val)
{
int ret = 0;
while (val >>= 1)
ret++;
return ret;
}
QString Util::file2name(const QString &path)
{
QFileInfo fi(displayName(path));

View File

@ -5,8 +5,12 @@
class QTemporaryDir;
#define ARRAY_SIZE(array) \
(sizeof(array) / sizeof(array[0]))
namespace Util
{
int log2i(unsigned val);
int str2int(const char *str, int len);
double niceNum(double x, bool round);
QString file2name(const QString &path);