1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-25 04:05:53 +01:00
GPXSee/src/map/pcs.h
Martin Tůma 37c971a720 Added support for vector maps projection setting
Removed obsolete "Always show the map" setting
2019-05-14 23:01:24 +02:00

72 lines
1.7 KiB
C++

#ifndef PCS_H
#define PCS_H
#include <QDebug>
#include <QList>
#include "gcs.h"
#include "linearunits.h"
#include "coordinatesystem.h"
#include "projection.h"
class PCS
{
public:
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;
};
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;}
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;}
bool isNull() const
{return (!_gcs && _units.isNull() && _method.isNull() && _setup.isNull()
&& _cs.isNull());}
bool isValid() const
{return (_gcs && _gcs->isValid() && _units.isValid()
&& _method.isValid() && _cs.isValid());}
static void loadList(const QString &path);
static const PCS *pcs(int id);
static const PCS *pcs(const GCS *gcs, int proj);
static QList<Info> pcsList();
private:
class Entry;
static QList<Entry> defaults();
const GCS *_gcs;
Projection::Method _method;
Projection::Setup _setup;
LinearUnits _units;
CoordinateSystem _cs;
static QList<Entry> _pcss;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PCS &pcs);
#endif // QT_NO_DEBUG
#endif // PCS_H