feat(menu): add cancel translucent option to right-click menu

- Add cancelTranslucent i18n translations (zh-CN: 取消半透明, en-US: Cancel Translucent)
- Add unTranslucentModel() method to Engine layer
- Add unTranslucentModel() proxy to EngineManager
- Add menu item after 'Transparent Selected' (order: 4)
- Update menu item order numbers (5-8)
This commit is contained in:
yuding
2026-02-04 15:10:51 +08:00
parent 89783d0a9b
commit ad19934e19
5 changed files with 41 additions and 8 deletions

View File

@@ -819,6 +819,17 @@ export class Engine implements IBimComponent {
} }
} }
/**
* 取消半透明
*/
public unTranslucentModel(): void {
if (!this._isInitialized || !this.engine?.modelToolModule) {
console.warn('[Engine] Cannot cancel translucent: engine not initialized.');
return;
}
this.engine.modelToolModule.unTranslucentModel();
}
/** /**
* 隔离选中构件(隐藏其他) * 隔离选中构件(隐藏其他)
*/ */

View File

@@ -37,6 +37,7 @@ export const enUS: TranslationDictionary = {
componentDetail: 'Component Detail', componentDetail: 'Component Detail',
hideSelected: 'Hide Selected', hideSelected: 'Hide Selected',
transparentSelected: 'Transparent Selected', transparentSelected: 'Transparent Selected',
cancelTranslucent: 'Cancel Translucent',
isolateSelected: 'Isolate Selected', isolateSelected: 'Isolate Selected',
hideOthers: 'Hide Others', hideOthers: 'Hide Others',
transparentOthers: 'Transparent Others', transparentOthers: 'Transparent Others',

View File

@@ -56,6 +56,7 @@ export interface TranslationDictionary {
componentDetail: string; componentDetail: string;
hideSelected: string; hideSelected: string;
transparentSelected: string; transparentSelected: string;
cancelTranslucent: string;
isolateSelected: string; isolateSelected: string;
hideOthers: string; hideOthers: string;
transparentOthers: string; transparentOthers: string;

View File

@@ -37,6 +37,7 @@ export const zhCN: TranslationDictionary = {
componentDetail: '构件详情', componentDetail: '构件详情',
hideSelected: '隐藏选中构件', hideSelected: '隐藏选中构件',
transparentSelected: '半透明选中构件', transparentSelected: '半透明选中构件',
cancelTranslucent: '取消半透明',
isolateSelected: '隔离选中构件', isolateSelected: '隔离选中构件',
hideOthers: '其他构件隐藏', hideOthers: '其他构件隐藏',
transparentOthers: '其他构件半透明', transparentOthers: '其他构件半透明',

View File

@@ -93,12 +93,24 @@ export class EngineManager extends BaseManager {
} }
}); });
// 4. 隔离选中构件(带子菜单) // 4. 取消半透明
items.push({
id: 'cancelTranslucent',
label: 'menu.cancelTranslucent',
group: 'component',
order: 4,
onClick: () => {
this.unTranslucentModel();
this.rightKey?.hide();
}
});
// 5. 隔离选中构件(带子菜单)
items.push({ items.push({
id: 'isolateSelected', id: 'isolateSelected',
label: 'menu.isolateSelected', label: 'menu.isolateSelected',
group: 'component', group: 'component',
order: 4, order: 5,
divider: true, divider: true,
children: [ children: [
{ {
@@ -120,12 +132,12 @@ export class EngineManager extends BaseManager {
] ]
}); });
// 5. 快速选择(带子菜单) // 6. 快速选择(带子菜单)
items.push({ items.push({
id: 'quickSelect', id: 'quickSelect',
label: 'menu.quickSelect', label: 'menu.quickSelect',
group: 'component', group: 'component',
order: 5, order: 6,
children: [ children: [
{ {
id: 'selectSameType', id: 'selectSameType',
@@ -154,12 +166,12 @@ export class EngineManager extends BaseManager {
] ]
}); });
// 6. 剖切盒适应 // 7. 剖切盒适应
items.push({ items.push({
id: 'fitSectionBox', id: 'fitSectionBox',
label: 'menu.fitSectionBox', label: 'menu.fitSectionBox',
group: 'component', group: 'component',
order: 6, order: 7,
onClick: () => { onClick: () => {
this.fitSectionBoxToModel(); this.fitSectionBoxToModel();
this.rightKey?.hide(); this.rightKey?.hide();
@@ -167,12 +179,12 @@ export class EngineManager extends BaseManager {
}); });
} }
// 7. 显示全部(始终显示) // 8. 显示全部(始终显示)
items.push({ items.push({
id: 'showAll', id: 'showAll',
label: 'menu.showAll', label: 'menu.showAll',
group: 'component', group: 'component',
order: 7, order: 8,
onClick: () => { onClick: () => {
this.showAllModels(); this.showAllModels();
this.rightKey?.hide(); this.rightKey?.hide();
@@ -541,6 +553,13 @@ export class EngineManager extends BaseManager {
this.engineInstance?.translucentSelectedModels(); this.engineInstance?.translucentSelectedModels();
} }
/**
* 取消半透明
*/
public unTranslucentModel(): void {
this.engineInstance?.unTranslucentModel();
}
/** /**
* 隔离选中构件(隐藏其他) * 隔离选中构件(隐藏其他)
*/ */