diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2019-04-15 15:47:20 +0300 |
---|---|---|
committer | gmoryes <gmoryes@gmail.com> | 2019-06-10 14:00:38 +0300 |
commit | c0719b452d727560ca2fefc4bcfbd461f8856d4a (patch) | |
tree | b31100e67c3e65f7530a78c3f966fe87499b4a89 /routing | |
parent | a7900d43829c5335cf95cdcb6480a01b9f241d02 (diff) |
Crossroads
Diffstat (limited to 'routing')
-rw-r--r-- | routing/features_road_graph.cpp | 5 | ||||
-rw-r--r-- | routing/features_road_graph.hpp | 1 | ||||
-rw-r--r-- | routing/geometry.cpp | 1 | ||||
-rw-r--r-- | routing/geometry.hpp | 4 | ||||
-rw-r--r-- | routing/road_point.hpp | 2 | ||||
-rw-r--r-- | routing/transit_world_graph.cpp | 2 |
6 files changed, 13 insertions, 2 deletions
diff --git a/routing/features_road_graph.cpp b/routing/features_road_graph.cpp index da5f9ecf10..8f5292682d 100644 --- a/routing/features_road_graph.cpp +++ b/routing/features_road_graph.cpp @@ -57,6 +57,11 @@ SpeedKMpH FeaturesRoadGraph::CrossCountryVehicleModel::GetSpeed( return GetVehicleModel(f.GetID())->GetSpeed(f, speedParams); } +HighwayType FeaturesRoadGraph::CrossCountryVehicleModel::GetHighwayType(FeatureType & f) const +{ + return GetVehicleModel(f.GetID())->GetHighwayType(f); +} + double FeaturesRoadGraph::CrossCountryVehicleModel::GetOffroadSpeed() const { return m_offroadSpeedKMpH; diff --git a/routing/features_road_graph.hpp b/routing/features_road_graph.hpp index 84297e0919..c5686552b3 100644 --- a/routing/features_road_graph.hpp +++ b/routing/features_road_graph.hpp @@ -34,6 +34,7 @@ private: // VehicleModelInterface overrides: SpeedKMpH GetSpeed(FeatureType & f, SpeedParams const & speedParams) const override; + HighwayType GetHighwayType(FeatureType & f) const override; double GetMaxWeightSpeed() const override { return m_maxSpeed; }; double GetOffroadSpeed() const override; bool IsOneWay(FeatureType & f) const override; diff --git a/routing/geometry.cpp b/routing/geometry.cpp index c8a13042f3..f7f10d693d 100644 --- a/routing/geometry.cpp +++ b/routing/geometry.cpp @@ -159,6 +159,7 @@ void RoadGeometry::Load(VehicleModelInterface const & vehicleModel, FeatureType m_isOneWay = vehicleModel.IsOneWay(feature); m_forwardSpeed = vehicleModel.GetSpeed(feature, {true /* forward */, inCity, maxspeed}); m_backwardSpeed = vehicleModel.GetSpeed(feature, {false /* forward */, inCity, maxspeed}); + m_highwayType = vehicleModel.GetHighwayType(feature); m_isPassThroughAllowed = vehicleModel.IsPassThroughAllowed(feature); feature::TypesHolder types(feature); diff --git a/routing/geometry.hpp b/routing/geometry.hpp index a7d88a0a13..d5e819303c 100644 --- a/routing/geometry.hpp +++ b/routing/geometry.hpp @@ -20,6 +20,8 @@ #include <memory> #include <string> +#include <boost/optional.hpp> + class DataSource; namespace routing @@ -37,6 +39,7 @@ public: bool IsOneWay() const { return m_isOneWay; } SpeedKMpH const & GetSpeed(bool forward) const; + HighwayType GetHighwayType() const { return *m_highwayType; } bool IsPassThroughAllowed() const { return m_isPassThroughAllowed; } Junction const & GetJunction(uint32_t junctionId) const @@ -77,6 +80,7 @@ private: buffer_vector<Junction, 32> m_junctions; SpeedKMpH m_forwardSpeed; SpeedKMpH m_backwardSpeed; + boost::optional<HighwayType> m_highwayType; bool m_isOneWay = false; bool m_valid = false; bool m_isPassThroughAllowed = false; diff --git a/routing/road_point.hpp b/routing/road_point.hpp index dab000bec5..8c450eecb0 100644 --- a/routing/road_point.hpp +++ b/routing/road_point.hpp @@ -41,7 +41,7 @@ public: struct Hash { - uint64_t operator() (RoadPoint const & roadPoint) const + uint64_t operator()(RoadPoint const & roadPoint) const { uint32_t featureId = roadPoint.m_featureId; uint32_t pointId = roadPoint.m_pointId; diff --git a/routing/transit_world_graph.cpp b/routing/transit_world_graph.cpp index e45fea6ed5..1d1a8d34f7 100644 --- a/routing/transit_world_graph.cpp +++ b/routing/transit_world_graph.cpp @@ -156,7 +156,7 @@ RouteWeight TransitWorldGraph::CalcOffroadWeight(m2::PointD const & from, return RouteWeight(m_estimator->CalcOffroadWeight(from, to)); } -double TransitWorldGraph::CalcSegmentETA(routing::Segment const & segment) +double TransitWorldGraph::CalcSegmentETA(Segment const & segment) { // TODO: Separate weight and ETA of transit segments. if (TransitGraph::IsTransitSegment(segment)) |