import * as THREE from 'three'; import { PointSelector, type PointIntersection } from '../shared-utils/three/PointSelector'; /** V2 snapping only. The original PointSelector keeps its existing algorithm. */ export declare class MeasurePointSelector extends PointSelector { /** * @description 动态吸附线提供器:每次选点更新、吸附计算前调用,返回本次参与吸附的线段,不会写回 adhereLine。 * 适合按光标位置实时从模型提取的边线。返回的线按有限线段处理(clampToLine), * 与 adhereLine 里的无限轴线(如量尺的 XYZ 轴)区分开。 */ adhereLineProvider: ((params: { intersection: PointIntersection; pointSelector: PointSelector; }) => THREE.Line3[]) | null; /** * @description 动态吸附线的屏幕吸附半径(像素) * 动态线按「光标到线段投影的屏幕距离」取最近的一条,而不是按 3D 距离排序后让远边覆盖近边 */ dynamicAdhereScreenRadius: number; /** * @description 已吸附后保持吸附的屏幕半径(像素),略大于进入半径,避免在阈值边界来回跳动 */ dynamicAdhereKeepScreenRadius: number; /** * @description 动态吸附线允许的最大 3D 距离(米),用于排除画面深处或明显不在落点附近的边 */ dynamicAdhereMaxDistance: number; /** * 上一次吸住的动态线。候选线集合会随查询球心移动而变化, * 把吸住的边单独留住,光标在保持半径内时优先继续用它,避免在相邻边之间来回跳。 */ private dynamicAdhereLine; protected get mouseNdcPosition(): { x: number; y: number; }; refresh(): void; private readonly onFocusLost; enable(): void; disable(): void; clearDynamicAdhereLine(): void; protected updatePointSelectorHelperIntersect: (intersect?: PointIntersection | null) => void; /** * @description 计算一条静态吸附线的吸附结果(3D 距离优先,其次屏幕距离) */ private getLineAdhereResult; /** * @description 在动态吸附线(模型边)中选出屏幕上离光标最近的一条。 * * 三个要点: * 1. 用射线与线段的最近点求落点,避免透视投影下屏幕比例回推 3D 点造成的偏差; * 2. 光标贴着已吸住的边时直接锁定,不让相邻边参与评分,消除来回跳; * 3. 需要换边时按「屏幕距离 + 深度惩罚」择优,避免吸到屏幕上重叠、但实际更远的边。 */ private getBestDynamicAdhereResult; }