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

Method CollectLinesSubway

libs/drape_frontend/transit_scheme_builder.cpp:572–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572void TransitSchemeBuilder::CollectLinesSubway(TransitDisplayInfo const & transitDisplayInfo, MwmSchemeData & scheme)
573{
574 CHECK_EQUAL(transitDisplayInfo.m_transitVersion, ::transit::TransitVersion::OnlySubway, ());
575
576 std::multimap<size_t, routing::transit::LineId> linesLengths;
577 for (auto const & line : transitDisplayInfo.m_linesSubway)
578 {
579 auto const lineId = line.second.GetId();
580 size_t stopsCount = 0;
581 auto const & stopsRanges = line.second.GetStopIds();
582 for (auto const & stops : stopsRanges)
583 stopsCount += stops.size();
584 linesLengths.insert(std::make_pair(stopsCount, lineId));
585 }
586 float depth = kBaseLineDepth;
587 for (auto const & pair : linesLengths)
588 {
589 auto const lineId = pair.second;
590
591 scheme.m_linesSubway[lineId] = LineParams(transitDisplayInfo.m_linesSubway.at(lineId).GetColor(), depth);
592
593 depth += kDepthPerLine;
594 }
595}
596
597LinesDataPT TransitSchemeBuilder::CollectLinesPT(TransitDisplayInfo const & transitDisplayInfo, MwmSchemeData & scheme)
598{

Callers

nothing calls this directly

Calls 6

LineParamsClass · 0.85
atMethod · 0.80
GetIdMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
GetColorMethod · 0.45

Tested by

no test coverage detected