| 337 | } |
| 338 | |
| 339 | void DescriptionEditService::addIfSpaceAvailable( |
| 340 | DataDescription& result, |
| 341 | Occupancy& cellOccupancy, |
| 342 | DataDescription const& toAdd, |
| 343 | float distance, |
| 344 | IntVector2D const& worldSize) |
| 345 | { |
| 346 | SpaceCalculator space(worldSize); |
| 347 | |
| 348 | for (auto const& cell : toAdd.cells) { |
| 349 | if (!isCellPresent(cellOccupancy, space, cell.pos, distance)) { |
| 350 | result.addCell(cell); |
| 351 | cellOccupancy[toIntVector2D(cell.pos)].emplace_back(cell.pos); |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | void DescriptionEditService::reconnectCells(DataDescription& data, float maxDistance) |
| 357 | { |
no test coverage detected