mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refs #865, based on discussion https://dev.vatsim-germany.org/issues/865#note-12
* do not call XP`s elevation provider if not needed in interpolator * some renaming/utility functions
This commit is contained in:
committed by
Mathew Sutcliffe
parent
47aa04b5e9
commit
1d967b08e8
@@ -11,6 +11,7 @@
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -27,6 +28,11 @@ namespace BlackMisc
|
||||
);
|
||||
}
|
||||
|
||||
const CAltitude &CElevationPlane::getAltitudeIfWithinRadius(const BlackMisc::Geo::ICoordinateGeodetic &coordinate) const
|
||||
{
|
||||
return (isWithinRange(coordinate)) ? geodeticHeight() : CAltitude::null();
|
||||
}
|
||||
|
||||
bool CElevationPlane::isNull() const
|
||||
{
|
||||
return m_radius.isNull();
|
||||
@@ -34,7 +40,7 @@ namespace BlackMisc
|
||||
|
||||
bool CElevationPlane::isWithinRange(const ICoordinateGeodetic &coordinate) const
|
||||
{
|
||||
if (m_radius.isNull()) { return false; }
|
||||
if (isNull()) { return false; }
|
||||
const CLength d = this->calculateGreatCircleDistance(coordinate);
|
||||
const bool inRange = m_radius >= d;
|
||||
return inRange;
|
||||
|
||||
Reference in New Issue
Block a user