1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 23:03:22 +02:00
GPXSee/src/atlas.h

57 lines
1.1 KiB
C
Raw Normal View History

2017-03-26 15:32:55 +02:00
#ifndef ATLAS_H
#define ATLAS_H
#include <QFileInfoList>
#include "map.h"
#include "offlinemap.h"
class Atlas : public Map
{
Q_OBJECT
public:
Atlas(const QString &fileName, QObject *parent = 0);
2017-04-01 06:10:36 +02:00
~Atlas();
2017-03-26 15:32:55 +02:00
const QString &name() const {return _name;}
QRectF bounds() const;
qreal resolution(const QPointF &p) const;
qreal zoom() const;
qreal zoomFit(const QSize &size, const QRectF &br);
2017-06-26 00:20:42 +02:00
qreal zoomFit(qreal resolution, const Coordinates &c);
2017-03-26 15:32:55 +02:00
qreal zoomIn();
qreal zoomOut();
2017-04-30 00:19:53 +02:00
QPointF ll2xy(const Coordinates &c);
Coordinates xy2ll(const QPointF &p);
2017-03-26 15:32:55 +02:00
void draw(QPainter *painter, const QRectF &rect);
void unload();
bool isValid() const {return _valid;}
const QString &errorString() const {return _errorString;}
2017-03-26 15:32:55 +02:00
private:
2017-04-01 05:59:55 +02:00
void draw(QPainter *painter, const QRectF &rect, int mapIndex);
bool isAtlas(Tar &tar, const QString &path);
2017-03-26 15:32:55 +02:00
void computeZooms();
void computeBounds();
QString _name;
bool _valid;
QString _errorString;
2017-03-26 15:32:55 +02:00
QList<OfflineMap*> _maps;
QVector<QPair<int, int> > _zooms;
QVector<QPair<QRectF, QRectF> > _bounds;
int _zoom;
2017-04-30 00:19:53 +02:00
int _ci, _cz;
2017-03-26 15:32:55 +02:00
};
#endif // ATLAS_H