| 150 | } |
| 151 | |
| 152 | bool GuidesConnections::FitsForDirectLinkToGuide(size_t checkpointIdx, size_t checkpointsCount) const |
| 153 | { |
| 154 | auto it = m_checkpointsOnTracks.find(checkpointIdx); |
| 155 | CHECK(it != m_checkpointsOnTracks.end(), (checkpointIdx)); |
| 156 | bool const checkpointIsFar = it->second.m_distToProjectedPointM > kEqDistToTrackPointM; |
| 157 | if (checkpointIsFar) |
| 158 | return false; |
| 159 | |
| 160 | // If checkpoint lies on the track but its neighbour intermediate checkpoint does not, we should |
| 161 | // connect this checkpoint to the OSM graph. |
| 162 | if (checkpointsCount <= 2) |
| 163 | return true; |
| 164 | |
| 165 | for (auto const neighbourIdx : GetNeighbourIntermediatePoints(checkpointIdx, checkpointsCount)) |
| 166 | if (m_checkpointsOnTracks.find(neighbourIdx) == m_checkpointsOnTracks.end()) |
| 167 | return false; |
| 168 | |
| 169 | return true; |
| 170 | } |
| 171 | |
| 172 | void GuidesConnections::PullAdditionalCheckpointsToTracks(std::vector<m2::PointD> const & checkpoints) |
| 173 | { |