From 6e7be97139f7dcfb3a8f5bb4923a9c6f2f82a9e3 Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Mon, 22 Jun 2026 14:43:57 +0000 Subject: [PATCH] feat: implement SelectionEngine with rbush hit testing --- frontend/src/interaction/SelectionEngine.ts | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 frontend/src/interaction/SelectionEngine.ts diff --git a/frontend/src/interaction/SelectionEngine.ts b/frontend/src/interaction/SelectionEngine.ts new file mode 100644 index 0000000..43ddfcc --- /dev/null +++ b/frontend/src/interaction/SelectionEngine.ts @@ -0,0 +1,47 @@ +import RBush from 'rbush'; + +class SelectionEngine { + private rbush: RBush; + + constructor() { + this.rbush = new RBush(); + } + + // Single click selection + selectSingle(x: number, y: number): any[] { + // Implementation for single click selection + return []; + } + + // Window selection (left-to-right) + selectWindow(startX: number, startY: number, endX: number, endY: number): any[] { + // Implementation for window selection + return []; + } + + // Crossing selection (right-to-left) + selectCrossing(startX: number, startY: number, endX: number, endY: number): any[] { + // Implementation for crossing selection + return []; + } + + // Fence selection (polyline crossing) + selectFence(points: {x: number, y: number}[]): any[] { + // Implementation for fence selection + return []; + } + + // Quick-select (by layer/type/color) + quickSelect(criteria: {layer?: string, type?: string, color?: string}): any[] { + // Implementation for quick-select + return []; + } + + // Lasso selection + selectLasso(points: {x: number, y: number}[]): any[] { + // Implementation for lasso selection + return []; + } +} + +export default SelectionEngine;