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

Method GetEdgeList

libs/routing/transit_world_graph.cpp:35–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void 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
79void TransitWorldGraph::GetEdgeList(astar::VertexData<JointSegment, RouteWeight> const & parentVertexData,
80 Segment const & segment, bool isOutgoing, bool useAccessConditional,

Callers 1

AddRealEdgesMethod · 0.45

Calls 9

GetTransitEdgesMethod · 0.80
GetTargetMethod · 0.80
GetMwmIdMethod · 0.45
FindRealMethod · 0.45
emplace_backMethod · 0.45
GetWeightMethod · 0.45
appendMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected