mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T231, arbitrary radius for elevation plane
This commit is contained in:
@@ -34,7 +34,7 @@ namespace BlackMisc
|
||||
|
||||
bool CElevationPlane::isNull() const
|
||||
{
|
||||
return m_radius.isNull();
|
||||
return m_radius.isNull() || CCoordinateGeodetic::isNull();
|
||||
}
|
||||
|
||||
bool CElevationPlane::isWithinRange(const ICoordinateGeodetic &coordinate) const
|
||||
@@ -46,6 +46,16 @@ namespace BlackMisc
|
||||
return inRange;
|
||||
}
|
||||
|
||||
bool CElevationPlane::isWithinRange(const ICoordinateGeodetic &coordinate, const CLength &radius) const
|
||||
{
|
||||
if (coordinate.isNull()) { return false; }
|
||||
if (radius.isNull()) { return false; }
|
||||
if (isNull()) { return false; }
|
||||
const CLength d = this->calculateGreatCircleDistance(coordinate);
|
||||
const bool inRange = (radius >= d);
|
||||
return inRange;
|
||||
}
|
||||
|
||||
void CElevationPlane::setSinglePointRadius()
|
||||
{
|
||||
m_radius = singlePointRadius();
|
||||
|
||||
@@ -48,12 +48,16 @@ namespace BlackMisc
|
||||
//! Altitude (synonym for geodetic height)
|
||||
const Aviation::CAltitude &getAltitude() const { return this->geodeticHeight(); }
|
||||
|
||||
//! Existing value
|
||||
bool isNull() const;
|
||||
//! Existing value?
|
||||
virtual bool isNull() const override;
|
||||
|
||||
//! Check if elevation is within radius and can be used
|
||||
//! \remark checks against the set radius
|
||||
bool isWithinRange(const ICoordinateGeodetic &coordinate) const;
|
||||
|
||||
//! Check if elevation is within radius and can be used
|
||||
bool isWithinRange(const ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &radius) const;
|
||||
|
||||
//! Treat as single point as obtained from simulator
|
||||
void setSinglePointRadius();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user