MCPcopy Create free account
hub / github.com/comaps/comaps / FindCenter

Function FindCenter

tools/feature_list/feature_list.cpp:67–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65};
66
67m2::PointD FindCenter(FeatureType & f)
68{
69 ClosestPoint closest(f.GetLimitRect(FeatureType::BEST_GEOMETRY).Center());
70 if (f.GetGeomType() == feature::GeomType::Area)
71 {
72 f.ForEachTriangle([&closest](m2::PointD const & p1, m2::PointD const & p2, m2::PointD const & p3)
73 { closest((p1 + p2 + p3) / 3); }, FeatureType::BEST_GEOMETRY);
74 }
75 else
76 {
77 f.ForEachPoint(closest, FeatureType::BEST_GEOMETRY);
78 }
79 return closest.GetBest();
80}
81
82size_t const kLangCount = localisation::GetSupportedLanguages().size();
83

Callers 1

ProcessMethod · 0.85

Calls 6

GetBestMethod · 0.80
CenterMethod · 0.45
GetLimitRectMethod · 0.45
GetGeomTypeMethod · 0.45
ForEachTriangleMethod · 0.45
ForEachPointMethod · 0.45

Tested by

no test coverage detected