| 33 | } |
| 34 | |
| 35 | void TransitWorldGraph::GetEdgeList(astar::VertexData<Segment, RouteWeight> const & vertexData, bool isOutgoing, |
| 36 | bool useRoutingOptions, bool useAccessConditional, SegmentEdgeListT & edges) |
| 37 | { |
| 38 | auto const & segment = vertexData.m_vertex; |
| 39 | auto & transitGraph = GetTransitGraph(segment.GetMwmId()); |
| 40 | |
| 41 | if (TransitGraph::IsTransitSegment(segment)) |
| 42 | { |
| 43 | transitGraph.GetTransitEdges(segment, isOutgoing, edges); |
| 44 | |
| 45 | Segment real; |
| 46 | if (transitGraph.FindReal(segment, real)) |
| 47 | { |
| 48 | bool const haveSameFront = GetJunction(segment, true /* front */) == GetJunction(real, true); |
| 49 | bool const haveSameBack = GetJunction(segment, false /* front */) == GetJunction(real, false); |
| 50 | if ((isOutgoing && haveSameFront) || (!isOutgoing && haveSameBack)) |
| 51 | { |
| 52 | astar::VertexData const data(real, vertexData.m_realDistance); |
| 53 | AddRealEdges(data, isOutgoing, useRoutingOptions, edges); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | GetTwins(segment, isOutgoing, useRoutingOptions, edges); |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | AddRealEdges(vertexData, isOutgoing, useRoutingOptions, edges); |
| 62 | } |
| 63 | |
| 64 | SegmentEdgeListT fakeFromReal; |
| 65 | for (auto const & edge : edges) |
| 66 | { |
| 67 | auto const & edgeSegment = edge.GetTarget(); |
| 68 | for (auto const & s : transitGraph.GetFake(edgeSegment)) |
| 69 | { |
| 70 | bool const haveSameFront = GetJunction(edgeSegment, true /* front */) == GetJunction(s, true); |
| 71 | bool const haveSameBack = GetJunction(edgeSegment, false /* front */) == GetJunction(s, false); |
| 72 | if ((isOutgoing && haveSameBack) || (!isOutgoing && haveSameFront)) |
| 73 | fakeFromReal.emplace_back(s, edge.GetWeight()); |
| 74 | } |
| 75 | } |
| 76 | edges.append(fakeFromReal.begin(), fakeFromReal.end()); |
| 77 | } |
| 78 | |
| 79 | void TransitWorldGraph::GetEdgeList(astar::VertexData<JointSegment, RouteWeight> const & parentVertexData, |
| 80 | Segment const & segment, bool isOutgoing, bool useAccessConditional, |
no test coverage detected