static
| 1235 | |
| 1236 | // static |
| 1237 | bool IndexRouter::PointsOnEdgesSnapping::FindClosestCodirectionalEdge(m2::PointD const & point, |
| 1238 | m2::PointD const & direction, |
| 1239 | vector<EdgeProjectionT> const & candidates, |
| 1240 | Edge & closestCodirectionalEdge) |
| 1241 | { |
| 1242 | double constexpr kInvalidDist = numeric_limits<double>::max(); |
| 1243 | double squareDistToClosestCodirectionalEdgeM = kInvalidDist; |
| 1244 | |
| 1245 | IndexRouter::BestEdgeComparator bestEdgeComparator(point, direction); |
| 1246 | if (!bestEdgeComparator.IsDirectionValid()) |
| 1247 | return false; |
| 1248 | |
| 1249 | for (auto const & c : candidates) |
| 1250 | { |
| 1251 | auto const & edge = c.first; |
| 1252 | if (!bestEdgeComparator.IsAlmostCodirectional(edge)) |
| 1253 | continue; |
| 1254 | |
| 1255 | double const distM = bestEdgeComparator.GetSquaredDist(edge); |
| 1256 | if (distM >= squareDistToClosestCodirectionalEdgeM) |
| 1257 | continue; |
| 1258 | |
| 1259 | closestCodirectionalEdge = edge; |
| 1260 | squareDistToClosestCodirectionalEdgeM = distM; |
| 1261 | } |
| 1262 | |
| 1263 | return squareDistToClosestCodirectionalEdgeM != kInvalidDist; |
| 1264 | } |
| 1265 | |
| 1266 | bool IndexRouter::PointsOnEdgesSnapping::FindBestSegments(m2::PointD const & checkpoint, m2::PointD const & direction, |
| 1267 | bool isOutgoing, vector<Segment> & bestSegments, |
nothing calls this directly
no test coverage detected