| 114 | } |
| 115 | |
| 116 | void CandidatePathsGetter::GetAllSuitablePaths(Graph::EdgeVector const & startLines, bool isLastPoint, double bearDistM, |
| 117 | FunctionalRoadClass functionalRoadClass, FormOfWay formOfWay, |
| 118 | double distanceToNextPointM, vector<LinkPtr> & allPaths) |
| 119 | { |
| 120 | queue<LinkPtr> q; |
| 121 | |
| 122 | for (auto const & e : startLines) |
| 123 | { |
| 124 | auto const u = make_shared<Link>(nullptr /* parent */, e, 0 /* distanceM */); |
| 125 | q.push(u); |
| 126 | } |
| 127 | |
| 128 | while (!q.empty()) |
| 129 | { |
| 130 | auto const u = q.front(); |
| 131 | q.pop(); |
| 132 | |
| 133 | auto const & currentEdge = u->m_edge; |
| 134 | auto const currentEdgeLen = EdgeLength(currentEdge); |
| 135 | |
| 136 | // TODO(mgsergio): Maybe weak this constraint a bit. |
| 137 | if (u->m_distanceM + currentEdgeLen >= bearDistM) |
| 138 | { |
| 139 | allPaths.push_back(u); |
| 140 | continue; |
| 141 | } |
| 142 | |
| 143 | ASSERT_LESS(u->m_distanceM + currentEdgeLen, bearDistM, ()); |
| 144 | |
| 145 | Graph::EdgeListT edges; |
| 146 | if (!isLastPoint) |
| 147 | m_graph.GetOutgoingEdges(currentEdge.GetEndJunction(), edges); |
| 148 | else |
| 149 | m_graph.GetIngoingEdges(currentEdge.GetStartJunction(), edges); |
| 150 | |
| 151 | for (auto const & e : edges) |
| 152 | { |
| 153 | // Fake edges are allowed only at the start/end of the path. |
| 154 | if (e.IsFake()) |
| 155 | continue; |
| 156 | |
| 157 | if (EdgesAreAlmostEqual(e.GetReverseEdge(), currentEdge)) |
| 158 | continue; |
| 159 | |
| 160 | ASSERT(currentEdge.HasRealPart(), ()); |
| 161 | |
| 162 | if (!PassesRestriction(e, functionalRoadClass, formOfWay, 2 /* kFRCThreshold */, m_infoGetter)) |
| 163 | continue; |
| 164 | |
| 165 | // TODO(mgsergio): Should we check form of way as well? |
| 166 | |
| 167 | if (u->IsPointOnPath(e.GetEndJunction())) |
| 168 | continue; |
| 169 | |
| 170 | auto const p = make_shared<Link>(u, e, u->m_distanceM + currentEdgeLen); |
| 171 | q.push(p); |
| 172 | } |
| 173 | } |
nothing calls this directly
no test coverage detected