!2540 功能:二维刀路界面右击刀具提取板块刀具轮廓

pull/2425/MERGE
林三 9 months ago committed by ChenX
parent a364d40239
commit 27ad1f8275

@ -375,34 +375,40 @@ export class BoardConfigModal extends React.Component<BoardConfigProps, {}>{
app.Viewer.CameraCtrl.LookAt(ZAxisN);
app.Viewer.CameraCtrl.ZoomExtentsBox3(brCurve.BoundingBox.expandByScalar(1000));
let rightPanelStore = RightPanelStore.GetInstance();
await CommandWrap(async () =>
{
app.Database.ModelSpace.Append(brCurve);
//载入配置,设置配置
let store = RightPanelStore.GetInstance();
let config = new DialogUserConfig(store.modeling2Store, BoardModalType.ZX2);
let config = new DialogUserConfig(rightPanelStore.modeling2Store, BoardModalType.ZX2);
await config.LoadAndInitConfig(false);
//初始化造型数据Store
store.modeling2Store.InitModelingItems();
rightPanelStore.modeling2Store.InitModelingItems();
//提取出二维造型轮廓
for (let data of br.Modeling2D)
{
let color = data.path.ColorIndex;
store.modeling2Store.ChangeModelingValue(color - 1, data);
rightPanelStore.modeling2Store.ChangeModelingValue(color - 1, data);
let cu = data.path.Clone().Z0();
app.Database.ModelSpace.Append(cu);
}
//记录源板件
rightPanelStore.modeling2Store.localBoard = br;
//呼出右侧二维刀路对照表
store.modeling2Store.isNotUpdateStore = true;
store.modeling2Store.configName = "";
store.m_IsShow = true;
rightPanelStore.modeling2Store.isNotUpdateStore = true;
rightPanelStore.modeling2Store.configName = "";
rightPanelStore.m_IsShow = true;
app.Editor.MaskManage.OnFocusEvent();
store.m_TabId = RightTabId.Model2;
store.modeling2Store.isNotUpdateStore = false;
rightPanelStore.m_TabId = RightTabId.Model2;
rightPanelStore.modeling2Store.isNotUpdateStore = false;
}, "提取二维刀路");
@ -414,6 +420,7 @@ export class BoardConfigModal extends React.Component<BoardConfigProps, {}>{
{
if (TempEditor.EditorIng)
{
rightPanelStore.modeling2Store.localBoard = undefined;
app.Editor.ModalManage.DestoryAll();
TempEditor.End();
app.Editor.UCSMatrix = backUCSMatrix;

@ -1,12 +1,18 @@
import { Button, Classes, Intent, Label } from '@blueprintjs/core';
import { observer } from 'mobx-react';
import * as React from 'react';
import { selectOutlinePosition } from '../../../../Add-on/DrawBoard/DrawSpecialShapeBoardTool';
import { FaceDirection } from "../../../../Add-on/DrawDrilling/DrillType";
import { app } from '../../../../ApplicationServices/Application';
import { CheckObjectType } from '../../../../Common/CheckoutVaildValue';
import { ColorMaterial } from '../../../../Common/ColorPalette';
import { MouseKey } from '../../../../Common/KeyEnum';
import { FixedNotZero } from '../../../../Common/Utils';
import { safeEval } from '../../../../Common/eval';
import { Board } from '../../../../DatabaseServices/Entity/Board';
import { CommandWrap } from '../../../../Editor/CommandMachine';
import { JigUtils } from '../../../../Editor/JigUtils';
import { TempEditor } from '../../../../Editor/TempEditor';
import { IKnifeInfo2, IUiVModeing, IVModelingInfo, Modeling2Store } from '../../../Store/RightPanelStore/Modeling2Store';
import { BoardModalType } from "../../Board/BoardModalType";
import { Config_ModalType, UserConfigComponent } from '../../Board/UserConfigComponent';
@ -85,6 +91,7 @@ export class ModelingComponent2 extends React.Component<{ store?: Modeling2Store
className="bp3-input select-kinfe"
value={d1items[i].knife.name ? `${d1items[i].knife.name},半径:${d1items[i].knife.props.radius},角度:${FixedNotZero(d1items[i].knife.props.angle)}` : "双击选刀"}
onDoubleClick={() => this.startSelectKnife(d1items[i].knife)}
onMouseDown={(e) => this.handleMouseDown(e, d1items[i])}
readOnly
/>
{
@ -137,4 +144,26 @@ export class ModelingComponent2 extends React.Component<{ store?: Modeling2Store
{
app.Editor.ModalManage.RenderModal(KnifeManage, { knifeInfo: info });
};
handleMouseDown = async (e: React.MouseEvent<HTMLElement>, info: IVModelingInfo) =>
{
if (e.button === MouseKey.Right)
{
let br = this.props.store.localBoard as Board;
if (!TempEditor.EditorIng || !br) return;
let knifeId = info.knife.id;
let pl = br.KnifePolylineMap.get(knifeId);
if (pl)
{
let cu = JigUtils.Draw(pl.Clone());
CommandWrap(async () =>
{
await selectOutlinePosition(cu);
});
}
}
e.preventDefault();
};
}

@ -41,6 +41,7 @@ export class Modeling2Store implements IConfigStore
@observable modelingItems: IModeling2Item[] = [];
@observable uiModeingItems: IUiVModeing[] = [];
isNotUpdateStore = false;
localBoard: any; //记录编辑二维刀路的源板件
private _ModelingItemId = 0;
constructor()
{

Loading…
Cancel
Save