import { DIVEScene } from '../../../index.ts'; import { OrbitController } from '../../orbitcontroller/index.ts'; import { Tool } from './Tool.ts'; import { SelectionState } from './SelectionState.ts'; import { ToolType, ToolTypeMap } from '../types/index.ts'; /** * Toolbox manages multiple tools and dispatches pointer events to them. * * Tools are processed in priority order (lower number = higher priority). * Each tool can stop event propagation by returning true from its handler. * * @module */ export declare class Toolbox { private _scene; private _controller; private _canvas; private _tools; private _activeTools; private _sortedActiveTools; private _selectionState; get selectionState(): SelectionState; private _raycaster; private _pointer; private _pointerPrimaryDown; private _pointerMiddleDown; private _pointerSecondaryDown; private _lastPointerDown; private _boundPointerMove; private _boundPointerDown; private _boundPointerUp; private _boundWheel; constructor(scene: DIVEScene, controller: OrbitController, canvas: HTMLElement); /** * Enable a tool by type. */ enableTool(type: ToolType): void; /** * Disable an active tool by type. */ disableTool(type: ToolType): void; /** * Check if a tool is currently enabled. */ isToolEnabled(type: ToolType): boolean; /** * Get a tool by type. */ getTool(type: T): ToolTypeMap[T]; /** * Get all currently active tools. */ getActiveTools(): Tool[]; /** * Dispose of the toolbox and clean up resources. */ dispose(): void; private onPointerMove; private onPointerDown; private onPointerUp; private onWheel; private createPointerContext; private createWheelContext; /** * The four intersect lists, each raycast on first read and then kept. * * Still one raycast per event shared by every tool -- but only if a tool * actually looks. It used to run eagerly, so a pointer move cost a full * raycast even with no tool enabled at all, and while the camera was being * orbited that was a raycast per frame against every mesh in the scene. */ private createLazyIntersects; private updatePointer; private updatePointerState; private raycast; private filterIntersectsByLayer; private updateSortedTools; private pointerWasDragged; }