Optimization
[GPXSee.git] / src / map / calibrationpoint.h
blob53654c4edbf945658e50440c2cdd9e9b61abae37
1 #ifndef CALIBRATIONPOINT_H
2 #define CALIBRATIONPOINT_H
4 #include <QDebug>
5 #include "transform.h"
6 #include "projection.h"
8 class CalibrationPoint {
9 public:
10 CalibrationPoint() {}
11 CalibrationPoint(PointD xy, PointD pp) : _xy(xy), _pp(pp) {}
12 CalibrationPoint(PointD xy, Coordinates c) : _xy(xy), _ll(c) {}
14 bool isValid() const
16 return !(_xy.isNull() || (_pp.isNull() && !_ll.isValid()));
19 ReferencePoint rp(const Projection &projection) const
21 return (_pp.isNull())
22 ? ReferencePoint(_xy, projection.ll2xy(_ll))
23 : ReferencePoint(_xy, _pp);
26 friend QDebug operator<<(QDebug dbg, const CalibrationPoint &p);
28 private:
29 PointD _xy;
30 PointD _pp;
31 Coordinates _ll;
34 #ifndef QT_NO_DEBUG
35 inline QDebug operator<<(QDebug dbg, const CalibrationPoint &p)
37 dbg.nospace() << "CalibrationPoint(" << p._xy << ", " << p._pp << ", "
38 << p._ll << ")";
39 return dbg.space();
41 #endif // QT_NO_DEBUG
43 #endif // CALIBRATIONPOINT_H