| 256 | } |
| 257 | |
| 258 | bool RestrictionCollector::IsRestrictionValid(Restriction::Type & restrictionType, m2::PointD const & coords, |
| 259 | std::vector<uint32_t> & featureIds) const |
| 260 | { |
| 261 | if (featureIds.empty() || !m_indexGraph.IsRoad(featureIds[0])) |
| 262 | return false; |
| 263 | |
| 264 | for (size_t i = 1; i < featureIds.size(); ++i) |
| 265 | { |
| 266 | auto prev = featureIds[i - 1]; |
| 267 | auto cur = featureIds[i]; |
| 268 | if (!m_indexGraph.IsRoad(cur)) |
| 269 | return false; |
| 270 | |
| 271 | if (!FeaturesAreCross(coords, prev, cur)) |
| 272 | return false; |
| 273 | } |
| 274 | |
| 275 | ConvertToUTurnIfPossible(restrictionType, coords, featureIds); |
| 276 | |
| 277 | if (!IsUTurnType(restrictionType)) |
| 278 | return true; |
| 279 | |
| 280 | return CheckAndProcessUTurn(restrictionType, coords, featureIds); |
| 281 | } |
| 282 | |
| 283 | bool RestrictionCollector::AddRestriction(m2::PointD const & coords, Restriction::Type restrictionType, |
| 284 | std::vector<base::GeoObjectId> const & osmIds) |
nothing calls this directly
no test coverage detected