From 5dd2132ac195fe9fd8cf96368adf461987e76d78 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Fri, 16 Dec 2016 17:05:01 +0300 Subject: [PATCH] git-clang-format --- routing/bicycle_directions.cpp | 16 +++++++--------- routing/car_router.cpp | 6 +++--- routing/loaded_path_segment.hpp | 6 +----- routing/turns.cpp | 13 ++++++++----- routing/turns.hpp | 11 ++++++----- 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/routing/bicycle_directions.cpp b/routing/bicycle_directions.cpp index e5cedbb90a..5f2a5395f5 100644 --- a/routing/bicycle_directions.cpp +++ b/routing/bicycle_directions.cpp @@ -39,7 +39,6 @@ public: // turns::IRoutingResult overrides: TUnpackedPathSegments const & GetSegments() const override { return m_pathSegments; } - void GetPossibleTurns(UniNodeId const & node, m2::PointD const & /* ingoingPoint */, m2::PointD const & /* junctionPoint */, size_t & ingoingCount, TurnCandidates & outgoingTurns) const override @@ -166,7 +165,8 @@ void BicycleDirectionsEngine::Generate(IRoadGraph const & graph, vector(inSegId), - inIsForward ? TrafficInfo::RoadSegmentId::kForwardDirection - : TrafficInfo::RoadSegmentId::kReverseDirection - }}; + pathSegment.m_trafficSegs = {{inFeatureId.m_index, static_cast(inSegId), + inIsForward ? TrafficInfo::RoadSegmentId::kForwardDirection + : TrafficInfo::RoadSegmentId::kReverseDirection}}; auto const it = m_adjacentEdges.insert(make_pair(uniNodeId, move(adjacentEdges))); ASSERT(it.second, ()); @@ -227,7 +224,8 @@ void BicycleDirectionsEngine::LoadPathGeometry(UniNodeId const & uniNodeId, } FeatureType ft; - if (!GetLoader(uniNodeId.GetFeature().m_mwmId).GetFeatureByIndex(uniNodeId.GetFeature().m_index, ft)) + if (!GetLoader(uniNodeId.GetFeature().m_mwmId) + .GetFeatureByIndex(uniNodeId.GetFeature().m_index, ft)) { // The feature can't be read, therefore path geometry can't be // loaded. diff --git a/routing/car_router.cpp b/routing/car_router.cpp index 00189536b2..e05a2386d8 100644 --- a/routing/car_router.cpp +++ b/routing/car_router.cpp @@ -89,7 +89,8 @@ public: ingoingCount = 0; for (EdgeID const e : m_routingMapping.m_dataFacade.GetAdjacentEdgeRange(node.GetNodeId())) { - QueryEdge::EdgeData const data = m_routingMapping.m_dataFacade.GetEdgeData(e, node.GetNodeId()); + QueryEdge::EdgeData const data = + m_routingMapping.m_dataFacade.GetEdgeData(e, node.GetNodeId()); if (data.shortcut) continue; if (data.forward) @@ -145,8 +146,7 @@ public: outgoingTurns.isCandidatesAngleValid = true; double const a = my::RadToDeg(turns::PiMinusTwoVectorsAngle(junctionPoint, ingoingPoint, outgoingPoint)); - outgoingTurns.candidates.emplace_back(a, UniNodeId(targetNode), - ftypes::GetHighwayClass(ft)); + outgoingTurns.candidates.emplace_back(a, UniNodeId(targetNode), ftypes::GetHighwayClass(ft)); } sort(outgoingTurns.candidates.begin(), outgoingTurns.candidates.end(), diff --git a/routing/loaded_path_segment.hpp b/routing/loaded_path_segment.hpp index ad785300f0..d9dd5c8bcb 100644 --- a/routing/loaded_path_segment.hpp +++ b/routing/loaded_path_segment.hpp @@ -40,11 +40,7 @@ struct LoadedPathSegment bool m_onRoundabout; bool m_isLink; - LoadedPathSegment(UniNodeId::Type type) : m_nodeId(type) - { - Clear(); - } - + LoadedPathSegment(UniNodeId::Type type) : m_nodeId(type) { Clear(); } void Clear() { m_path.clear(); diff --git a/routing/turns.cpp b/routing/turns.cpp index e883ce66a7..c002bb1aaf 100644 --- a/routing/turns.cpp +++ b/routing/turns.cpp @@ -57,10 +57,11 @@ bool UniNodeId::operator==(UniNodeId const & rhs) const if (m_type != rhs.m_type) return false; - switch (m_type) { + switch (m_type) + { case Type::Osrm: return m_nodeId == rhs.m_nodeId; - case Type::Mwm: return m_featureId == rhs.m_featureId - && m_segId == rhs.m_segId && m_forward == rhs.m_forward; + case Type::Mwm: + return m_featureId == rhs.m_featureId && m_segId == rhs.m_segId && m_forward == rhs.m_forward; } } @@ -69,7 +70,8 @@ bool UniNodeId::operator<(UniNodeId const & rhs) const if (m_type != rhs.m_type) return m_type < rhs.m_type; - switch (m_type) { + switch (m_type) + { case Type::Osrm: return m_nodeId < rhs.m_nodeId; case Type::Mwm: if (m_featureId != rhs.m_featureId) @@ -116,7 +118,8 @@ bool UniNodeId::IsForward() const string DebugPrint(UniNodeId::Type type) { - switch (type) { + switch (type) + { case UniNodeId::Type::Osrm: return "Osrm"; case UniNodeId::Type::Mwm: return "Mwm"; } diff --git a/routing/turns.hpp b/routing/turns.hpp index 7039a41b66..43d1fd3820 100644 --- a/routing/turns.hpp +++ b/routing/turns.hpp @@ -29,9 +29,10 @@ struct UniNodeId UniNodeId(Type type) : m_type(type) {} UniNodeId(FeatureID const & featureId, uint32_t segId, bool forward) - : m_type(Type::Mwm), m_featureId(featureId), m_segId(segId), m_forward(forward) {} + : m_type(Type::Mwm), m_featureId(featureId), m_segId(segId), m_forward(forward) + { + } UniNodeId(uint32_t nodeId) : m_type(Type::Osrm), m_nodeId(nodeId) {} - bool operator==(UniNodeId const & rh) const; bool operator<(UniNodeId const & rh) const; void Clear(); @@ -44,9 +45,9 @@ private: Type m_type; /// \note In case of OSRM unique id is kept in |m_featureId.m_index|. /// So |m_featureId.m_mwmId|, |m_segId| and |m_forward| have default values. - FeatureID m_featureId; // |m_featureId.m_index| is NodeID for OSRM. - uint32_t m_segId = 0; // Not valid for OSRM. - bool m_forward = true; // Segment direction in |m_featureId|. + FeatureID m_featureId; // |m_featureId.m_index| is NodeID for OSRM. + uint32_t m_segId = 0; // Not valid for OSRM. + bool m_forward = true; // Segment direction in |m_featureId|. NodeID m_nodeId = SPECIAL_NODEID; };