|
|
@ -1,12 +1,11 @@
|
|
|
|
import { Intent } from '@blueprintjs/core';
|
|
|
|
import { Intent } from '@blueprintjs/core';
|
|
|
|
import { Matrix4, Vector3 } from 'three';
|
|
|
|
import { Matrix4, Vector3 } from 'three';
|
|
|
|
import { begin } from 'xaop';
|
|
|
|
|
|
|
|
import { app } from '../../ApplicationServices/Application';
|
|
|
|
import { app } from '../../ApplicationServices/Application';
|
|
|
|
import { EBoardKeyList } from '../../Common/BoardKeyList';
|
|
|
|
|
|
|
|
import { Board } from '../../DatabaseServices/Entity/Board';
|
|
|
|
import { Board } from '../../DatabaseServices/Entity/Board';
|
|
|
|
import { Command } from '../../Editor/CommandMachine';
|
|
|
|
import { Command } from '../../Editor/CommandMachine';
|
|
|
|
import { PromptStatus } from '../../Editor/PromptResult';
|
|
|
|
import { PromptStatus } from '../../Editor/PromptResult';
|
|
|
|
import { Box3Ext } from '../../Geometry/Box';
|
|
|
|
import { Box3Ext } from '../../Geometry/Box';
|
|
|
|
|
|
|
|
import { TryRotateSpaceToUCS } from '../../Geometry/SpaceParse/PointSelectSpace';
|
|
|
|
import { TotalSpaceParse } from '../../Geometry/SpaceParse/TotalSpaceParse';
|
|
|
|
import { TotalSpaceParse } from '../../Geometry/SpaceParse/TotalSpaceParse';
|
|
|
|
import { BoardModal, BoardModalType } from '../../UI/Components/Board/BoardModal';
|
|
|
|
import { BoardModal, BoardModalType } from '../../UI/Components/Board/BoardModal';
|
|
|
|
import { ModalState } from '../../UI/Components/Modal/ModalInterface';
|
|
|
|
import { ModalState } from '../../UI/Components/Modal/ModalInterface';
|
|
|
@ -14,7 +13,6 @@ import { AppToaster } from '../../UI/Components/Toaster';
|
|
|
|
import { BoardType, BrRelativePos, LinesType, StripType } from '../../UI/Store/BoardInterface';
|
|
|
|
import { BoardType, BrRelativePos, LinesType, StripType } from '../../UI/Store/BoardInterface';
|
|
|
|
import { ClosingStripStore } from '../../UI/Store/BoardStore';
|
|
|
|
import { ClosingStripStore } from '../../UI/Store/BoardStore';
|
|
|
|
import { AutoCutting } from '../BoardCutting/AutoCuttingReactor';
|
|
|
|
import { AutoCutting } from '../BoardCutting/AutoCuttingReactor';
|
|
|
|
import { TryRotateSpaceToUCS } from '../../Geometry/SpaceParse/PointSelectSpace';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//补收口条默认宽度
|
|
|
|
//补收口条默认宽度
|
|
|
|
const DEFAULT_STRIP_WIDTH = 80;
|
|
|
|
const DEFAULT_STRIP_WIDTH = 80;
|
|
|
@ -22,6 +20,7 @@ const DEFAULT_STRIP_WIDTH = 80;
|
|
|
|
export class DrawClosingStrip implements Command
|
|
|
|
export class DrawClosingStrip implements Command
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private store: ClosingStripStore;
|
|
|
|
private store: ClosingStripStore;
|
|
|
|
|
|
|
|
|
|
|
|
async exec()
|
|
|
|
async exec()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let useUcs = false;
|
|
|
|
let useUcs = false;
|
|
|
@ -61,23 +60,8 @@ export class DrawClosingStrip implements Command
|
|
|
|
this.store = ClosingStripStore.GetInstance();
|
|
|
|
this.store = ClosingStripStore.GetInstance();
|
|
|
|
app.Editor.ModalManage.RenderModeless(BoardModal, { store: this.store, type: BoardModalType.Skt }, { canMinimize: false });
|
|
|
|
app.Editor.ModalManage.RenderModeless(BoardModal, { store: this.store, type: BoardModalType.Skt }, { canMinimize: false });
|
|
|
|
|
|
|
|
|
|
|
|
this.store.GetBoardProcessOption(boards[0]);
|
|
|
|
// this.store.GetBoardProcessOption(boards[0]);
|
|
|
|
this.store.ChangeCabinetName();
|
|
|
|
this.store.ChangeCabinetName();
|
|
|
|
|
|
|
|
|
|
|
|
let useOptionCallback = begin(this.store, this.store.UpdateOption, (cof) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//用周围板件加工数据
|
|
|
|
|
|
|
|
if (cof.processData.useBoardProcessOption)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cof.processData[EBoardKeyList.RoomName] = boards[0].BoardProcessOption[EBoardKeyList.RoomName];
|
|
|
|
|
|
|
|
cof.processData[EBoardKeyList.CabinetName] = boards[0].BoardProcessOption[EBoardKeyList.CabinetName];
|
|
|
|
|
|
|
|
cof.processData[EBoardKeyList.Mat] = boards[0].BoardProcessOption[EBoardKeyList.Mat];
|
|
|
|
|
|
|
|
cof.processData[EBoardKeyList.BrMat] = boards[0].BoardProcessOption[EBoardKeyList.BrMat];
|
|
|
|
|
|
|
|
cof.processData[EBoardKeyList.Color] = boards[0].BoardProcessOption[EBoardKeyList.Color];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
useOptionCallback();
|
|
|
|
|
|
|
|
useOptionCallback = null;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
let res = await app.Editor.ModalManage.Wait();
|
|
|
|
let res = await app.Editor.ModalManage.Wait();
|
|
|
|
|
|
|
|
|
|
|
|
if (res.Status !== ModalState.Ok)
|
|
|
|
if (res.Status !== ModalState.Ok)
|
|
|
@ -94,7 +78,7 @@ export class DrawClosingStrip implements Command
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.buildClosingStrip(spaceParse.SpaceBox, spaceParse.SpaceOCS);
|
|
|
|
this.buildClosingStrip(spaceParse.SpaceBox, spaceParse.SpaceOCS, boards[0]);
|
|
|
|
AppToaster.show({
|
|
|
|
AppToaster.show({
|
|
|
|
message: "收口条已绘制",
|
|
|
|
message: "收口条已绘制",
|
|
|
|
timeout: 1000,
|
|
|
|
timeout: 1000,
|
|
|
@ -111,7 +95,7 @@ export class DrawClosingStrip implements Command
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//构建收口条,更新总空间
|
|
|
|
//构建收口条,更新总空间
|
|
|
|
buildClosingStrip(totalSpace: Box3Ext, rot: Matrix4)
|
|
|
|
buildClosingStrip(totalSpace: Box3Ext, rot: Matrix4, board: Board)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const opt = this.store.m_Option;
|
|
|
|
const opt = this.store.m_Option;
|
|
|
|
let size = totalSpace.getSize(new Vector3());
|
|
|
|
let size = totalSpace.getSize(new Vector3());
|
|
|
@ -200,12 +184,14 @@ export class DrawClosingStrip implements Command
|
|
|
|
}
|
|
|
|
}
|
|
|
|
br.BoardProcessOption = this.store.BoardProcessOption;
|
|
|
|
br.BoardProcessOption = this.store.BoardProcessOption;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.useBoardProcessOption(br, board);
|
|
|
|
|
|
|
|
|
|
|
|
let brs = [br];
|
|
|
|
let brs = [br];
|
|
|
|
if (opt.isDrawFuZhu && br2)
|
|
|
|
if (opt.isDrawFuZhu && br2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
brs.push(br2);
|
|
|
|
brs.push(br2);
|
|
|
|
br2.BoardProcessOption = this.store.BoardProcessOption;
|
|
|
|
br2.BoardProcessOption = this.store.BoardProcessOption;
|
|
|
|
|
|
|
|
this.useBoardProcessOption(br2, board);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
br.Position = pos;
|
|
|
|
br.Position = pos;
|
|
|
|
//更新总空间
|
|
|
|
//更新总空间
|
|
|
@ -221,4 +207,16 @@ export class DrawClosingStrip implements Command
|
|
|
|
|
|
|
|
|
|
|
|
app.Editor.UpdateScreen();
|
|
|
|
app.Editor.UpdateScreen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private useBoardProcessOption(br: Board, board: Board)//使用周围板件数据
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (this.store.BoardProcessOption.useBoardProcessOption)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
br.BoardProcessOption.roomName = board.BoardProcessOption.roomName;
|
|
|
|
|
|
|
|
br.BoardProcessOption.cabinetName = board.BoardProcessOption.cabinetName + br.Name.replace("条", "");
|
|
|
|
|
|
|
|
br.BoardProcessOption.material = board.BoardProcessOption.material;
|
|
|
|
|
|
|
|
br.BoardProcessOption.boardName = board.BoardProcessOption.boardName;
|
|
|
|
|
|
|
|
br.BoardProcessOption.color = board.BoardProcessOption.color;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|