! * \brief Calculates a turn instruction if the ingoing edge or (and) the outgoing edge belongs to a * roundabout. * \return Returns one of the following results: * - TurnDirection::EnterRoundAbout if the ingoing edge does not belong to a roundabout * and the outgoing edge belongs to a roundabout. * - TurnDirection::StayOnRoundAbout if the ingoing edge and the outgoing edge belong to a *
| 157 | * but it is (they are) relevantly small. |
| 158 | */ |
| 159 | CarDirection GetRoundaboutDirectionBasic(bool isIngoingEdgeRoundabout, bool isOutgoingEdgeRoundabout, |
| 160 | bool isMultiTurnJunction, bool keepTurnByHighwayClass) |
| 161 | { |
| 162 | if (isIngoingEdgeRoundabout && isOutgoingEdgeRoundabout) |
| 163 | { |
| 164 | if (isMultiTurnJunction) |
| 165 | return keepTurnByHighwayClass ? CarDirection::StayOnRoundAbout : CarDirection::None; |
| 166 | return CarDirection::None; |
| 167 | } |
| 168 | |
| 169 | if (!isIngoingEdgeRoundabout && isOutgoingEdgeRoundabout) |
| 170 | return CarDirection::EnterRoundAbout; |
| 171 | |
| 172 | if (isIngoingEdgeRoundabout && !isOutgoingEdgeRoundabout) |
| 173 | return CarDirection::LeaveRoundAbout; |
| 174 | |
| 175 | ASSERT(false, ()); |
| 176 | return CarDirection::None; |
| 177 | } |
| 178 | |
| 179 | /*! |
| 180 | * \brief Returns false when other possible turns leads to service roads; |