MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / checkSegmentMatch

Function checkSegmentMatch

src/core/objects/boolean_tool.cpp:1185–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183}
1184
1185bool checkSegmentMatch(
1186 const PathObject* original,
1187 int coord_index,
1188 const ClipperLib::Path& polygon,
1189 ClipperLib::Path::size_type start_index,
1190 ClipperLib::Path::size_type end_index,
1191 bool& out_coords_increasing,
1192 bool& out_is_curve )
1193{
1194
1195 const MapCoord first = original->getCoordinate(coord_index);
1196 out_is_curve = first.isCurveStart();
1197
1198 auto other_index = (coord_index + (out_is_curve ? 3 : 1)) % original->getCoordinateCount();
1199 const MapCoord other = original->getCoordinate(other_index);
1200
1201 bool found = true;
1202 if (first == polygon.at(start_index) && other == polygon.at(end_index))
1203 {
1204 out_coords_increasing = true;
1205 }
1206 else if (first == polygon.at(end_index) && other == polygon.at(start_index))
1207 {
1208 out_coords_increasing = false;
1209 }
1210 else
1211 {
1212 found = false;
1213 }
1214
1215 return found;
1216}
1217
1218} // namespace
1219

Callers 1

rebuildTwoIndexSegmentFunction · 0.85

Calls 4

getCoordinateMethod · 0.80
isCurveStartMethod · 0.80
getCoordinateCountMethod · 0.80
atMethod · 0.60

Tested by

no test coverage detected