| 595 | } |
| 596 | |
| 597 | LinesDataPT TransitSchemeBuilder::CollectLinesPT(TransitDisplayInfo const & transitDisplayInfo, MwmSchemeData & scheme) |
| 598 | { |
| 599 | CHECK_EQUAL(transitDisplayInfo.m_transitVersion, ::transit::TransitVersion::AllPublicTransport, ()); |
| 600 | |
| 601 | LinesDataPT linesData; |
| 602 | |
| 603 | std::set<::transit::TransitId> notTerminal; |
| 604 | |
| 605 | for (auto const & [lineId, line] : transitDisplayInfo.m_linesPT) |
| 606 | { |
| 607 | auto const itRoute = transitDisplayInfo.m_routesPT.find(line.GetRouteId()); |
| 608 | CHECK(itRoute != transitDisplayInfo.m_routesPT.end(), (line.GetRouteId())); |
| 609 | |
| 610 | auto const & lineType = itRoute->second.GetType(); |
| 611 | |
| 612 | // We skip types that are not mentioned for displaying on the layer - buses, ferries, etc. |
| 613 | if (transit::kSubwayLayerTypes.find(lineType) == transit::kSubwayLayerTypes.end()) |
| 614 | continue; |
| 615 | |
| 616 | for (auto stopId : line.GetStopIds()) |
| 617 | linesData.m_stopToLineIds[stopId].insert(lineId); |
| 618 | |
| 619 | auto const & firstStop = line.GetStopIds().front(); |
| 620 | auto const & lastStop = line.GetStopIds().back(); |
| 621 | |
| 622 | if (!linesData.m_terminalStops.insert(firstStop).second) |
| 623 | notTerminal.insert(firstStop); |
| 624 | |
| 625 | if (!linesData.m_terminalStops.insert(lastStop).second) |
| 626 | notTerminal.insert(lastStop); |
| 627 | |
| 628 | auto & schemeLine = scheme.m_linesPT[lineId]; |
| 629 | schemeLine = LineParams(itRoute->second.GetColor(), kBaseLineDepth); |
| 630 | schemeLine.m_stopIds = line.GetStopIds(); |
| 631 | } |
| 632 | |
| 633 | for (auto id : notTerminal) |
| 634 | linesData.m_terminalStops.erase(id); |
| 635 | |
| 636 | return linesData; |
| 637 | } |
| 638 | |
| 639 | void TransitSchemeBuilder::CollectShapesSubway(TransitDisplayInfo const & transitDisplayInfo, MwmSchemeData & scheme) |
| 640 | { |
nothing calls this directly
no test coverage detected