diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2018-01-17 10:10:23 +0300 |
---|---|---|
committer | Yuri Gorshenin <mipt.vi002@gmail.com> | 2018-01-17 16:46:08 +0300 |
commit | 06547fe263a3e915b8df91ff4c17aded30cf9d14 (patch) | |
tree | e54a287e521dbfd73619b6507c49902b29d72736 /routing/turns.cpp | |
parent | 621fdd181da838828a0b51132b6f0b4d960b46f2 (diff) |
Fixing assert for segment uniqueness in route.
Diffstat (limited to 'routing/turns.cpp')
-rw-r--r-- | routing/turns.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/routing/turns.cpp b/routing/turns.cpp index 15069973b5..6bc8c1970c 100644 --- a/routing/turns.cpp +++ b/routing/turns.cpp @@ -89,6 +89,11 @@ void SegmentRange::Clear() m_forward = true; } +bool SegmentRange::IsClear() const +{ + return m_featureId == FeatureID() && m_startSegId == 0 && m_endSegId == 0 && m_forward; +} + FeatureID const & SegmentRange::GetFeature() const { return m_featureId; @@ -99,6 +104,17 @@ bool SegmentRange::IsCorrect() const return (m_forward && m_startSegId <= m_endSegId) || (!m_forward && m_endSegId <= m_startSegId); } +string DebugPrint(SegmentRange const & segmentRange) +{ + stringstream out; + out << "SegmentRange [ m_featureId = " << DebugPrint(segmentRange.m_featureId) + << ", m_startSegId = " << segmentRange.m_startSegId + << ", m_endSegId = " << segmentRange.m_endSegId + << ", m_forward = " << segmentRange.m_forward + << ", ]" << endl; + return out.str(); +} + namespace turns { // SingleLaneInfo --------------------------------------------------------------------------------- |