/** * PickingManager - Handles GPU-based object picking at screen coordinates. * Extracted from the Renderer class to use composition pattern. */ import { Camera } from './camera.js'; import { Scene } from './scene.js'; import { Picker, type PointPickSizing } from './picker.js'; import type { MeshData } from '@ifc-lite/geometry'; import type { PickOptions, PickResult, PickClipState } from './types.js'; import type { PointPickNode } from './point-picker.js'; /** * Supplied by the renderer when point clouds are loaded — returns the * snapshot of pickable nodes and the sizing to use for the splat picker. * Returning empty / null disables point-pick for this frame. */ export type PointPickProvider = () => { nodes: ReadonlyArray; sizing: PointPickSizing; } | null; export declare class PickingManager { private camera; private scene; private picker; private canvas; private createMeshFromDataFn; private pointPickProvider; constructor(camera: Camera, scene: Scene, picker: Picker | null, canvas: HTMLCanvasElement, createMeshFromDataFn: (meshData: MeshData) => void); /** Renderer wires this on init so the manager can fetch point nodes lazily. */ setPointPickProvider(provider: PointPickProvider | null): void; /** * Update the picker reference (e.g., after init) */ setPicker(picker: Picker | null): void; /** * Pick object at screen coordinates * Respects visibility filtering so users can only select visible elements * Returns PickResult with expressId and modelIndex for multi-model support * * Note: x, y are CSS pixel coordinates relative to the canvas element. * These are scaled internally to match the actual canvas pixel dimensions. */ pick(x: number, y: number, options?: PickOptions, clip?: PickClipState | null): Promise; /** * GPU-based rectangle pick. Renders the same pick pass as `pick()`, * then reads back every texel inside the rect and dedupes the hit * set. Point splats and mesh triangles both participate. * * Rect coordinates are in CSS pixels; we scale to canvas pixels * the same way `pick()` does. Visibility filters from `options` * are applied to meshes before the pass; point nodes are not * filtered (per-asset visibility is binary and the asset count is * tiny). * * Limitations: skips the CPU-raycast and dynamic-mesh-creation * fallbacks that `pick()` uses for very large batched models, so * rect pick may miss entities whose individual meshes haven't been * hydrated. Acceptable for an MVP — rect select is a power-user * tool and the user can fall back to single-click pick. */ pickRect(x0: number, y0: number, x1: number, y1: number, options?: PickOptions, clip?: PickClipState | null): Promise>; } //# sourceMappingURL=picking-manager.d.ts.map