| 170 | } |
| 171 | |
| 172 | vector<IRoadGraph::FullRoadInfo> FeaturesRoadGraphBase::FindRoads(m2::RectD const & rect, |
| 173 | IsGoodFeatureFn const & isGoodFeature) const |
| 174 | { |
| 175 | vector<IRoadGraph::FullRoadInfo> roads; |
| 176 | |
| 177 | m_dataSource.ForEachStreet([&](FeatureType & ft) |
| 178 | { |
| 179 | if (!m_vehicleModel.IsRoad(ft)) |
| 180 | return; |
| 181 | |
| 182 | FeatureID const & featureId = ft.GetID(); |
| 183 | if (isGoodFeature && !isGoodFeature(featureId)) |
| 184 | return; |
| 185 | |
| 186 | // DataSource::ForEachInRect() gives not only features inside |rect| but some other features |
| 187 | // which lie close to the rect. Removes all the features which don't cross |rect|. |
| 188 | auto const & roadInfo = GetCachedRoadInfo(featureId, ft, kInvalidSpeedKMPH); |
| 189 | if (!RectCoversPolyline(roadInfo.m_junctions, rect)) |
| 190 | return; |
| 191 | |
| 192 | roads.emplace_back(featureId, roadInfo); |
| 193 | }, rect); |
| 194 | |
| 195 | return roads; |
| 196 | } |
| 197 | |
| 198 | void FeaturesRoadGraphBase::GetFeatureTypes(FeatureID const & featureId, feature::TypesHolder & types) const |
| 199 | { |
no test coverage detected