From 679b83cc72c9988dc4c8e7f8c39442c2cc39b35e Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Mon, 12 Mar 2018 20:41:18 +0300 Subject: Getting rid of mutable in FollowedPolyline class. --- routing/base/followed_polyline.cpp | 4 ++-- routing/base/followed_polyline.hpp | 7 +++---- routing/route.cpp | 2 +- routing/route.hpp | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'routing') diff --git a/routing/base/followed_polyline.cpp b/routing/base/followed_polyline.cpp index eb03760871..b25e08e2bf 100644 --- a/routing/base/followed_polyline.cpp +++ b/routing/base/followed_polyline.cpp @@ -157,7 +157,7 @@ Iter FollowedPolyline::GetBestProjection(m2::RectD const & posRect, } Iter FollowedPolyline::UpdateProjectionByPrediction(m2::RectD const & posRect, - double predictDistance) const + double predictDistance) { ASSERT(m_current.IsValid(), ()); ASSERT_LESS(m_current.m_ind, m_poly.GetSize() - 1, ()); @@ -176,7 +176,7 @@ Iter FollowedPolyline::UpdateProjectionByPrediction(m2::RectD const & posRect, return res; } -Iter FollowedPolyline::UpdateProjection(m2::RectD const & posRect) const +Iter FollowedPolyline::UpdateProjection(m2::RectD const & posRect) { ASSERT(m_current.IsValid(), ()); ASSERT_LESS(m_current.m_ind, m_poly.GetSize() - 1, ()); diff --git a/routing/base/followed_polyline.hpp b/routing/base/followed_polyline.hpp index a63d0efa62..883adacb34 100644 --- a/routing/base/followed_polyline.hpp +++ b/routing/base/followed_polyline.hpp @@ -47,7 +47,6 @@ public: double GetDistanceToEndMeters() const; double GetDistFromCurPointToRoutePointMerc() const; double GetDistFromCurPointToRoutePointMeters() const; - double GetMercatorDistanceFromBegin() const; /*! \brief Return next navigation point for direction widgets. * Returns first geometry point from the polyline after your location if it is farther then @@ -71,8 +70,8 @@ public: double GetDistanceM(Iter const & it1, Iter const & it2) const; - Iter UpdateProjectionByPrediction(m2::RectD const & posRect, double predictDistance) const; - Iter UpdateProjection(m2::RectD const & posRect) const; + Iter UpdateProjectionByPrediction(m2::RectD const & posRect, double predictDistance); + Iter UpdateProjection(m2::RectD const & posRect); Iter Begin() const; Iter End() const; @@ -95,7 +94,7 @@ private: m2::PolylineD m_poly; /// Iterator with the current position. Position sets with UpdateProjection methods. - mutable Iter m_current; + Iter m_current; size_t m_nextCheckpointIndex; /// Precalculated info for fast projection finding. std::vector> m_segProj; diff --git a/routing/route.cpp b/routing/route.cpp index c83d780bc2..bc835eb24d 100644 --- a/routing/route.cpp +++ b/routing/route.cpp @@ -243,7 +243,7 @@ void Route::GetCurrentDirectionPoint(m2::PointD & pt) const m_poly.GetCurrentDirectionPoint(pt, kOnEndToleranceM); } -bool Route::MoveIterator(location::GpsInfo const & info) const +bool Route::MoveIterator(location::GpsInfo const & info) { m2::RectD const rect = MercatorBounds::MetresToXY( info.m_longitude, info.m_latitude, diff --git a/routing/route.hpp b/routing/route.hpp index 16d2fd8524..c3e7703e62 100644 --- a/routing/route.hpp +++ b/routing/route.hpp @@ -267,7 +267,7 @@ public: void GetCurrentDirectionPoint(m2::PointD & pt) const; /// @return true If position was updated successfully (projection within gps error radius). - bool MoveIterator(location::GpsInfo const & info) const; + bool MoveIterator(location::GpsInfo const & info); void MatchLocationToRoute(location::GpsInfo & location, location::RouteMatchingInfo & routeMatchingInfo) const; -- cgit v1.2.3