| 179 | } |
| 180 | |
| 181 | void IndexGraphStarter::GetEdgesList(astar::VertexData<Vertex, Weight> const & vertexData, bool isOutgoing, |
| 182 | bool useAccessConditional, EdgeListT & edges) const |
| 183 | { |
| 184 | edges.clear(); |
| 185 | CHECK_NOT_EQUAL(m_graph.GetMode(), WorldGraphMode::LeapsOnly, ()); |
| 186 | |
| 187 | auto const & segment = vertexData.m_vertex; |
| 188 | // Weight used only when isOutgoing = false for passing to m_guides and placing to |edges|. |
| 189 | RouteWeight ingoingSegmentWeight; |
| 190 | if (!isOutgoing) |
| 191 | ingoingSegmentWeight = CalcSegmentWeight(segment, EdgeEstimator::Purpose::Weight); |
| 192 | |
| 193 | if (IsFakeSegment(segment)) |
| 194 | { |
| 195 | Segment real; |
| 196 | if (m_fake.FindReal(segment, real)) |
| 197 | { |
| 198 | bool const haveSameFront = GetJunction(segment, true /* front */) == GetJunction(real, true); |
| 199 | bool const haveSameBack = GetJunction(segment, false /* front */) == GetJunction(real, false); |
| 200 | if ((isOutgoing && haveSameFront) || (!isOutgoing && haveSameBack)) |
| 201 | { |
| 202 | if (IsGuidesSegment(real)) |
| 203 | { |
| 204 | m_guides.GetEdgeList(real, isOutgoing, edges, ingoingSegmentWeight); |
| 205 | } |
| 206 | else if (IsRegionsGraphMode()) |
| 207 | { |
| 208 | m_regionsGraph->GetEdgeList(real, isOutgoing, edges, GetJunction(segment, true /* front */).GetLatLon()); |
| 209 | } |
| 210 | else |
| 211 | { |
| 212 | astar::VertexData const replacedFakeSegment(real, vertexData.m_realDistance); |
| 213 | m_graph.GetEdgeList(replacedFakeSegment, isOutgoing, true /* useRoutingOptions */, useAccessConditional, |
| 214 | edges); |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | for (auto const & s : m_fake.GetEdges(segment, isOutgoing)) |
| 220 | edges.emplace_back(s, isOutgoing ? CalcSegmentWeight(s, EdgeEstimator::Purpose::Weight) : ingoingSegmentWeight); |
| 221 | } |
| 222 | else if (IsGuidesSegment(segment)) |
| 223 | { |
| 224 | m_guides.GetEdgeList(segment, isOutgoing, edges, ingoingSegmentWeight); |
| 225 | } |
| 226 | else if (IsRegionsGraphMode()) |
| 227 | { |
| 228 | m_regionsGraph->GetEdgeList(segment, isOutgoing, edges, GetJunction(segment, true /* front */).GetLatLon()); |
| 229 | } |
| 230 | else |
| 231 | { |
| 232 | m_graph.GetEdgeList(vertexData, isOutgoing, true /* useRoutingOptions */, useAccessConditional, edges); |
| 233 | } |
| 234 | |
| 235 | AddFakeEdges(segment, isOutgoing, edges); |
| 236 | } |
| 237 | |
| 238 | RouteWeight IndexGraphStarter::CalcGuidesSegmentWeight(Segment const & segment, EdgeEstimator::Purpose purpose) const |
nothing calls this directly
no test coverage detected