Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2018-02-26 19:39:16 +0300
committermpimenov <mpimenov@users.noreply.github.com>2018-02-28 14:09:16 +0300
commitb0bfcfd3b9bd7c63835348be96ad220f5ca6724f (patch)
tree30a1238bac00f94ca8f65e3742b02d8c91b0fb57 /routing
parenta96daee16f4081ac50626e1d11b1da29ac2fdde1 (diff)
Review fixes.
Diffstat (limited to 'routing')
-rw-r--r--routing/turns.cpp36
-rw-r--r--routing/turns.hpp3
-rw-r--r--routing/turns_generator.cpp10
-rw-r--r--routing/turns_tts_text.cpp2
4 files changed, 26 insertions, 25 deletions
diff --git a/routing/turns.cpp b/routing/turns.cpp
index 6aaf370a01..41174f4f85 100644
--- a/routing/turns.cpp
+++ b/routing/turns.cpp
@@ -36,24 +36,24 @@ array<pair<LaneWay, char const *>, static_cast<size_t>(LaneWay::Count)> const g_
static_assert(g_laneWayNames.size() == static_cast<size_t>(LaneWay::Count),
"Check the size of g_laneWayNames");
-array<pair<CarDirection, char const *>, static_cast<size_t>(CarDirection::Count)> const g_turnNames = {
- {{CarDirection::None, "None"},
- {CarDirection::GoStraight, "GoStraight"},
- {CarDirection::TurnRight, "TurnRight"},
- {CarDirection::TurnSharpRight, "TurnSharpRight"},
- {CarDirection::TurnSlightRight, "TurnSlightRight"},
- {CarDirection::TurnLeft, "TurnLeft"},
- {CarDirection::TurnSharpLeft, "TurnSharpLeft"},
- {CarDirection::TurnSlightLeft, "TurnSlightLeft"},
- {CarDirection::UTurnLeft, "UTurnLeft"},
- {CarDirection::UTurnRight, "UTurnRight"},
- {CarDirection::ExitHighwayToRight, "ExitHighwayToRight"},
- {CarDirection::ExitHighwayToLeft, "ExitHighwayToLeft"},
- {CarDirection::EnterRoundAbout, "EnterRoundAbout"},
- {CarDirection::LeaveRoundAbout, "LeaveRoundAbout"},
- {CarDirection::StayOnRoundAbout, "StayOnRoundAbout"},
- {CarDirection::StartAtEndOfStreet, "StartAtEndOfStreet"},
- {CarDirection::ReachedYourDestination, "ReachedYourDestination"}}};
+array<pair<CarDirection, char const *>, static_cast<size_t>(CarDirection::Count)> const
+ g_turnNames = {{{CarDirection::None, "None"},
+ {CarDirection::GoStraight, "GoStraight"},
+ {CarDirection::TurnRight, "TurnRight"},
+ {CarDirection::TurnSharpRight, "TurnSharpRight"},
+ {CarDirection::TurnSlightRight, "TurnSlightRight"},
+ {CarDirection::TurnLeft, "TurnLeft"},
+ {CarDirection::TurnSharpLeft, "TurnSharpLeft"},
+ {CarDirection::TurnSlightLeft, "TurnSlightLeft"},
+ {CarDirection::UTurnLeft, "UTurnLeft"},
+ {CarDirection::UTurnRight, "UTurnRight"},
+ {CarDirection::EnterRoundAbout, "EnterRoundAbout"},
+ {CarDirection::LeaveRoundAbout, "LeaveRoundAbout"},
+ {CarDirection::StayOnRoundAbout, "StayOnRoundAbout"},
+ {CarDirection::StartAtEndOfStreet, "StartAtEndOfStreet"},
+ {CarDirection::ReachedYourDestination, "ReachedYourDestination"},
+ {CarDirection::ExitHighwayToLeft, "ExitHighwayToLeft"},
+ {CarDirection::ExitHighwayToRight, "ExitHighwayToRight"}}};
static_assert(g_turnNames.size() == static_cast<size_t>(CarDirection::Count),
"Check the size of g_turnNames");
} // namespace
diff --git a/routing/turns.hpp b/routing/turns.hpp
index ce7e51976a..18e7b3db2f 100644
--- a/routing/turns.hpp
+++ b/routing/turns.hpp
@@ -98,8 +98,9 @@ enum class CarDirection
StartAtEndOfStreet,
ReachedYourDestination,
- ExitHighwayToRight,
ExitHighwayToLeft,
+ ExitHighwayToRight,
+
Count /**< This value is used for internals only. */
};
diff --git a/routing/turns_generator.cpp b/routing/turns_generator.cpp
index ec73809265..96de115dd4 100644
--- a/routing/turns_generator.cpp
+++ b/routing/turns_generator.cpp
@@ -42,7 +42,7 @@ bool IsLinkOrSmallRoad(ftypes::HighwayClass hwClass, bool isLink)
/// \brief Fills |turn| with |CarDirection::ExitHighwayToRight| or |CarDirection::ExitHighwayToLeft|
/// and returns true. Or does not change |turn| and returns false.
-/// \note The method makes a decision about |turn| based on geometry of the route and turn
+/// \note The function makes a decision about |turn| based on geometry of the route and turn
/// candidates, so it works correctly for both left and right hand traffic.
bool IsExit(TurnCandidates const & possibleTurns, TurnInfo const & turnInfo,
Segment const & firstOutgoingSeg, CarDirection & turn)
@@ -57,13 +57,13 @@ bool IsExit(TurnCandidates const & possibleTurns, TurnInfo const & turnInfo,
}
// Considering cases when the route goes from a highway to a link or a small road.
- // Checking all turn candidates (sorted by its angle) and looking for the road which is a
+ // Checking all turn candidates (sorted by their angles) and looking for the road which is a
// continuation of the ingoing segment. If the continuation is on the right hand of the route
// it's an exit to the left. If the continuation is on the left hand of the route
// it's an exit to the right.
- // Note. The angle which is using for sorting turn candidates in |possibleTurns.candidates|
+ // Note. The angle which is used for sorting turn candidates in |possibleTurns.candidates|
// is a counterclockwise angle between the ingoing route edge and corresponding candidate.
- // For left turns the angle is less than zero and for it is more than zero.
+ // For left turns the angle is less than zero and for right ones it is more than zero.
bool isCandidateBeforeOutgoing = true;
bool isHighwayCandidateBeforeOutgoing = true;
size_t highwayCandidateNumber = 0;
@@ -80,7 +80,7 @@ bool IsExit(TurnCandidates const & possibleTurns, TurnInfo const & turnInfo,
{
++highwayCandidateNumber;
if (highwayCandidateNumber >= 2)
- return false; // There're two or more highway candidates from the junction.
+ return false; // There are two or more highway candidates from the junction.
isHighwayCandidateBeforeOutgoing = isCandidateBeforeOutgoing;
}
}
diff --git a/routing/turns_tts_text.cpp b/routing/turns_tts_text.cpp
index 8f464b66b6..78250ed7bd 100644
--- a/routing/turns_tts_text.cpp
+++ b/routing/turns_tts_text.cpp
@@ -159,8 +159,8 @@ string GetDirectionTextId(Notification const & notification)
return GetYouArriveTextId(notification);
case CarDirection::StayOnRoundAbout:
case CarDirection::StartAtEndOfStreet:
- case CarDirection::ExitHighwayToRight:
case CarDirection::ExitHighwayToLeft:
+ case CarDirection::ExitHighwayToRight:
case CarDirection::None:
case CarDirection::Count:
ASSERT(false, ());