mxdraw 0.1.149 → 0.1.151

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.
@@ -63,6 +63,16 @@ export default class McEdGetPointWorldDrawObject {
63
63
  *
64
64
  */
65
65
  drawMcDbEntity(mcdbEntity: any): any;
66
+ /**
67
+ * 绘制一个MxCAD数据库对象
68
+ * @param mcdbEntity MxCAD数据库对象
69
+ * @returns void
70
+ * @example
71
+ * ``` typescript
72
+ * ```
73
+ *
74
+ */
75
+ drawMcDbLine(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): any;
66
76
  /**
67
77
  * 绘制一个文档对象
68
78
  * @param sText 文本
@@ -1 +1 @@
1
- import store from"../store";export default class McEdGetPointWorldDrawObject{constructor(){var t;this._McEdGetPointWorldDraw=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=(()=>this._McEdGetPointWorldDraw)}drawCircle(t,r){return this._McEdGetPointWorldDraw.drawCircle(t,r)}drawLine(t,r){return this._McEdGetPointWorldDraw.drawLine(t,r)}drawEntity(t,r){return this._McEdGetPointWorldDraw.drawEntity(t,r)}drawMcDbEntity(t){return this._McEdGetPointWorldDraw.drawMcDbEntity(t)}drawText(t,r,e,o){return this._McEdGetPointWorldDraw.drawText(t,r,e,o)}setDraw(t){return this._McEdGetPointWorldDraw.setDraw(t)}setColor(t){return this._McEdGetPointWorldDraw.setColor(t)}getColor(){return this._McEdGetPointWorldDraw.getColor()}drawCustomEntity(t,r){return this._McEdGetPointWorldDraw.drawCustomEntity(t,r)}};
1
+ import store from"../store";export default class McEdGetPointWorldDrawObject{constructor(){var t;this._McEdGetPointWorldDraw=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=(()=>this._McEdGetPointWorldDraw)}drawCircle(t,r){return this._McEdGetPointWorldDraw.drawCircle(t,r)}drawLine(t,r){return this._McEdGetPointWorldDraw.drawLine(t,r)}drawEntity(t,r){return this._McEdGetPointWorldDraw.drawEntity(t,r)}drawMcDbEntity(t){return this._McEdGetPointWorldDraw.drawMcDbEntity(t)}drawMcDbLine(t,r,e,o,d,i){return this._McEdGetPointWorldDraw.drawMcDbLine(t,r,e,o,d,i)}drawText(t,r,e,o){return this._McEdGetPointWorldDraw.drawText(t,r,e,o)}setDraw(t){return this._McEdGetPointWorldDraw.setDraw(t)}setColor(t){return this._McEdGetPointWorldDraw.setColor(t)}getColor(){return this._McEdGetPointWorldDraw.getColor()}drawCustomEntity(t,r){return this._McEdGetPointWorldDraw.drawCustomEntity(t,r)}};
@@ -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;