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

57 lines
1.1 KiB
C
Raw Normal View History

2018-01-08 23:47:45 +01:00
#ifndef PCS_H
#define PCS_H
#include <QDebug>
#include <QMap>
#include "common/kv.h"
#include "gcs.h"
#include "linearunits.h"
#include "coordinatesystem.h"
#include "conversion.h"
2018-01-08 23:47:45 +01:00
class PCS
{
public:
2021-06-17 21:58:25 +02:00
PCS() {}
PCS(const GCS &gcs, const Conversion &conversion)
: _gcs(gcs), _conversion(conversion) {}
2021-06-17 21:58:25 +02:00
const GCS &gcs() const {return _gcs;}
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
static void loadList(const QString &path);
static PCS pcs(int id);
static QList<KV<int, QString> > list();
2018-01-08 23:47:45 +01:00
private:
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
static QMap<int, Entry> defaults();
2021-06-17 21:58:25 +02:00
GCS _gcs;
Conversion _conversion;
2018-01-08 23:47:45 +01:00
static QMap<int, Entry> _pcss;
2018-01-08 23:47:45 +01:00
};
#ifndef QT_NO_DEBUG
2018-01-08 23:47:45 +01:00
QDebug operator<<(QDebug dbg, const PCS &pcs);
#endif // QT_NO_DEBUG
2018-01-08 23:47:45 +01:00
#endif // PCS_H