Ref T259, Ref T243 utility functions for aircraft situation/elevation plane

This commit is contained in:
Klaus Basan
2018-03-23 02:18:47 +01:00
parent bb34beed26
commit 1203c58a23
6 changed files with 42 additions and 3 deletions

View File

@@ -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();

View File

@@ -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; }