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

Method ProcessEdge

tools/openlr/score_paths_connector.cpp:31–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 explicit EdgeContainer(Graph const & graph) : m_graph(graph) {}
30
31 void ProcessEdge(Graph::Edge const & edge)
32 {
33 CHECK(!edge.IsFake(), ());
34
35 feature::TypesHolder types;
36 m_graph.GetFeatureTypes(edge.GetFeatureId(), types);
37
38 ftypes::HighwayClass const hwClass = ftypes::GetHighwayClass(types);
39 if (m_minHwClass == ftypes::HighwayClass::Undefined)
40 {
41 m_minHwClass = hwClass;
42 m_maxHwClass = m_minHwClass;
43 m_oneWay.m_field = ftypes::IsOneWayChecker::Instance()(types);
44 m_roundabout.m_field = ftypes::IsRoundAboutChecker::Instance()(types);
45 m_link.m_field = ftypes::IsLinkChecker::Instance()(types);
46 }
47 else
48 {
49 CHECK(hwClass != ftypes::HighwayClass::Undefined, (edge));
50
51 m_minHwClass = static_cast<ftypes::HighwayClass>(min(base::Underlying(m_minHwClass), base::Underlying(hwClass)));
52 m_maxHwClass = static_cast<ftypes::HighwayClass>(max(base::Underlying(m_maxHwClass), base::Underlying(hwClass)));
53
54 if (m_oneWay.m_allEqual && m_oneWay.m_field != ftypes::IsOneWayChecker::Instance()(types))
55 m_oneWay.m_allEqual = false;
56
57 if (m_roundabout.m_allEqual && m_roundabout.m_field != ftypes::IsRoundAboutChecker::Instance()(types))
58 m_roundabout.m_allEqual = false;
59
60 if (m_link.m_allEqual && m_link.m_field != ftypes::IsLinkChecker::Instance()(types))
61 m_link.m_allEqual = false;
62 }
63 }
64
65 uint8_t GetHighwayClassDiff() const
66 {

Callers 1

GetScoreForUniformityMethod · 0.80

Calls 5

GetHighwayClassFunction · 0.85
UnderlyingFunction · 0.85
IsFakeMethod · 0.45
GetFeatureTypesMethod · 0.45
GetFeatureIdMethod · 0.45

Tested by

no test coverage detected