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

Method GetRoutePoints

libs/map/routing_mark.cpp:396–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396std::vector<RouteMarkPoint *> RoutePointsLayout::GetRoutePoints()
397{
398 auto const & markIds = m_manager.GetUserMarkIds(UserMark::Type::ROUTING);
399 std::vector<RouteMarkPoint *> points;
400 points.reserve(markIds.size());
401 RouteMarkPoint * startPoint = nullptr;
402 RouteMarkPoint * finishPoint = nullptr;
403 for (auto markId : markIds)
404 {
405 auto * p = m_editSession.GetMarkForEdit<RouteMarkPoint>(markId);
406 if (p->GetRoutePointType() == RouteMarkType::Start)
407 startPoint = p;
408 else if (p->GetRoutePointType() == RouteMarkType::Finish)
409 finishPoint = p;
410 else
411 points.push_back(p);
412 }
413 std::sort(points.begin(), points.end(), [](RouteMarkPoint const * p1, RouteMarkPoint const * p2)
414 { return p1->GetIntermediateIndex() < p2->GetIntermediateIndex(); });
415 if (startPoint != nullptr)
416 points.insert(points.begin(), startPoint);
417 if (finishPoint != nullptr)
418 points.push_back(finishPoint);
419 return points;
420}
421
422size_t RoutePointsLayout::GetRoutePointsCount() const
423{

Callers 6

SubmitRoutingPointMethod · 0.45
FollowRouteMethod · 0.45
OnRouteRecommendationMethod · 0.45
GetParsedRoutingDataMethod · 0.45
UNIT_TESTFunction · 0.45

Calls 8

GetRoutePointTypeMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetIntermediateIndexMethod · 0.45
insertMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.36