From 7073403f1be79b4b80e89d48fdd177d71e88c8ce Mon Sep 17 00:00:00 2001 From: Moritz Kobitzsch Date: Wed, 9 Nov 2016 10:34:47 +0100 Subject: [PATCH] rip out dedicated file for single function (minor refactor) --- .../intersection_scenario_three_way.hpp | 22 --------------- .../intersection_scenario_three_way.cpp | 28 ------------------- src/extractor/guidance/sliproad_handler.cpp | 1 - src/extractor/guidance/turn_handler.cpp | 13 ++++++++- 4 files changed, 12 insertions(+), 52 deletions(-) delete mode 100644 include/extractor/guidance/intersection_scenario_three_way.hpp delete mode 100644 src/extractor/guidance/intersection_scenario_three_way.cpp diff --git a/include/extractor/guidance/intersection_scenario_three_way.hpp b/include/extractor/guidance/intersection_scenario_three_way.hpp deleted file mode 100644 index 70bfc22ff..000000000 --- a/include/extractor/guidance/intersection_scenario_three_way.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_SCENARIO_THREE_WAY_HPP_ -#define OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_SCENARIO_THREE_WAY_HPP_ - -#include "extractor/guidance/intersection.hpp" - -namespace osrm -{ -namespace extractor -{ -namespace guidance -{ - -// Ending in a T-Intersection -bool isEndOfRoad(const ConnectedRoad &uturn, - const ConnectedRoad &possible_right_turn, - const ConnectedRoad &possible_left_turn); - -} // namespace guidance -} // namespace extractor -} // namespace osrm - -#endif /*OSRM_EXTRACTOR_GUIDANCE_INTERSECTION_SCENARIO_THREE_WAY_HPP_*/ diff --git a/src/extractor/guidance/intersection_scenario_three_way.cpp b/src/extractor/guidance/intersection_scenario_three_way.cpp deleted file mode 100644 index dce8c017b..000000000 --- a/src/extractor/guidance/intersection_scenario_three_way.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "extractor/guidance/intersection_scenario_three_way.hpp" -#include "extractor/guidance/constants.hpp" -#include "extractor/guidance/toolkit.hpp" - -#include "util/guidance/toolkit.hpp" - -using osrm::util::guidance::angularDeviation; - -namespace osrm -{ -namespace extractor -{ -namespace guidance -{ - -bool isEndOfRoad(const ConnectedRoad &, - const ConnectedRoad &possible_right_turn, - const ConnectedRoad &possible_left_turn) -{ - return angularDeviation(possible_right_turn.angle, 90) < NARROW_TURN_ANGLE && - angularDeviation(possible_left_turn.angle, 270) < NARROW_TURN_ANGLE && - angularDeviation(possible_right_turn.angle, possible_left_turn.angle) > - 2 * NARROW_TURN_ANGLE; -} - -} // namespace guidance -} // namespace extractor -} // namespace osrm diff --git a/src/extractor/guidance/sliproad_handler.cpp b/src/extractor/guidance/sliproad_handler.cpp index 55bb4e468..6de847851 100644 --- a/src/extractor/guidance/sliproad_handler.cpp +++ b/src/extractor/guidance/sliproad_handler.cpp @@ -1,6 +1,5 @@ #include "extractor/guidance/sliproad_handler.hpp" #include "extractor/guidance/constants.hpp" -#include "extractor/guidance/intersection_scenario_three_way.hpp" #include "extractor/guidance/toolkit.hpp" #include "util/guidance/toolkit.hpp" diff --git a/src/extractor/guidance/turn_handler.cpp b/src/extractor/guidance/turn_handler.cpp index 755567a2b..9a20ccb60 100644 --- a/src/extractor/guidance/turn_handler.cpp +++ b/src/extractor/guidance/turn_handler.cpp @@ -1,6 +1,5 @@ #include "extractor/guidance/turn_handler.hpp" #include "extractor/guidance/constants.hpp" -#include "extractor/guidance/intersection_scenario_three_way.hpp" #include "extractor/guidance/toolkit.hpp" #include "util/guidance/toolkit.hpp" @@ -21,6 +20,18 @@ namespace extractor { namespace guidance { +namespace +{ +bool isEndOfRoad(const ConnectedRoad &, + const ConnectedRoad &possible_right_turn, + const ConnectedRoad &possible_left_turn) +{ + return angularDeviation(possible_right_turn.angle, 90) < NARROW_TURN_ANGLE && + angularDeviation(possible_left_turn.angle, 270) < NARROW_TURN_ANGLE && + angularDeviation(possible_right_turn.angle, possible_left_turn.angle) > + 2 * NARROW_TURN_ANGLE; +} +} TurnHandler::TurnHandler(const util::NodeBasedDynamicGraph &node_based_graph, const std::vector &node_info_list,