| 147 | } |
| 148 | |
| 149 | bool MiniRoundaboutTransformer::AddRoundaboutToRoad(RoundaboutUnit const & roundaboutOnRoad, PointsT & roundaboutCircle, |
| 150 | PointsT & road, |
| 151 | std::vector<feature::FeatureBuilder> & newRoads) const |
| 152 | { |
| 153 | auto const roundaboutCenter = roundaboutOnRoad.m_location; |
| 154 | auto itPointUpd = GetIterOnRoad(roundaboutCenter, road); |
| 155 | |
| 156 | CHECK(itPointUpd != road.end(), ()); |
| 157 | |
| 158 | auto itPointNearRoundabout = itPointUpd; |
| 159 | bool const isMiddlePoint = MoveIterAwayFromRoundabout(itPointNearRoundabout, road); |
| 160 | m2::PointD const nextPointOnRoad = GetPointAtDistFromTarget( |
| 161 | *itPointNearRoundabout /* source */, roundaboutCenter /* target */, m_radiusMercator /* dist */); |
| 162 | |
| 163 | if (isMiddlePoint && !AlmostEqualAbs(nextPointOnRoad, *itPointNearRoundabout, kMwmPointAccuracy)) |
| 164 | { |
| 165 | auto surrogateRoad = CreateSurrogateRoad(roundaboutOnRoad, roundaboutCircle, road, itPointUpd); |
| 166 | if (surrogateRoad.size() < 2) |
| 167 | return false; |
| 168 | auto fbSurrogateRoad = CreateFb(std::move(surrogateRoad), roundaboutOnRoad.m_roadId); |
| 169 | for (auto const & t : roundaboutOnRoad.m_roadTypes) |
| 170 | fbSurrogateRoad.AddType(t); |
| 171 | |
| 172 | newRoads.push_back(std::move(fbSurrogateRoad)); |
| 173 | } |
| 174 | |
| 175 | AddPointToCircle(roundaboutCircle, nextPointOnRoad); |
| 176 | *itPointUpd = nextPointOnRoad; |
| 177 | return true; |
| 178 | } |
| 179 | |
| 180 | void MiniRoundaboutTransformer::AddRoad(feature::FeatureBuilder && road) |
| 181 | { |
nothing calls this directly
no test coverage detected