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

Function AddTransitShapes

libs/map/transit/transit_display.cpp:187–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void AddTransitShapes(vector<routing::transit::ShapeId> const & shapeIds, TransitShapesInfo const & shapes,
188 df::ColorConstant const & color, bool isInverted, df::Subroute & subroute)
189{
190 ASSERT_GREATER(subroute.m_polyline.GetSize(), 0, ());
191 df::SubrouteStyle style(color);
192 style.m_startIndex = subroute.m_polyline.GetSize() - 1;
193
194 for (auto it = shapeIds.crbegin(); it != shapeIds.crend(); ++it)
195 {
196 auto const & shapePolyline = shapes.at(*it).GetPolyline();
197 if (isInverted)
198 subroute.m_polyline.Append(shapePolyline.crbegin(), shapePolyline.crend());
199 else
200 subroute.m_polyline.Append(shapePolyline.cbegin(), shapePolyline.cend());
201 }
202
203 style.m_endIndex = subroute.m_polyline.GetSize() - 1;
204 subroute.AddStyle(style);
205}
206
207void AddTransitShapes(::transit::ShapeLink shapeLink, TransitShapesInfoPT const & shapesInfo,
208 df::ColorConstant const & color, df::Subroute & subroute)

Callers 2

AddEdgePTForSubrouteMethod · 0.85

Calls 9

atMethod · 0.80
AddStyleMethod · 0.80
GetSizeMethod · 0.45
AppendMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected