mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 21:33:59 +00:00
# Conflicts: # CMakeLists.txt # android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java # android/sdk/src/main/cpp/app/organicmaps/sdk/Framework.hpp # android/sdk/src/main/cpp/app/organicmaps/sdk/OrganicMaps.cpp # android/sdk/src/main/cpp/app/organicmaps/sdk/util/Config.cpp # libs/indexer/data_source.hpp # libs/indexer/feature.hpp # libs/indexer/ftypes_matcher.hpp # libs/map/framework.cpp # libs/map/traffic_manager.cpp # libs/routing/absent_regions_finder.cpp # libs/routing/edge_estimator.hpp # libs/routing/index_router.cpp # libs/routing/index_router.hpp # libs/routing/routing_session.hpp # libs/routing_common/num_mwm_id.hpp # libs/traffic/traffic_info.cpp # qt/mainwindow.hpp # qt/preferences_dialog.cpp # tools/openlr/helpers.hpp # tools/openlr/openlr_decoder.cpp # tools/openlr/openlr_decoder.hpp # tools/openlr/openlr_stat/openlr_stat.cpp # tools/openlr/router.hpp # tools/openlr/score_candidate_paths_getter.cpp # tools/openlr/score_candidate_paths_getter.hpp # xcode/CoMaps.xcworkspace/contents.xcworkspacedata
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "openlr/graph.hpp"
|
|
#include "openlr/score_types.hpp"
|
|
#include "openlr/stats.hpp"
|
|
|
|
#include "indexer/data_source.hpp"
|
|
|
|
#include "geometry/point2d.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <functional>
|
|
#include <vector>
|
|
|
|
namespace openlr
|
|
{
|
|
class ScoreCandidatePointsGetter
|
|
{
|
|
public:
|
|
ScoreCandidatePointsGetter(size_t maxJunctionCandidates, size_t maxProjectionCandidates,
|
|
DataSource const & dataSource, Graph & graph)
|
|
: m_maxJunctionCandidates(maxJunctionCandidates)
|
|
, m_maxProjectionCandidates(maxProjectionCandidates)
|
|
, m_dataSource(dataSource)
|
|
, m_graph(graph)
|
|
{}
|
|
|
|
void GetEdgeCandidates(m2::PointD const & p, bool isLastPoint, ScoreEdgeVec & edges)
|
|
{
|
|
GetJunctionPointCandidates(p, isLastPoint, edges);
|
|
EnrichWithProjectionPoints(p, edges);
|
|
}
|
|
|
|
private:
|
|
void GetJunctionPointCandidates(m2::PointD const & p, bool isLastPoint, ScoreEdgeVec & edgeCandidates);
|
|
void EnrichWithProjectionPoints(m2::PointD const & p, ScoreEdgeVec & edgeCandidates);
|
|
|
|
/**
|
|
* @return true if `p` is a junction and false otherwise.
|
|
*/
|
|
bool IsJunction(m2::PointD const & p);
|
|
Score GetScoreByDistance(m2::PointD const & point, m2::PointD const & candidate);
|
|
|
|
size_t const m_maxJunctionCandidates;
|
|
size_t const m_maxProjectionCandidates;
|
|
|
|
DataSource const & m_dataSource;
|
|
Graph & m_graph;
|
|
};
|
|
} // namespace openlr
|