| 1278 | } |
| 1279 | |
| 1280 | bool PathObject::canBeConnected(const PathObject* other, double connect_threshold_sq) const |
| 1281 | { |
| 1282 | for (const auto& part : path_parts) |
| 1283 | { |
| 1284 | if (part.isClosed()) |
| 1285 | continue; |
| 1286 | |
| 1287 | for (const auto& other_part : other->path_parts) |
| 1288 | { |
| 1289 | if (other_part.isClosed()) |
| 1290 | continue; |
| 1291 | |
| 1292 | if (coords[part.first_index].distanceSquaredTo(other->coords[other_part.first_index]) <= connect_threshold_sq |
| 1293 | || coords[part.first_index].distanceSquaredTo(other->coords[other_part.last_index]) <= connect_threshold_sq |
| 1294 | || coords[part.last_index].distanceSquaredTo(other->coords[other_part.first_index]) <= connect_threshold_sq |
| 1295 | || coords[part.last_index].distanceSquaredTo(other->coords[other_part.last_index]) <= connect_threshold_sq) |
| 1296 | { |
| 1297 | return true; |
| 1298 | } |
| 1299 | } |
| 1300 | } |
| 1301 | |
| 1302 | return false; |
| 1303 | } |
| 1304 | |
| 1305 | bool PathObject::connectIfClose(PathObject* other, double connect_threshold_sq) |
| 1306 | { |
no test coverage detected