2018-01-20 20:13:56 +01:00
|
|
|
#ifndef PRIMEMERIDIAN_H
|
|
|
|
#define PRIMEMERIDIAN_H
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
class PrimeMeridian
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrimeMeridian() : _pm(NAN) {}
|
|
|
|
PrimeMeridian(int code);
|
2021-06-17 21:58:25 +02:00
|
|
|
PrimeMeridian(double lon) : _pm(lon) {}
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
bool isNull() const {return std::isnan(_pm);}
|
|
|
|
bool isValid() const {return !std::isnan(_pm);}
|
|
|
|
|
|
|
|
double toGreenwich(double val) const;
|
|
|
|
double fromGreenwich(double val) const;
|
|
|
|
|
|
|
|
friend bool operator==(const PrimeMeridian &pm1, const PrimeMeridian &pm2);
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2018-01-20 20:13:56 +01:00
|
|
|
friend QDebug operator<<(QDebug dbg, const PrimeMeridian &pm);
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
double _pm;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline bool operator==(const PrimeMeridian &pm1, const PrimeMeridian &pm2)
|
|
|
|
{return (pm1._pm == pm2._pm);}
|
|
|
|
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2018-01-20 20:13:56 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const PrimeMeridian &pm);
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
#endif // PRIMEMERIDIAN_H
|