1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 13:41:16 +01:00
GPXSee/src/map/pcs.h

59 lines
1.5 KiB
C
Raw Normal View History

2018-01-08 23:47:45 +01:00
#ifndef PCS_H
#define PCS_H
#include <QDebug>
#include <QList>
#include "common/kv.h"
#include "gcs.h"
#include "linearunits.h"
#include "coordinatesystem.h"
2018-01-08 23:47:45 +01:00
#include "projection.h"
class PCS
{
public:
PCS() : _gcs(0) {}
PCS(const GCS *gcs, const Projection::Method &method,
const Projection::Setup &setup, const LinearUnits &units,
const CoordinateSystem &cs = CoordinateSystem())
: _gcs(gcs), _method(method), _setup(setup), _units(units), _cs(cs) {}
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;}
const LinearUnits &units() const {return _units;}
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());}
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
static void loadList(const QString &path);
static const PCS *pcs(int id);
static const PCS *pcs(const GCS *gcs, int proj);
static QList<KV<int, QString> > list();
2018-01-08 23:47:45 +01:00
private:
class Entry;
static QList<Entry> defaults();
const GCS *_gcs;
2018-01-08 23:47:45 +01:00
Projection::Method _method;
Projection::Setup _setup;
LinearUnits _units;
CoordinateSystem _cs;
2018-01-08 23:47:45 +01:00
static QList<Entry> _pcss;
};
#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