mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +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) :
|
||||
m_x(latitude.cos() * longitude.cos()),
|
||||
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::CCoordinateGeodetic(const ICoordinateGeodetic &coordinate) :
|
||||
m_x(coordinate.normalVectorDouble()[0]),
|
||||
m_y(coordinate.normalVectorDouble()[1]),
|
||||
m_z(coordinate.normalVectorDouble()[2]),
|
||||
m_geodeticHeight(coordinate.geodeticHeight())
|
||||
{ }
|
||||
{
|
||||
this->setNormalVector(coordinate.normalVectorDouble());
|
||||
}
|
||||
|
||||
CLatitude CCoordinateGeodetic::latitude() const
|
||||
{
|
||||
@@ -248,6 +252,14 @@ namespace BlackMisc
|
||||
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)
|
||||
{
|
||||
m_geodeticHeight.switchUnit(unit);
|
||||
|
||||
@@ -205,6 +205,9 @@ namespace BlackMisc
|
||||
//! Constructor by normal vector
|
||||
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
|
||||
CCoordinateGeodetic(const CLatitude &latitude, const CLongitude &longitude, const Aviation::CAltitude &geodeticHeight);
|
||||
|
||||
@@ -262,6 +265,9 @@ namespace BlackMisc
|
||||
//! Set normal vector
|
||||
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
|
||||
void setNull()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user