mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 07:10:05 +00:00 
			
		
		
		
	USe a common default geodesic object instead of duplicate copies.
All used functions are constant, and don't require unique instantiations for thread safety.
This commit is contained in:
		
							parent
							
								
									4a31cf6d3e
								
							
						
					
					
						commit
						90c8c0183a
					
				
					 10 changed files with 89 additions and 47 deletions
				
			
		|  | @ -1,13 +1,12 @@ | |||
| #include <scwx/qt/model/radar_site_model.hpp> | ||||
| #include <scwx/qt/config/radar_site.hpp> | ||||
| #include <scwx/qt/types/qt_types.hpp> | ||||
| #include <scwx/qt/util/geographic_lib.hpp> | ||||
| #include <scwx/common/geographic.hpp> | ||||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <format> | ||||
| 
 | ||||
| #include <GeographicLib/Geodesic.hpp> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace qt | ||||
|  | @ -36,7 +35,7 @@ public: | |||
| 
 | ||||
|    QList<std::shared_ptr<config::RadarSite>> radarSites_; | ||||
| 
 | ||||
|    GeographicLib::Geodesic geodesic_; | ||||
|    const GeographicLib::Geodesic& geodesic_; | ||||
| 
 | ||||
|    std::unordered_map<std::string, double> distanceMap_; | ||||
|    scwx::common::DistanceType              distanceDisplay_; | ||||
|  | @ -186,8 +185,7 @@ void RadarSiteModel::HandleMapUpdate(double latitude, double longitude) | |||
| 
 | ||||
| RadarSiteModelImpl::RadarSiteModelImpl() : | ||||
|     radarSites_ {}, | ||||
|     geodesic_(GeographicLib::Constants::WGS84_a(), | ||||
|               GeographicLib::Constants::WGS84_f()), | ||||
|     geodesic_(util::GeographicLib::DefaultGeodesic()), | ||||
|     distanceMap_ {}, | ||||
|     distanceDisplay_ {scwx::common::DistanceType::Miles}, | ||||
|     previousPosition_ {} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat