mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 08:55:43 +08:00
Ref T259, Ref T243 set function/ctor for normal vector
This commit is contained in:
@@ -180,6 +180,11 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCoordinateGeodetic::CCoordinateGeodetic(const std::array<double, 3> &normalVector)
|
||||||
|
{
|
||||||
|
this->setNormalVector(normalVector);
|
||||||
|
}
|
||||||
|
|
||||||
CCoordinateGeodetic::CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const CAltitude &geodeticHeight) :
|
CCoordinateGeodetic::CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const CAltitude &geodeticHeight) :
|
||||||
m_x(latitude.cos() * longitude.cos()),
|
m_x(latitude.cos() * longitude.cos()),
|
||||||
m_y(latitude.cos() * longitude.sin()),
|
m_y(latitude.cos() * longitude.sin()),
|
||||||
@@ -194,11 +199,10 @@ namespace BlackMisc
|
|||||||
CCoordinateGeodetic({ latitudeDegrees, PhysicalQuantities::CAngleUnit::deg() }, { longitudeDegrees, PhysicalQuantities::CAngleUnit::deg() }, { heightFeet, PhysicalQuantities::CLengthUnit::ft() }) {}
|
CCoordinateGeodetic({ latitudeDegrees, PhysicalQuantities::CAngleUnit::deg() }, { longitudeDegrees, PhysicalQuantities::CAngleUnit::deg() }, { heightFeet, PhysicalQuantities::CLengthUnit::ft() }) {}
|
||||||
|
|
||||||
CCoordinateGeodetic::CCoordinateGeodetic(const ICoordinateGeodetic &coordinate) :
|
CCoordinateGeodetic::CCoordinateGeodetic(const ICoordinateGeodetic &coordinate) :
|
||||||
m_x(coordinate.normalVectorDouble()[0]),
|
|
||||||
m_y(coordinate.normalVectorDouble()[1]),
|
|
||||||
m_z(coordinate.normalVectorDouble()[2]),
|
|
||||||
m_geodeticHeight(coordinate.geodeticHeight())
|
m_geodeticHeight(coordinate.geodeticHeight())
|
||||||
{ }
|
{
|
||||||
|
this->setNormalVector(coordinate.normalVectorDouble());
|
||||||
|
}
|
||||||
|
|
||||||
CLatitude CCoordinateGeodetic::latitude() const
|
CLatitude CCoordinateGeodetic::latitude() const
|
||||||
{
|
{
|
||||||
@@ -248,6 +252,14 @@ namespace BlackMisc
|
|||||||
this->setGeodeticHeight(CAltitude::null());
|
this->setGeodeticHeight(CAltitude::null());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCoordinateGeodetic::setNormalVector(const std::array<double, 3> &normalVector)
|
||||||
|
{
|
||||||
|
Q_ASSERT_X(normalVector.size() == 3, Q_FUNC_INFO, "Wrong vector size");
|
||||||
|
m_x = normalVector[0];
|
||||||
|
m_y = normalVector[1];
|
||||||
|
m_z = normalVector[2];
|
||||||
|
}
|
||||||
|
|
||||||
CCoordinateGeodetic &CCoordinateGeodetic::switchUnit(const CLengthUnit &unit)
|
CCoordinateGeodetic &CCoordinateGeodetic::switchUnit(const CLengthUnit &unit)
|
||||||
{
|
{
|
||||||
m_geodeticHeight.switchUnit(unit);
|
m_geodeticHeight.switchUnit(unit);
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ namespace BlackMisc
|
|||||||
//! Constructor by normal vector
|
//! Constructor by normal vector
|
||||||
CCoordinateGeodetic(const QVector3D &normal) : m_x(normal.x()), m_y(normal.y()), m_z(normal.z()) {}
|
CCoordinateGeodetic(const QVector3D &normal) : m_x(normal.x()), m_y(normal.y()), m_z(normal.z()) {}
|
||||||
|
|
||||||
|
//! Constructor by normal vector
|
||||||
|
CCoordinateGeodetic(const std::array<double, 3> &normalVector);
|
||||||
|
|
||||||
//! Constructor by values
|
//! Constructor by values
|
||||||
CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const Aviation::CAltitude &geodeticHeight);
|
CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const Aviation::CAltitude &geodeticHeight);
|
||||||
|
|
||||||
@@ -262,6 +265,9 @@ namespace BlackMisc
|
|||||||
//! Set normal vector
|
//! Set normal vector
|
||||||
void setNormalVector(double x, double y, double z) { m_x = x; m_y = y; m_z = z; }
|
void setNormalVector(double x, double y, double z) { m_x = x; m_y = y; m_z = z; }
|
||||||
|
|
||||||
|
//! Set normal vector
|
||||||
|
void setNormalVector(const std::array<double, 3> &normalVector);
|
||||||
|
|
||||||
//! Set to null
|
//! Set to null
|
||||||
void setNull()
|
void setNull()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user