mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
54
drape_frontend/route_builder.hpp
Normal file
54
drape_frontend/route_builder.hpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape_frontend/color_constants.hpp"
|
||||
#include "drape_frontend/route_shape.hpp"
|
||||
|
||||
#include "drape/pointers.hpp"
|
||||
|
||||
#include "traffic/speed_groups.hpp"
|
||||
|
||||
#include "geometry/polyline2d.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace dp
|
||||
{
|
||||
class TextureManager;
|
||||
class GraphicsContext;
|
||||
} // namespace dp
|
||||
|
||||
namespace df
|
||||
{
|
||||
class RouteBuilder
|
||||
{
|
||||
public:
|
||||
using FlushFn = std::function<void(drape_ptr<SubrouteData> &&)>;
|
||||
using FlushArrowsFn = std::function<void(drape_ptr<SubrouteArrowsData> &&)>;
|
||||
using FlushMarkersFn = std::function<void(drape_ptr<SubrouteMarkersData> &&)>;
|
||||
|
||||
RouteBuilder(FlushFn && flushFn, FlushArrowsFn && flushArrowsFn,
|
||||
FlushMarkersFn && flushMarkersFn);
|
||||
|
||||
void Build(ref_ptr<dp::GraphicsContext> context, dp::DrapeID subrouteId, SubrouteConstPtr subroute,
|
||||
ref_ptr<dp::TextureManager> textures, int recacheId);
|
||||
|
||||
void BuildArrows(ref_ptr<dp::GraphicsContext> context, dp::DrapeID subrouteId,
|
||||
std::vector<ArrowBorders> const & borders, ref_ptr<dp::TextureManager> textures, int recacheId);
|
||||
|
||||
void ClearRouteCache();
|
||||
|
||||
private:
|
||||
FlushFn m_flushFn;
|
||||
FlushArrowsFn m_flushArrowsFn;
|
||||
FlushMarkersFn m_flushMarkersFn;
|
||||
|
||||
struct RouteCacheData
|
||||
{
|
||||
m2::PolylineD m_polyline;
|
||||
double m_baseDepthIndex = 0.0;
|
||||
};
|
||||
std::unordered_map<dp::DrapeID, RouteCacheData> m_routeCache;
|
||||
};
|
||||
} // namespace df
|
||||
Reference in New Issue
Block a user