mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #865, hints get ground elevation from provider or from set value
* using CAltitude for elevation provider * null() for CAltitude * formatting of members * fixme in fs9 client
This commit is contained in:
committed by
Mathew Sutcliffe
parent
0a99c82ddc
commit
38585d10b2
@@ -10,6 +10,7 @@
|
||||
#include "interpolationhints.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
@@ -22,6 +23,13 @@ namespace BlackMisc
|
||||
CInterpolationHints::CInterpolationHints(bool isVtolAircraft) : m_isVtol(isVtolAircraft)
|
||||
{ }
|
||||
|
||||
CAltitude CInterpolationHints::getGroundElevation(const Aviation::CAircraftSituation &situation) const
|
||||
{
|
||||
if (m_elevationProvider) { return m_elevationProvider(situation); }
|
||||
if (m_elevation.isNull() || !m_elevation.isWithinRange(situation)) { return CAltitude::null(); }
|
||||
return m_elevation.geodeticHeight();
|
||||
}
|
||||
|
||||
void CInterpolationHints::resetElevation()
|
||||
{
|
||||
m_elevation = CElevationPlane();
|
||||
@@ -33,6 +41,12 @@ namespace BlackMisc
|
||||
return m_elevation.isWithinRange(coordinate);
|
||||
}
|
||||
|
||||
void CInterpolationHints::setAircraftParts(const CAircraftParts &parts, bool hasParts)
|
||||
{
|
||||
m_hasParts = hasParts;
|
||||
m_aircraftParts = parts;
|
||||
}
|
||||
|
||||
CVariant CInterpolationHints::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
Reference in New Issue
Block a user