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

Function HasSingleForwardTurn

libs/routing/turns_generator.cpp:245–261  ·  view source on GitHub ↗

\returns true if there is exactly 1 turn in |turnCandidates| with angle less then |kMaxForwardAngleCandidates|.

Source from the content-addressed store, hash-verified

243/// \returns true if there is exactly 1 turn in |turnCandidates| with angle less then
244/// |kMaxForwardAngleCandidates|.
245bool HasSingleForwardTurn(TurnCandidates const & turnCandidates, float maxForwardAngleCandidates)
246{
247 bool foundForwardTurn = false;
248
249 for (auto const & turn : turnCandidates.candidates)
250 {
251 if (std::fabs(turn.m_angle) < maxForwardAngleCandidates)
252 {
253 if (foundForwardTurn)
254 return false;
255
256 foundForwardTurn = true;
257 }
258 }
259
260 return foundForwardTurn;
261}
262
263double CalcTurnAngle(IRoutingResult const & result, size_t const outgoingSegmentIndex, NumMwmIds const & numMwmIds,
264 RoutingSettings const & vehicleSettings)

Callers 1

GetTurnDirectionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected