diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-05-25 18:40:03 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2016-05-27 14:17:13 +0300 |
commit | c51114a4779d93665fdeac54a0e2600bc2195933 (patch) | |
tree | 1bd20625e1cc9f82d371356b226603c1beec951f /routing/features_road_graph.cpp | |
parent | d797fc0ff1e38c048d13652d9125ff7a97667ce6 (diff) |
[bicycle routing] Taking into account oneway osm tag (road direction) while bicycle routing.
Diffstat (limited to 'routing/features_road_graph.cpp')
-rw-r--r-- | routing/features_road_graph.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/routing/features_road_graph.cpp b/routing/features_road_graph.cpp index 65e5b039bc..1fa3793f48 100644 --- a/routing/features_road_graph.cpp +++ b/routing/features_road_graph.cpp @@ -101,9 +101,9 @@ void FeaturesRoadGraph::RoadInfoCache::Clear() m_cache.clear(); } - -FeaturesRoadGraph::FeaturesRoadGraph(Index & index, unique_ptr<IVehicleModelFactory> && vehicleModelFactory) - : m_index(index), +FeaturesRoadGraph::FeaturesRoadGraph(Index const & index, bool onewayAsBidirectional, + unique_ptr<IVehicleModelFactory> && vehicleModelFactory) + : m_index(index), m_onewayAsBidirectional(onewayAsBidirectional), m_vehicleModel(move(vehicleModelFactory)) { } @@ -114,7 +114,7 @@ class CrossFeaturesLoader { public: CrossFeaturesLoader(FeaturesRoadGraph const & graph, - IRoadGraph::CrossEdgesLoader & edgesLoader) + IRoadGraph::ICrossEdgesLoader & edgesLoader) : m_graph(graph), m_edgesLoader(edgesLoader) {} @@ -136,7 +136,7 @@ public: private: FeaturesRoadGraph const & m_graph; - IRoadGraph::CrossEdgesLoader & m_edgesLoader; + IRoadGraph::ICrossEdgesLoader & m_edgesLoader; }; IRoadGraph::RoadInfo FeaturesRoadGraph::GetRoadInfo(FeatureID const & featureId) const @@ -159,7 +159,7 @@ double FeaturesRoadGraph::GetMaxSpeedKMPH() const } void FeaturesRoadGraph::ForEachFeatureClosestToCross(m2::PointD const & cross, - CrossEdgesLoader & edgesLoader) const + ICrossEdgesLoader & edgesLoader) const { CrossFeaturesLoader featuresLoader(*this, edgesLoader); m2::RectD const rect = MercatorBounds::RectByCenterXYAndSizeInMeters(cross, kMwmRoadCrossingRadiusMeters); @@ -230,6 +230,11 @@ void FeaturesRoadGraph::GetJunctionTypes(Junction const & junction, feature::Typ m_index.ForEachInRect(f, rect, GetStreetReadScale()); } +bool FeaturesRoadGraph::ConsiderOnewayFeaturesAsBidirectional() const +{ + return m_onewayAsBidirectional; +}; + void FeaturesRoadGraph::ClearState() { m_cache.Clear(); |