10using namespace swift::misc::aviation;
11using namespace swift::misc::physical_quantities;
13namespace swift::misc::geo
18 return QStringLiteral(
"%1 radius: %2").arg(coordinate, m_radius.valueRoundedWithUnit(2, i18n));
47 Q_ASSERT_X(!std::isnan(altitudeMSLft), Q_FUNC_INFO,
"elv.nan");
93 if (unit.
isNull() || this->getAltitudeUnit().isNull())
130 const CLength d = this->calculateGreatCircleDistance(coordinate);
131 const bool inRange = (m_radius >= d);
149 const CLength d = this->calculateGreatCircleDistance(coordinate);
150 const bool inRange = (radius >= d);
169 case IndexRadius:
return m_radius.propertyByIndex(index.
copyFrontRemoved());
185 case IndexRadius: m_radius.setPropertyByIndex(index.
copyFrontRemoved(), variant);
break;
Non-owning reference to a CPropertyIndex with a subset of its features.
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const
Copy with first element removed.
CastType frontCasted() const
First element casted to given type, usually the PropertIndex enum.
bool isMyself() const
Myself index, used with nesting.
Altitude as used in aviation, can be AGL or MSL altitude.
bool isMeanSeaLevel() const
MSL Mean sea level?
CAltitude withOffset(const CLength &offset) const
Altitude with offset.
CAltitude & switchUnit(const physical_quantities::CLengthUnit &newUnit)
Value in switched unit.
int compare(const CAltitude &otherAltitude) const
Return negative, zero, or positive if a is less than, equal to, or greater than b.
static const CAltitude & null()
Null altitude (MSL).
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
bool isNull() const
Is null?
void setGeodeticHeight(const aviation::CAltitude &height)
Set height (ellipsoidal or geodetic height).
const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS).
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
void setMinorAirportRadius()
Treat as elevation of a small airport.
static const physical_quantities::CLength & singlePointRadius()
Radius for single point.
const physical_quantities::CLengthUnit & getAltitudeUnit() const
Altitude (synonym for geodetic height) unit.
static const physical_quantities::CLength & majorAirportRadius()
Radius for major airport.
void addAltitudeOffset(const physical_quantities::CLength &offset)
Add offset to altitude.
QVariant propertyByIndex(CPropertyIndexRef index) const
Property by index.
void switchAltitudeUnit(const physical_quantities::CLengthUnit &unit)
Switch altitude unit.
bool isWithinRange(const ICoordinateGeodetic &coordinate) const
Check if elevation is within radius and can be used.
bool isNull() const
Existing value?
const aviation::CAltitude & getAltitudeIfWithinRadius(const ICoordinateGeodetic &coordinate) const
Altitude when within radius, else null.
QString convertToQString(bool i18n=false) const
Cast as QString.
CCoordinateGeodetic()=default
Constructors from CCoordinateGeodetic.
void setRadiusOrMinimumRadius(const physical_quantities::CLength &radius)
Radius or minimum CElevationPlane::singlePointRadius.
void fixRadius()
Set minimum radius if not having radius.
static const physical_quantities::CLength & minorAirportRadius()
Radius for minor airport.
void setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
Set property by index.
double getAltitudeValue(const physical_quantities::CLengthUnit &unit) const
Altitude (synonym for geodetic height).
const physical_quantities::CLength & getRadiusOrMinimumRadius() const
Radius or minimum radius.
const aviation::CAltitude & getAltitude() const
Altitude (synonym for geodetic height).
aviation::CAltitude getAltitudeInUnit(const physical_quantities::CLengthUnit &unit) const
Altitude (synonym for geodetic height).
CElevationPlane()=default
Default constructor.
static const CElevationPlane & null()
NULL plane.
void setMajorAirportRadius()
Treat as elevation of a small airport.
ColumnIndex
Properties by index.
int comparePropertyByIndex(CPropertyIndexRef index, const CElevationPlane &elevationPlane) const
Compare for index.
void setSinglePointRadius()
Treat as single point as obtained from simulator.
Geodetic coordinate, a position in 3D space relative to the reference geoid.
virtual bool isNull() const
Is null, means vector x, y, z == 0.
QString toQString(bool i18n=false) const
Physical unit length (length).
Specialized class for distance units (meter, foot, nautical miles).
static CLengthUnit m()
Meter m.
static CLengthUnit ft()
Foot ft.
bool isNull() const
Is unit null?
bool isNull() const
Is quantity null?
double value(MU unit) const
Value in given unit.
bool isZeroEpsilonConsidered() const
Quantity value <= epsilon.
QVariant fromValue(T &&value)