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

Method GetClosestTurnAfterIdx

libs/routing/route.cpp:268–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268void Route::GetClosestTurnAfterIdx(size_t segIdx, TurnItem & turn) const
269{
270 if (!IsValid())
271 {
272 turn = {};
273 return;
274 }
275
276 CHECK_LESS(segIdx, m_routeSegments.size(), ());
277
278 for (size_t i = segIdx; i < m_routeSegments.size(); ++i)
279 {
280 if (IsNormalTurn(m_routeSegments[i].GetTurn()))
281 {
282 turn = m_routeSegments[i].GetTurn();
283 return;
284 }
285 }
286 CHECK(false, ("The last turn should be ReachedYourDestination."));
287}
288
289void Route::GetNearestTurn(double & distanceToTurnMeters, TurnItem & turn) const
290{

Callers

nothing calls this directly

Calls 3

IsNormalTurnFunction · 0.85
IsValidFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected