restructure for readability
This commit is contained in:
parent
378322f6e3
commit
036475afd0
@ -1,7 +1,7 @@
|
|||||||
|
#include "extractor/guidance/turn_handler.hpp"
|
||||||
#include "extractor/guidance/constants.hpp"
|
#include "extractor/guidance/constants.hpp"
|
||||||
#include "extractor/guidance/intersection_scenario_three_way.hpp"
|
#include "extractor/guidance/intersection_scenario_three_way.hpp"
|
||||||
#include "extractor/guidance/toolkit.hpp"
|
#include "extractor/guidance/toolkit.hpp"
|
||||||
#include "extractor/guidance/turn_handler.hpp"
|
|
||||||
|
|
||||||
#include "util/guidance/toolkit.hpp"
|
#include "util/guidance/toolkit.hpp"
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
|
|||||||
intersection[2].turn.instruction = {TurnType::OnRamp, DirectionModifier::Left};
|
intersection[2].turn.instruction = {TurnType::OnRamp, DirectionModifier::Left};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (obvious_index != 0) // has an obvious continuing road/obvious turn
|
||||||
{
|
{
|
||||||
const auto direction_at_one = getTurnDirection(intersection[1].turn.angle);
|
const auto direction_at_one = getTurnDirection(intersection[1].turn.angle);
|
||||||
const auto direction_at_two = getTurnDirection(intersection[2].turn.angle);
|
const auto direction_at_two = getTurnDirection(intersection[2].turn.angle);
|
||||||
@ -172,33 +172,36 @@ Intersection TurnHandler::handleThreeWayTurn(const EdgeID via_edge, Intersection
|
|||||||
{
|
{
|
||||||
intersection[1].turn.instruction = getInstructionForObvious(
|
intersection[1].turn.instruction = getInstructionForObvious(
|
||||||
3, via_edge, isThroughStreet(1, intersection), intersection[1]);
|
3, via_edge, isThroughStreet(1, intersection), intersection[1]);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (obvious_index != 0 && direction_at_one == direction_at_two &&
|
|
||||||
direction_at_one == DirectionModifier::Straight)
|
|
||||||
intersection[1].turn.instruction = {findBasicTurnType(via_edge, intersection[1]),
|
|
||||||
DirectionModifier::SlightRight};
|
|
||||||
else
|
|
||||||
intersection[1].turn.instruction = {findBasicTurnType(via_edge, intersection[1]),
|
|
||||||
direction_at_one};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obvious_index == 2)
|
const auto second_direction = (direction_at_one == direction_at_two &&
|
||||||
|
direction_at_two == DirectionModifier::Straight)
|
||||||
|
? DirectionModifier::SlightLeft
|
||||||
|
: direction_at_two;
|
||||||
|
|
||||||
|
intersection[2].turn.instruction = {findBasicTurnType(via_edge, intersection[2]),
|
||||||
|
second_direction};
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
BOOST_ASSERT(obvious_index == 2);
|
||||||
intersection[2].turn.instruction = getInstructionForObvious(
|
intersection[2].turn.instruction = getInstructionForObvious(
|
||||||
3, via_edge, isThroughStreet(2, intersection), intersection[2]);
|
3, via_edge, isThroughStreet(2, intersection), intersection[2]);
|
||||||
|
|
||||||
|
const auto first_direction = (direction_at_one == direction_at_two &&
|
||||||
|
direction_at_one == DirectionModifier::Straight)
|
||||||
|
? DirectionModifier::SlightRight
|
||||||
|
: direction_at_one;
|
||||||
|
|
||||||
|
intersection[1].turn.instruction = {findBasicTurnType(via_edge, intersection[1]),
|
||||||
|
first_direction};
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else // basic turn assignment
|
||||||
{
|
{
|
||||||
if (obvious_index != 0 && direction_at_one == direction_at_two &&
|
intersection[1].turn.instruction = {findBasicTurnType(via_edge, intersection[1]),
|
||||||
direction_at_two == DirectionModifier::Straight)
|
getTurnDirection(intersection[1].turn.angle)};
|
||||||
intersection[2].turn.instruction = {findBasicTurnType(via_edge, intersection[2]),
|
intersection[2].turn.instruction = {findBasicTurnType(via_edge, intersection[2]),
|
||||||
DirectionModifier::SlightLeft};
|
getTurnDirection(intersection[2].turn.angle)};
|
||||||
else
|
|
||||||
intersection[2].turn.instruction = {findBasicTurnType(via_edge, intersection[2]),
|
|
||||||
direction_at_two};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return intersection;
|
return intersection;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user