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:
@@ -134,6 +134,11 @@ export class MeasurePanel implements IBimComponent {
|
||||
this.applyActiveModeState();
|
||||
this.applyViewState();
|
||||
this.renderResult();
|
||||
|
||||
// 触发初始测量模式的回调(让外部知道默认激活了哪个模式)
|
||||
if (this.options.onModeChange) {
|
||||
this.options.onModeChange(this.activeMode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,27 +1,15 @@
|
||||
/**
|
||||
* 测量面板 - 类型定义
|
||||
*
|
||||
*
|
||||
* 注意:
|
||||
* - 本次只实现 UI,不实现真实测量逻辑(拾取、画线、计算等)。
|
||||
* - 这里的类型以“可读性优先”为原则,尽量直观、易扩展。
|
||||
* - 这里的类型以"可读性优先"为原则,尽量直观、易扩展。
|
||||
*/
|
||||
|
||||
/**
|
||||
* 测量方式(8 种)
|
||||
*
|
||||
* 说明:
|
||||
* - id 采用英文驼峰/小写,便于程序内部使用;
|
||||
* - 显示名称必须通过国际化 key 获取(见 locales)。
|
||||
*/
|
||||
export type MeasureMode =
|
||||
| 'distance' // 距离
|
||||
| 'minDistance' // 最小距离
|
||||
| 'angle' // 角度
|
||||
| 'elevation' // 标高
|
||||
| 'volume' // 体积
|
||||
| 'laserDistance' // 激光测距
|
||||
| 'slope' // 坡度
|
||||
| 'spaceVolume'; // 空间体积
|
||||
// 从通用 types 目录导入 MeasureMode,避免组件间耦合
|
||||
import type { MeasureMode } from '../../types/measure';
|
||||
// 同时重新导出,保持向后兼容
|
||||
export type { MeasureMode };
|
||||
|
||||
/**
|
||||
* 距离/标高等“长度类”单位
|
||||
|
||||
Reference in New Issue
Block a user