Code cleanup
[GPXSee.git] / src / map / angularunits.h
blobc484e09bafdfe384b1981683b64c2bb2e78cea9f
1 #ifndef ANGULARUNITS_H
2 #define ANGULARUNITS_H
4 #include <cmath>
5 #include <QDebug>
7 class AngularUnits
9 public:
10 AngularUnits() : _code(0), _f(NAN) {}
11 AngularUnits(int code);
13 bool isNull() const {return std::isnan(_f);}
14 bool isValid() const {return !std::isnan(_f);}
16 double toDegrees(double val) const;
17 double fromDegrees(double val) const;
19 friend bool operator==(const AngularUnits &au1, const AngularUnits &au2);
20 #ifndef QT_NO_DEBUG
21 friend QDebug operator<<(QDebug dbg, const AngularUnits &au);
22 #endif // QT_NO_DEBUG
23 private:
24 int _code;
25 double _f;
28 inline bool operator==(const AngularUnits &au1, const AngularUnits &au2)
29 {return (au1._f == au2._f);}
31 #ifndef QT_NO_DEBUG
32 QDebug operator<<(QDebug dbg, const AngularUnits &au);
33 #endif // QT_NO_DEBUG
35 #endif // ANGULARUNITS_H