|
|
|
@ -3,7 +3,8 @@ import { app } from "../../ApplicationServices/Application";
|
|
|
|
|
import { Board } from "../../DatabaseServices/Entity/Board";
|
|
|
|
|
import { PromptStatus } from "../../Editor/PromptResult";
|
|
|
|
|
import { DrawDrillingTool } from "./DrawDrillingTool";
|
|
|
|
|
import { CylinderHole } from "../../DatabaseServices/3DSolid/CylinderHole";
|
|
|
|
|
import { CylinderHole, GangDrillType } from "../../DatabaseServices/3DSolid/CylinderHole";
|
|
|
|
|
import { Hole } from "../../DatabaseServices/3DSolid/Hole";
|
|
|
|
|
|
|
|
|
|
enum EDeleteDrillType
|
|
|
|
|
{
|
|
|
|
@ -22,7 +23,7 @@ const keyWordList = [
|
|
|
|
|
|
|
|
|
|
export class DeleteDrill implements Command
|
|
|
|
|
{
|
|
|
|
|
private deleteType: EDeleteDrillType = EDeleteDrillType.All;
|
|
|
|
|
private deleteType: EDeleteDrillType = EDeleteDrillType.Face;
|
|
|
|
|
async exec()
|
|
|
|
|
{
|
|
|
|
|
while (true)
|
|
|
|
@ -36,7 +37,7 @@ export class DeleteDrill implements Command
|
|
|
|
|
{
|
|
|
|
|
case EDeleteDrillType.All:
|
|
|
|
|
promptMsg = "<全部删除>选择板件或者排钻进行删除排钻:";
|
|
|
|
|
filterTypes = [Board, CylinderHole];
|
|
|
|
|
filterTypes = [Board, Hole];
|
|
|
|
|
break;
|
|
|
|
|
case EDeleteDrillType.Face:
|
|
|
|
|
promptMsg = "<板件间排钻删除>选择板件,删除板件间关联的排钻:";
|
|
|
|
@ -48,7 +49,7 @@ export class DeleteDrill implements Command
|
|
|
|
|
break;
|
|
|
|
|
case EDeleteDrillType.Drills:
|
|
|
|
|
promptMsg = "<删除排钻>选择排钻实体进行删除:";
|
|
|
|
|
filterTypes = [CylinderHole];
|
|
|
|
|
filterTypes = [Hole];
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
@ -83,14 +84,15 @@ export class DeleteDrill implements Command
|
|
|
|
|
return;
|
|
|
|
|
case EDeleteDrillType.Nail:
|
|
|
|
|
for (let b of ens as Board[])
|
|
|
|
|
{
|
|
|
|
|
b.ClearAllDrillList();
|
|
|
|
|
b.ClearLayerNails();
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
case EDeleteDrillType.Drills:
|
|
|
|
|
for (let e of ens)
|
|
|
|
|
{
|
|
|
|
|
if (e instanceof CylinderHole && e.Type === GangDrillType.Nail)
|
|
|
|
|
continue;
|
|
|
|
|
e.Erase();
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|