2025-12-24 19:02:34 +08:00
|
|
|
|
import type { ButtonConfig } from '../../../index.type';
|
|
|
|
|
|
import type { BimEngine } from '../../../../../bim-engine';
|
2025-12-25 18:57:09 +08:00
|
|
|
|
import { getIcon } from '../../../../../utils/icon-manager';
|
2025-12-24 19:02:34 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 选框放大按钮配置
|
2025-12-25 18:57:09 +08:00
|
|
|
|
*
|
2025-12-24 19:02:34 +08:00
|
|
|
|
* 说明:
|
|
|
|
|
|
* - 当前仅添加 UI 按钮,点击事件先留空(后续接入引擎能力再实现)
|
|
|
|
|
|
* - 使用工厂函数模式注入 engine,便于未来调用 engine API
|
|
|
|
|
|
*/
|
2026-01-15 14:13:13 +08:00
|
|
|
|
export const createZoomBoxButton = (engine: BimEngine): ButtonConfig => {
|
2025-12-24 19:02:34 +08:00
|
|
|
|
return {
|
|
|
|
|
|
id: 'zoom-box',
|
|
|
|
|
|
groupId: 'group-1',
|
2026-01-15 14:13:13 +08:00
|
|
|
|
keepActive: false,
|
2025-12-24 19:02:34 +08:00
|
|
|
|
type: 'button',
|
|
|
|
|
|
label: 'toolbar.zoomBox',
|
2025-12-25 18:57:09 +08:00
|
|
|
|
icon: getIcon('框选放大'),
|
2025-12-24 19:02:34 +08:00
|
|
|
|
onClick: () => {
|
2026-01-15 14:13:13 +08:00
|
|
|
|
engine.engine?.getEngine().rangeScale.active();
|
2025-12-24 19:02:34 +08:00
|
|
|
|
// 事件先留空:后续实现“框选放大/框选缩放”能力时再接入
|
|
|
|
|
|
// 这里不做任何动作,避免误触影响用户操作
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|