1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-19 12:12:08 +01:00
GPXSee/src/common/demloader.h

44 lines
816 B
C
Raw Normal View History

#ifndef DEMLOADER_H
#define DEMLOADER_H
#include <QObject>
2021-09-01 13:08:34 +02:00
#include <QDir>
2024-02-29 07:59:34 +01:00
#include "downloader.h"
#include "dem.h"
class RectC;
#define DEM_DOWNLOAD_WARNING 4
#define DEM_DOWNLOAD_LIMIT 1024
class DEMLoader : public QObject
{
Q_OBJECT
public:
DEMLoader(const QString &dir, QObject *parent = 0);
void setUrl(const QString &url) {_url = url;}
void setAuthorization(const Authorization &authorization);
int numTiles(const RectC &rect) const;
bool loadTiles(const RectC &rect);
bool checkTiles(const RectC &rect) const;
2021-09-01 13:27:30 +02:00
const QString &url() const {return _url;}
signals:
void finished();
private:
QUrl tileUrl(const DEM::Tile &tile) const;
QString tileFile(const DEM::Tile &tile) const;
Downloader *_downloader;
QString _url;
2021-09-01 13:08:34 +02:00
QDir _dir;
QList<HTTPHeader> _headers;
};
#endif // DEMLOADER_H