MCPcopy Create free account
hub / github.com/comaps/comaps / UpdateProjection

Method UpdateProjection

libs/routing/base/followed_polyline.cpp:164–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164Iter FollowedPolyline::UpdateProjection(m2::RectD const & posRect)
165{
166 ASSERT(m_current.IsValid(), ());
167 ASSERT_LESS(m_current.m_ind, m_poly.GetSize() - 1, ());
168
169 Iter res;
170 m2::PointD const currPos = posRect.Center();
171 res = GetBestProjection(posRect, [&](Iter const & it) { return mercator::DistanceOnEarth(it.m_pt, currPos); });
172
173 if (res.IsValid())
174 m_current = res;
175 return res;
176}
177
178void FollowedPolyline::SetFakeSegmentIndexes(vector<size_t> && fakeSegmentIndexes)
179{

Callers 3

UNIT_TESTFunction · 0.80

Calls 5

ASSERTFunction · 0.85
DistanceOnEarthFunction · 0.50
IsValidMethod · 0.45
GetSizeMethod · 0.45
CenterMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64