Ref T275, Ref T280, avoid nan (not a number) values in PQs/elevation

This commit is contained in:
Klaus Basan
2018-06-20 00:53:12 +02:00
parent d99a7639e8
commit fc1a2bbb0f
5 changed files with 41 additions and 9 deletions

View File

@@ -52,7 +52,9 @@ namespace BlackMisc
CElevationPlane::CElevationPlane(double latDeg, double lngDeg, double altitudeMSLft, const CLength &radius) :
CCoordinateGeodetic(latDeg, lngDeg, altitudeMSLft), m_radius(radius)
{ }
{
Q_ASSERT_X(!std::isnan(altitudeMSLft), Q_FUNC_INFO, "elv.nan");
}
void CElevationPlane::setRadiusOrMinimum(const CLength &radius)
{
@@ -93,7 +95,7 @@ namespace BlackMisc
bool CElevationPlane::isWithinRange(const ICoordinateGeodetic &coordinate) const
{
if (coordinate.isNull()) { return false; }
if (isNull()) { return false; }
if (this->isNull()) { return false; }
const CLength d = this->calculateGreatCircleDistance(coordinate);
const bool inRange = (m_radius >= d);
return inRange;