| 51 | } |
| 52 | |
| 53 | void 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 |
nothing calls this directly
no test coverage detected