| 795 | } |
| 796 | |
| 797 | void TransitSchemeBuilder::PrepareSchemeSubway(MwmSchemeData & scheme) |
| 798 | { |
| 799 | m2::RectD boundingRect; |
| 800 | |
| 801 | for (auto const & shape : scheme.m_shapesSubway) |
| 802 | { |
| 803 | auto const stop1 = shape.first.GetStop1Id(); |
| 804 | auto const stop2 = shape.first.GetStop2Id(); |
| 805 | StopNodeParamsSubway & params1 = (scheme.m_stopsSubway.find(stop1) == scheme.m_stopsSubway.end()) |
| 806 | ? scheme.m_transfersSubway[stop1] |
| 807 | : scheme.m_stopsSubway[stop1]; |
| 808 | StopNodeParamsSubway & params2 = (scheme.m_stopsSubway.find(stop2) == scheme.m_stopsSubway.end()) |
| 809 | ? scheme.m_transfersSubway[stop2] |
| 810 | : scheme.m_stopsSubway[stop2]; |
| 811 | |
| 812 | auto const linesCount = shape.second.m_forwardLines.size() + shape.second.m_backwardLines.size(); |
| 813 | |
| 814 | auto const sz = shape.second.m_polyline.size(); |
| 815 | |
| 816 | auto const dir1 = (shape.second.m_polyline[1] - shape.second.m_polyline[0]).Normalize(); |
| 817 | auto const dir2 = (shape.second.m_polyline[sz - 2] - shape.second.m_polyline[sz - 1]).Normalize(); |
| 818 | |
| 819 | params1.m_shapesInfo[shape.first].m_linesCount = linesCount; |
| 820 | params1.m_shapesInfo[shape.first].m_direction = dir1; |
| 821 | |
| 822 | params2.m_shapesInfo[shape.first].m_linesCount = linesCount; |
| 823 | params2.m_shapesInfo[shape.first].m_direction = dir2; |
| 824 | |
| 825 | for (auto const & pt : shape.second.m_polyline) |
| 826 | boundingRect.Add(pt); |
| 827 | } |
| 828 | |
| 829 | scheme.m_pivot = boundingRect.Center(); |
| 830 | } |
| 831 | |
| 832 | void UpdateShapeInfos(std::vector<ShapeInfoPT> & shapeInfos, m2::PointD const & newDir, |
| 833 | std::set<std::string> const & colors) |
nothing calls this directly
no test coverage detected