|
|
@ -1,12 +1,18 @@
|
|
|
|
import { Button, Classes, Intent, Label } from '@blueprintjs/core';
|
|
|
|
import { Button, Classes, Intent, Label } from '@blueprintjs/core';
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
import * as React from 'react';
|
|
|
|
import * as React from 'react';
|
|
|
|
|
|
|
|
import { selectOutlinePosition } from '../../../../Add-on/DrawBoard/DrawSpecialShapeBoardTool';
|
|
|
|
import { FaceDirection } from "../../../../Add-on/DrawDrilling/DrillType";
|
|
|
|
import { FaceDirection } from "../../../../Add-on/DrawDrilling/DrillType";
|
|
|
|
import { app } from '../../../../ApplicationServices/Application';
|
|
|
|
import { app } from '../../../../ApplicationServices/Application';
|
|
|
|
import { CheckObjectType } from '../../../../Common/CheckoutVaildValue';
|
|
|
|
import { CheckObjectType } from '../../../../Common/CheckoutVaildValue';
|
|
|
|
import { ColorMaterial } from '../../../../Common/ColorPalette';
|
|
|
|
import { ColorMaterial } from '../../../../Common/ColorPalette';
|
|
|
|
|
|
|
|
import { MouseKey } from '../../../../Common/KeyEnum';
|
|
|
|
import { FixedNotZero } from '../../../../Common/Utils';
|
|
|
|
import { FixedNotZero } from '../../../../Common/Utils';
|
|
|
|
import { safeEval } from '../../../../Common/eval';
|
|
|
|
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 { IKnifeInfo2, IUiVModeing, IVModelingInfo, Modeling2Store } from '../../../Store/RightPanelStore/Modeling2Store';
|
|
|
|
import { BoardModalType } from "../../Board/BoardModalType";
|
|
|
|
import { BoardModalType } from "../../Board/BoardModalType";
|
|
|
|
import { Config_ModalType, UserConfigComponent } from '../../Board/UserConfigComponent';
|
|
|
|
import { Config_ModalType, UserConfigComponent } from '../../Board/UserConfigComponent';
|
|
|
@ -85,6 +91,7 @@ export class ModelingComponent2 extends React.Component<{ store?: Modeling2Store
|
|
|
|
className="bp3-input select-kinfe"
|
|
|
|
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)}` : "双击选刀"}
|
|
|
|
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)}
|
|
|
|
onDoubleClick={() => this.startSelectKnife(d1items[i].knife)}
|
|
|
|
|
|
|
|
onMouseDown={(e) => this.handleMouseDown(e, d1items[i])}
|
|
|
|
readOnly
|
|
|
|
readOnly
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -137,4 +144,26 @@ export class ModelingComponent2 extends React.Component<{ store?: Modeling2Store
|
|
|
|
{
|
|
|
|
{
|
|
|
|
app.Editor.ModalManage.RenderModal(KnifeManage, { knifeInfo: info });
|
|
|
|
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();
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|