1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-12-03 16:09:08 +01:00
GPXSee/src/map/mapfile.h

48 lines
1.2 KiB
C
Raw Normal View History

2018-01-08 23:47:45 +01:00
#ifndef MAPFILE_H
#define MAPFILE_H
#include "transform.h"
#include "projection.h"
#include "calibrationpoint.h"
2018-01-08 23:47:45 +01:00
2018-03-10 09:25:52 +01:00
class QIODevice;
2018-03-21 19:23:17 +01:00
class GCS;
2018-03-10 09:25:52 +01:00
2018-01-08 23:47:45 +01:00
class MapFile
{
public:
2018-03-21 19:09:37 +01:00
MapFile(QIODevice &file);
2018-03-22 20:00:30 +01:00
bool isValid() const
{return !_image.isNull() && _projection.isValid() && _transform.isValid();}
const QString &errorString() const {return _errorString;}
2018-01-08 23:47:45 +01:00
const Projection &projection() const {return _projection;}
2018-03-22 20:00:30 +01:00
const Transform &transform() const {return _transform;}
2018-01-08 23:47:45 +01:00
const QString &name() const {return _name;}
const QString &image() const {return _image;}
const QSize &size() const {return _size;}
private:
int parse(QIODevice &device, QList<CalibrationPoint> &points,
QString &projection, Projection::Setup &setup, QString &datum);
bool parseMapFile(QIODevice &device, QList<CalibrationPoint> &points,
QString &projection, Projection::Setup &setup, QString &datum);
const GCS *createGCS(const QString &datum);
bool createProjection(const GCS *gcs, const QString &projection,
const Projection::Setup &setup);
bool computeTransformation(const QList<CalibrationPoint> &points);
2018-01-08 23:47:45 +01:00
QString _name;
QString _image;
QSize _size;
Projection _projection;
2018-03-22 20:00:30 +01:00
Transform _transform;
2018-01-08 23:47:45 +01:00
QString _errorString;
};
#endif // MAPFILE_H