|
|
|
@ -6,7 +6,7 @@ import { GetOnlineTemplate } from "../../../DatabaseServices/Template/TempateUti
|
|
|
|
|
import { TemplateRecord } from "../../../DatabaseServices/Template/TemplateRecord";
|
|
|
|
|
import { ISpaceParse } from "../../../Geometry/SpaceParse/ISpaceParse";
|
|
|
|
|
import { BoardProcessOption, DrillType, BoardOpenDir, BoardType } from "../../../UI/Store/BoardInterface";
|
|
|
|
|
import { IDoorConfigOption, IDoorInfo, HandleHorPos, HandleVePos, DoorOpenDir } from "../../../UI/Store/DoorInterface";
|
|
|
|
|
import { IDoorConfigOption, IDoorInfo, HandleHorPos, HandleVePos, DoorOpenDir, DisableChangeParName } from "../../../UI/Store/DoorInterface";
|
|
|
|
|
import { DuplicateRecordCloning } from "../../../Common/Status";
|
|
|
|
|
import { Box3Ext } from "../../../Geometry/Box";
|
|
|
|
|
import { HardwareCompositeEntity } from "../../../DatabaseServices/Hardware/HardwareCompositeEntity";
|
|
|
|
@ -15,6 +15,8 @@ import { Entity } from './../../../DatabaseServices/Entity/Entity';
|
|
|
|
|
import { TemplateVisualSpace } from "../../../DatabaseServices/Template/ProgramTempate/TemplateVisualSpace";
|
|
|
|
|
import { Vector3 } from "three";
|
|
|
|
|
import { isParallelTo } from "../../../Geometry/GeUtils";
|
|
|
|
|
import { TemplateSizeBoard } from "../../../DatabaseServices/Template/ProgramTempate/TemplateSizeBoard";
|
|
|
|
|
import { openDirTitle } from "../../../UI/Store/DoorDrawerStore/DoorStore";
|
|
|
|
|
|
|
|
|
|
export class DrawDoorTool
|
|
|
|
|
{
|
|
|
|
@ -479,19 +481,105 @@ export class DrawDoorTool
|
|
|
|
|
}
|
|
|
|
|
return [...spaceBoardSet];
|
|
|
|
|
}
|
|
|
|
|
protected GetBoardOpenDir(dir: DoorOpenDir)
|
|
|
|
|
protected GetDoorTemp(info: IDoorInfo)
|
|
|
|
|
{
|
|
|
|
|
let doorTemp: TemplateRecord;
|
|
|
|
|
|
|
|
|
|
if (info.tempInfo.temp.id === "" || !this._idTempMap.has(info.tempInfo.temp.id))
|
|
|
|
|
{
|
|
|
|
|
doorTemp = new TemplateSizeBoard().InitBaseParams();
|
|
|
|
|
doorTemp.Name = "门板";
|
|
|
|
|
app.Database.TemplateTable.Append(doorTemp);
|
|
|
|
|
let br = Board.CreateBoard(info.height, info.width, 18, BoardType.Behind);
|
|
|
|
|
br.BoardProcessOption.drillType = DrillType.None;
|
|
|
|
|
br.ColorIndex = 6;
|
|
|
|
|
|
|
|
|
|
br.BoardProcessOption[EBoardKeyList.UpSealed] = this.option.topDoorSeal.toString();
|
|
|
|
|
br.BoardProcessOption[EBoardKeyList.DownSealed] = this.option.bottomDoorSeal.toString();
|
|
|
|
|
br.BoardProcessOption[EBoardKeyList.LeftSealed] = this.option.leftDoorSeal.toString();
|
|
|
|
|
br.BoardProcessOption[EBoardKeyList.RightSealed] = this.option.rightDoorSeal.toString();
|
|
|
|
|
|
|
|
|
|
if (this.surroundOption)
|
|
|
|
|
{
|
|
|
|
|
br.BoardProcessOption[EBoardKeyList.RoomName] = this.surroundOption[EBoardKeyList.RoomName];
|
|
|
|
|
br.BoardProcessOption[EBoardKeyList.CabinetName] = this.surroundOption[EBoardKeyList.CabinetName];
|
|
|
|
|
}
|
|
|
|
|
br.Name =
|
|
|
|
|
info.openDir === DoorOpenDir.None ? "门板" :
|
|
|
|
|
openDirTitle[info.openDir] + "开门板";
|
|
|
|
|
|
|
|
|
|
app.Database.ModelSpace.Append(br);
|
|
|
|
|
doorTemp.Objects.push(br.Id);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
let drawId = info.tempInfo.temp.id;
|
|
|
|
|
let temp = this._idTempMap.get(drawId);
|
|
|
|
|
doorTemp = app.Database.WblockCloneObejcts([temp], app.Database.TemplateTable, new Map(), DuplicateRecordCloning.Ignore)[0] as TemplateRecord;
|
|
|
|
|
//修改的参数应用给模板
|
|
|
|
|
for (let par of info.tempInfo.temp.props)
|
|
|
|
|
{
|
|
|
|
|
if (DisableChangeParName.includes(par.name)) continue;
|
|
|
|
|
let p = doorTemp.GetParam(par.name);
|
|
|
|
|
if (p)
|
|
|
|
|
p.expr = par.expr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doorTemp.LParam.expr = "_L+_ZG+_YG";
|
|
|
|
|
doorTemp.WParam.expr = "_W";
|
|
|
|
|
doorTemp.HParam.expr = "_H+_SG+_XG";
|
|
|
|
|
doorTemp.PXParam.expr = "-_ZG";
|
|
|
|
|
doorTemp.PZParam.expr = "-_XG";
|
|
|
|
|
|
|
|
|
|
return doorTemp;
|
|
|
|
|
}
|
|
|
|
|
protected SetOpenDir(doorsTemp: TemplateRecord, info: IDoorInfo)
|
|
|
|
|
{
|
|
|
|
|
for (let id of doorsTemp.Objects)
|
|
|
|
|
{
|
|
|
|
|
if (!id.IsErase)
|
|
|
|
|
{
|
|
|
|
|
let en = id.Object;
|
|
|
|
|
if (en instanceof Board)
|
|
|
|
|
{
|
|
|
|
|
en.OpenDir = this.GetBoardOpenDir(info.openDir) as BoardOpenDir;
|
|
|
|
|
}
|
|
|
|
|
else if (en instanceof HardwareCompositeEntity)
|
|
|
|
|
{
|
|
|
|
|
en.HardwareOption.model = this.GetBoardOpenDir(info.openDir, true) as string;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private GetBoardOpenDir(dir: DoorOpenDir, getModel = false): string | BoardOpenDir
|
|
|
|
|
{
|
|
|
|
|
switch (dir)
|
|
|
|
|
{
|
|
|
|
|
case DoorOpenDir.Left:
|
|
|
|
|
if (getModel)
|
|
|
|
|
return "左开门板";
|
|
|
|
|
else
|
|
|
|
|
return BoardOpenDir.Left;
|
|
|
|
|
case DoorOpenDir.Right:
|
|
|
|
|
if (getModel)
|
|
|
|
|
return "右开门板";
|
|
|
|
|
else
|
|
|
|
|
return BoardOpenDir.Right;
|
|
|
|
|
case DoorOpenDir.Top:
|
|
|
|
|
if (getModel)
|
|
|
|
|
return "上开门板";
|
|
|
|
|
else
|
|
|
|
|
return BoardOpenDir.Up;
|
|
|
|
|
case DoorOpenDir.Bottom:
|
|
|
|
|
if (getModel)
|
|
|
|
|
return "下开门板";
|
|
|
|
|
else
|
|
|
|
|
return BoardOpenDir.Down;
|
|
|
|
|
default:
|
|
|
|
|
if (getModel)
|
|
|
|
|
return "门板";
|
|
|
|
|
else
|
|
|
|
|
return BoardOpenDir.None;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|