#pragma once #include "drape_frontend/color_constants.hpp" #include "drape_frontend/route_shape.hpp" #include "drape/pointers.hpp" #include "drape/texture_manager.hpp" #include "traffic/speed_groups.hpp" #include "geometry/polyline2d.hpp" #include "std/function.hpp" #include "std/unordered_map.hpp" namespace df { class RouteBuilder { public: using TFlushRouteFn = function &&)>; using TFlushRouteSignFn = function &&)>; using TFlushRouteArrowsFn = function &&)>; RouteBuilder(TFlushRouteFn const & flushRouteFn, TFlushRouteSignFn const & flushRouteSignFn, TFlushRouteArrowsFn const & flushRouteArrowsFn); void Build(m2::PolylineD const & routePolyline, vector const & turns, df::ColorConstant color, vector const & traffic, df::RoutePattern const & pattern, ref_ptr textures, int recacheId); void BuildArrows(int routeIndex, vector const & borders, ref_ptr textures, int recacheId); void BuildSign(m2::PointD const & pos, bool isStart, bool isValid, ref_ptr textures, int recacheId); void ClearRouteCache(); private: TFlushRouteFn m_flushRouteFn; TFlushRouteSignFn m_flushRouteSignFn; TFlushRouteArrowsFn m_flushRouteArrowsFn; int m_routeIndex = 0; unordered_map m_routeCache; }; } // namespace df