#pragma once #include "routing/cross_mwm_index_graph.hpp" #include "routing/edge_estimator.hpp" #include "routing/geometry.hpp" #include "routing/index_graph.hpp" #include "routing/index_graph_loader.hpp" #include "routing/segment.hpp" #include #include #include namespace routing { class WorldGraph final { public: WorldGraph(std::unique_ptr crossMwmGraph, std::unique_ptr loader, std::shared_ptr estimator); void GetEdgeList(Segment const & segment, bool isOutgoing, bool isLeap, std::vector & edges); IndexGraph & GetIndexGraph(NumMwmId numMwmId) { return m_loader->GetIndexGraph(numMwmId); } EdgeEstimator const & GetEstimator() const { return *m_estimator; } RoadGeometry const & GetRoadGeometry(NumMwmId mwmId, uint32_t featureId); // Disable edges between mwms. // Unblocking is not implemented due to YAGNI principle. void BlockMwmBorders() { m_crossMwmGraph = nullptr; } // Clear memory used by loaded index graphs. void ClearIndexGraphs() { m_loader->Clear(); } private: void GetTwins(Segment const & s, bool isOutgoing, std::vector & edges); std::unique_ptr m_crossMwmGraph; std::unique_ptr m_loader; std::shared_ptr m_estimator; std::vector m_twins; }; } // namespace routing