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

Function StopHasMultipleShapes

libs/drape_frontend/transit_scheme_builder.cpp:1195–1209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1193}
1194
1195bool StopHasMultipleShapes(std::vector<ShapeInfoPT> const & shapeInfosIn,
1196 std::vector<ShapeInfoPT> const & shapeInfosOut)
1197{
1198 size_t count = 0;
1199
1200 for (auto const & si : shapeInfosIn)
1201 {
1202 auto const it = std::find_if(shapeInfosOut.begin(), shapeInfosOut.end(), [&si](ShapeInfoPT const & so)
1203 { return AlmostEqualAbs(si.m_direction, so.m_direction, kEps); });
1204 if (it != shapeInfosOut.end())
1205 ++count;
1206 }
1207
1208 return std::max(shapeInfosIn.size(), shapeInfosOut.size()) - count > 1;
1209}
1210
1211void TransitSchemeBuilder::GenerateStop(ref_ptr<dp::GraphicsContext> context, StopNodeParamsPT const & stopParams,
1212 m2::PointD const & pivot,

Callers 1

GenerateStopMethod · 0.85

Calls 4

AlmostEqualAbsFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected