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

Method CreateRoadWarningMarks

libs/map/routing_manager.cpp:713–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713void RoutingManager::CreateRoadWarningMarks(RoadWarningsCollection && roadWarnings)
714{
715 if (roadWarnings.empty())
716 return;
717
718 GetPlatform().RunTask(Platform::Thread::Gui, [this, roadWarnings = std::move(roadWarnings)]()
719 {
720 auto es = m_bmManager->GetEditSession();
721 for (auto const & typeInfo : roadWarnings)
722 {
723 auto const type = GetRoadType(typeInfo.first);
724 for (size_t i = 0; i < typeInfo.second.size(); ++i)
725 {
726 auto const & routeInfo = typeInfo.second[i];
727 auto mark = es.CreateUserMark<RoadWarningMark>(routeInfo.m_startPoint);
728 mark->SetIndex(static_cast<uint32_t>(i));
729 mark->SetRoadWarningType(type);
730 mark->SetFeatureId(routeInfo.m_featureId);
731 std::string distanceStr = platform::Distance::CreateFormatted(routeInfo.m_distance).ToString();
732 mark->SetDistance(distanceStr);
733 }
734 }
735 });
736}
737
738void RoutingManager::CollectTrafficLights(vector<RouteSegment> const & segments, m2::PointD const & startPt, vector<std::pair<m2::PointD, FeatureID>> & trafficLights)
739{

Callers

nothing calls this directly

Calls 10

GetRoadTypeFunction · 0.85
RunTaskMethod · 0.80
GetEditSessionMethod · 0.80
SetIndexMethod · 0.80
SetRoadWarningTypeMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
SetFeatureIdMethod · 0.45
ToStringMethod · 0.45
SetDistanceMethod · 0.45

Tested by

no test coverage detected