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

Method FillDeadEndsCache

libs/routing/index_router.cpp:1138–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1136}
1137
1138void IndexRouter::PointsOnEdgesSnapping::FillDeadEndsCache(m2::PointD const & point)
1139{
1140 auto const rect = mercator::RectByCenterXYAndSizeInMeters(point, kFirstSearchDistanceM);
1141 auto closestRoads = m_router.m_roadGraph.FindRoads(rect, [this](FeatureID const & fid)
1142 {
1143 auto const & info = fid.m_mwmId.GetInfo();
1144 return m_router.m_numMwmIds->ContainsFile(info->GetLocalFile().GetCountryFile());
1145 });
1146
1147 m_deadEnds[0].clear();
1148 EraseIfDeadEnd(point, closestRoads, m_deadEnds[0]);
1149
1150 vector<EdgeProjectionT> candidates;
1151 m_deadEnds[1].clear();
1152 RoadsToNearestEdges(point, closestRoads, [this](EdgeProjectionT const & proj)
1153 {
1154 auto const segment = GetSegmentByEdge(proj.first);
1155 return !IsDeadEndCached(segment, true /* isOutgoing */, true /* useRoutingOptions */, m_graph, m_deadEnds[1]);
1156 }, candidates);
1157}
1158
1159void IndexRouter::PointsOnEdgesSnapping::EraseIfDeadEnd(m2::PointD const & checkpoint, vector<RoadInfoT> & roads,
1160 std::set<Segment> & deadEnds) const

Callers

nothing calls this directly

Calls 7

IsDeadEndCachedFunction · 0.85
ContainsFileMethod · 0.80
GetLocalFileMethod · 0.80
FindRoadsMethod · 0.45
GetInfoMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected