mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-25 04:05:53 +01:00
Martin Tůma
97e12d809f
Including several map providers refactoring/rewrite especial KML, JNX and TrekBuddy atlases.
68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
#ifndef BSBMAP_H
|
|
#define BSBMAP_H
|
|
|
|
#include <QColor>
|
|
#include "transform.h"
|
|
#include "projection.h"
|
|
#include "map.h"
|
|
|
|
class QFile;
|
|
class Image;
|
|
|
|
class BSBMap : public Map
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
BSBMap(const QString &fileName, QObject *parent = 0);
|
|
~BSBMap();
|
|
|
|
QString name() const {return _name;}
|
|
|
|
QRectF bounds();
|
|
QPointF ll2xy(const Coordinates &c);
|
|
Coordinates xy2ll(const QPointF &p);
|
|
|
|
void draw(QPainter *painter, const QRectF &rect, Flags flags);
|
|
|
|
void load(const Projection &in, const Projection &out, qreal deviceRatio,
|
|
bool hidpi);
|
|
void unload();
|
|
|
|
bool isValid() const {return _valid;}
|
|
QString errorString() const {return _errorString;}
|
|
|
|
static Map *create(const QString &path, bool *isMap);
|
|
|
|
private:
|
|
bool parseBSB(const QByteArray &line);
|
|
bool parseKNP(const QByteArray &line, QString &datum, QString &proj,
|
|
double &pp);
|
|
bool parseKNQ(const QByteArray &line, double params[9]);
|
|
bool parseREF(const QByteArray &line, const QString &datum,
|
|
const QString &proj, double params[9], QList<ReferencePoint> &points);
|
|
bool parseRGB(const QByteArray &line);
|
|
bool readHeader(QFile &file);
|
|
bool createProjection(const QString &datum, const QString &proj,
|
|
double params[9], const Coordinates &c);
|
|
bool createTransform(QList<ReferencePoint> &points);
|
|
QImage readImage();
|
|
bool readRow(QFile &file, char bits, uchar *buf);
|
|
|
|
QString _name;
|
|
Projection _projection;
|
|
Transform _transform;
|
|
qreal _skew;
|
|
Image *_img;
|
|
QSize _size;
|
|
QSize _skewSize;
|
|
qreal _mapRatio;
|
|
qint64 _dataOffset;
|
|
QVector<QRgb> _palette;
|
|
|
|
bool _valid;
|
|
QString _errorString;
|
|
};
|
|
|
|
#endif // BSBMAP_H
|