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

Method IsUTurnAndRestricted

libs/routing/index_graph.cpp:514–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514bool IndexGraph::IsUTurnAndRestricted(Segment const & parent, Segment const & child, bool isOutgoing) const
515{
516 ASSERT(IsUTurn(parent, child), ());
517
518 uint32_t const featureId = parent.GetFeatureId();
519 uint32_t const turnPoint = parent.GetPointId(isOutgoing);
520 auto const & roadGeometry = GetRoadGeometry(featureId);
521
522 RoadPoint const rp = parent.GetRoadPoint(isOutgoing);
523 if (m_roadIndex.GetJointId(rp) == Joint::kInvalidId && !roadGeometry.IsEndPointId(turnPoint))
524 return true;
525
526 auto const it = m_noUTurnRestrictions.find(featureId);
527 if (it == m_noUTurnRestrictions.cend())
528 return false;
529
530 auto const & uTurn = it->second;
531 if (uTurn.m_atTheBegin && turnPoint == 0)
532 return true;
533
534 uint32_t const n = roadGeometry.GetPointsCount();
535 ASSERT_GREATER_OR_EQUAL(n, 1, ());
536 return uTurn.m_atTheEnd && turnPoint == n - 1;
537}
538
539RouteWeight IndexGraph::CalculateEdgeWeight(EdgeEstimator::Purpose purpose, bool isOutgoing, Segment const & from,
540 Segment const & to,

Callers

nothing calls this directly

Calls 10

ASSERTFunction · 0.85
IsUTurnFunction · 0.85
GetRoadPointMethod · 0.80
IsEndPointIdMethod · 0.80
GetFeatureIdMethod · 0.45
GetPointIdMethod · 0.45
GetJointIdMethod · 0.45
findMethod · 0.45
cendMethod · 0.45
GetPointsCountMethod · 0.45

Tested by

no test coverage detected