mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +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);
|
||||
|
||||
Reference in New Issue
Block a user