mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-24 15:34:24 +02:00
Compare commits
16 Commits
13.1
...
bb22ad95b7
Author | SHA1 | Date | |
---|---|---|---|
bb22ad95b7 | |||
682fcc09cc | |||
60e83b24f9 | |||
c30501185c | |||
9b3c11cc68 | |||
61f77ef19e | |||
c0834491d3 | |||
e6fdd0f53d | |||
fe444e88a3 | |||
d9c0770b51 | |||
3a0e9bb733 | |||
ca6c7247c0 | |||
0b25cb9f81 | |||
b19c3a83f3 | |||
728361ad7b | |||
f5e3e5bd21 |
@ -1,4 +1,4 @@
|
||||
version: 13.1.{build}
|
||||
version: 13.2.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 13.1
|
||||
VERSION = 13.2
|
||||
|
||||
QT += core \
|
||||
gui \
|
||||
|
@ -866,7 +866,7 @@
|
||||
<location filename="../src/GUI/gui.cpp" line="907"/>
|
||||
<location filename="../src/GUI/gui.cpp" line="925"/>
|
||||
<source>CRS directory:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Directori CRS:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="909"/>
|
||||
@ -1020,6 +1020,7 @@
|
||||
<translation>
|
||||
<numerusform>%n fitxer</numerusform>
|
||||
<numerusform>%n fitxers</numerusform>
|
||||
<numerusform>%n fitxers</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -712,7 +712,7 @@
|
||||
<location filename="../src/GUI/gui.cpp" line="907"/>
|
||||
<location filename="../src/GUI/gui.cpp" line="925"/>
|
||||
<source>CRS directory:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>CRS-mappe:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="913"/>
|
||||
@ -1718,12 +1718,12 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="70"/>
|
||||
<source>Select the proper coordinate reference system (CRS) of maps without a CRS definition (JNX, KMZ and World file maps).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Velg riktig koordinatreferansesystem (CRS) for kart uten en CRS-definisjon (JNX, KMZ og World-file kart).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="73"/>
|
||||
<source>Select the desired projection of vector maps (IMG, Mapsforge and ENC maps). The projection must be valid for the whole map area.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Velg ønsket projeksjon for vektorkart (IMG, Mapsforge og ENC-kart). Projeksjonen må være gyldig for hele kartområdet.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="104"/>
|
||||
|
@ -37,7 +37,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "13.1"
|
||||
!define VERSION "13.2"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#define HASH_T uint
|
||||
|
||||
inline uint qHash(const QPoint &p)
|
||||
{
|
||||
return qHash(QPair<int, int>(p.x(), p.y()));
|
||||
}
|
||||
#else // QT6
|
||||
#define HASH_T size_t
|
||||
#endif // QT6
|
||||
|
||||
inline HASH_T qHash(const QPoint &p)
|
||||
{
|
||||
return ::qHash(p.x()) ^ ::qHash(p.y());
|
||||
}
|
||||
|
||||
#endif // HASH_H
|
||||
|
@ -33,13 +33,16 @@ Path Route::path() const
|
||||
Graph Route::gpsElevation() const
|
||||
{
|
||||
Graph graph;
|
||||
graph.append(GraphSegment(QDateTime()));
|
||||
GraphSegment &gs = graph.last();
|
||||
QDateTime date;
|
||||
GraphSegment gs(date);
|
||||
|
||||
for (int i = 0; i < _data.size(); i++)
|
||||
if (_data.at(i).hasElevation())
|
||||
gs.append(GraphPoint(_distance.at(i), NAN, _data.at(i).elevation()));
|
||||
|
||||
if (gs.size() >= 2)
|
||||
graph.append(gs);
|
||||
|
||||
if (_data.style().color().isValid())
|
||||
graph.setColor(_data.style().color());
|
||||
|
||||
@ -49,8 +52,8 @@ Graph Route::gpsElevation() const
|
||||
Graph Route::demElevation() const
|
||||
{
|
||||
Graph graph;
|
||||
graph.append(GraphSegment(QDateTime()));
|
||||
GraphSegment &gs = graph.last();
|
||||
QDateTime date;
|
||||
GraphSegment gs(date);
|
||||
|
||||
for (int i = 0; i < _data.size(); i++) {
|
||||
qreal dem = DEM::elevation(_data.at(i).coordinates());
|
||||
@ -58,6 +61,9 @@ Graph Route::demElevation() const
|
||||
gs.append(GraphPoint(_distance.at(i), NAN, dem));
|
||||
}
|
||||
|
||||
if (gs.size() >= 2)
|
||||
graph.append(gs);
|
||||
|
||||
if (_data.style().color().isValid())
|
||||
graph.setColor(_data.style().color());
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "common/rectc.h"
|
||||
#include "common/garmin.h"
|
||||
#include "common/hash.h"
|
||||
#include "deltastream.h"
|
||||
#include "huffmanstream.h"
|
||||
#include "style.h"
|
||||
@ -13,12 +14,10 @@ using namespace IMG;
|
||||
|
||||
#define MASK(bits) ((1U << (bits)) - 1U)
|
||||
|
||||
static quint64 pointId(const QPoint &pos, quint32 type)
|
||||
static quint64 pointId(const QPoint &pos, quint32 type, const QString &label)
|
||||
{
|
||||
quint64 id;
|
||||
|
||||
uint hash = (uint)qHash(QPair<int, int>(pos.x(), pos.y()));
|
||||
id = ((quint64)type)<<32 | hash;
|
||||
quint64 hash = qHash(pos) ^ qHash(label);
|
||||
quint64 id = ((quint64)type)<<40 | (hash & 0xFFFFFFFFFF);
|
||||
|
||||
// Increase rendering priorities for some special items
|
||||
if (!Style::isCountry(type) && !Style::isMarina(type))
|
||||
@ -484,11 +483,11 @@ bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv,
|
||||
|
||||
point.type = (quint16)type<<8 | subtype;
|
||||
point.coordinates = Coordinates(toWGS24(pos.x()), toWGS24(pos.y()));
|
||||
point.id = pointId(pos, point.type);
|
||||
if (lbl && (labelPtr & 0x3FFFFF))
|
||||
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF,
|
||||
labelPtr & 0x400000, !(Style::isCountry(point.type)
|
||||
|| Style::isState(point.type)), Style::isSpot(point.type));
|
||||
point.id = pointId(pos, point.type, point.label.text());
|
||||
|
||||
points->append(point);
|
||||
}
|
||||
@ -537,9 +536,9 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv,
|
||||
continue;
|
||||
|
||||
point.coordinates = Coordinates(toWGS24(p.x()), toWGS24(p.y()));
|
||||
point.id = pointId(p, point.type);
|
||||
if (lbl && (labelPtr & 0x3FFFFF))
|
||||
point.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF);
|
||||
point.id = pointId(p, point.type, point.label.text());
|
||||
|
||||
points->append(point);
|
||||
}
|
||||
|
@ -5,34 +5,26 @@
|
||||
|
||||
#define SAMPLES 100
|
||||
|
||||
void Map::growLeft(const QPointF &p, RectC &rect)
|
||||
static void growLeft(const Coordinates &c, RectC &rect)
|
||||
{
|
||||
Coordinates c(xy2ll(p));
|
||||
|
||||
if (c.lon() < rect.left())
|
||||
rect.setLeft(c.lon());
|
||||
}
|
||||
|
||||
void Map::growRight(const QPointF &p, RectC &rect)
|
||||
static void growRight(const Coordinates &c, RectC &rect)
|
||||
{
|
||||
Coordinates c(xy2ll(p));
|
||||
|
||||
if (c.lon() > rect.right())
|
||||
rect.setRight(c.lon());
|
||||
}
|
||||
|
||||
void Map::growTop(const QPointF &p, RectC &rect)
|
||||
static void growTop(const Coordinates &c, RectC &rect)
|
||||
{
|
||||
Coordinates c(xy2ll(p));
|
||||
|
||||
if (c.lat() > rect.top())
|
||||
rect.setTop(c.lat());
|
||||
}
|
||||
|
||||
void Map::growBottom(const QPointF &p, RectC &rect)
|
||||
static void growBottom(const Coordinates &c, RectC &rect)
|
||||
{
|
||||
Coordinates c(xy2ll(p));
|
||||
|
||||
if (c.lat() < rect.bottom())
|
||||
rect.setBottom(c.lat());
|
||||
}
|
||||
@ -53,14 +45,14 @@ RectC Map::llBounds(const Projection &proj)
|
||||
|
||||
for (int i = 0; i <= SAMPLES; i++) {
|
||||
double x = b.left() + i * dx;
|
||||
growBottom(QPointF(x, b.bottom()), rect);
|
||||
growTop(QPointF(x, b.top()), rect);
|
||||
growBottom(xy2ll(QPointF(x, b.bottom())), rect);
|
||||
growTop(xy2ll(QPointF(x, b.top())), rect);
|
||||
}
|
||||
|
||||
for (int i = 0; i <= SAMPLES; i++) {
|
||||
double y = b.top() + i * dy;
|
||||
growLeft(QPointF(b.left(), y), rect);
|
||||
growRight(QPointF(b.right(), y), rect);
|
||||
growLeft(xy2ll(QPointF(b.left(), y)), rect);
|
||||
growRight(xy2ll(QPointF(b.right(), y)), rect);
|
||||
}
|
||||
|
||||
return rect;
|
||||
|
@ -62,11 +62,6 @@ signals:
|
||||
void mapLoaded();
|
||||
|
||||
private:
|
||||
void growLeft(const QPointF &p, RectC &rect);
|
||||
void growRight(const QPointF &p, RectC &rect);
|
||||
void growTop(const QPointF &p, RectC &rect);
|
||||
void growBottom(const QPointF &p, RectC &rect);
|
||||
|
||||
QString _path;
|
||||
};
|
||||
|
||||
|
@ -17,7 +17,7 @@ public:
|
||||
const QVariant &zoom() const {return _zoom;}
|
||||
const QPoint &xy() const {return _xy;}
|
||||
const RectD &bbox() const {return _bbox;}
|
||||
QPixmap& pixmap() {return _pixmap;}
|
||||
QPixmap &pixmap() {return _pixmap;}
|
||||
|
||||
private:
|
||||
QPoint _xy;
|
||||
|
@ -61,6 +61,7 @@ TileLoader::TileLoader(const QString &dir, QObject *parent)
|
||||
connect(_downloader, &Downloader::finished, this, &TileLoader::finished);
|
||||
}
|
||||
|
||||
|
||||
void TileLoader::loadTilesAsync(QVector<FetchTile> &list)
|
||||
{
|
||||
QList<Download> dl;
|
||||
@ -142,6 +143,11 @@ void TileLoader::loadTilesSync(QVector<FetchTile> &list)
|
||||
|
||||
QFuture<void> future = QtConcurrent::map(imgs, &TileImage::load);
|
||||
future.waitForFinished();
|
||||
|
||||
for (int i = 0; i < imgs.size(); i++) {
|
||||
TileImage &ti = imgs[i];
|
||||
QPixmapCache::insert(ti.file(), ti.tile()->pixmap());
|
||||
}
|
||||
}
|
||||
|
||||
void TileLoader::clearCache()
|
||||
|
Reference in New Issue
Block a user