mxdraw 0.1.150 → 0.1.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,11 @@
1
1
  /** @module MrxDbgUiPrPointClass */
2
2
  import McEdGetPointWorldDrawObject from '../McEdGetPointWorldDrawObject';
3
3
  import MrxDbgUiPrBaseReturn from '../MrxDbgUiPrBaseReturn';
4
+ export declare enum MxCursorType {
5
+ kNormal = 0,
6
+ kRect = 1,
7
+ kCross = 2
8
+ }
4
9
  export interface MrxDbgUiPrPointClass {
5
10
  keyWords(): string;
6
11
  setKeyWords(keyWordList: string): void;
@@ -28,6 +33,7 @@ export interface MrxDbgUiPrPointClass {
28
33
  * ```
29
34
  */
30
35
  export default class MrxDbgUiPrPoint {
36
+ private _MrxDbgUiPrPoint;
31
37
  constructor();
32
38
  /**
33
39
  * 返回关键字列表
@@ -128,4 +134,12 @@ export default class MrxDbgUiPrPoint {
128
134
  * 返回需要的Touche输入类型
129
135
  */
130
136
  getInputToucheType(): number;
137
+ /**
138
+ * 设置光标类型
139
+ */
140
+ setCursorType(type: MxCursorType): void;
141
+ /**
142
+ * 返回光标类型
143
+ */
144
+ getCursorType(): MxCursorType;
131
145
  }
@@ -1 +1 @@
1
- import McEdGetPointWorldDrawObject from"../McEdGetPointWorldDrawObject";import store from"../store";let _MrxDbgUiPrPoint;export default class MrxDbgUiPrPoint{constructor(){var r;_MrxDbgUiPrPoint=new(null===(r=store.state.MxFun)||void 0===r?void 0:r.getMxJigCmdManager().getMrxDbgUiPrPointClass())}keyWords(){return _MrxDbgUiPrPoint.keyWords()}setKeyWords(r){return _MrxDbgUiPrPoint.setKeyWords(r)}message(){return _MrxDbgUiPrPoint.message()}setMessage(r){return _MrxDbgUiPrPoint.setMessage(r)}keyWordPicked(){return _MrxDbgUiPrPoint.keyWordPicked()}isKeyWordPicked(r){return _MrxDbgUiPrPoint.isKeyWordPicked(r)}setUserDraw(r){if("function"!=typeof r)return _MrxDbgUiPrPoint.setUserDraw(r._get?r._get():r);{const e=new McEdGetPointWorldDrawObject;e.setDraw(r),_MrxDbgUiPrPoint.setUserDraw(e._get())}}value(){return _MrxDbgUiPrPoint.value()}getCADValue(){return _MrxDbgUiPrPoint.getCADValue()}valueDocCoord(){return _MrxDbgUiPrPoint.valueDocCoord()}basePt(){return _MrxDbgUiPrPoint.basePt()}setBasePt(r){return _MrxDbgUiPrPoint.setBasePt(r)}setUseBasePt(r){return _MrxDbgUiPrPoint.setUseBasePt(r)}go(r){return r?(_MrxDbgUiPrPoint.go(r),new Promise((r,e)=>{r(null)})):new Promise((r,e)=>{_MrxDbgUiPrPoint.go(e=>{r(0!=e?null:_MrxDbgUiPrPoint.value())})})}goWhile(r,e){return _MrxDbgUiPrPoint.goWhile(r,e)}drawReserve(r){return _MrxDbgUiPrPoint.drawReserve(r)}setInputToucheType(r){return _MrxDbgUiPrPoint.setInputToucheType(r)}getInputToucheType(){return _MrxDbgUiPrPoint.getInputToucheType()}};
1
+ import McEdGetPointWorldDrawObject from"../McEdGetPointWorldDrawObject";import store from"../store";export var MxCursorType;!function(r){r[r.kNormal=0]="kNormal",r[r.kRect=1]="kRect",r[r.kCross=2]="kCross"}(MxCursorType||(MxCursorType={}));export default class MrxDbgUiPrPoint{constructor(){var r;this._MrxDbgUiPrPoint=new(null===(r=store.state.MxFun)||void 0===r?void 0:r.getMxJigCmdManager().getMrxDbgUiPrPointClass())}keyWords(){return this._MrxDbgUiPrPoint.keyWords()}setKeyWords(r){return this._MrxDbgUiPrPoint.setKeyWords(r)}message(){return this._MrxDbgUiPrPoint.message()}setMessage(r){return this._MrxDbgUiPrPoint.setMessage(r)}keyWordPicked(){return this._MrxDbgUiPrPoint.keyWordPicked()}isKeyWordPicked(r){return this._MrxDbgUiPrPoint.isKeyWordPicked(r)}setUserDraw(r){if("function"!=typeof r)return this._MrxDbgUiPrPoint.setUserDraw(r._get?r._get():r);{const t=new McEdGetPointWorldDrawObject;t.setDraw(r),this._MrxDbgUiPrPoint.setUserDraw(t._get())}}value(){return this._MrxDbgUiPrPoint.value()}getCADValue(){return this._MrxDbgUiPrPoint.getCADValue()}valueDocCoord(){return this._MrxDbgUiPrPoint.valueDocCoord()}basePt(){return this._MrxDbgUiPrPoint.basePt()}setBasePt(r){return this._MrxDbgUiPrPoint.setBasePt(r)}setUseBasePt(r){return this._MrxDbgUiPrPoint.setUseBasePt(r)}go(r){let t=this;return r?(t._MrxDbgUiPrPoint.go(r),new Promise((r,t)=>{r(null)})):new Promise((r,e)=>{t._MrxDbgUiPrPoint.go(e=>{r(0!=e?null:t._MrxDbgUiPrPoint.value())})})}goWhile(r,t){return this._MrxDbgUiPrPoint.goWhile(r,t)}drawReserve(r){return this._MrxDbgUiPrPoint.drawReserve(r)}setInputToucheType(r){return this._MrxDbgUiPrPoint.setInputToucheType(r)}getInputToucheType(){return this._MrxDbgUiPrPoint.getInputToucheType()}setCursorType(r){this._MrxDbgUiPrPoint.setCursorType(r)}getCursorType(){return this._MrxDbgUiPrPoint.getCursorType()}};
@@ -0,0 +1 @@
1
+ export default function drawMxDbSplineCurve(): Promise<void>;
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function u(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,u)}a((r=r.apply(t,e||[])).next())})};import MxDbSplineCurve from".";import MrxDbgUiPrBaseReturn from"../MrxDbgUiPrBaseReturn";import MrxDbgUiPrPoint from"../MrxDbgUiPrPoint";import MxFun from"../MxFun";export default function drawMxDbSplineCurve(){return __awaiter(this,void 0,void 0,function*(){const t=new MrxDbgUiPrPoint,e=new MxDbSplineCurve;t.goWhile(n=>__awaiter(this,void 0,void 0,function*(){if(n===MrxDbgUiPrBaseReturn.kOk)e.points.push(t.value()),t.setUserDraw((n,r)=>{const i=e.clone();i.points.push(n),r.drawCustomEntity(i),0===e.points.length?t.setMessage("\n指定第一个点:"):(t.setMessage("\n指定下一个点:"),t.setKeyWords("[闭合(C)/ 放弃(U)]"))});else if(n===MrxDbgUiPrBaseReturn.kKeyWord){if(t.isKeyWordPicked("C"))return e.closed=!0,{exit:!0};t.isKeyWordPicked("U")&&e.points.pop()}}),()=>{MxFun.getCurrentDraw().addMxEntity(e)})})};
@@ -0,0 +1,22 @@
1
+ import McGiWorldDraw from "../McGiWorldDraw";
2
+ import MxDbEntity from "../MxDbEntity";
3
+ import drawMxDbSplineCurve from "./draw";
4
+ export declare class MxDbSplineCurve extends MxDbEntity {
5
+ static draw: typeof drawMxDbSplineCurve;
6
+ /** 圆中心点 */
7
+ points: THREE.Vector3[];
8
+ /** 闭合 */
9
+ closed: boolean;
10
+ /** 曲线的张力 */
11
+ tension: number;
12
+ /** 曲线类型: centripetal、chordal和catmullrom */
13
+ curveType: string;
14
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
15
+ getGripPoints(): THREE.Vector3[];
16
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
17
+ create(): MxDbEntity;
18
+ dwgIn(obj: any): boolean;
19
+ dwgOut(obj: any): object;
20
+ getTypeName(): string;
21
+ }
22
+ export default MxDbSplineCurve;
@@ -0,0 +1 @@
1
+ import MxDbEntity from"../MxDbEntity";import{addRegisterMxDbEntity}from"../../tools/registerMxDbEntity";import drawMxDbSplineCurve from"./draw";const propertyDbKeys=["points","closed","tension","curveType"];export class MxDbSplineCurve extends MxDbEntity{constructor(){super(...arguments),this.points=[],this.closed=!1,this.tension=.5,this.curveType="centripetal"}worldDraw(t){const e=new THREE.CatmullRomCurve3(this.points,this.closed,"catmullrom",this.tension).getPoints(15*this.points.length),r=(new THREE.Geometry).setFromPoints(e),i=new THREE.LineBasicMaterial({color:this.color}),n=new THREE.Line(r,i);t.drawEntity(n)}getGripPoints(){return this.points}moveGripPointsAt(t,e){return this.points[t].add(e),!0}create(){return new MxDbSplineCurve}dwgIn(t){return this.onDwgIn(t),this.dwgInHelp(t,propertyDbKeys),!0}dwgOut(t){return this.onDwgOut(t),this.dwgOutHelp(t,propertyDbKeys),t}getTypeName(){return"MxDbSplineCurve"}};MxDbSplineCurve.draw=drawMxDbSplineCurve,addRegisterMxDbEntity(MxDbSplineCurve);export default MxDbSplineCurve;