mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Ref T261, improved "finding" for elevation, "findFirst" for small radius
This commit is contained in:
committed by
Roland Winklmeier
parent
ae8d9abf0d
commit
ad10470eb1
@@ -91,9 +91,13 @@ namespace BlackMisc
|
||||
return delta;
|
||||
}
|
||||
|
||||
CElevationPlane ISimulationEnvironmentProvider::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const PhysicalQuantities::CLength &range) const
|
||||
CElevationPlane ISimulationEnvironmentProvider::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const CLength &range) const
|
||||
{
|
||||
const CCoordinateGeodetic coordinate = this->getElevationCoordinates().findClosestWithinRange(reference, minRange(range));
|
||||
// for single point we use a slightly optimized version
|
||||
const bool singlePoint = (range <= CElevationPlane::singlePointRadius());
|
||||
const CCoordinateGeodetic coordinate = singlePoint ?
|
||||
this->getElevationCoordinates().findFirstWithinRangeOrDefault(reference, CElevationPlane::singlePointRadius()) :
|
||||
this->getElevationCoordinates().findClosestWithinRange(reference, range);
|
||||
const bool found = !coordinate.isNull();
|
||||
{
|
||||
QWriteLocker l{&m_lockElvCoordinates };
|
||||
|
||||
Reference in New Issue
Block a user