Adds initial intermediate qt6 porting state
This commit is contained in:
11247 files changed
+1891537
No files matched your search
Executable
+57
@@ -0,0 +1,57 @@
|
||||
|
||||
|
||||
|
||||
#include "participantposition.h"
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
|
||||
namespace HighLevelArchitecture
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
rpr2::WorldLocationStruct ParticipantPosition::toWorldLocation() const
|
||||
{
|
||||
rpr2::WorldLocationStruct wl;
|
||||
|
||||
LtsCoordTrans::lonLatAltToGeocentric(lon, lat, -z, wl.X, wl.Y, wl.Z);
|
||||
|
||||
return wl;
|
||||
}
|
||||
|
||||
QString ParticipantPosition::toString(bool mgrs) const
|
||||
{
|
||||
if (!mgrs)
|
||||
return QStringLiteral("lon: %1, lat: %2, z: %3").arg(lon).arg(lat).arg(z);
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate c1(LtsCoordTrans::UtmCoordinate::fromGeographic(lon, lat));
|
||||
return QStringLiteral("MGRS: %1, Z: %2").arg(c1.mgrs()).arg(z);
|
||||
}
|
||||
|
||||
bool ParticipantPosition::hasMoved(const ParticipantPosition &other) const
|
||||
{
|
||||
const LtsCoordTrans::UtmCoordinate c1(LtsCoordTrans::UtmCoordinate::fromGeographic(lon, lat));
|
||||
const LtsCoordTrans::UtmCoordinate c2(LtsCoordTrans::UtmCoordinate::fromGeographic(other.lon, other.lat));
|
||||
|
||||
if (c1.zone != c2.zone)
|
||||
return true;
|
||||
if (std::abs(c1.x - c2.x) > 1)
|
||||
return true;
|
||||
if (std::abs(c1.y - c2.y) > 1)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ParticipantPosition::isNull() const
|
||||
{
|
||||
return (qFuzzyIsNull(lon) && qFuzzyIsNull(lat));
|
||||
}
|
||||
|
||||
ParticipantPosition::ParticipantPosition(const rpr2::WorldLocationStruct &wl)
|
||||
{
|
||||
LtsCoordTrans::geocentric2LonLatAlt(wl.X, wl.Y, wl.Z, lon, lat, z);
|
||||
z *= -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user