mxdraw 0.1.106 → 0.1.107

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.
package/dist/index.d.ts CHANGED
@@ -1839,7 +1839,7 @@ interface MxFunType {
1839
1839
  openFile(sFile: string | string[], useWebsocket: boolean): boolean;
1840
1840
  getMxJigCmdManager(): CmdMangerType;
1841
1841
  loadSVG(url: string, color?: number | string | THREE.Color, callResult?: any, loadSet?: any): void;
1842
- getTHREE(): typeof window.THREE;
1842
+ getTHREE(): any;
1843
1843
  }
1844
1844
  /**
1845
1845
  * MxFun 模块
@@ -3583,21 +3583,24 @@ declare class MxDbRegularPolygon extends MxDbEntity {
3583
3583
  * */
3584
3584
  declare class MxDbLeadComment extends MxDbEntity {
3585
3585
  /** 标注点 */
3586
- point1: THREE.Vector3;
3586
+ point1: three.Vector3;
3587
3587
  /** 文字显示位置 */
3588
- point2: THREE.Vector3;
3588
+ point2: three.Vector3;
3589
3589
  /** 文字内容 */
3590
3590
  text: string;
3591
3591
  /** 文字高度 */
3592
3592
  textHeight: number;
3593
3593
  textWidth: number;
3594
+ /** 文字大小,取屏幕像素绘图单位。 */
3595
+ fixedSize: boolean;
3594
3596
  getTypeName(): string;
3595
3597
  create(): MxDbEntity;
3596
3598
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3597
- getGripPoints(): Array<THREE.Vector3>;
3598
- moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3599
+ getGripPoints(): Array<three.Vector3>;
3600
+ moveGripPointsAt(index: number, offset: three.Vector3): boolean;
3599
3601
  dwgIn(obj: any): boolean;
3600
3602
  dwgOut(obj: any): object;
3603
+ protected onViewChange(): boolean;
3601
3604
  }
3602
3605
 
3603
3606
  /**
@@ -3616,6 +3619,9 @@ declare class MxDbRectBoxLeadComment extends MxDbEntity {
3616
3619
  textHeight: number;
3617
3620
  /** 云线的半圆弧半径 */
3618
3621
  radius: number;
3622
+ textWidth: number;
3623
+ /** 文字大小,取屏幕像素绘图单位。 */
3624
+ fixedSize: boolean;
3619
3625
  getTypeName(): string;
3620
3626
  create(): MxDbEntity;
3621
3627
  worldDraw(pWorldDraw: McGiWorldDraw): void;
@@ -3623,6 +3629,7 @@ declare class MxDbRectBoxLeadComment extends MxDbEntity {
3623
3629
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3624
3630
  dwgIn(obj: any): boolean;
3625
3631
  dwgOut(obj: any): object;
3632
+ protected onViewChange(): boolean;
3626
3633
  }
3627
3634
 
3628
3635
  /**
@@ -1,4 +1,5 @@
1
1
  /** @module MxDbLeadComment*/
2
+ import * as THREE from 'three';
2
3
  import McGiWorldDraw from '../McGiWorldDraw';
3
4
  import MxDbEntity from '../MxDbEntity';
4
5
  /**
@@ -14,6 +15,8 @@ export default class MxDbLeadComment extends MxDbEntity {
14
15
  /** 文字高度 */
15
16
  textHeight: number;
16
17
  textWidth: number;
18
+ /** 文字大小,取屏幕像素绘图单位。 */
19
+ fixedSize: boolean;
17
20
  getTypeName(): string;
18
21
  create(): MxDbEntity;
19
22
  worldDraw(pWorldDraw: McGiWorldDraw): void;
@@ -21,4 +24,5 @@ export default class MxDbLeadComment extends MxDbEntity {
21
24
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
22
25
  dwgIn(obj: any): boolean;
23
26
  dwgOut(obj: any): object;
27
+ protected onViewChange(): boolean;
24
28
  }
@@ -1 +1 @@
1
- import MxDbEntity from"../MxDbEntity";import MxThreeJS from"../MxThreeJS";export default class MxDbLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.text="",this.textHeight=20,this.textWidth=0}getTypeName(){return"MxDbLeadComment"}create(){return new MxDbLeadComment}worldDraw(t){if(t.drawLine(this.point1,this.point2),this.text.length>0){const i=new THREE.Vector3;let e=MxThreeJS.clacTextSpriteSize(this.text,this.textHeight,this.textWidth);i.x=this.point2.x+.5*e.spritewidth,i.y=this.point2.y+.5*e.spriteheight,t.drawText(this.text,this.textHeight,0,i,this.textWidth);const h=new THREE.Vector3;h.x=this.point2.x+e.textwidth,h.y=this.point2.y,t.drawLine(h,this.point2)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,i){return 0==t?this.point1.add(i):1==t&&this.point2.add(i),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.text=t.text.substr(0),this.textHeight=t.textHeight,t.textWidth&&(this.textWidth=t.textWidth),!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.textHeight=this.textHeight,t.text=this.text,t.textWidth=this.textWidth,t}};
1
+ import*as THREE from"three";import MxDbEntity from"../MxDbEntity";import MxThreeJS from"../MxThreeJS";export default class MxDbLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.text="",this.textHeight=20,this.textWidth=0,this.fixedSize=!1}getTypeName(){return"MxDbLeadComment"}create(){return new MxDbLeadComment}worldDraw(t){if(t.drawLine(this.point1,this.point2),this.text.length>0){const e=new THREE.Vector3;let i=this.textHeight,h=this.textWidth,n=t.getMxObject();this.fixedSize&&(i=n.screenCoordLong2Doc(i),h=n.screenCoordLong2Doc(h));let s=MxThreeJS.clacTextSpriteSize(this.text,i,h);e.x=this.point2.x+.5*s.textwidth,e.y=this.point2.y+.5*s.allTextHeight,t.drawText(this.text,i,0,e,h);const o=new THREE.Vector3;o.x=this.point2.x+s.textwidth,o.y=this.point2.y,t.drawLine(o,this.point2)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t}moveGripPointsAt(t,e){return 0==t?this.point1.add(e):1==t&&this.point2.add(e),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.text=t.text.substr(0),this.textHeight=t.textHeight,t.textWidth&&(this.textWidth=t.textWidth),this.fixedSize=t.fixedSize,!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.textHeight=this.textHeight,t.text=this.text,t.textWidth=this.textWidth,t.fixedSize=this.fixedSize,t}onViewChange(){return!!this.fixedSize&&(this.setNeedUpdateDisplay(!1),!0)}};
@@ -16,6 +16,9 @@ export default class MxDbRectBoxLeadComment extends MxDbEntity {
16
16
  textHeight: number;
17
17
  /** 云线的半圆弧半径 */
18
18
  radius: number;
19
+ textWidth: number;
20
+ /** 文字大小,取屏幕像素绘图单位。 */
21
+ fixedSize: boolean;
19
22
  getTypeName(): string;
20
23
  create(): MxDbEntity;
21
24
  worldDraw(pWorldDraw: McGiWorldDraw): void;
@@ -23,4 +26,5 @@ export default class MxDbRectBoxLeadComment extends MxDbEntity {
23
26
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
24
27
  dwgIn(obj: any): boolean;
25
28
  dwgOut(obj: any): object;
29
+ protected onViewChange(): boolean;
26
30
  }
@@ -1 +1 @@
1
- import MxDbLeadComment from"../MxDbLeadComment";import MxDbCloudLine from"../MxDbCloudLine";import MxDbEntity from"../MxDbEntity";export default class MxDbRectBoxLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.text="",this.textHeight=20,this.radius=16}getTypeName(){return"MxDbRectBoxLeadComment"}create(){return new MxDbRectBoxLeadComment}worldDraw(t){let i=new MxDbCloudLine;i.setRadius(this.radius);let e=this.point1.clone(),n=this.point2.clone();if(e.x>n.x){let t=e.x;e.x=n.x,n.x=t}if(e.y>n.y){let t=e.y;e.y=n.y,n.y=t}let o=new THREE.Vector3(e.x,n.y,e.z);o=i.addLine(e,o),n=new THREE.Vector3(n.x,o.y,n.z),n=i.addLine(o,n);let s=new THREE.Vector3(n.x,e.y,e.z);if(s=i.addLine(n,s),e=i.addLine(s,e),i.worldDraw(t),this.text.length>0){let i=e,h=e.distanceTo(this.point3);h>o.distanceTo(this.point3)&&(i=o,h=o.distanceTo(this.point3)),h>n.distanceTo(this.point3)&&(i=n,h=n.distanceTo(this.point3)),h>s.distanceTo(this.point3)&&(i=s,h=s.distanceTo(this.point3));let p=new MxDbLeadComment;p.point1=i,p.point2=this.point3,p.text=this.text,p.textHeight=this.textHeight,p.worldDraw(t)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t.push(this.point3),t}moveGripPointsAt(t,i){return 0==t?this.point1.add(i):1==t?this.point2.add(i):2==t&&this.point3.add(i),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),this.text=t.text.substr(0),this.textHeight=t.textHeight,this.radius=t.radius,!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t.textHeight=this.textHeight,t.text=this.text,t.radius=this.radius,t}};
1
+ import MxDbLeadComment from"../MxDbLeadComment";import MxDbCloudLine from"../MxDbCloudLine";import MxDbEntity from"../MxDbEntity";export default class MxDbRectBoxLeadComment extends MxDbEntity{constructor(){super(...arguments),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.text="",this.textHeight=20,this.radius=16,this.textWidth=0,this.fixedSize=!1}getTypeName(){return"MxDbRectBoxLeadComment"}create(){return new MxDbRectBoxLeadComment}worldDraw(t){let i=new MxDbCloudLine;i.setRadius(this.radius);let e=this.point1.clone(),n=this.point2.clone();if(e.x>n.x){let t=e.x;e.x=n.x,n.x=t}if(e.y>n.y){let t=e.y;e.y=n.y,n.y=t}let o=new THREE.Vector3(e.x,n.y,e.z);o=i.addLine(e,o),n=new THREE.Vector3(n.x,o.y,n.z),n=i.addLine(o,n);let s=new THREE.Vector3(n.x,e.y,e.z);if(s=i.addLine(n,s),e=i.addLine(s,e),i.worldDraw(t),this.text.length>0){let i=e,h=e.distanceTo(this.point3);h>o.distanceTo(this.point3)&&(i=o,h=o.distanceTo(this.point3)),h>n.distanceTo(this.point3)&&(i=n,h=n.distanceTo(this.point3)),h>s.distanceTo(this.point3)&&(i=s,h=s.distanceTo(this.point3));let d=new MxDbLeadComment;d.point1=i,d.point2=this.point3,d.text=this.text,d.textHeight=this.textHeight,d.textWidth=this.textWidth,d.fixedSize=this.fixedSize,d.worldDraw(t)}}getGripPoints(){let t=[];return t.push(this.point1),t.push(this.point2),t.push(this.point3),t}moveGripPointsAt(t,i){return 0==t?this.point1.add(i):1==t?this.point2.add(i):2==t&&this.point3.add(i),!0}dwgIn(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),this.text=t.text.substr(0),this.textHeight=t.textHeight,this.radius=t.radius,t.textWidth&&(this.textWidth=t.textWidth),this.fixedSize=t.fixedSize,!0}dwgOut(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t.textHeight=this.textHeight,t.text=this.text,t.radius=this.radius,t.textWidth=this.textWidth,t.fixedSize=this.fixedSize,t}onViewChange(){return!!this.fixedSize&&(this.setNeedUpdateDisplay(!1),!0)}};
@@ -1,6 +1,7 @@
1
1
  /** @module MxFun */
2
- import MxDrawObject, { MxDrawObjectType } from '../MxDrawObject';
2
+ import MxDrawObject from '../MxDrawObject';
3
3
  import MxDbEntity from '../MxDbEntity';
4
+ import { MxDrawObjectType } from '../MxDrawObject';
4
5
  import MxDbDatabase from '../MxDbDatabase';
5
6
  import MxCADObject from '../MxCADObject';
6
7
  declare let mxUiData: import("../loadCoreCode/mxUiData").MxVueInterface;
@@ -48,7 +49,7 @@ export interface MxFunType {
48
49
  openFile(sFile: string | string[], useWebsocket: boolean): boolean;
49
50
  getMxJigCmdManager(): CmdMangerType;
50
51
  loadSVG(url: string, color?: number | string | THREE.Color, callResult?: any, loadSet?: any): void;
51
- getTHREE(): typeof window.THREE;
52
+ getTHREE(): any;
52
53
  }
53
54
  /**
54
55
  * MxFun 模块