| 51 | } |
| 52 | |
| 53 | std::optional<FakeEnding> RegionsSparseGraph::GetFakeEnding(m2::PointD const & point) const |
| 54 | { |
| 55 | auto const country = platform::CountryFile(m_countryFileGetterFn(point)); |
| 56 | if (country.IsEmpty()) |
| 57 | return {}; |
| 58 | NumMwmId const mwmId = m_numMwmIds->GetId(country); |
| 59 | auto const it = m_graph.m_mwms.find(mwmId); |
| 60 | if (it == m_graph.m_mwms.end()) |
| 61 | return {}; |
| 62 | |
| 63 | FakeEnding ending; |
| 64 | |
| 65 | ending.m_originJunction = LatLonWithAltitude(mercator::ToLatLon(point), 0); |
| 66 | |
| 67 | for (auto const & segmentId : it->second) |
| 68 | { |
| 69 | CrossBorderSegment const & data = GetDataById(segmentId); |
| 70 | |
| 71 | bool const oneWay = false; |
| 72 | auto const & frontJunction = data.m_end.m_point; |
| 73 | auto const & backJunction = data.m_start.m_point; |
| 74 | |
| 75 | auto const & projectedJunction = CalcProjectionToSegment(backJunction, frontJunction, point); |
| 76 | |
| 77 | Segment const segment(data.m_start.m_numMwmId, segmentId /* featureId */, 0 /* segmentIdx */, true /* isForward */); |
| 78 | |
| 79 | ending.m_projections.emplace_back(segment, oneWay, frontJunction, backJunction, projectedJunction); |
| 80 | } |
| 81 | |
| 82 | return ending; |
| 83 | } |
| 84 | |
| 85 | double GetWeight(CrossBorderSegment const & toSeg, LatLonWithAltitude const & coordFrom, NumMwmId fromMwm) |
| 86 | { |
nothing calls this directly
no test coverage detected