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

Method CheckAndProcessTransitFeatures

libs/routing/single_vehicle_world_graph.cpp:40–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void SingleVehicleWorldGraph::CheckAndProcessTransitFeatures(Segment const & parent, JointEdgeListT & jointEdges,
41 WeightListT & parentWeights, bool isOutgoing)
42{
43 JointEdgeListT newCrossMwmEdges;
44
45 NumMwmId const mwmId = parent.GetMwmId();
46
47 for (size_t i = 0; i < jointEdges.size(); ++i)
48 {
49 JointSegment const & target = jointEdges[i].GetTarget();
50
51 vector<Segment> twins;
52 m_crossMwmGraph->GetTwinFeature(target.GetSegment(true /* start */), isOutgoing, twins);
53 if (twins.empty())
54 {
55 ASSERT_EQUAL(mwmId, target.GetMwmId(), ());
56 continue;
57 }
58
59 auto & currentIndexGraph = GetIndexGraph(mwmId);
60 for (auto const & twin : twins)
61 {
62 NumMwmId const twinMwmId = twin.GetMwmId();
63 Segment const start(twinMwmId, twin.GetFeatureId(), target.GetSegmentId(isOutgoing), target.IsForward());
64
65 auto & twinIndexGraph = GetIndexGraph(twinMwmId);
66
67 IndexGraph::PointIdListT lastPoints;
68 twinIndexGraph.GetLastPointsForJoint({start}, isOutgoing, lastPoints);
69 ASSERT_EQUAL(lastPoints.size(), 1, ());
70
71 if (auto edge = currentIndexGraph.GetJointEdgeByLastPoint(parent, target.GetSegment(isOutgoing), isOutgoing,
72 lastPoints.back()))
73 {
74 newCrossMwmEdges.emplace_back(*edge);
75 newCrossMwmEdges.back().GetTarget().AssignID(twin);
76
77 parentWeights.push_back(parentWeights[i]);
78 }
79 }
80 }
81
82 jointEdges.insert(jointEdges.end(), newCrossMwmEdges.begin(), newCrossMwmEdges.end());
83}
84
85void SingleVehicleWorldGraph::GetEdgeList(astar::VertexData<Segment, RouteWeight> const & vertexData, bool isOutgoing,
86 bool useRoutingOptions, bool useAccessConditional, SegmentEdgeListT & edges)

Callers

nothing calls this directly

Calls 15

GetTargetMethod · 0.80
GetTwinFeatureMethod · 0.80
GetSegmentMethod · 0.80
GetLastPointsForJointMethod · 0.80
backMethod · 0.80
AssignIDMethod · 0.80
GetMwmIdMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
GetFeatureIdMethod · 0.45
GetSegmentIdMethod · 0.45

Tested by

no test coverage detected