mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-22 02:20:47 +01:00
Compare commits
No commits in common. "267094dc6c7e369c377dc201d923923b9162d3a6" and "f026387d7606921c0173b5b15bc2d3acdf960b00" have entirely different histories.
267094dc6c
...
f026387d76
@ -56,7 +56,6 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
|
||||
"QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */
|
||||
Downloader::setNetworkManager(new QNetworkAccessManager(this));
|
||||
DEM::setDir(ProgramPaths::demDir());
|
||||
DEM::setCacheSize(536870912/*512MB*/);
|
||||
QSurfaceFormat fmt;
|
||||
fmt.setStencilBufferSize(8);
|
||||
fmt.setSamples(4);
|
||||
|
@ -21,9 +21,9 @@
|
||||
#include "common/rectc.h"
|
||||
#include "dem.h"
|
||||
|
||||
#define SRTM3_SAMPLES 1201
|
||||
#define SRTM1_SAMPLES 3601
|
||||
#define SRTM05_SAMPLES 7201
|
||||
|
||||
#define SRTM3_SAMPLES 1201
|
||||
#define SRTM1_SAMPLES 3601
|
||||
|
||||
#define SRTM_SIZE(samples) \
|
||||
((samples) * (samples) * 2)
|
||||
@ -51,8 +51,6 @@ static qreal height(const Coordinates &c, const QByteArray *data)
|
||||
samples = SRTM3_SAMPLES;
|
||||
else if (data->size() == SRTM_SIZE(SRTM1_SAMPLES))
|
||||
samples = SRTM1_SAMPLES;
|
||||
else if (data->size() == SRTM_SIZE(SRTM05_SAMPLES))
|
||||
samples = SRTM05_SAMPLES;
|
||||
else
|
||||
return NAN;
|
||||
|
||||
@ -87,18 +85,13 @@ QString DEM::Tile::baseName() const
|
||||
}
|
||||
|
||||
QString DEM::_dir;
|
||||
DEM::TileCache DEM::_data;
|
||||
QCache<DEM::Tile, QByteArray> DEM::_data;
|
||||
|
||||
QString DEM::fileName(const QString &baseName)
|
||||
{
|
||||
return QDir(_dir).absoluteFilePath(baseName);
|
||||
}
|
||||
|
||||
void DEM::setCacheSize(int size)
|
||||
{
|
||||
_data.setMaxCost(size);
|
||||
}
|
||||
|
||||
void DEM::setDir(const QString &path)
|
||||
{
|
||||
_dir = path;
|
||||
@ -126,7 +119,7 @@ qreal DEM::elevation(const Coordinates &c)
|
||||
QZipReader zip(zn, QIODevice::ReadOnly);
|
||||
ba = new QByteArray(zip.fileData(bn));
|
||||
qreal ele = height(c, ba);
|
||||
_data.insert(tile, ba, ba->size());
|
||||
_data.insert(tile, ba);
|
||||
return ele;
|
||||
} else {
|
||||
QFile file(fn);
|
||||
@ -138,7 +131,7 @@ qreal DEM::elevation(const Coordinates &c)
|
||||
} else {
|
||||
ba = new QByteArray(file.readAll());
|
||||
qreal ele = height(c, ba);
|
||||
_data.insert(tile, ba, ba->size());
|
||||
_data.insert(tile, ba);
|
||||
return ele;
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ public:
|
||||
int _lon, _lat;
|
||||
};
|
||||
|
||||
static void setCacheSize(int size);
|
||||
static void setDir(const QString &path);
|
||||
static void clearCache();
|
||||
static qreal elevation(const Coordinates &c);
|
||||
@ -42,12 +41,10 @@ public:
|
||||
static QList<Area> tiles();
|
||||
|
||||
private:
|
||||
typedef QCache<DEM::Tile, QByteArray> TileCache;
|
||||
|
||||
static QString fileName(const QString &baseName);
|
||||
|
||||
static QString _dir;
|
||||
static TileCache _data;
|
||||
static QCache<Tile, QByteArray> _data;
|
||||
};
|
||||
|
||||
inline HASH_T qHash(const DEM::Tile &tile)
|
||||
|
@ -279,8 +279,9 @@ void Style::defaultPolygonStyle()
|
||||
// Draw order
|
||||
_drawOrder
|
||||
<< TYPE(0x4b) << 0x10d01 << 0x10104 << TYPE(0x4a)
|
||||
<< 0x10101 << 0x10102 << 0x10301 << 0x10302 << 0x10303 << 0x10304
|
||||
<< 0x10305 << 0x10306
|
||||
<< 0x10101 << 0x10102 << 0x10301 << 0x10302 << 0x10303
|
||||
<< 0x10304 << 0x10305 << 0x10306 << 0x10613 << 0x10105
|
||||
<< 0x10409 << 0x10503 << 0x10601 << 0x1060a
|
||||
<< TYPE(0x01) << 0x10800 << TYPE(0x02) << 0x10801 << TYPE(0x03) << 0x10802
|
||||
<< TYPE(0x17) << 0x10a04 << TYPE(0x18) << 0x1090c << TYPE(0x1a) << 0x1090e
|
||||
<< TYPE(0x28) << 0x10b01 << TYPE(0x32) << 0x10b02 << TYPE(0x3c) << 0x10b03
|
||||
@ -297,8 +298,7 @@ void Style::defaultPolygonStyle()
|
||||
<< TYPE(0x0a) << 0x10907 << TYPE(0x0b) << 0x10908 << TYPE(0x0c) << 0x10909
|
||||
<< TYPE(0x0d) << 0x1090a << TYPE(0x0e) << 0x1090b << TYPE(0x0f)
|
||||
<< TYPE(0x10) << TYPE(0x11) << TYPE(0x12) << TYPE(0x19) << 0x1090d
|
||||
<< TYPE(0x13) << 0x10900 << 0x10613 << 0x10105 << 0x10409 << 0x10503
|
||||
<< 0x10601 << 0x1060a;
|
||||
<< TYPE(0x13) << 0x10900;
|
||||
}
|
||||
|
||||
void Style::defaultLineStyle()
|
||||
|
Loading…
x
Reference in New Issue
Block a user