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