mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -40,12 +40,15 @@ m2::PointD GetCenter(FeatureType & f, int scale)
|
||||
}
|
||||
}
|
||||
|
||||
m2::PointD GetCenter(FeatureType & f) { return GetCenter(f, FeatureType::BEST_GEOMETRY); }
|
||||
m2::PointD GetCenter(FeatureType & f)
|
||||
{
|
||||
return GetCenter(f, FeatureType::BEST_GEOMETRY);
|
||||
}
|
||||
|
||||
double GetMinDistanceMeters(FeatureType & ft, m2::PointD const & pt, int scale)
|
||||
{
|
||||
double res = std::numeric_limits<double>::max();
|
||||
auto updateDistanceFn = [&] (m2::PointD const & p)
|
||||
auto updateDistanceFn = [&](m2::PointD const & p)
|
||||
{
|
||||
double const d = mercator::DistanceOnEarth(p, pt);
|
||||
if (d < res)
|
||||
@@ -55,9 +58,7 @@ double GetMinDistanceMeters(FeatureType & ft, m2::PointD const & pt, int scale)
|
||||
GeomType const type = ft.GetGeomType();
|
||||
switch (type)
|
||||
{
|
||||
case GeomType::Point:
|
||||
updateDistanceFn(ft.GetCenter());
|
||||
break;
|
||||
case GeomType::Point: updateDistanceFn(ft.GetCenter()); break;
|
||||
|
||||
case GeomType::Line:
|
||||
{
|
||||
@@ -84,7 +85,8 @@ double GetMinDistanceMeters(FeatureType & ft, m2::PointD const & pt, int scale)
|
||||
return;
|
||||
}
|
||||
|
||||
auto fn = [&](m2::PointD const & x1, m2::PointD const & x2) {
|
||||
auto fn = [&](m2::PointD const & x1, m2::PointD const & x2)
|
||||
{
|
||||
m2::ParametrizedSegment<m2::PointD> const segment(x1, x2);
|
||||
updateDistanceFn(segment.ClosestPointTo(pt));
|
||||
};
|
||||
@@ -92,7 +94,6 @@ double GetMinDistanceMeters(FeatureType & ft, m2::PointD const & pt, int scale)
|
||||
fn(p1, p2);
|
||||
fn(p2, p3);
|
||||
fn(p3, p1);
|
||||
|
||||
}, scale);
|
||||
break;
|
||||
}
|
||||
@@ -111,9 +112,7 @@ double CalcArea(FeatureType & ft)
|
||||
if (ft.GetGeomType() == GeomType::Area)
|
||||
{
|
||||
ft.ForEachTriangle([&area](m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3)
|
||||
{
|
||||
area += m2::GetTriangleArea(p1, p2, p3);
|
||||
}, FeatureType::BEST_GEOMETRY);
|
||||
{ area += m2::GetTriangleArea(p1, p2, p3); }, FeatureType::BEST_GEOMETRY);
|
||||
}
|
||||
return area;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user