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

Method SetGeometry

libs/routing/route.hpp:300–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298
299 template <class TIter>
300 void SetGeometry(TIter beg, TIter end)
301 {
302 if (beg == end)
303 {
304 FollowedPolyline().Swap(m_poly);
305 }
306 else
307 {
308 FollowedPolyline(beg, end).Swap(m_poly);
309 // If there are no intermediate points it's acceptable to have an empty m_subrouteAttrs.
310 // Constructed m_poly will have the last point index as next checkpoint index, it's right.
311 if (!m_subrouteAttrs.empty())
312 {
313 ASSERT_GREATER(m_subrouteAttrs.size(), m_currentSubrouteIdx, ());
314 m_poly.SetNextCheckpointIndex(m_subrouteAttrs[m_currentSubrouteIdx].GetEndSegmentIdx());
315 }
316 }
317 }
318
319 void SetRouteSegments(std::vector<RouteSegment> && routeSegments);
320

Callers 3

ReconstructRouteFunction · 0.45
CalculateRouteMethod · 0.45
UNIT_TESTFunction · 0.45

Calls 6

FollowedPolylineClass · 0.85
GetEndSegmentIdxMethod · 0.80
SwapMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.36