feat(section-axis): integrate dialog manager with engine methods
This commit is contained in:
@@ -57,13 +57,16 @@ export class SectionAxisDialogManager extends BaseDialogManager {
|
||||
defaultAxis: 'x',
|
||||
defaultHidden: false,
|
||||
onHideToggle: (isHidden) => {
|
||||
console.log('[SectionAxisDialogManager] 隐藏切换:', isHidden);
|
||||
// 隐藏功能:第三方引擎无 API,仅输出日志
|
||||
console.log('[SectionAxisDialogManager] 隐藏切换(暂不支持):', isHidden);
|
||||
},
|
||||
onReverse: () => {
|
||||
console.log('[SectionAxisDialogManager] 反向剖切');
|
||||
// 反向功能:第三方引擎无 API,仅输出日志
|
||||
console.log('[SectionAxisDialogManager] 反向剖切(暂不支持)');
|
||||
},
|
||||
onAxisChange: (axis) => {
|
||||
console.log('[SectionAxisDialogManager] 切换轴向:', axis);
|
||||
this.registry.engine3d?.activateSectionAxis(axis);
|
||||
}
|
||||
});
|
||||
this.panel.init();
|
||||
@@ -73,6 +76,15 @@ export class SectionAxisDialogManager extends BaseDialogManager {
|
||||
/** 对话框创建后的回调,自适应高度 */
|
||||
protected onDialogCreated(): void {
|
||||
this.dialog?.fitHeight(false);
|
||||
|
||||
// 检查 Engine 是否已初始化
|
||||
if (!this.registry.engine3d) {
|
||||
console.error('[SectionAxisDialogManager] Engine not initialized. Call initEngine() first.');
|
||||
return;
|
||||
}
|
||||
|
||||
// 自动激活默认轴向剖切(X轴)
|
||||
this.registry.engine3d.activateSectionAxis('x');
|
||||
}
|
||||
|
||||
/** 对话框关闭时的回调,取消工具栏按钮激活状态 */
|
||||
@@ -82,6 +94,9 @@ export class SectionAxisDialogManager extends BaseDialogManager {
|
||||
|
||||
/** 销毁前的清理,销毁面板实例 */
|
||||
protected onBeforeDestroy(): void {
|
||||
// 停用轴向剖切
|
||||
this.registry.engine3d?.deactivateSectionAxis();
|
||||
|
||||
if (this.panel) {
|
||||
this.panel.destroy();
|
||||
this.panel = null;
|
||||
|
||||
Reference in New Issue
Block a user