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

Method CacheRouteArrows

libs/drape_frontend/route_renderer.cpp:281–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281void RouteRenderer::CacheRouteArrows(ScreenBase const & screen, dp::DrapeID subrouteId,
282 std::vector<ArrowBorders> && arrowBorders,
283 CacheRouteArrowsCallback const & cacheCallback)
284{
285 ASSERT(cacheCallback != nullptr, ());
286 auto const it = FindSubroute(m_subroutes, subrouteId);
287 if (it == m_subroutes.end())
288 return;
289
290 auto & subrouteInfo = *it;
291
292 double zoom = 0.0;
293 float halfWidth = 0.0;
294 InterpolateByZoom(subrouteInfo.m_subroute, screen, halfWidth, zoom);
295
296 if (arrowBorders.empty() || zoom < kArrowAppearingZoomLevel)
297 {
298 // Clear arrows.
299 subrouteInfo.m_arrowsData.reset();
300 subrouteInfo.m_arrowBorders.clear();
301 }
302 else if (!AreEqualArrowBorders(arrowBorders, subrouteInfo.m_arrowBorders))
303 {
304 subrouteInfo.m_arrowBorders = std::move(arrowBorders);
305 cacheCallback(subrouteInfo.m_subrouteId, subrouteInfo.m_arrowBorders);
306 }
307}
308
309void RouteRenderer::UpdatePreview(ScreenBase const & screen)
310{

Callers

nothing calls this directly

Calls 8

ASSERTFunction · 0.85
FindSubrouteFunction · 0.85
InterpolateByZoomFunction · 0.85
AreEqualArrowBordersFunction · 0.85
endMethod · 0.45
emptyMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected