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

Method FitsForDirectLinkToGuide

libs/routing/guides_connections.cpp:152–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152bool GuidesConnections::FitsForDirectLinkToGuide(size_t checkpointIdx, size_t checkpointsCount) const
153{
154 auto it = m_checkpointsOnTracks.find(checkpointIdx);
155 CHECK(it != m_checkpointsOnTracks.end(), (checkpointIdx));
156 bool const checkpointIsFar = it->second.m_distToProjectedPointM > kEqDistToTrackPointM;
157 if (checkpointIsFar)
158 return false;
159
160 // If checkpoint lies on the track but its neighbour intermediate checkpoint does not, we should
161 // connect this checkpoint to the OSM graph.
162 if (checkpointsCount <= 2)
163 return true;
164
165 for (auto const neighbourIdx : GetNeighbourIntermediatePoints(checkpointIdx, checkpointsCount))
166 if (m_checkpointsOnTracks.find(neighbourIdx) == m_checkpointsOnTracks.end())
167 return false;
168
169 return true;
170}
171
172void GuidesConnections::PullAdditionalCheckpointsToTracks(std::vector<m2::PointD> const & checkpoints)
173{

Callers 2

UNIT_TESTFunction · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64