mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Ref T259, Ref T243 utility functions for aircraft situation/elevation plane
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "elevationplane.h"
|
||||
#include "coordinategeodetic.h"
|
||||
#include "blackmisc/pq/length.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
|
||||
@@ -27,6 +28,12 @@ namespace BlackMisc
|
||||
m_radius.valueRoundedWithUnit(2, i18n));
|
||||
}
|
||||
|
||||
CElevationPlane::CElevationPlane(const ICoordinateGeodetic &coordinate, const ICoordinateGeodetic &rangeCoordinate) :
|
||||
CCoordinateGeodetic(coordinate)
|
||||
{
|
||||
m_radius = this->calculateGreatCircleDistance(rangeCoordinate);
|
||||
}
|
||||
|
||||
const CAltitude &CElevationPlane::getAltitudeIfWithinRadius(const ICoordinateGeodetic &coordinate) const
|
||||
{
|
||||
return (isWithinRange(coordinate)) ? geodeticHeight() : CAltitude::null();
|
||||
|
||||
@@ -21,8 +21,7 @@ namespace BlackMisc
|
||||
{
|
||||
//! Plane of same elevation, can be a single point or larger area (e.g. airport)
|
||||
//! \remark 100km/h 1sec => 28m
|
||||
class BLACKMISC_EXPORT CElevationPlane :
|
||||
public CValueObject<CElevationPlane, CCoordinateGeodetic>
|
||||
class BLACKMISC_EXPORT CElevationPlane : public CCoordinateGeodetic
|
||||
{
|
||||
public:
|
||||
//! Properties by index
|
||||
@@ -34,8 +33,11 @@ namespace BlackMisc
|
||||
//! Default constructor
|
||||
CElevationPlane() {}
|
||||
|
||||
//! Plane at given coordinates with range to 2nd coordinate
|
||||
CElevationPlane(const ICoordinateGeodetic &coordinate, const ICoordinateGeodetic &rangeCoordinate);
|
||||
|
||||
//! Constructors from CCoordinateGeodetic
|
||||
using CValueObject<CElevationPlane, CCoordinateGeodetic>::CValueObject;
|
||||
using CCoordinateGeodetic::CCoordinateGeodetic;
|
||||
|
||||
//! Radius
|
||||
const PhysicalQuantities::CLength &getRadius() const { return m_radius; }
|
||||
|
||||
Reference in New Issue
Block a user