2018-01-08 23:47:45 +01:00
|
|
|
#ifndef PCS_H
|
|
|
|
#define PCS_H
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QList>
|
2018-01-20 20:13:56 +01:00
|
|
|
#include "gcs.h"
|
2018-01-20 23:51:39 +01:00
|
|
|
#include "linearunits.h"
|
2018-04-05 20:38:23 +02:00
|
|
|
#include "coordinatesystem.h"
|
2018-01-08 23:47:45 +01:00
|
|
|
#include "projection.h"
|
|
|
|
|
|
|
|
class PCS
|
|
|
|
{
|
|
|
|
public:
|
2019-05-14 23:01:24 +02:00
|
|
|
class Info {
|
|
|
|
public:
|
|
|
|
Info(int id, const QString &name) : _id(id), _name(name) {}
|
|
|
|
|
|
|
|
int id() const {return _id;}
|
|
|
|
const QString &name() const {return _name;}
|
|
|
|
|
|
|
|
bool operator<(const Info &other) const {return _id < other._id;}
|
|
|
|
|
|
|
|
private:
|
|
|
|
int _id;
|
|
|
|
QString _name;
|
|
|
|
};
|
|
|
|
|
2018-01-20 20:13:56 +01:00
|
|
|
PCS() : _gcs(0) {}
|
2018-01-20 23:51:39 +01:00
|
|
|
PCS(const GCS *gcs, const Projection::Method &method,
|
2018-04-05 20:38:23 +02:00
|
|
|
const Projection::Setup &setup, const LinearUnits &units,
|
|
|
|
const CoordinateSystem &cs = CoordinateSystem())
|
|
|
|
: _gcs(gcs), _method(method), _setup(setup), _units(units), _cs(cs) {}
|
2018-01-20 20:13:56 +01:00
|
|
|
PCS(const GCS *gcs, int proj);
|
|
|
|
|
|
|
|
const GCS *gcs() const {return _gcs;}
|
2018-01-08 23:47:45 +01:00
|
|
|
const Projection::Method &method() const {return _method;}
|
|
|
|
const Projection::Setup &setup() const {return _setup;}
|
2018-01-20 23:51:39 +01:00
|
|
|
const LinearUnits &units() const {return _units;}
|
2018-04-05 20:38:23 +02:00
|
|
|
const CoordinateSystem &coordinateSystem() const {return _cs;}
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
bool isNull() const
|
2018-05-16 18:52:48 +02:00
|
|
|
{return (!_gcs && _units.isNull() && _method.isNull() && _setup.isNull()
|
|
|
|
&& _cs.isNull());}
|
2018-01-20 23:51:39 +01:00
|
|
|
bool isValid() const
|
2018-05-16 18:52:48 +02:00
|
|
|
{return (_gcs && _gcs->isValid() && _units.isValid()
|
|
|
|
&& _method.isValid() && _cs.isValid());}
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2018-01-20 20:13:56 +01:00
|
|
|
static void loadList(const QString &path);
|
|
|
|
static const PCS *pcs(int id);
|
|
|
|
static const PCS *pcs(const GCS *gcs, int proj);
|
2019-05-14 23:01:24 +02:00
|
|
|
static QList<Info> pcsList();
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
class Entry;
|
|
|
|
|
2019-05-14 23:01:24 +02:00
|
|
|
static QList<Entry> defaults();
|
2018-06-28 22:12:16 +02:00
|
|
|
|
2018-01-20 20:13:56 +01:00
|
|
|
const GCS *_gcs;
|
2018-01-08 23:47:45 +01:00
|
|
|
Projection::Method _method;
|
|
|
|
Projection::Setup _setup;
|
2018-01-20 23:51:39 +01:00
|
|
|
LinearUnits _units;
|
2018-04-05 20:38:23 +02:00
|
|
|
CoordinateSystem _cs;
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
static QList<Entry> _pcss;
|
|
|
|
};
|
|
|
|
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2018-01-08 23:47:45 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const PCS &pcs);
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
#endif // PCS_H
|