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

Method Build

libs/drape_frontend/route_builder.cpp:20–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18{}
19
20void RouteBuilder::Build(ref_ptr<dp::GraphicsContext> context, dp::DrapeID subrouteId, SubrouteConstPtr subroute,
21 ref_ptr<dp::TextureManager> textures, int recacheId)
22{
23 RouteCacheData cacheData;
24 cacheData.m_polyline = subroute->m_polyline;
25 cacheData.m_baseDepthIndex = subroute->m_baseDepthIndex;
26 m_routeCache[subrouteId] = std::move(cacheData);
27
28 std::vector<drape_ptr<df::SubrouteData>> subrouteData;
29 subrouteData.reserve(subroute->m_style.size());
30
31 ASSERT(!subroute->m_style.empty(), ());
32 for (size_t styleIndex = 0; styleIndex < subroute->m_style.size(); ++styleIndex)
33 subrouteData.push_back(RouteShape::CacheRoute(context, subrouteId, subroute, styleIndex, recacheId));
34
35 auto markersData = RouteShape::CacheMarkers(context, subrouteId, subroute, recacheId, textures);
36
37 // Flush route geometry.
38 context->Flush();
39
40 if (m_flushFn != nullptr)
41 {
42 for (auto & data : subrouteData)
43 m_flushFn(std::move(data));
44 subrouteData.clear();
45 }
46
47 if (m_flushMarkersFn != nullptr && markersData != nullptr)
48 m_flushMarkersFn(std::move(markersData));
49}
50
51void RouteBuilder::ClearRouteCache()
52{

Callers

nothing calls this directly

Calls 7

ASSERTFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
FlushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected