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

42 lines
883 B
C
Raw Normal View History

#ifndef TILE_H
#define TILE_H
2018-06-04 23:40:42 +02:00
#include <QVariant>
#include <QPixmap>
#include <QPoint>
2017-11-14 22:15:46 +01:00
#include <QDebug>
#include "rectd.h"
class Tile
{
public:
2019-03-05 21:44:36 +01:00
Tile() : _scaledSize(0) {}
Tile(const QPoint &xy, const QVariant &zoom, int scaledSize = 0,
const RectD &bbox = RectD()) : _xy(xy), _zoom(zoom),
_scaledSize(scaledSize), _bbox(bbox) {}
const QVariant &zoom() const {return _zoom;}
const QPoint &xy() const {return _xy;}
const RectD &bbox() const {return _bbox;}
int scaledSize() const {return _scaledSize;}
QPixmap& pixmap() {return _pixmap;}
private:
QPoint _xy;
QVariant _zoom;
int _scaledSize;
RectD _bbox;
QPixmap _pixmap;
};
#ifndef QT_NO_DEBUG
2017-11-14 22:15:46 +01:00
inline QDebug operator<<(QDebug dbg, const Tile &tile)
{
dbg.nospace() << "Tile(" << tile.zoom() << ", " << tile.xy() << ", "
<< tile.bbox() << ")";
2018-01-21 11:19:46 +01:00
return dbg.space();
2017-11-14 22:15:46 +01:00
}
#endif // QT_NO_DEBUG
2017-11-14 22:15:46 +01:00
#endif // TILE_H