2018-01-08 23:47:45 +01:00
|
|
|
#ifndef MAPFILE_H
|
|
|
|
#define MAPFILE_H
|
|
|
|
|
|
|
|
#include "transform.h"
|
|
|
|
#include "projection.h"
|
2019-03-07 01:08:51 +01:00
|
|
|
#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();}
|
2018-01-25 00:19:11 +01:00
|
|
|
const QString &errorString() const {return _errorString;}
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2018-01-25 00:19:11 +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);
|
2021-06-17 21:58:25 +02:00
|
|
|
bool createProjection(const QString &datum, const QString &projection,
|
2019-03-07 01:08:51 +01:00
|
|
|
const Projection::Setup &setup);
|
|
|
|
bool computeTransformation(const QList<CalibrationPoint> &points);
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
QString _name;
|
|
|
|
QString _image;
|
|
|
|
QSize _size;
|
|
|
|
|
2018-01-25 00:19:11 +01:00
|
|
|
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
|