MCPcopy Create free account
hub / github.com/comaps/comaps / MoveIterAwayFromRoundabout

Function MoveIterAwayFromRoundabout

generator/mini_roundabout_transformer.cpp:22–42  ·  view source on GitHub ↗

\brief Moves |it| on the |road| range one step from current |it| element.

Source from the content-addressed store, hash-verified

20
21/// \brief Moves |it| on the |road| range one step from current |it| element.
22bool MoveIterAwayFromRoundabout(feature::FeatureBuilder::PointSeq::iterator & it,
23 feature::FeatureBuilder::PointSeq const & road)
24{
25 bool middlePoint = false;
26 if (it == road.begin())
27 {
28 ++it;
29 }
30 else if (it + 1 == road.end())
31 {
32 --it;
33 }
34 else
35 {
36 // Mini-roundabout is on the middle of the road so we need to insert 2 points to the roundabout
37 // circle and create additional surrogate road.
38 --it;
39 middlePoint = true;
40 }
41 return middlePoint;
42}
43
44feature::FeatureBuilder::PointSeq::iterator GetIterOnRoad(m2::PointD const & point,
45 feature::FeatureBuilder::PointSeq & road)

Callers 1

AddRoundaboutToRoadMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected