#ifndef QCTMAP_H #define QCTMAP_H #include #include #include "map.h" class QDataStream; class QCTMap : public Map { public: QCTMap(const QString &fileName, QObject *parent = 0); 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(); void unload(); void setDevicePixelRatio(qreal /*deviceRatio*/, qreal mapRatio) {_mapRatio = mapRatio;} bool isValid() const {return _valid;} QString errorString() const {return _errorString;} private: bool readHeader(QDataStream &stream); bool readGeoRef(QDataStream &stream); bool readIndex(QDataStream &stream); bool readPalette(QDataStream &stream); QPixmap tile(int x, int y); QFile _file; QString _name; int _rows, _cols; double _lon, _lonX, _lonXX, _lonXXX, _lonY, _lonYY, _lonYYY, _lonXY, _lonXXY, _lonXYY; double _lat, _latX, _latXX, _latXXX, _latY, _latYY, _latYYY, _latXY, _latXXY, _latXYY; double _eas, _easY, _easX, _easYY, _easXY, _easXX, _easYYY, _easYYX, _easXXY, _easXXX; double _nor, _norY, _norX, _norYY, _norXY, _norXX, _norYYY, _norYYX, _norXXY, _norXXX; double _shiftE, _shiftN; QVector _index; QVector _palette; qreal _mapRatio; bool _valid; QString _errorString; }; #endif // QCTMAP_H