#pragma once #include "drape_frontend/custom_features_context.hpp" #include "drape_frontend/map_shape.hpp" #include "drape_frontend/metaline_manager.hpp" #include "drape_frontend/tile_key.hpp" #include "drape_frontend/traffic_generator.hpp" #include "drape/pointers.hpp" #include "indexer/road_shields_parser.hpp" #include "geometry/rect2d.hpp" #include "geometry/screenbase.hpp" #include #include #include #include #include class FeatureType; namespace df { class EngineContext; class Stylist; class RuleDrawer { public: using TDrawerCallback = std::function; using TCheckCancelledCallback = std::function; using TIsCountryLoadedByNameFn = std::function; using TInsertShapeFn = function && shape)>; RuleDrawer(TDrawerCallback const & drawerFn, TCheckCancelledCallback const & checkCancelled, TIsCountryLoadedByNameFn const & isLoadedFn, ref_ptr engineContext); ~RuleDrawer(); void operator()(FeatureType const & f); private: void ProcessAreaStyle(FeatureType const & f, Stylist const & s, TInsertShapeFn const & insertShape, int & minVisibleScale); void ProcessLineStyle(FeatureType const & f, Stylist const & s, TInsertShapeFn const & insertShape, int & minVisibleScale); void ProcessPointStyle(FeatureType const & f, Stylist const & s, TInsertShapeFn const & insertShape, int & minVisibleScale); bool CheckCoastlines(FeatureType const & f, Stylist const & s); #ifdef DRAW_TILE_NET void DrawTileNet(TInsertShapeFn const & insertShape); #endif bool CheckCancelled(); TDrawerCallback m_callback; TCheckCancelledCallback m_checkCancelled; TIsCountryLoadedByNameFn m_isLoadedFn; ref_ptr m_context; CustomFeaturesContextPtr m_customFeaturesContext; std::unordered_set m_usedMetalines; m2::RectD m_globalRect; double m_currentScaleGtoP; double m_trafficScalePtoG; TrafficSegmentsGeometry m_trafficGeometry; std::array m_mapShapes; bool m_wasCancelled; GeneratedRoadShields m_generatedRoadShields; }; } // namespace df