| 38 | } |
| 39 | |
| 40 | void 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 | |
| 85 | void SingleVehicleWorldGraph::GetEdgeList(astar::VertexData<Segment, RouteWeight> const & vertexData, bool isOutgoing, |
| 86 | bool useRoutingOptions, bool useAccessConditional, SegmentEdgeListT & edges) |
nothing calls this directly
no test coverage detected