From 7fee8c6cfff0e804731fd253a6fef5f2403bf650 Mon Sep 17 00:00:00 2001 From: ChenX Date: Wed, 31 Mar 2021 19:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD:C2R=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=BA=E5=88=B6=E4=BD=BF=E7=94=A8=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E7=B3=BB=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../twoD2threeD/Command_Curve2Polyline.ts | 10 +++- .../twoD2threeD/Modals/Curve2RecModal.tsx | 51 +++++++++++++------ 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/Add-on/twoD2threeD/Command_Curve2Polyline.ts b/src/Add-on/twoD2threeD/Command_Curve2Polyline.ts index 6a40cfb1a..797ae603c 100644 --- a/src/Add-on/twoD2threeD/Command_Curve2Polyline.ts +++ b/src/Add-on/twoD2threeD/Command_Curve2Polyline.ts @@ -51,6 +51,8 @@ export class Command_Curve2Polyline implements Command this.BreakCurve = store.option.isAnaly; this.SmallWidth = store.option.width; this.ExtendsMinDist = store.option.gap; + this.ForceUseFrontViewCS = store.option.ForceUseFrontViewCS; + this.ForceUseUCS = store.option.forceUseUCS; let ss = await app.Editor.GetSelection({ Msg: "请选择曲线:", UseSelect: true, @@ -89,7 +91,11 @@ export class Command_Curve2Polyline implements Command newCurves.push(pl); } else - newCurves.push(cu); + { + let ncu = cu.Clone(); + newCurves.push(ncu); + OldNewCurvesMap.set(ncu, cu); + } } groups = [{ ocs: undefined, cus: newCurves }]; @@ -223,7 +229,7 @@ export class Command_Curve2Polyline implements Command OldNewCurvesMap.set(cloneC, OldNewCurvesMap.get(r.curve)); curves.push(cloneC); } - const JoinedCurveList: Curve[] = []; + let JoinedCurveList: Curve[] = []; arrayRemoveDuplicateBySort(curves, (cu1: Curve, cu2: Curve) => { if (cu1.Join(cu2) === Status.True) diff --git a/src/Add-on/twoD2threeD/Modals/Curve2RecModal.tsx b/src/Add-on/twoD2threeD/Modals/Curve2RecModal.tsx index 0e50f3774..bc2f0cbf2 100644 --- a/src/Add-on/twoD2threeD/Modals/Curve2RecModal.tsx +++ b/src/Add-on/twoD2threeD/Modals/Curve2RecModal.tsx @@ -1,23 +1,23 @@ -import React from "react"; -import { app } from "../../../ApplicationServices/Application"; -import { KeyBoard } from "../../../Common/KeyEnum"; -import { Classes, Card, Intent, Button, Checkbox, Divider } from "@blueprintjs/core"; -import { ModalHeader, ModalFooter } from "../../../UI/Components/Modal/ModalContainer"; -import { UserConfig, IConfigOption } from "../../../UI/Components/Board/UserConfig"; -import { IConfigStore } from "../../../UI/Store/BoardStore"; -import { BoardModalType } from "../../../UI/Components/Board/BoardModal"; +import { Button, Card, Checkbox, Classes, Divider, Intent, Tooltip } from "@blueprintjs/core"; import { observable, toJS } from "mobx"; import { observer } from "mobx-react"; -import { safeEval } from "../../../Common/eval"; -import '../Modals/Curve2Rec.less'; +import React from "react"; import { begin } from "xaop"; -import { ToasterInput, ToasterValueError } from "../../../UI/Components/Toaster"; +import { app } from "../../../ApplicationServices/Application"; import { CheckObjectType } from "../../../Common/CheckoutVaildValue"; -import { IBaseOption, IUiOption } from "../../../UI/Store/BoardInterface"; import { DataAdapter } from "../../../Common/DataAdapter"; -import { DefaultCurve2RecOption } from "../../../Editor/DefaultConfig"; +import { safeEval } from "../../../Common/eval"; +import { KeyBoard } from "../../../Common/KeyEnum"; import { Singleton } from "../../../Common/Singleton"; +import { DefaultCurve2RecOption } from "../../../Editor/DefaultConfig"; +import { BoardModalType } from "../../../UI/Components/Board/BoardModal"; +import { IConfigOption, UserConfig } from "../../../UI/Components/Board/UserConfig"; import { GetCompoentObjectIdString } from "../../../UI/Components/ComponentObjectId"; +import { ModalFooter, ModalHeader } from "../../../UI/Components/Modal/ModalContainer"; +import { ToasterInput, ToasterValueError } from "../../../UI/Components/Toaster"; +import { IBaseOption, IUiOption } from "../../../UI/Store/BoardInterface"; +import { IConfigStore } from "../../../UI/Store/BoardStore"; +import '../Modals/Curve2Rec.less'; export interface Curve2RecOption extends IBaseOption { @@ -26,6 +26,8 @@ export interface Curve2RecOption extends IBaseOption width: number; //保留轮廓的宽度 isAnaly: boolean; //分析相交区域 gap: number; //最小间隙 + forceUseUCS: boolean;//强制使用UCS坐标系 + ForceUseFrontViewCS: boolean;//强制使用前视图坐标系 } export class Curve2RecModalStore extends Singleton implements IConfigStore { @@ -46,7 +48,9 @@ export class Curve2RecModalStore extends Singleton implements IConfigStore isSaveSmall: true, width: 90, isAnaly: true, - gap: 3 + gap: 3, + forceUseUCS: false, + ForceUseFrontViewCS: false, }; if (this.uiOption) Object.assign(this.uiOption, DataAdapter.ConvertUIData(this.option)); @@ -120,8 +124,7 @@ export class Curve2RecModal extends React.Component<{ store: Curve2RecModalStore checked={option.isSaveMax} label="保留最大轮廓" onChange={() => { this.props.store.option.isSaveMax = !this.props.store.option.isSaveMax; }} - > - + />
{ this.props.store.option.isSaveSmall = !this.props.store.option.isSaveSmall; }}> @@ -172,6 +175,22 @@ export class Curve2RecModal extends React.Component<{ store: Curve2RecModalStore
+ + { this.props.store.option.forceUseUCS = !this.props.store.option.forceUseUCS; }} + /> + +
+ + { this.props.store.option.ForceUseFrontViewCS = !this.props.store.option.ForceUseFrontViewCS; }} + /> + {/* 配置 */}