2025-07-06 20:43:53 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include <include/core/SkCanvas.h>
|
|
|
|
|
#include "../DrawData.hpp"
|
|
|
|
|
#include "../DrawComponents/DrawComponent.hpp"
|
|
|
|
|
|
|
|
|
|
class DrawingProgram;
|
|
|
|
|
|
|
|
|
|
class EraserTool {
|
|
|
|
|
public:
|
|
|
|
|
EraserTool(DrawingProgram& initDrawP);
|
|
|
|
|
void gui_toolbox();
|
|
|
|
|
void tool_update();
|
2025-07-23 16:04:16 +03:00
|
|
|
void reset_tool();
|
2025-07-06 20:43:53 +03:00
|
|
|
void draw(SkCanvas* canvas, const DrawData& drawData);
|
|
|
|
|
private:
|
2025-07-23 16:04:16 +03:00
|
|
|
std::unordered_set<CollabList<std::shared_ptr<DrawComponent>, ServerClientID>::ObjectInfoPtr> erasedComponents;
|
|
|
|
|
std::unordered_set<std::shared_ptr<DrawingProgramCache::BVHNode>> erasedBVHNodes;
|
2025-07-06 20:43:53 +03:00
|
|
|
|
2025-07-23 16:04:16 +03:00
|
|
|
void move_erased_components_from_bvh_nodes_recursive(const std::shared_ptr<DrawingProgramCache::BVHNode>& bvhNode);
|
2025-07-06 20:43:53 +03:00
|
|
|
|
|
|
|
|
DrawingProgram& drawP;
|
|
|
|
|
};
|