2018-01-08 23:47:45 +01:00
|
|
|
#ifndef PCS_H
|
|
|
|
#define PCS_H
|
|
|
|
|
|
|
|
#include <QDebug>
|
2023-04-13 08:39:33 +02:00
|
|
|
#include <QMap>
|
2019-08-01 08:36:58 +02:00
|
|
|
#include "common/kv.h"
|
2018-01-20 20:13:56 +01:00
|
|
|
#include "gcs.h"
|
2023-04-13 08:39:33 +02:00
|
|
|
#include "conversion.h"
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
class PCS
|
|
|
|
{
|
|
|
|
public:
|
2021-06-17 21:58:25 +02:00
|
|
|
PCS() {}
|
2023-04-13 08:39:33 +02:00
|
|
|
PCS(const GCS &gcs, const Conversion &conversion)
|
|
|
|
: _gcs(gcs), _conversion(conversion) {}
|
2018-01-20 20:13:56 +01:00
|
|
|
|
2021-06-17 21:58:25 +02:00
|
|
|
const GCS &gcs() const {return _gcs;}
|
2023-04-13 08:39:33 +02:00
|
|
|
const Conversion &conversion() const {return _conversion;}
|
|
|
|
|
|
|
|
bool isNull() const {return (_gcs.isNull() && _conversion.isNull());}
|
|
|
|
bool isValid() const {return (_gcs.isValid() && _conversion.isValid());}
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2023-04-15 03:18:52 +02:00
|
|
|
static bool loadList(const QString &path);
|
2021-07-01 08:54:48 +02:00
|
|
|
static PCS pcs(int id);
|
2019-08-01 08:36:58 +02:00
|
|
|
static QList<KV<int, QString> > list();
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
private:
|
2023-04-13 08:39:33 +02:00
|
|
|
class Entry {
|
|
|
|
public:
|
|
|
|
Entry(const QString &name, int gcs, int proj)
|
|
|
|
: _name(name), _gcs(gcs), _proj(proj) {}
|
|
|
|
|
|
|
|
const QString &name() const {return _name;}
|
|
|
|
int proj() const {return _proj;}
|
|
|
|
int gcs() const {return _gcs;}
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString _name;
|
|
|
|
int _gcs, _proj;
|
|
|
|
};
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2023-04-13 08:39:33 +02:00
|
|
|
static QMap<int, Entry> defaults();
|
2018-06-28 22:12:16 +02:00
|
|
|
|
2021-06-17 21:58:25 +02:00
|
|
|
GCS _gcs;
|
2023-04-13 08:39:33 +02:00
|
|
|
Conversion _conversion;
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2023-04-13 08:39:33 +02:00
|
|
|
static QMap<int, Entry> _pcss;
|
2018-01-08 23:47:45 +01:00
|
|
|
};
|
|
|
|
|
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
|