MCPcopy Create free account
hub / github.com/comaps/comaps / EnrichWithProjectionPoints

Method EnrichWithProjectionPoints

tools/openlr/candidate_points_getter.cpp:53–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void CandidatePointsGetter::EnrichWithProjectionPoints(m2::PointD const & p, std::vector<m2::PointD> & candidates)
54{
55 m_graph.ResetFakes();
56
57 std::vector<std::pair<Graph::Edge, geometry::PointWithAltitude>> vicinities;
58 m_graph.FindClosestEdges(p, static_cast<uint32_t>(m_maxProjectionCandidates), vicinities);
59 for (auto const & v : vicinities)
60 {
61 auto const & edge = v.first;
62 auto const & junction = v.second;
63
64 ASSERT(edge.HasRealPart() && !edge.IsFake(), ());
65
66 if (PointsAreClose(edge.GetStartPoint(), junction.GetPoint()) ||
67 PointsAreClose(edge.GetEndPoint(), junction.GetPoint()))
68 {
69 continue;
70 }
71
72 auto const firstHalf = Edge::MakeFake(edge.GetStartJunction(), junction, edge);
73 auto const secondHalf = Edge::MakeFake(junction, edge.GetEndJunction(), edge);
74
75 m_graph.AddOutgoingFakeEdge(firstHalf);
76 m_graph.AddIngoingFakeEdge(firstHalf);
77 m_graph.AddOutgoingFakeEdge(secondHalf);
78 m_graph.AddIngoingFakeEdge(secondHalf);
79 candidates.push_back(junction.GetPoint());
80 }
81}
82} // namespace openlr

Callers

nothing calls this directly

Calls 12

ASSERTFunction · 0.85
PointsAreCloseFunction · 0.85
HasRealPartMethod · 0.80
ResetFakesMethod · 0.45
FindClosestEdgesMethod · 0.45
IsFakeMethod · 0.45
GetStartPointMethod · 0.45
GetPointMethod · 0.45
GetEndPointMethod · 0.45
AddOutgoingFakeEdgeMethod · 0.45
AddIngoingFakeEdgeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected