feat: 优化测量功能架构与引擎组件
- 重构测量激活逻辑,在 Engine 组件中添加统一的 activateMeasure(mode) 方法 - 简化 MeasureDialogManager,移除冗余的 handleMeasureTypeChange 方法 - 添加 EngineManager.activateMeasure 转发方法 - 修复 loadModel 错误,正确调用 Engine 组件方法 - 为 Engine 组件设置固定背景渐变色 - MeasurePanel 初始化时触发 onModeChange 回调 - 添加 MeasureMode 共享类型定义 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,17 +13,10 @@ export const createHomeButton = (engine: BimEngine): ButtonConfig => {
|
||||
type: 'button',
|
||||
label: 'toolbar.home',
|
||||
icon: getIcon('主视角'),
|
||||
keepActive: true,
|
||||
keepActive: false,
|
||||
onClick: (button) => {
|
||||
console.log('首页按钮被点击:', button.id);
|
||||
// 演示:使用 engine 发送事件
|
||||
// engine.dialog?.showInfoDialog()
|
||||
engine.emit('ui:open-dialog', { id: 'home-info' });
|
||||
|
||||
// 或者直接调用 engine 的方法
|
||||
// if (engine.engine) {
|
||||
// engine.engine.loadModel('...');
|
||||
// }
|
||||
engine.engine?.CameraGoHome()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,15 +9,16 @@ import { getIcon } from '../../../../../utils/icon-manager';
|
||||
* - 当前仅添加 UI 按钮,点击事件先留空(后续接入引擎能力再实现)
|
||||
* - 使用工厂函数模式注入 engine,便于未来调用 engine API
|
||||
*/
|
||||
export const createZoomBoxButton = (_engine: BimEngine): ButtonConfig => {
|
||||
export const createZoomBoxButton = (engine: BimEngine): ButtonConfig => {
|
||||
return {
|
||||
id: 'zoom-box',
|
||||
groupId: 'group-1',
|
||||
keepActive: true,
|
||||
keepActive: false,
|
||||
type: 'button',
|
||||
label: 'toolbar.zoomBox',
|
||||
icon: getIcon('框选放大'),
|
||||
onClick: () => {
|
||||
engine.engine?.getEngine().rangeScale.active();
|
||||
// 事件先留空:后续实现“框选放大/框选缩放”能力时再接入
|
||||
// 这里不做任何动作,避免误触影响用户操作
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user