| 596 | } |
| 597 | |
| 598 | void MapRenderables::removeRenderablesOfObject(const Object* object, bool mark_area_as_dirty) |
| 599 | { |
| 600 | for (auto& color : *this) |
| 601 | { |
| 602 | auto obj = color.second.find(object); |
| 603 | if (obj != color.second.end()) |
| 604 | { |
| 605 | if (mark_area_as_dirty) |
| 606 | { |
| 607 | // We don't want to loop over every dot in an area ... |
| 608 | QRectF extent = object->getExtent(); |
| 609 | if (!extent.isValid()) |
| 610 | { |
| 611 | // ... because here it gets expensive |
| 612 | for (const auto& renderables : *obj->second) |
| 613 | { |
| 614 | for (const auto* renderable : renderables.second) |
| 615 | { |
| 616 | extent = extent.isValid() ? extent.united(renderable->getExtent()) : renderable->getExtent(); |
| 617 | } |
| 618 | } |
| 619 | } |
| 620 | map->setObjectAreaDirty(extent); |
| 621 | } |
| 622 | |
| 623 | color.second.erase(obj); |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | void MapRenderables::clear(bool mark_area_as_dirty) |
| 629 | { |
no test coverage detected