2016-05-12 12:50:10 -04:00
|
|
|
#ifndef OSRM_EXTRACTION_TURN_HPP
|
|
|
|
#define OSRM_EXTRACTION_TURN_HPP
|
|
|
|
|
|
|
|
#include <boost/numeric/conversion/cast.hpp>
|
|
|
|
|
|
|
|
#include <extractor/guidance/intersection.hpp>
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace extractor
|
|
|
|
{
|
|
|
|
|
|
|
|
struct ExtractionTurn
|
|
|
|
{
|
2017-08-15 10:53:27 -04:00
|
|
|
ExtractionTurn(const guidance::ConnectedRoad &turn,
|
|
|
|
bool has_traffic_light,
|
|
|
|
bool source_restricted,
|
|
|
|
bool target_restricted,
|
|
|
|
bool is_left_hand_driving)
|
2016-05-12 12:50:10 -04:00
|
|
|
: angle(180. - turn.angle), turn_type(turn.instruction.type),
|
|
|
|
direction_modifier(turn.instruction.direction_modifier),
|
2017-08-15 10:53:27 -04:00
|
|
|
has_traffic_light(has_traffic_light), source_restricted(source_restricted),
|
|
|
|
target_restricted(target_restricted), is_left_hand_driving(is_left_hand_driving),
|
|
|
|
weight(0.), duration(0.)
|
2016-05-12 12:50:10 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-08-15 10:53:27 -04:00
|
|
|
ExtractionTurn(bool has_traffic_light,
|
|
|
|
bool source_restricted,
|
|
|
|
bool target_restricted,
|
|
|
|
bool is_left_hand_driving)
|
2017-07-20 08:03:39 -04:00
|
|
|
: angle(0), turn_type(guidance::TurnType::NoTurn),
|
|
|
|
direction_modifier(guidance::DirectionModifier::Straight),
|
2017-08-15 10:53:27 -04:00
|
|
|
has_traffic_light(has_traffic_light), source_restricted(source_restricted),
|
|
|
|
target_restricted(target_restricted), is_left_hand_driving(is_left_hand_driving),
|
|
|
|
weight(0.), duration(0.)
|
2017-07-20 08:03:39 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-05-12 12:50:10 -04:00
|
|
|
const double angle;
|
|
|
|
const guidance::TurnType::Enum turn_type;
|
|
|
|
const guidance::DirectionModifier::Enum direction_modifier;
|
|
|
|
const bool has_traffic_light;
|
2017-08-15 10:53:27 -04:00
|
|
|
const bool source_restricted;
|
|
|
|
const bool target_restricted;
|
|
|
|
const bool is_left_hand_driving;
|
|
|
|
|
2016-05-12 12:50:10 -04:00
|
|
|
double weight;
|
|
|
|
double duration;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|