1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-18 21:04:24 +02:00

Use a shared CalibrationPoint implementation

This commit is contained in:
2019-03-07 01:08:51 +01:00
parent e2ad2e9d98
commit 060f940b75
6 changed files with 102 additions and 103 deletions

View File

@ -6,7 +6,7 @@
#include "common/rectc.h"
#include "common/wgs84.h"
#include "common/config.h"
#include "transform.h"
#include "calibrationpoint.h"
#include "utm.h"
#include "pcs.h"
#include "rectd.h"
@ -20,30 +20,6 @@
return; \
}
class CalibrationPoint {
public:
CalibrationPoint() {}
CalibrationPoint(PointD xy, PointD pp) : _xy(xy), _pp(pp) {}
CalibrationPoint(PointD xy, Coordinates c) : _xy(xy), _ll(c) {}
bool isValid() const
{
return !(_xy.isNull() || (_pp.isNull() && !_ll.isValid()));
}
ReferencePoint rp(const Projection &projection) const
{
return (_pp.isNull())
? ReferencePoint(_xy, projection.ll2xy(_ll))
: ReferencePoint(_xy, _pp);
}
private:
PointD _xy;
PointD _pp;
Coordinates _ll;
};
static CalibrationPoint parseCalibrationPoint(const QString &str)
{
QStringList fields(str.split(","));