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

Method AddGatePTForSubroute

libs/map/transit/transit_display.cpp:551–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551void TransitRouteDisplay::AddGatePTForSubroute(routing::RouteSegment const & segment, df::Subroute & subroute,
552 SubrouteParams & sp, SubrouteSegmentParams & ssp)
553{
554 auto const & gate = ssp.m_transitInfo.GetGatePT();
555 if (sp.m_lastLineId != ::transit::kInvalidTransitId)
556 {
557 m_routeInfo.AddStep(TransitStepInfo(TransitType::Pedestrian, ssp.m_distance, ssp.m_time));
558
559 AddTransitGateSegment(segment.GetJunction().GetPoint(), sp.m_lastColor, subroute);
560
561 subroute.m_markers.push_back(sp.m_marker);
562 sp.m_marker = df::SubrouteMarker();
563
564 sp.m_transitMarkInfo.m_type = TransitMarkInfo::Type::KeyStop;
565 sp.m_transitMarkInfo.m_symbolName = kTransitSymbols.at(sp.m_transitType);
566 sp.m_transitMarkInfo.m_color = sp.m_lastColor;
567 m_transitMarks.push_back(sp.m_transitMarkInfo);
568 sp.m_transitMarkInfo = TransitMarkInfo();
569 }
570 else
571 {
572 sp.m_pendingEntrance = true;
573 }
574
575 auto gateMarkInfo = TransitMarkInfo();
576 gateMarkInfo.m_point = sp.m_pendingEntrance ? subroute.m_polyline.Back() : segment.GetJunction().GetPoint();
577 gateMarkInfo.m_type = TransitMarkInfo::Type::Gate;
578 gateMarkInfo.m_symbolName = kZeroIcon;
579 if (gate.m_featureId != kInvalidFeatureId)
580 {
581 auto const fid = FeatureID(ssp.m_mwmId, gate.m_featureId);
582 auto const & featureInfo = ssp.m_displayInfo.m_features.at(fid);
583 auto symbolName = featureInfo.m_gateSymbolName;
584 if (symbolName.ends_with("-s") || symbolName.ends_with("-m") || symbolName.ends_with("-l"))
585 symbolName = symbolName.substr(0, symbolName.rfind('-'));
586
587 gateMarkInfo.m_featureId = fid;
588 if (!symbolName.empty())
589 gateMarkInfo.m_symbolName = symbolName;
590 auto const title = m_getStringsBundleFn().GetString(sp.m_pendingEntrance ? "core_entrance" : "core_exit");
591 gateMarkInfo.m_titles.emplace_back(title, df::GetTransitTextColorName("default"));
592 }
593
594 m_transitMarks.push_back(gateMarkInfo);
595}
596
597bool TransitRouteDisplay::ProcessSubroute(vector<routing::RouteSegment> const & segments, df::Subroute & subroute)
598{

Callers

nothing calls this directly

Calls 14

AddTransitGateSegmentFunction · 0.85
SubrouteMarkerClass · 0.85
TransitMarkInfoClass · 0.85
GetTransitTextColorNameFunction · 0.85
atMethod · 0.80
TransitStepInfoClass · 0.70
FeatureIDClass · 0.50
AddStepMethod · 0.45
GetPointMethod · 0.45
push_backMethod · 0.45
BackMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected