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

Method GetFirstCommonJoint

generator/restriction_collector.cpp:123–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123Joint::Id RestrictionCollector::GetFirstCommonJoint(uint32_t firstFeatureId, uint32_t secondFeatureId) const
124{
125 uint32_t const firstLen = m_indexGraph.GetRoadGeometry(firstFeatureId).GetPointsCount();
126 uint32_t const secondLen = m_indexGraph.GetRoadGeometry(secondFeatureId).GetPointsCount();
127
128 auto const firstRoad = m_indexGraph.GetRoad(firstFeatureId);
129 auto const secondRoad = m_indexGraph.GetRoad(secondFeatureId);
130
131 ankerl::unordered_dense::set<Joint::Id> used;
132 for (uint32_t i = 0; i < firstLen; ++i)
133 if (firstRoad.GetJointId(i) != Joint::kInvalidId)
134 used.emplace(firstRoad.GetJointId(i));
135
136 for (uint32_t i = 0; i < secondLen; ++i)
137 if (used.count(secondRoad.GetJointId(i)) != 0)
138 return secondRoad.GetJointId(i);
139
140 return Joint::kInvalidId;
141}
142
143bool RestrictionCollector::FeatureHasPointWithCoords(uint32_t featureId, m2::PointD const & coords) const
144{

Callers

nothing calls this directly

Calls 4

GetPointsCountMethod · 0.45
GetJointIdMethod · 0.45
emplaceMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected