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

Method GetEdgesList

libs/routing/leaps_graph.cpp:46–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void 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
87void LeapsGraph::GetEdgesListFromStart(EdgeListT & edges) const
88{

Callers 2

GetEdgesMethod · 0.45
FindFirstJointsMethod · 0.45

Calls 9

clearMethod · 0.45
IsRoutingOptionsGoodMethod · 0.45
IsTransitionMethod · 0.45
GetMwmIdMethod · 0.45
GetTwinsInnerMethod · 0.45
emplace_backMethod · 0.45
GetCrossBorderPenaltyMethod · 0.45
GetOutgoingEdgeListMethod · 0.45
GetIngoingEdgeListMethod · 0.45

Tested by

no test coverage detected