| 44 | } |
| 45 | |
| 46 | void LeapsGraph::GetEdgesList(Segment const & segment, bool isOutgoing, EdgeListT & edges) |
| 47 | { |
| 48 | edges.clear(); |
| 49 | |
| 50 | if (segment == m_startSegment) |
| 51 | { |
| 52 | CHECK(isOutgoing, ("Only forward wave of A* should get edges from start. Backward wave should " |
| 53 | "stop when first time visit the |m_startSegment|.")); |
| 54 | return GetEdgesListFromStart(edges); |
| 55 | } |
| 56 | |
| 57 | if (segment == m_finishSegment) |
| 58 | { |
| 59 | CHECK(!isOutgoing, ("Only backward wave of A* should get edges to finish. Forward wave should " |
| 60 | "stop when first time visit the |m_finishSegment|.")); |
| 61 | return GetEdgesListToFinish(edges); |
| 62 | } |
| 63 | |
| 64 | if (!m_starter.IsRoutingOptionsGood(segment)) |
| 65 | return; |
| 66 | |
| 67 | auto & crossMwmGraph = m_starter.GetGraph().GetCrossMwmGraph(); |
| 68 | |
| 69 | if (crossMwmGraph.IsTransition(segment, isOutgoing)) |
| 70 | { |
| 71 | auto const segMwmId = segment.GetMwmId(); |
| 72 | |
| 73 | std::vector<Segment> twins; |
| 74 | m_starter.GetGraph().GetTwinsInner(segment, isOutgoing, twins); |
| 75 | for (auto const & twin : twins) |
| 76 | edges.emplace_back(twin, m_hierarchyHandler.GetCrossBorderPenalty(segMwmId, twin.GetMwmId())); |
| 77 | |
| 78 | return; |
| 79 | } |
| 80 | |
| 81 | if (isOutgoing) |
| 82 | crossMwmGraph.GetOutgoingEdgeList(segment, edges); |
| 83 | else |
| 84 | crossMwmGraph.GetIngoingEdgeList(segment, edges); |
| 85 | } |
| 86 | |
| 87 | void LeapsGraph::GetEdgesListFromStart(EdgeListT & edges) const |
| 88 | { |
no test coverage detected