From 34bdab9f749c0fce93d9213dff098cc9e83cb01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E8=8B=A5=E5=AF=92?= <13470150+qian-ruohan@user.noreply.gitee.com> Date: Tue, 20 Aug 2024 10:00:40 +0000 Subject: [PATCH] =?UTF-8?q?!2977=20=E6=96=B0=E5=A2=9E:=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E2=80=9C=E6=A0=B9=E6=8D=AE=E6=9D=BF=E4=BB=B6=E7=BA=B9=E8=B7=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=9C=E8=89=B2=E2=80=9D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangeColorByLinesType.tsx | 164 ++++++++++++++++++ .../ShareView/ShareViewCommandRegister.ts | 144 +++++++-------- src/Common/CommandNames.ts | 1 + src/Editor/CommandRegister.ts | 2 + src/UI/Components/CommandPanel/CommandList.ts | 9 + src/UI/Components/TopToolBar/ToolsBlock.tsx | 2 +- src/UI/Components/TopToolBar/TopToolBar.tsx | 1 + 7 files changed, 251 insertions(+), 72 deletions(-) create mode 100644 src/Add-on/ChangeColorByBoard/ChangeColorByLinesType.tsx diff --git a/src/Add-on/ChangeColorByBoard/ChangeColorByLinesType.tsx b/src/Add-on/ChangeColorByBoard/ChangeColorByLinesType.tsx new file mode 100644 index 000000000..0e9c8f532 --- /dev/null +++ b/src/Add-on/ChangeColorByBoard/ChangeColorByLinesType.tsx @@ -0,0 +1,164 @@ +import { Classes, Intent } from "@blueprintjs/core"; +import { observer } from "mobx-react"; +import React, { useEffect, useRef, useState } from "react"; +import { begin, end } from "xaop"; +import { app } from "../../ApplicationServices/Application"; +import { ColorMaterial } from "../../Common/ColorPalette"; +import { KeyBoard } from "../../Common/KeyEnum"; +import { Board } from "../../DatabaseServices/Entity/Board"; +import { LinesType } from "../../DatabaseServices/Entity/BoardInterface"; +import { Command } from "../../Editor/CommandMachine"; +import { SelectSetBase } from "../../Editor/SelectBase"; +import { CommonModal } from "../../UI/Components/Modal/ModalContainer"; +import { AppToaster } from "../../UI/Components/Toaster"; +import { ResetColor } from "./ResetColor"; + +export class ChangeColorByLinesType implements Command +{ + async exec() + { + AppToaster.show({ + message: "根据板件的纹路修改颜色,红色=正纹,黄色=反纹,绿色=可翻转", + timeout: 5000, + intent: Intent.SUCCESS, + }, "ChangeColorByLinesType"); + + let ents = app.Database.ModelSpace.Entitys.filter(e => !e.IsErase && e instanceof Board) as Board[]; + + const oldColorMap = new Map(); + let boardMap = new Map(); + + for (let br of ents) + { + oldColorMap.set(br, br.ColorIndex); + if (br.BoardProcessOption.lines === LinesType.Positive) + br.ColorIndex = 1; + else if (br.BoardProcessOption.lines === LinesType.Reverse) + br.ColorIndex = 2; + else + br.ColorIndex = 3; + + let arr = boardMap.get(br.ColorIndex); + if (!arr) + { + arr = []; + boardMap.set(br.ColorIndex, arr); + } + arr.push(br); + } + app.Editor.ModalManage.RenderModeless(BoardColorByLinesTypeDialog, { boardMap, oldColorMap }, { canMinimize: false }); + } +} +interface IBoardColorByLinesTypeProps +{ + boardMap: Map; + oldColorMap: Map; +} +export const BoardColorByLinesTypeDialog = observer((props: IBoardColorByLinesTypeProps,) => +{ + const [selectbg, setSelectbg] = useState([]); + const onCtrlKeyBoard = useRef(false); + const removeFun = useRef([]); + const selectIndex = useRef([]); + + const OnClick = (index: number) => + { + if (!onCtrlKeyBoard.current) + { + selectIndex.current = [index]; + } else + { + if (selectIndex.current.length > 1 && selectIndex.current.includes(index)) + { + selectIndex.current = selectIndex.current.filter((item) => item !== index); + } else + { + selectIndex.current.push(index); + } + } + let brs: Board[] = []; + for (let i of selectIndex.current) + { + const boards = props.boardMap.get(i); + if (boards) + { + brs.push(...boards); + } + } + setSelectbg([...selectIndex.current]); + app.Editor.SetSelection(brs); + }; + + useEffect(() => + { + const onKeyDown = (e: KeyboardEvent) => + { + if (e.keyCode === KeyBoard.Enter || e.keyCode === KeyBoard.Space) + app.Editor.ModalManage.Destory(); + else if (e.keyCode === KeyBoard.Control) + onCtrlKeyBoard.current = true; + e.stopPropagation(); + }; + + const onKeyUp = (e: KeyboardEvent) => + { + if (e.keyCode === KeyBoard.Control) + { + onCtrlKeyBoard.current = false; + e.stopPropagation(); + } + }; + + const addSelect = (ss: SelectSetBase) => + { + if (onCtrlKeyBoard.current) return; + let br = ss.SelectEntityList[0]; + if (!br) return; + if (br instanceof Board) + { + const type = br.BoardProcessOption.lines; + selectIndex.current = [type === LinesType.Positive ? 1 : type === LinesType.Reverse ? 2 : 3]; + setSelectbg([...selectIndex.current]); + } + }; + + removeFun.current = [ + begin(app.Editor.ModalManage, app.Editor.ModalManage.OnKeyDown, onKeyDown), + end(app.Editor.ModalManage, app.Editor.ModalManage.onKeyUp, onKeyUp), + begin(app.Editor.SelectCtrl, app.Editor.SelectCtrl.AddSelect, addSelect), + ]; + + return () => + { + for (let fun of removeFun.current) + fun(); + ResetColor(props.oldColorMap); + }; + }, []); + + return ( + + { + app.Editor.ModalManage.Destory(); + }} + > +
    + { + Array.from(props.boardMap.keys()).map((index) => ( + +
  • OnClick(index)} + style={{ background: selectbg.includes(index) ? ColorMaterial.GetColor(index)?.getStyle() : "" }}> + + {`设计纹路:${index === 1 ? '正纹' : index === 2 ? '反纹' : '可翻转'} 实体颜色:${index}`} +
  • + )) + } +
+
+ ); +}); diff --git a/src/Add-on/ShareView/ShareViewCommandRegister.ts b/src/Add-on/ShareView/ShareViewCommandRegister.ts index 2c79c6e36..5a4e6c1c2 100644 --- a/src/Add-on/ShareView/ShareViewCommandRegister.ts +++ b/src/Add-on/ShareView/ShareViewCommandRegister.ts @@ -12,6 +12,8 @@ import { RenderType } from "../../GraphicsSystem/RenderType"; import { Command_HeadCeilingContourManage } from "../../UI/Components/HeadCeiling/HeadCeilingContourManageCommand"; import { Command_HeadCeilingInfoConfigPanel, Command_HeadCeilingMaterialPanel } from "../../UI/Components/HeadCeiling/HeadCeilingInfoConfigPanelCommand"; import { EOptionTabId } from "../../UI/Components/Modal/OptionModal/ConfigDialog"; +import { ActicityLayerBoard } from "../ActivityLayerBoard"; +import { AddPtOnBoard, DeletePtOnBoard } from "../AddPtOnBoard"; import { Align } from "../Align"; import { Command_DrawArcBoard } from "../ArcBoard/DrawArcBoard"; import { Command_Area } from "../Area"; @@ -19,17 +21,24 @@ import { Command_Array } from "../Array"; import { AutoHoleFaceSetting } from "../AutoHoleFaceSetting"; import { BackgroundSwitching } from "../BackgroundSwitching"; import { FindModeingKnifeRadius } from "../Batch/FindModeingKnifes"; +import { BatchModifyPanel } from "../BatchModifyPanel"; +import { BoardBatchCurtail } from "../BoardBatchCurtail"; import { CuttingByFace, CuttingByRectFace } from "../BoardCutting/CuttingByFace"; import { DeleteRelevance } from "../BoardCutting/DeleteRelevance"; +import { LinearCutting, RectLinearCutting } from "../BoardCutting/LinearCutting"; +import { NonAssociativeCutting } from "../BoardCutting/NonAssociativeCutting"; +import { ReferenceCutting } from "../BoardCutting/ReferenceCutting"; import { Command_ChangeBoardColorByPBFace } from "../BoardEditor/ChangeBoardColorByPBFace"; import { Command_ClearBoard2DModeling } from "../BoardEditor/ClearBoard2DModeling"; import { SetBoardLines, SetComposingFace } from "../BoardEditor/SetBoardLines"; import { Command_TextModifyTool } from "../BoardEditor/TextModifyTool"; import { UpdateBoardInfos } from "../BoardEditor/UpdateBoardInfos"; +import { BoardFindModify } from "../BoardFindModify"; import { OneClickInspection } from "../BoardInspection/OneClickInspection"; import { IntersectionOperation, SubsractOperation, UnionOperation } from "../BoolOperation"; import { Command_Break, Command_BreakAll } from "../Break"; import { Command_CameraSnapshootRestore, Command_CameraSnapshootSave, Command_CameraSnapshootSaveIndex } from "../CameraSnapshootCMD"; +import { ChangeColorByLinesType } from "../ChangeColorByBoard/ChangeColorByLinesType"; import { ChangeColorByMaterial } from "../ChangeColorByBoard/ChangeColorByMaterial"; import { ChangeColorByRoomCabinet } from "../ChangeColorByRoomOrCabinet/ChangeColorByRoomOrCabinet"; import { CheckHoles } from "../CheckHoles"; @@ -51,7 +60,21 @@ import { DeleteCurve } from "../DeleteCurve"; import { Command_Dist } from "../Dist"; import { CMD_Divide } from "../Divide"; import { DrawArc } from "../DrawArc"; +import { ApplyModel2ToBoard } from "../DrawBoard/ApplyModel2ToBoard"; +import { Command_ApplyModelToBoards } from "../DrawBoard/ApplyModelToBoards"; +import { DrawBehindBoard } from "../DrawBoard/DrawBehindBoard"; +import { DrawClosingStrip } from "../DrawBoard/DrawClosingStrip"; +import { DrawDoor } from "../DrawBoard/DrawDoor"; +import { DrawDrawrer } from "../DrawBoard/DrawDrawer"; +import { DrawLayerBoard } from "../DrawBoard/DrawLayerBoard"; +import { DrawLeftRight } from "../DrawBoard/DrawLeftRightBoard"; +import { DrawSingleBoard } from "../DrawBoard/DrawSingleBoard"; +import { DrawSpecialShapedBoard } from "../DrawBoard/DrawSpecialShapedBoard"; +import { DrawSpecialShapedBoardByContour } from "../DrawBoard/DrawSpecialShapedBoardByContour"; import { DrawTemplateByImport } from "../DrawBoard/DrawTemplateByImport"; +import { DrawTopBottomBoard } from "../DrawBoard/DrawTopBottomBoard"; +import { DrawVerticalBoard } from "../DrawBoard/DrawVerticalBoard"; +import { EditorBoardTemplate } from "../DrawBoard/EditorBoardTempate"; import { FindMaxOrMinSizeBoard } from "../DrawBoard/FindMaxSizeBoard"; import { FixIntersectSelfContour } from "../DrawBoard/FixIntersectSelfContour"; import { ParseHandle } from "../DrawBoard/ParseHandle"; @@ -59,21 +82,30 @@ import { ParseHinge } from "../DrawBoard/ParseHinge"; import { SetHoleNoneType } from "../DrawBoard/SetHoleType"; import { DrawCircle } from "../DrawCircle"; import { DrawCylineder } from "../DrawCylinder"; +import { Command_AutoDimBrs } from "../DrawDim/AutoDimBrs"; +import { Command_BoardInfoDimTool } from "../DrawDim/BoardInfoDimTool"; +import { BreakDim } from "../DrawDim/BreakDim"; import { Command_DimContinue } from "../DrawDim/Command_DimContinue"; import { Command_DimStyle } from "../DrawDim/Command_DimStyle"; +import { DeleteDim, DeleteMinDim } from "../DrawDim/DeleteDim"; import { Command_DimArc } from "../DrawDim/DimArc"; import { Command_Draw2LineAngularDim } from "../DrawDim/Draw2LineAngularDim"; import { DrawAlignedDimension } from "../DrawDim/DrawAlignedDimension"; import { DrawDiameterDim } from "../DrawDim/DrawDiameterDim"; import { DrawLinearDimension } from "../DrawDim/DrawLinearDimension"; import { DrawRadiusDim } from "../DrawDim/DrawRadiusDim"; +import { Command_FastDimBrs } from "../DrawDim/FastDim/FastDim"; import { Command_HideDim, Command_ShowDim } from "../DrawDim/OneKeyHideOrShowDim"; import { CheckDrawHole } from "../DrawDrilling/CheckDrawHole"; import { CheckHasHoleBoard } from "../DrawDrilling/CheckHasHole"; +import { DeleteDrill } from "../DrawDrilling/DeleteDrill"; +import { DrawDrilling } from "../DrawDrilling/DrawDrilling"; +import { DrillConfig } from "../DrawDrilling/DrillConfig"; import { AddAssocDrillLock } from "../DrawDrilling/DrillLock/AddAssocDrillLock"; import { AddAloneDrillLock } from "../DrawDrilling/DrillLock/AloneDrillLock"; import { RemoveAssocDrillLock } from "../DrawDrilling/DrillLock/RemoveAssocDrillLock"; import { RemoveDrillLock } from "../DrawDrilling/DrillLock/RemoveDrillLock"; +import { ReverseDrillFace } from "../DrawDrilling/ReverseDrillFace"; import { ShowDrillingTemplate } from "../DrawDrilling/ShowDrillingTemplate"; import { ToggleDrillingReactor } from "../DrawDrilling/ToggleDrillingReactor"; import { DrawEllipse } from "../DrawEllipse"; @@ -107,6 +139,7 @@ import { Command_EraseNoSelect } from "../EraseNoSelect"; import { Command_Esc } from "../Esc"; import { Command_ExportSTL } from "../Exports/ExportSTL"; import { Command_Extend } from "../Extends"; +import { Command_FZWL } from "../FZWL"; import { Command_OpenHistory } from "../File/OpenHistory"; import { OperLogs } from "../File/OperLog"; import { CommandFillet } from "../Fillet"; @@ -120,6 +153,7 @@ import { Command_Join } from "../Join"; import { EditorLattice } from "../LatticeDrawer/EditorLattice"; import { Command_Length } from "../Length"; import { Command_Lisp } from "../Lisp"; +import { LookOverBoardInfos } from "../LookOverBoardInfos/LookOverBoardInfos"; import { Command_MatchProp } from "../MatchProp"; import { Command_Move } from "../Move"; import { Command_Cmd_Down } from "../Move/Cmd_Down"; @@ -128,6 +162,7 @@ import { Command_ExportObj } from "../Obj/Command_ExportObj"; import { Command_ExportObjAndMtl } from "../Obj/Command_ExportObjMtl"; import { Command_DynOffset, Command_DynOffsetToolPath, Command_Offset } from "../Offset"; import { Open } from "../Open"; +import { Command_OpenCabinet } from "../OpenCabinet/OpenCabinet"; import { PasteClip } from "../PasteClip"; import { Pedit } from "../Pedit"; import { ReOpen } from "../ReOpen"; @@ -137,6 +172,7 @@ import { Command_RestoreColor } from "../RestoreColor"; import { Command_Reverse } from "../Reverse"; import { Command_ParseRoomWall } from "../Room/ParseRoomWall"; import { Command_Rotate, Command_RotateRefer } from "../Rotate"; +import { RotateLayerBoard } from "../RotateLayerBoard"; import { New } from "../Save"; import { Command_Scale } from "../Scale"; import { SetSmoothEdge } from "../SetSmoothEdge/SetSmoothEdge"; @@ -175,41 +211,6 @@ import { Command_Curve2VSBox } from "../twoD2threeD/Command_Curve2VSBox"; import { Command_ParseBoardName } from "../twoD2threeD/ParseBoardName"; import { Polyline2Board } from "../twoD2threeD/Polyline2Board"; import { Rect2Board } from "../twoD2threeD/Rect2Board"; -import { Command_OpenCabinet } from "../OpenCabinet/OpenCabinet"; -import { DrawLeftRight } from "../DrawBoard/DrawLeftRightBoard"; -import { DrawTopBottomBoard } from "../DrawBoard/DrawTopBottomBoard"; -import { DrawBehindBoard } from "../DrawBoard/DrawBehindBoard"; -import { DrawLayerBoard } from "../DrawBoard/DrawLayerBoard"; -import { DrawVerticalBoard } from "../DrawBoard/DrawVerticalBoard"; -import { DrawSingleBoard } from "../DrawBoard/DrawSingleBoard"; -import { DrawClosingStrip } from "../DrawBoard/DrawClosingStrip"; -import { DrawDoor } from "../DrawBoard/DrawDoor"; -import { DrillConfig } from "../DrawDrilling/DrillConfig"; -import { DrawDrilling } from "../DrawDrilling/DrawDrilling"; -import { DrawSpecialShapedBoard } from "../DrawBoard/DrawSpecialShapedBoard"; -import { DrawSpecialShapedBoardByContour } from "../DrawBoard/DrawSpecialShapedBoardByContour"; -import { Command_ApplyModelToBoards } from "../DrawBoard/ApplyModelToBoards"; -import { ApplyModel2ToBoard } from "../DrawBoard/ApplyModel2ToBoard"; -import { LinearCutting, RectLinearCutting } from "../BoardCutting/LinearCutting"; -import { NonAssociativeCutting } from "../BoardCutting/NonAssociativeCutting"; -import { ReferenceCutting } from "../BoardCutting/ReferenceCutting"; -import { AddPtOnBoard, DeletePtOnBoard } from "../AddPtOnBoard"; -import { BoardFindModify } from "../BoardFindModify"; -import { LookOverBoardInfos } from "../LookOverBoardInfos/LookOverBoardInfos"; -import { BoardBatchCurtail } from "../BoardBatchCurtail"; -import { BatchModifyPanel } from "../BatchModifyPanel"; -import { Command_AutoDimBrs } from "../DrawDim/AutoDimBrs"; -import { Command_BoardInfoDimTool } from "../DrawDim/BoardInfoDimTool"; -import { Command_FastDimBrs } from "../DrawDim/FastDim/FastDim"; -import { BreakDim } from "../DrawDim/BreakDim"; -import { DeleteDim, DeleteMinDim } from "../DrawDim/DeleteDim"; -import { RotateLayerBoard } from "../RotateLayerBoard"; -import { DrawDrawrer } from "../DrawBoard/DrawDrawer"; -import { DeleteDrill } from "../DrawDrilling/DeleteDrill"; -import { ReverseDrillFace } from "../DrawDrilling/ReverseDrillFace"; -import { Command_FZWL } from "../FZWL"; -import { EditorBoardTemplate } from "../DrawBoard/EditorBoardTempate"; -import { ActicityLayerBoard } from "../ActivityLayerBoard"; export function registerCommand() { @@ -439,41 +440,41 @@ export function registerCommand() commandMachine.RegisterCommand(CommandNames.LayerBoard, new DrawLayerBoard()); commandMachine.RegisterCommand(CommandNames.VertialBoard, new DrawVerticalBoard()); commandMachine.RegisterCommand(CommandNames.SingleBoard, new DrawSingleBoard()); - commandMachine.RegisterCommand(CommandNames.CloseStrip, new DrawClosingStrip()); - commandMachine.RegisterCommand(CommandNames.Door, new DrawDoor()); - commandMachine.RegisterCommand(CommandNames.DrillConfig, new DrillConfig()); - commandMachine.RegisterCommand(CommandNames.Hole, new DrawDrilling()); - commandMachine.RegisterCommand(CommandNames.YiXing, new DrawSpecialShapedBoard()); - commandMachine.RegisterCommand(CommandNames.YXLK, new DrawSpecialShapedBoardByContour()); - commandMachine.RegisterCommand(CommandNames.ZXLK, new Command_ApplyModelToBoards()); - commandMachine.RegisterCommand(CommandNames.Model2Contour, new ApplyModel2ToBoard()); - commandMachine.RegisterCommand(CommandNames.LinearCutting, new LinearCutting()); - commandMachine.RegisterCommand(CommandNames.RectLinearCutting, new RectLinearCutting()); - commandMachine.RegisterCommand(CommandNames.NonAssociativeCutting, new NonAssociativeCutting()); - commandMachine.RegisterCommand(CommandNames.ReferenceCutting, new ReferenceCutting()); - commandMachine.RegisterCommand(CommandNames.AddPtOnBoard, new AddPtOnBoard()); - commandMachine.RegisterCommand(CommandNames.DeletePtOnBoard, new DeletePtOnBoard()); - commandMachine.RegisterCommand(CommandNames.BoardFindModify, new BoardFindModify()); - commandMachine.RegisterCommand(CommandNames.LookOverBoardInfos, new LookOverBoardInfos()); - commandMachine.RegisterCommand(CommandNames.BoardBatchCurtail, new BoardBatchCurtail()); - commandMachine.RegisterCommand(CommandNames.BatchModifyPanel, new BatchModifyPanel()); - commandMachine.RegisterCommand(CommandNames.AutoDimBrs, new Command_AutoDimBrs()); - commandMachine.RegisterCommand(CommandNames.BoardInfoDim, new Command_BoardInfoDimTool()); - commandMachine.RegisterCommand(CommandNames.FastDimBrs, new Command_FastDimBrs()); - commandMachine.RegisterCommand(CommandNames.BreakDim, new BreakDim()); - commandMachine.RegisterCommand(CommandNames.DeleteDim, new DeleteDim()); - commandMachine.RegisterCommand(CommandNames.DeleteMinDim, new DeleteMinDim()); - commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle()); - - commandMachine.RegisterCommand(CommandNames.RotateLayerBoard, new RotateLayerBoard()); - - commandMachine.RegisterCommand(CommandNames.Drawer, new DrawDrawrer()); - commandMachine.RegisterCommand(CommandNames.DeleteHole, new DeleteDrill()); - commandMachine.RegisterCommand(CommandNames.ReverseDrillFace, new ReverseDrillFace()); - commandMachine.RegisterCommand(CommandNames.FZWL, new Command_FZWL()); - commandMachine.RegisterCommand(CommandNames.EditorboardTemplate, new EditorBoardTemplate()); - - commandMachine.RegisterCommand(CommandNames.ActicityLayerBoard, new ActicityLayerBoard()); + commandMachine.RegisterCommand(CommandNames.CloseStrip, new DrawClosingStrip()); + commandMachine.RegisterCommand(CommandNames.Door, new DrawDoor()); + commandMachine.RegisterCommand(CommandNames.DrillConfig, new DrillConfig()); + commandMachine.RegisterCommand(CommandNames.Hole, new DrawDrilling()); + commandMachine.RegisterCommand(CommandNames.YiXing, new DrawSpecialShapedBoard()); + commandMachine.RegisterCommand(CommandNames.YXLK, new DrawSpecialShapedBoardByContour()); + commandMachine.RegisterCommand(CommandNames.ZXLK, new Command_ApplyModelToBoards()); + commandMachine.RegisterCommand(CommandNames.Model2Contour, new ApplyModel2ToBoard()); + commandMachine.RegisterCommand(CommandNames.LinearCutting, new LinearCutting()); + commandMachine.RegisterCommand(CommandNames.RectLinearCutting, new RectLinearCutting()); + commandMachine.RegisterCommand(CommandNames.NonAssociativeCutting, new NonAssociativeCutting()); + commandMachine.RegisterCommand(CommandNames.ReferenceCutting, new ReferenceCutting()); + commandMachine.RegisterCommand(CommandNames.AddPtOnBoard, new AddPtOnBoard()); + commandMachine.RegisterCommand(CommandNames.DeletePtOnBoard, new DeletePtOnBoard()); + commandMachine.RegisterCommand(CommandNames.BoardFindModify, new BoardFindModify()); + commandMachine.RegisterCommand(CommandNames.LookOverBoardInfos, new LookOverBoardInfos()); + commandMachine.RegisterCommand(CommandNames.BoardBatchCurtail, new BoardBatchCurtail()); + commandMachine.RegisterCommand(CommandNames.BatchModifyPanel, new BatchModifyPanel()); + commandMachine.RegisterCommand(CommandNames.AutoDimBrs, new Command_AutoDimBrs()); + commandMachine.RegisterCommand(CommandNames.BoardInfoDim, new Command_BoardInfoDimTool()); + commandMachine.RegisterCommand(CommandNames.FastDimBrs, new Command_FastDimBrs()); + commandMachine.RegisterCommand(CommandNames.BreakDim, new BreakDim()); + commandMachine.RegisterCommand(CommandNames.DeleteDim, new DeleteDim()); + commandMachine.RegisterCommand(CommandNames.DeleteMinDim, new DeleteMinDim()); + commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle()); + + commandMachine.RegisterCommand(CommandNames.RotateLayerBoard, new RotateLayerBoard()); + + commandMachine.RegisterCommand(CommandNames.Drawer, new DrawDrawrer()); + commandMachine.RegisterCommand(CommandNames.DeleteHole, new DeleteDrill()); + commandMachine.RegisterCommand(CommandNames.ReverseDrillFace, new ReverseDrillFace()); + commandMachine.RegisterCommand(CommandNames.FZWL, new Command_FZWL()); + commandMachine.RegisterCommand(CommandNames.EditorboardTemplate, new EditorBoardTemplate()); + + commandMachine.RegisterCommand(CommandNames.ActicityLayerBoard, new ActicityLayerBoard()); //改板 // commandMachine.RegisterCommand(CommandNames.SetBRXAxis, new Command_SetBRXAxis()); @@ -496,7 +497,7 @@ export function registerCommand() // // commandMachine.RegisterCommand(CommandNames.Explode, new Command_Explode()); // commandMachine.RegisterCommand(CommandNames.Explosion, new Command_ExplosionMap()); - commandMachine.RegisterCommand(CommandNames.OpenCabinet, new Command_OpenCabinet()); + commandMachine.RegisterCommand(CommandNames.OpenCabinet, new Command_OpenCabinet()); // // commandMachine.RegisterCommand(CommandNames.Lattice, new DrawLattice()); /*******test ↓↓↓*********/ @@ -710,6 +711,7 @@ export function registerCommand() commandMachine.RegisterCommand(CommandNames.ChangeColorByMaterial, new ChangeColorByMaterial()); commandMachine.RegisterCommand(CommandNames.ChangeColorByRoomOrCabinet, new ChangeColorByRoomCabinet()); commandMachine.RegisterCommand(CommandNames.ChangeBoardColorByPBFace, new Command_ChangeBoardColorByPBFace()); + commandMachine.RegisterCommand(CommandNames.ChangeColorByLinesType, new ChangeColorByLinesType()); commandMachine.RegisterCommand(CommandNames.TextModifyTool, new Command_TextModifyTool()); commandMachine.RegisterCommand(CommandNames.SelectAll, new SelectAll()); diff --git a/src/Common/CommandNames.ts b/src/Common/CommandNames.ts index 6eb82cc78..ca03a6eed 100644 --- a/src/Common/CommandNames.ts +++ b/src/Common/CommandNames.ts @@ -267,6 +267,7 @@ export enum CommandNames ChangeColorByMaterial = "CHANGECOLORBYMATERIAL",//根据板材改颜色 ChangeColorByRoomOrCabinet = "CHANGECOLORBYRROOMORCABINET",//根据房间名及柜名修改颜色 ChangeBoardColorByPBFace = "CHANGEBOARDCOLORBYPBFACE",//根据排版面改颜色 + ChangeColorByLinesType = "CHANGECOLORBYLINESTYPE",//根据板件纹路修改颜色 TextModifyTool = "TEXTMODIFYTOOL",//批量替换文字 RestoreColor = "RESTORECOLOR", diff --git a/src/Editor/CommandRegister.ts b/src/Editor/CommandRegister.ts index 6378b06f4..056408a11 100644 --- a/src/Editor/CommandRegister.ts +++ b/src/Editor/CommandRegister.ts @@ -215,6 +215,7 @@ import { Command_AlignLineGroup } from "../Add-on/AlignLine/Command_AlignLineGro import { Command_DrawArcBoard } from "../Add-on/ArcBoard/DrawArcBoard"; import { OneClickInspection } from "../Add-on/BoardInspection/OneClickInspection"; import { ImportCFData } from "../Add-on/CF/Import/CFImport"; +import { ChangeColorByLinesType } from "../Add-on/ChangeColorByBoard/ChangeColorByLinesType"; import { ChangeColorByRoomCabinet } from "../Add-on/ChangeColorByRoomOrCabinet/ChangeColorByRoomOrCabinet"; import { Command_ClearCDBrHoleModeling } from "../Add-on/ClearCDBrHoleModeling"; import { Cmd_LockMaterial, Cmd_UnLockMaterial } from "../Add-on/Cmd_LockMaterial"; @@ -822,6 +823,7 @@ export function registerCommand() commandMachine.RegisterCommand(CommandNames.ChangeColorByMaterial, new ChangeColorByMaterial()); commandMachine.RegisterCommand(CommandNames.ChangeColorByRoomOrCabinet, new ChangeColorByRoomCabinet()); commandMachine.RegisterCommand(CommandNames.ChangeBoardColorByPBFace, new Command_ChangeBoardColorByPBFace()); + commandMachine.RegisterCommand(CommandNames.ChangeColorByLinesType, new ChangeColorByLinesType()); commandMachine.RegisterCommand(CommandNames.TextModifyTool, new Command_TextModifyTool()); commandMachine.RegisterCommand(CommandNames.SelectAll, new SelectAll()); diff --git a/src/UI/Components/CommandPanel/CommandList.ts b/src/UI/Components/CommandPanel/CommandList.ts index 03a992e46..5e37969df 100644 --- a/src/UI/Components/CommandPanel/CommandList.ts +++ b/src/UI/Components/CommandPanel/CommandList.ts @@ -817,6 +817,15 @@ export const CommandList: ICommand[] = [ chName: "根据排版面改颜色", chDes: "根据排版面改颜色", }, + { + typeId: "bjbj", + link: `#`, + defaultCustom: CommandNames.ChangeColorByLinesType, + command: CommandNames.ChangeColorByLinesType, + type: "板件编辑", + chName: "根据板件纹路修改颜色", + chDes: "根据板件纹路修改颜色", + }, { icon: IconEnum.TextModifyTool, typeId: "bjbj", diff --git a/src/UI/Components/TopToolBar/ToolsBlock.tsx b/src/UI/Components/TopToolBar/ToolsBlock.tsx index e8bae4313..97eb4cac6 100644 --- a/src/UI/Components/TopToolBar/ToolsBlock.tsx +++ b/src/UI/Components/TopToolBar/ToolsBlock.tsx @@ -200,9 +200,9 @@ export class ToolsBlock extends React.Component return (
  • { + app.Editor.MaskManage.Clear(); this.HandleOnClick(cmd.command); this.isExtendShow = false; - app.Editor.MaskManage.Clear(); }}>
  • diff --git a/src/UI/Components/TopToolBar/TopToolBar.tsx b/src/UI/Components/TopToolBar/TopToolBar.tsx index 2da6287e2..127c8ab34 100644 --- a/src/UI/Components/TopToolBar/TopToolBar.tsx +++ b/src/UI/Components/TopToolBar/TopToolBar.tsx @@ -86,6 +86,7 @@ export class TopToolBar extends React.Component<{}, {}> { svg: IconEnum.Cabrush, title: "复合实体属性刷", command: CommandNames.CombinatAttributeBrush }, { svg: IconEnum.Rect2Winerack, title: "矩形变酒格", command: CommandNames.Rect2Winerack }, { svg: IconEnum.ChangeColorByRoomOrCabinet, title: "根据房间名柜名修改颜色", command: CommandNames.ChangeColorByRoomOrCabinet }, + { svg: IconEnum.ChangeColorByMat, title: "根据板件纹路修改颜色", command: CommandNames.ChangeColorByLinesType }, ]; store.iconList.brEdit = [ { svg: IconEnum.QG, title: "线性切割", command: CommandNames.LinearCutting },