Format with clang-format 3.8
This commit is contained in:
@@ -9,10 +9,10 @@ namespace guidance
|
||||
{
|
||||
enum class RoundaboutType
|
||||
{
|
||||
None, // not a roundabout
|
||||
Roundabout, // standard roundabout
|
||||
Rotary, // traffic circle (large roundabout) with dedicated name
|
||||
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
|
||||
None, // not a roundabout
|
||||
Roundabout, // standard roundabout
|
||||
Rotary, // traffic circle (large roundabout) with dedicated name
|
||||
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
|
||||
};
|
||||
} /* namespace guidance */
|
||||
} /* namespace extractor */
|
||||
|
||||
@@ -70,7 +70,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
};
|
||||
|
||||
for (auto compressed_geometry_itr = compressed_geometry_begin;
|
||||
compressed_geometry_itr != compressed_geometry_end; ++compressed_geometry_itr)
|
||||
compressed_geometry_itr != compressed_geometry_end;
|
||||
++compressed_geometry_itr)
|
||||
{
|
||||
const auto next_coordinate =
|
||||
extractCoordinateFromNode(query_nodes[compressed_geometry_itr->node_id]);
|
||||
@@ -82,7 +83,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
if (distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
|
||||
return util::coordinate_calculation::interpolateLinear(
|
||||
getFactor(distance_to_current_coordinate, distance_to_next_coordinate),
|
||||
current_coordinate, next_coordinate);
|
||||
current_coordinate,
|
||||
next_coordinate);
|
||||
|
||||
// prepare for next iteration
|
||||
current_coordinate = next_coordinate;
|
||||
@@ -98,7 +100,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
|
||||
return util::coordinate_calculation::interpolateLinear(
|
||||
getFactor(distance_to_current_coordinate, distance_to_next_coordinate),
|
||||
current_coordinate, final_coordinate);
|
||||
current_coordinate,
|
||||
final_coordinate);
|
||||
else
|
||||
return final_coordinate;
|
||||
}
|
||||
@@ -280,10 +283,14 @@ inline double getTurnConfidence(const double angle, TurnInstruction instruction)
|
||||
// swaps left <-> right modifier types
|
||||
inline DirectionModifier::Enum mirrorDirectionModifier(const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr DirectionModifier::Enum results[] = {
|
||||
DirectionModifier::UTurn, DirectionModifier::SharpLeft, DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft, DirectionModifier::Straight, DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right, DirectionModifier::SharpRight};
|
||||
const constexpr DirectionModifier::Enum results[] = {DirectionModifier::UTurn,
|
||||
DirectionModifier::SharpLeft,
|
||||
DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft,
|
||||
DirectionModifier::Straight,
|
||||
DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right,
|
||||
DirectionModifier::SharpRight};
|
||||
return results[modifier];
|
||||
}
|
||||
|
||||
@@ -380,8 +387,10 @@ inline bool requiresNameAnnounced(const std::string &from,
|
||||
return false;
|
||||
if (!checkTable(first_prefix_and_suffixes.first))
|
||||
return false;
|
||||
return !first.compare(first_prefix_and_suffixes.first.length(), std::string::npos,
|
||||
second, second_prefix_and_suffixes.first.length(),
|
||||
return !first.compare(first_prefix_and_suffixes.first.length(),
|
||||
std::string::npos,
|
||||
second,
|
||||
second_prefix_and_suffixes.first.length(),
|
||||
std::string::npos);
|
||||
}();
|
||||
|
||||
@@ -390,8 +399,10 @@ inline bool requiresNameAnnounced(const std::string &from,
|
||||
return false;
|
||||
if (!checkTable(first_prefix_and_suffixes.second))
|
||||
return false;
|
||||
return !first.compare(0, first.length() - first_prefix_and_suffixes.second.length(),
|
||||
second, 0,
|
||||
return !first.compare(0,
|
||||
first.length() - first_prefix_and_suffixes.second.length(),
|
||||
second,
|
||||
0,
|
||||
second.length() - second_prefix_and_suffixes.second.length());
|
||||
}();
|
||||
|
||||
@@ -421,8 +432,8 @@ inline int getPriority(const FunctionalRoadClass road_class)
|
||||
// The road priorities indicate which roads can bee seen as more or less equal.
|
||||
// They are used in Fork-Discovery. Possibly should be moved to profiles post v5?
|
||||
// A fork can happen between road types that are at most 1 priority apart from each other
|
||||
const constexpr int road_priority[] = {10, 0, 10, 2, 10, 4, 10, 6,
|
||||
10, 8, 10, 11, 10, 12, 10, 14};
|
||||
const constexpr int road_priority[] = {
|
||||
10, 0, 10, 2, 10, 4, 10, 6, 10, 8, 10, 11, 10, 12, 10, 14};
|
||||
return road_priority[static_cast<int>(road_class)];
|
||||
}
|
||||
|
||||
@@ -441,10 +452,14 @@ inline bool canBeSeenAsFork(const FunctionalRoadClass first, const FunctionalRoa
|
||||
// turn and vice versa.
|
||||
inline ConnectedRoad mirror(ConnectedRoad road)
|
||||
{
|
||||
const constexpr DirectionModifier::Enum mirrored_modifiers[] = {
|
||||
DirectionModifier::UTurn, DirectionModifier::SharpLeft, DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft, DirectionModifier::Straight, DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right, DirectionModifier::SharpRight};
|
||||
const constexpr DirectionModifier::Enum mirrored_modifiers[] = {DirectionModifier::UTurn,
|
||||
DirectionModifier::SharpLeft,
|
||||
DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft,
|
||||
DirectionModifier::Straight,
|
||||
DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right,
|
||||
DirectionModifier::SharpRight};
|
||||
|
||||
if (angularDeviation(road.turn.angle, 0) > std::numeric_limits<double>::epsilon())
|
||||
{
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
#ifndef OSRM_GUIDANCE_TURN_CLASSIFICATION_HPP_
|
||||
#define OSRM_GUIDANCE_TURN_CLASSIFICATION_HPP_
|
||||
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/guidance/toolkit.hpp"
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/guidance/entry_class.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "util/guidance/entry_class.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -26,7 +24,7 @@ namespace extractor
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
std::pair<util::guidance::EntryClass,util::guidance::BearingClass>
|
||||
std::pair<util::guidance::EntryClass, util::guidance::BearingClass>
|
||||
classifyIntersection(NodeID nid,
|
||||
const Intersection &intersection,
|
||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
|
||||
@@ -101,7 +101,9 @@ struct TurnInstruction
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum enter_instruction[] = {
|
||||
TurnType::Invalid, TurnType::EnterRoundabout, TurnType::EnterRotary,
|
||||
TurnType::Invalid,
|
||||
TurnType::EnterRoundabout,
|
||||
TurnType::EnterRotary,
|
||||
TurnType::EnterRoundaboutIntersection};
|
||||
return {enter_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
@@ -109,9 +111,10 @@ struct TurnInstruction
|
||||
static TurnInstruction EXIT_ROUNDABOUT(const RoundaboutType roundabout_type,
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum exit_instruction[] = {
|
||||
TurnType::Invalid, TurnType::ExitRoundabout, TurnType::ExitRotary,
|
||||
TurnType::ExitRoundaboutIntersection};
|
||||
const constexpr TurnType::Enum exit_instruction[] = {TurnType::Invalid,
|
||||
TurnType::ExitRoundabout,
|
||||
TurnType::ExitRotary,
|
||||
TurnType::ExitRoundaboutIntersection};
|
||||
return {exit_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
|
||||
@@ -119,7 +122,9 @@ struct TurnInstruction
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum exit_instruction[] = {
|
||||
TurnType::Invalid, TurnType::EnterAndExitRoundabout, TurnType::EnterAndExitRotary,
|
||||
TurnType::Invalid,
|
||||
TurnType::EnterAndExitRoundabout,
|
||||
TurnType::EnterAndExitRotary,
|
||||
TurnType::EnterAndExitRoundaboutIntersection};
|
||||
return {exit_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
@@ -128,7 +133,9 @@ struct TurnInstruction
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum enter_instruction[] = {
|
||||
TurnType::Invalid, TurnType::EnterRoundaboutAtExit, TurnType::EnterRotaryAtExit,
|
||||
TurnType::Invalid,
|
||||
TurnType::EnterRoundaboutAtExit,
|
||||
TurnType::EnterRotaryAtExit,
|
||||
TurnType::EnterRoundaboutIntersectionAtExit};
|
||||
return {enter_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user