mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #552 CCoordinateGeodetic: added methods to get/set n-vector as doubles, to avoid narrowing.
This commit is contained in:
@@ -92,6 +92,9 @@ namespace BlackMisc
|
||||
//! \copydoc ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override { return this->m_position.normalVector(); }
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::normalVectorDouble
|
||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_position.normalVectorDouble(); }
|
||||
|
||||
//! Elevation
|
||||
//! \sa geodeticHeight
|
||||
const BlackMisc::PhysicalQuantities::CLength getElevation() const { return this->geodeticHeight(); }
|
||||
|
||||
@@ -99,6 +99,9 @@ namespace BlackMisc
|
||||
//! \copydoc ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override { return this->getPosition().normalVector(); }
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::normalVectorDouble
|
||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->getPosition().normalVectorDouble(); }
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
|
||||
@@ -337,6 +337,11 @@ namespace BlackMisc
|
||||
return this->m_position.normalVector();
|
||||
}
|
||||
|
||||
std::array<double, 3> CAtcStation::normalVectorDouble() const
|
||||
{
|
||||
return this->m_position.normalVectorDouble();
|
||||
}
|
||||
|
||||
CVariant CAtcStation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
@@ -233,6 +233,9 @@ namespace BlackMisc
|
||||
//! \copydoc ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override;
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::normalVectorDouble
|
||||
virtual std::array<double, 3> normalVectorDouble() const override;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
|
||||
@@ -186,6 +186,11 @@ namespace BlackMisc
|
||||
};
|
||||
}
|
||||
|
||||
std::array<double, 3> CCoordinateGeodetic::normalVectorDouble() const
|
||||
{
|
||||
return { this->m_x, this->m_y, this->m_z };
|
||||
}
|
||||
|
||||
void CCoordinateGeodetic::setLatitude(const CLatitude &latitude)
|
||||
{
|
||||
this->setLatLong(latitude, this->longitude());
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include <QVector3D>
|
||||
#include <array>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -64,6 +65,9 @@ namespace BlackMisc
|
||||
//! \sa http://www.movable-type.co.uk/scripts/latlong-vectors.html
|
||||
virtual QVector3D normalVector() const = 0;
|
||||
|
||||
//! Normal vector with double precision
|
||||
virtual std::array<double, 3> normalVectorDouble() const = 0;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
@@ -167,6 +171,9 @@ namespace BlackMisc
|
||||
//! \copydoc ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const;
|
||||
|
||||
//! \copydoc ICoordinateGeodetic::normalVectorDouble
|
||||
virtual std::array<double, 3> normalVectorDouble() const;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
@@ -191,6 +198,9 @@ namespace BlackMisc
|
||||
//! Set normal vector
|
||||
void setNormalVector(const QVector3D &normal) { this->m_x = normal.x(); this->m_y = normal.y(); this->m_z = normal.z(); }
|
||||
|
||||
//! Set normal vector
|
||||
void setNormalVector(double x, double y, double z) { this->m_x = x; this->m_y = y; this->m_z = z; }
|
||||
|
||||
//! Coordinate by WGS84 position data
|
||||
static CCoordinateGeodetic fromWgs84(const QString &latitudeWgs84, const QString &longitudeWgs84, const BlackMisc::PhysicalQuantities::CLength &geodeticHeight = {});
|
||||
|
||||
|
||||
@@ -173,6 +173,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::normalVector
|
||||
virtual QVector3D normalVector() const override { return this->m_situation.normalVector(); }
|
||||
|
||||
//! \copydoc BlackMisc::Geo::ICoordinateGeodetic::normalVectorDouble
|
||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_situation.normalVectorDouble(); }
|
||||
|
||||
//! Elevation
|
||||
//! \sa geodeticHeight
|
||||
const BlackMisc::PhysicalQuantities::CLength getElevation() const { return this->geodeticHeight(); }
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace BlackMisc
|
||||
virtual Geo::CLongitude longitude() const override { return m_position.longitude(); }
|
||||
virtual const PhysicalQuantities::CLength &geodeticHeight() const override { return m_position.geodeticHeight(); }
|
||||
virtual QVector3D normalVector() const override { return m_position.normalVector(); }
|
||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_position.normalVectorDouble(); }
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
|
||||
Reference in New Issue
Block a user