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

Method GetSegmentCandidateForRoadPoint

libs/routing/index_graph.cpp:278–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void IndexGraph::GetSegmentCandidateForRoadPoint(RoadPoint const & rp, NumMwmId numMwmId, bool isOutgoing,
279 SegmentListT & children) const
280{
281 RoadGeometry const & road = GetRoadGeometry(rp.GetFeatureId());
282 if (!road.IsValid())
283 return;
284
285 if (!road.SuitableForOptions(m_avoidRoutingOptions))
286 return;
287
288 bool const bidirectional = !road.IsOneWay();
289 auto const pointId = rp.GetPointId();
290
291 if ((isOutgoing || bidirectional) && pointId + 1 < road.GetPointsCount())
292 children.emplace_back(numMwmId, rp.GetFeatureId(), pointId, isOutgoing);
293
294 if ((!isOutgoing || bidirectional) && pointId > 0)
295 children.emplace_back(numMwmId, rp.GetFeatureId(), pointId - 1, !isOutgoing);
296}
297
298void IndexGraph::GetSegmentCandidateForJoint(Segment const & parent, bool isOutgoing, SegmentListT & children) const
299{

Callers

nothing calls this directly

Calls 7

SuitableForOptionsMethod · 0.80
GetFeatureIdMethod · 0.45
IsValidMethod · 0.45
IsOneWayMethod · 0.45
GetPointIdMethod · 0.45
GetPointsCountMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected