mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 08:20:06 +00:00
Replace boost/units in favor of units library
This commit is contained in:
parent
12833202b7
commit
35b90fa98d
15 changed files with 67 additions and 67 deletions
|
|
@ -18,15 +18,14 @@ const ::GeographicLib::Geodesic& DefaultGeodesic()
|
|||
return geodesic_;
|
||||
}
|
||||
|
||||
boost::units::quantity<boost::units::si::length>
|
||||
units::length::meters<double>
|
||||
GetDistance(double lat1, double lon1, double lat2, double lon2)
|
||||
{
|
||||
double distance;
|
||||
util::GeographicLib::DefaultGeodesic().Inverse(
|
||||
lat1, lon1, lat2, lon2, distance);
|
||||
|
||||
return static_cast<boost::units::quantity<boost::units::si::length>>(
|
||||
distance * boost::units::si::meter_base_unit::unit_type());
|
||||
return units::length::meters<double> {distance};
|
||||
}
|
||||
|
||||
} // namespace GeographicLib
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
#include <boost/units/quantity.hpp>
|
||||
#include <boost/units/systems/si/length.hpp>
|
||||
#include <units/length.h>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
|
|
@ -30,7 +29,7 @@ const ::GeographicLib::Geodesic& DefaultGeodesic();
|
|||
*
|
||||
* @return distance between point 1 and point 2
|
||||
*/
|
||||
boost::units::quantity<boost::units::si::length>
|
||||
units::length::meters<double>
|
||||
GetDistance(double lat1, double lon1, double lat2, double lon2);
|
||||
|
||||
} // namespace GeographicLib
|
||||
|
|
|
|||
|
|
@ -12,11 +12,12 @@ namespace util
|
|||
namespace maplibre
|
||||
{
|
||||
|
||||
boost::units::quantity<boost::units::si::length>
|
||||
units::length::meters<double>
|
||||
GetMapDistance(const QMapLibreGL::CustomLayerRenderParameters& params)
|
||||
{
|
||||
return QMapLibreGL::metersPerPixelAtLatitude(params.latitude, params.zoom) *
|
||||
(params.width + params.height) / 2.0 * boost::units::si::meters;
|
||||
return units::length::meters<double>(
|
||||
QMapLibreGL::metersPerPixelAtLatitude(params.latitude, params.zoom) *
|
||||
(params.width + params.height) / 2.0);
|
||||
}
|
||||
|
||||
glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMapLibreGL/types.hpp>
|
||||
#include <boost/units/quantity.hpp>
|
||||
#include <boost/units/systems/si/length.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <units/length.h>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
|
|
@ -14,7 +13,7 @@ namespace util
|
|||
namespace maplibre
|
||||
{
|
||||
|
||||
boost::units::quantity<boost::units::si::length>
|
||||
units::length::meters<double>
|
||||
GetMapDistance(const QMapLibreGL::CustomLayerRenderParameters& params);
|
||||
glm::vec2 LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue