!847 功能:右键增加显隐所有门板

pull/847/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 2d500afdb1
commit afff61fd64

@ -1,6 +1,8 @@
import { Command } from "../Editor/CommandMachine";
import { app } from "../ApplicationServices/Application";
import { Light } from "../DatabaseServices/Lights/Light";
import { Board } from "../DatabaseServices/Entity/Board";
import { BoardOpenDir } from "../UI/Store/BoardInterface";
export class Command_HideSelected implements Command
{
@ -46,3 +48,25 @@ export class Command_HideUnselected implements Command
app.Editor.Prompt("没有未选中的实体,隐藏失败!");
}
}
export class Command_ShowAllDoor implements Command
{
async exec()
{
app.Database.ModelSpace.Entitys.forEach(o =>
{
if (o instanceof Board && o.OpenDir !== BoardOpenDir.None)
o.Visible = true;
});
}
}
export class Command_HideAllDoor implements Command
{
async exec()
{
app.Database.ModelSpace.Entitys.forEach(o =>
{
if (o instanceof Board && o.OpenDir !== BoardOpenDir.None)
o.Visible = false;
});
}
}

@ -88,7 +88,7 @@ import { Command_ExportData } from "../Add-on/ExportData";
import { Command_Extend } from "../Add-on/Extends";
import { CommandFillet } from "../Add-on/Fillet";
import { Command_Group } from "../Add-on/Group";
import { Command_HideSelected, Command_HideUnselected, Command_ShowAll } from "../Add-on/HideSelected";
import { Command_HideSelected, Command_HideUnselected, Command_ShowAll, Command_ShowAllDoor, Command_HideAllDoor } from "../Add-on/HideSelected";
import { Command_Insert } from "../Add-on/Insert";
import { Command_INsTest } from "../Add-on/instest";
import { Command_Join } from "../Add-on/Join";
@ -453,6 +453,8 @@ export function registerCommand()
commandMachine.RegisterCommand("testw", new Command_TestTape());
commandMachine.RegisterCommand("showknifeMg", new ShowKinfeManageModal());
commandMachine.RegisterCommand("showdoors", new Command_ShowAllDoor());
commandMachine.RegisterCommand("hidedoors", new Command_HideAllDoor());
RegistCustomCommand();
}

@ -17,8 +17,10 @@ const KeyWordCommandMap: Map<string, string> = new Map(Object.entries({
"1": "HS",
"2": "HUS",
"3": "SHOW",
"4": "JD",
"5": "SD",
"4": "SHOWDOORS",
"5": "HIDEDOORS",
"6": "JD",
"7": "SD",
"R": "REDO",
"U": "U",
@ -151,8 +153,8 @@ export class ContextMenuServices implements EditorService
{
if (selects[0] instanceof Board)
menuKeywords.push(...[
{ key: "4", msg: `加点` },
{ key: "5", msg: `删点` },
{ key: "6", msg: `加点` },
{ key: "7", msg: `删点` },
]);
if (selects[0].Template && selects[0].Template.Object)
{
@ -184,7 +186,10 @@ export class ContextMenuServices implements EditorService
children:
[{ key: "1", msg: `隐藏选中` },
{ key: "2", msg: `隐藏未选中` },
{ key: "3", msg: `显示所有` },]
{ key: "3", msg: `显示所有` },
{ key: "4", msg: `显示门板` },
{ key: "5", msg: `隐藏门板` },
]
},
{ key: "U", msg: `放弃`, disable: lastCmd === "help" },
{ key: "R", msg: `重做`, disable: lastCmd === "help" },

Loading…
Cancel
Save