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

37 lines
836 B
C
Raw Normal View History

#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) {}
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);
#ifndef QT_NO_DEBUG
friend QDebug operator<<(QDebug dbg, const PrimeMeridian &pm);
#endif // QT_NO_DEBUG
private:
double _pm;
};
inline bool operator==(const PrimeMeridian &pm1, const PrimeMeridian &pm2)
{return (pm1._pm == pm2._pm);}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PrimeMeridian &pm);
#endif // QT_NO_DEBUG
#endif // PRIMEMERIDIAN_H