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

Method ContinueRouteToPoint

libs/map/routing_manager.cpp:969–990  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967}
968
969void RoutingManager::ContinueRouteToPoint(RouteMarkData && markData)
970{
971 ASSERT(m_bmManager != nullptr, ());
972 ASSERT(markData.m_pointType == RouteMarkType::Finish, ("New route point should have type RouteMarkType::Finish"));
973 RoutePointsLayout routePoints(*m_bmManager);
974
975 // Finish point is now Intermediate point
976 RouteMarkPoint * finishMarkData = routePoints.GetRoutePointForEdit(RouteMarkType::Finish);
977 finishMarkData->SetRoutePointType(RouteMarkType::Intermediate);
978 finishMarkData->SetIntermediateIndex(routePoints.GetRoutePointsCount() - 2);
979
980 if (markData.m_isMyPosition)
981 {
982 RouteMarkPoint const * mark = routePoints.GetMyPositionPoint();
983 if (mark)
984 routePoints.RemoveRoutePoint(mark->GetRoutePointType(), mark->GetIntermediateIndex());
985 }
986
987 markData.m_intermediateIndex = routePoints.GetRoutePointsCount() - 1;
988 markData.m_isVisible = !markData.m_isMyPosition;
989 routePoints.AddRoutePoint(std::move(markData));
990}
991
992void RoutingManager::RemoveRoutePoint(RouteMarkType type, size_t intermediateIndex)
993{

Callers 1

OnTapEventMethod · 0.80

Calls 10

ASSERTFunction · 0.85
GetRoutePointForEditMethod · 0.80
SetRoutePointTypeMethod · 0.80
GetMyPositionPointMethod · 0.80
GetRoutePointTypeMethod · 0.80
SetIntermediateIndexMethod · 0.45
GetRoutePointsCountMethod · 0.45
RemoveRoutePointMethod · 0.45
GetIntermediateIndexMethod · 0.45
AddRoutePointMethod · 0.45

Tested by

no test coverage detected