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

Function FillTurnsDistancesForRendering

libs/map/routing_manager.cpp:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72uint32_t constexpr kInvalidTransactionId = 0;
73
74void FillTurnsDistancesForRendering(vector<RouteSegment> const & segments, double baseDistance, vector<double> & turns)
75{
76 using namespace routing::turns;
77 turns.clear();
78 turns.reserve(segments.size());
79 for (auto const & s : segments)
80 {
81 auto const & t = s.GetTurn();
82 CHECK_NOT_EQUAL(t.m_turn, CarDirection::Count, ());
83 // We do not render some of the turn directions.
84 if (t.m_turn == CarDirection::None || t.m_turn == CarDirection::StartAtEndOfStreet ||
85 t.m_turn == CarDirection::StayOnRoundAbout || t.m_turn == CarDirection::ReachedYourDestination)
86 {
87 continue;
88 }
89 turns.push_back(s.GetDistFromBeginningMerc() - baseDistance);
90 }
91}
92
93void FillTrafficForRendering(vector<RouteSegment> const & segments, vector<traffic::SpeedGroup> & traffic)
94{

Callers 1

InsertRouteMethod · 0.85

Calls 5

clearMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected