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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 隔离选中构件(隐藏其他)
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,7 @@ export const enUS: TranslationDictionary = {
|
||||
componentDetail: 'Component Detail',
|
||||
hideSelected: 'Hide Selected',
|
||||
transparentSelected: 'Transparent Selected',
|
||||
cancelTranslucent: 'Cancel Translucent',
|
||||
isolateSelected: 'Isolate Selected',
|
||||
hideOthers: 'Hide Others',
|
||||
transparentOthers: 'Transparent Others',
|
||||
|
||||
@@ -56,6 +56,7 @@ export interface TranslationDictionary {
|
||||
componentDetail: string;
|
||||
hideSelected: string;
|
||||
transparentSelected: string;
|
||||
cancelTranslucent: string;
|
||||
isolateSelected: string;
|
||||
hideOthers: string;
|
||||
transparentOthers: string;
|
||||
|
||||
@@ -37,6 +37,7 @@ export const zhCN: TranslationDictionary = {
|
||||
componentDetail: '构件详情',
|
||||
hideSelected: '隐藏选中构件',
|
||||
transparentSelected: '半透明选中构件',
|
||||
cancelTranslucent: '取消半透明',
|
||||
isolateSelected: '隔离选中构件',
|
||||
hideOthers: '其他构件隐藏',
|
||||
transparentOthers: '其他构件半透明',
|
||||
|
||||
@@ -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({
|
||||
id: 'isolateSelected',
|
||||
label: 'menu.isolateSelected',
|
||||
group: 'component',
|
||||
order: 4,
|
||||
order: 5,
|
||||
divider: true,
|
||||
children: [
|
||||
{
|
||||
@@ -120,12 +132,12 @@ export class EngineManager extends BaseManager {
|
||||
]
|
||||
});
|
||||
|
||||
// 5. 快速选择(带子菜单)
|
||||
// 6. 快速选择(带子菜单)
|
||||
items.push({
|
||||
id: 'quickSelect',
|
||||
label: 'menu.quickSelect',
|
||||
group: 'component',
|
||||
order: 5,
|
||||
order: 6,
|
||||
children: [
|
||||
{
|
||||
id: 'selectSameType',
|
||||
@@ -154,12 +166,12 @@ export class EngineManager extends BaseManager {
|
||||
]
|
||||
});
|
||||
|
||||
// 6. 剖切盒适应
|
||||
// 7. 剖切盒适应
|
||||
items.push({
|
||||
id: 'fitSectionBox',
|
||||
label: 'menu.fitSectionBox',
|
||||
group: 'component',
|
||||
order: 6,
|
||||
order: 7,
|
||||
onClick: () => {
|
||||
this.fitSectionBoxToModel();
|
||||
this.rightKey?.hide();
|
||||
@@ -167,12 +179,12 @@ export class EngineManager extends BaseManager {
|
||||
});
|
||||
}
|
||||
|
||||
// 7. 显示全部(始终显示)
|
||||
// 8. 显示全部(始终显示)
|
||||
items.push({
|
||||
id: 'showAll',
|
||||
label: 'menu.showAll',
|
||||
group: 'component',
|
||||
order: 7,
|
||||
order: 8,
|
||||
onClick: () => {
|
||||
this.showAllModels();
|
||||
this.rightKey?.hide();
|
||||
@@ -541,6 +553,13 @@ export class EngineManager extends BaseManager {
|
||||
this.engineInstance?.translucentSelectedModels();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消半透明
|
||||
*/
|
||||
public unTranslucentModel(): void {
|
||||
this.engineInstance?.unTranslucentModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 隔离选中构件(隐藏其他)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user