diff --git a/gpxsee.pro b/gpxsee.pro index 444ce500..2ad5a6fb 100644 --- a/gpxsee.pro +++ b/gpxsee.pro @@ -80,7 +80,7 @@ HEADERS += src/config.h \ src/opengl.h \ src/timetype.h \ src/emptymap.h \ - src/ozimap.h \ + src/offlinemap.h \ src/mapdir.h \ src/matrix.h \ src/tar.h @@ -139,7 +139,7 @@ SOURCES += src/main.cpp \ src/colorbox.cpp \ src/stylecombobox.cpp \ src/emptymap.cpp \ - src/ozimap.cpp \ + src/offlinemap.cpp \ src/mapdir.cpp \ src/matrix.cpp \ src/tar.cpp diff --git a/src/mapdir.cpp b/src/mapdir.cpp index 8b30cbe1..aeca2be3 100644 --- a/src/mapdir.cpp +++ b/src/mapdir.cpp @@ -2,7 +2,7 @@ #include "mapdir.h" #include -#include "ozimap.h" +#include "offlinemap.h" QList MapDir::load(const QString &path, QObject *parent) { @@ -21,7 +21,7 @@ QList MapDir::load(const QString &path, QObject *parent) QFileInfoList list = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot); for (int i = 0; i < list.size(); i++) { QFileInfo fileInfo = list.at(i); - OziMap *map = new OziMap(fileInfo.absoluteFilePath(), parent); + OfflineMap *map = new OfflineMap(fileInfo.absoluteFilePath(), parent); if (map->isValid()) maps.append(map); else diff --git a/src/ozimap.cpp b/src/offlinemap.cpp similarity index 90% rename from src/ozimap.cpp rename to src/offlinemap.cpp index 446bbc1c..7661bdbd 100644 --- a/src/ozimap.cpp +++ b/src/offlinemap.cpp @@ -10,10 +10,10 @@ #include "wgs84.h" #include "coordinates.h" #include "matrix.h" -#include "ozimap.h" +#include "offlinemap.h" -int OziMap::parseMapFile(QIODevice &device, QList &points) +int OfflineMap::parseMapFile(QIODevice &device, QList &points) { bool res; int ln = 1; @@ -78,7 +78,7 @@ int OziMap::parseMapFile(QIODevice &device, QList &points) return 0; } -bool OziMap::computeTransformation(const QList &points) +bool OfflineMap::computeTransformation(const QList &points) { if (points.count() < 2) return false; @@ -125,7 +125,7 @@ bool OziMap::computeTransformation(const QList &points) return true; } -bool OziMap::computeResolution(QList &points) +bool OfflineMap::computeResolution(QList &points) { if (points.count() < 2) return false; @@ -154,7 +154,7 @@ bool OziMap::computeResolution(QList &points) return true; } -bool OziMap::getTileName(const QStringList &tiles) +bool OfflineMap::getTileName(const QStringList &tiles) { if (tiles.isEmpty()) { qWarning("%s: empty tile set", qPrintable(_name)); @@ -175,7 +175,7 @@ bool OziMap::getTileName(const QStringList &tiles) return true; } -bool OziMap::getTileSize() +bool OfflineMap::getTileSize() { QString tileName(_tileName.arg(QString::number(0), QString::number(0))); QImage tile; @@ -197,7 +197,7 @@ bool OziMap::getTileSize() return true; } -OziMap::OziMap(const QString &path, QObject *parent) : Map(parent) +OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent) { int errorLine = -2; QList points; @@ -286,7 +286,7 @@ OziMap::OziMap(const QString &path, QObject *parent) : Map(parent) _valid = true; } -void OziMap::load() +void OfflineMap::load() { if (_tileSize.isValid()) return; @@ -296,18 +296,18 @@ void OziMap::load() qWarning("%s: error loading map image", qPrintable(_name)); } -void OziMap::unload() +void OfflineMap::unload() { if (_img) delete _img; } -QRectF OziMap::bounds() const +QRectF OfflineMap::bounds() const { return QRectF(QPointF(0, 0), _size); } -qreal OziMap::zoomFit(const QSize &size, const QRectF &br) +qreal OfflineMap::zoomFit(const QSize &size, const QRectF &br) { Q_UNUSED(size); Q_UNUSED(br); @@ -315,24 +315,24 @@ qreal OziMap::zoomFit(const QSize &size, const QRectF &br) return 1.0; } -qreal OziMap::resolution(const QPointF &p) const +qreal OfflineMap::resolution(const QPointF &p) const { Q_UNUSED(p); return _resolution; } -qreal OziMap::zoomIn() +qreal OfflineMap::zoomIn() { return 1.0; } -qreal OziMap::zoomOut() +qreal OfflineMap::zoomOut() { return 1.0; } -void OziMap::draw(QPainter *painter, const QRectF &rect) +void OfflineMap::draw(QPainter *painter, const QRectF &rect) { if (_tileSize.isValid()) { QPoint tl = QPoint((int)floor(rect.left() / (qreal)_tileSize.width()) @@ -378,12 +378,12 @@ void OziMap::draw(QPainter *painter, const QRectF &rect) } } -QPointF OziMap::ll2xy(const Coordinates &c) const +QPointF OfflineMap::ll2xy(const Coordinates &c) const { return _transform.map(c.toMercator()); } -Coordinates OziMap::xy2ll(const QPointF &p) const +Coordinates OfflineMap::xy2ll(const QPointF &p) const { return Coordinates::fromMercator(_transform.inverted().map(p)); } diff --git a/src/ozimap.h b/src/offlinemap.h similarity index 87% rename from src/ozimap.h rename to src/offlinemap.h index ef61d62a..d116553d 100644 --- a/src/ozimap.h +++ b/src/offlinemap.h @@ -1,5 +1,5 @@ -#ifndef OZIMAP_H -#define OZIMAP_H +#ifndef OFFLINEMAP_H +#define OFFLINEMAP_H #include #include @@ -10,12 +10,12 @@ class QIODevice; class QDir; -class OziMap : public Map +class OfflineMap : public Map { Q_OBJECT public: - OziMap(const QString &path, QObject *parent = 0); + OfflineMap(const QString &path, QObject *parent = 0); const QString &name() const {return _name;} @@ -47,17 +47,17 @@ private: bool getTileSize(); QString _name; - QString _imgPath; QSize _size; QTransform _transform; qreal _resolution; Tar _tar; QImage *_img; + QString _imgPath; QSize _tileSize; QString _tileName; bool _valid; }; -#endif // OZIMAP_H +#endif // OFFLINEMAP_H