mxdraw 0.1.106 → 0.1.108

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxdraw",
3
- "version": "0.1.106",
3
+ "version": "0.1.108",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/mxdraw.umd.js",
@@ -1,28 +0,0 @@
1
- /** @module MxDbLeadComment*/
2
- import * as THREE from 'three';
3
- import McGiWorldDraw from '../McGiWorldDraw';
4
- import MxDbEntity from '../MxDbEntity';
5
- /**
6
- * MxDbLeadComment 引线文字标注
7
- * */
8
- export default class MxDbLeadComment extends MxDbEntity {
9
- /** 标注点 */
10
- point1: THREE.Vector3;
11
- /** 文字显示位置 */
12
- point2: THREE.Vector3;
13
- /** 文字内容 */
14
- text: string;
15
- /** 文字高度 */
16
- textHeight: number;
17
- textWidth: number;
18
- /** 文字大小,取屏幕像素绘图单位。 */
19
- fixedSize: boolean;
20
- getTypeName(): string;
21
- create(): MxDbEntity;
22
- worldDraw(pWorldDraw: McGiWorldDraw): void;
23
- getGripPoints(): Array<THREE.Vector3>;
24
- moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
25
- dwgIn(obj: any): boolean;
26
- dwgOut(obj: any): object;
27
- protected onViewChange(): boolean;
28
- }
@@ -1 +0,0 @@
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)}};
@@ -1,27 +0,0 @@
1
- import McGiWorldDraw from '../McGiWorldDraw';
2
- import MxDbEntity from '../MxDbEntity';
3
- /**
4
- * MxDbRectBoxLeadComment 引线审图标注
5
- * */
6
- export default class MxDbRectBoxLeadComment extends MxDbEntity {
7
- /** 云线矩形的对角点1 */
8
- point1: THREE.Vector3;
9
- /** 云线矩形的对角点2 */
10
- point2: THREE.Vector3;
11
- /** 要标注的内容位置 */
12
- point3: THREE.Vector3;
13
- /** 要显示的文字内容*/
14
- text: string;
15
- /**文字高度*/
16
- textHeight: number;
17
- /** 云线的半圆弧半径 */
18
- radius: number;
19
- textWidth: number;
20
- getTypeName(): string;
21
- create(): MxDbEntity;
22
- worldDraw(pWorldDraw: McGiWorldDraw): void;
23
- getGripPoints(): Array<THREE.Vector3>;
24
- moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
25
- dwgIn(obj: any): boolean;
26
- dwgOut(obj: any): object;
27
- }
@@ -1 +0,0 @@
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}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.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),!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}};
@@ -1,20 +0,0 @@
1
- import MxDbEntity from '../MxDbEntity';
2
- import McGiWorldDraw from '../McGiWorldDraw';
3
- /**
4
- * MxDbRegularPolygon 正多边形
5
- */
6
- export default class MxDbRegularPolygon extends MxDbEntity {
7
- /** 正多边形的中心点位置 */
8
- centerPoint: import("three").Vector3;
9
- /** 正多边形两条边之间的交点位置 */
10
- otherPoint: import("three").Vector3;
11
- /** 正多边形边的数量 */
12
- sidesNumber: number;
13
- getTypeName(): 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
- }
@@ -1 +0,0 @@
1
- import MxDbEntity from"../MxDbEntity";import MxFun from"../MxFun";import McGiWorldDrawType from"../McGiWorldDrawType";import{createThreeRegularPolygon}from"../../tools/three/index";export default class MxDbRegularPolygon extends MxDbEntity{constructor(){super(...arguments),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=createThreeRegularPolygon(this.centerPoint,this.otherPoint,this.sidesNumber,t.getColor());if(e.geometry.computeBoundingBox(),t.getType()===McGiWorldDrawType.kSelectDraw){const r=new THREE.Vector3;e.geometry.boundingBox.getSize(r),r.addScalar(MxFun.screenCoordLong2Doc(10));const o=r.x/2,n=r.y/2,i={x:this.centerPoint.x-o,y:this.centerPoint.y-n},s={x:this.centerPoint.x+o,y:this.centerPoint.y-n},h={x:this.centerPoint.x+o,y:this.centerPoint.y+n},c={x:this.centerPoint.x-o,y:this.centerPoint.y+n};t.drawLine(i.x,i.y,s.x,s.y),t.drawLine(s.x,s.y,h.x,h.y),t.drawLine(h.x,h.y,c.x,c.y),t.drawLine(c.x,c.y,i.x,i.y)}t.drawEntity(e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}create(){return new MxDbRegularPolygon}dwgIn(t){return this.onDwgIn(t),this.centerPoint.copy(t.centerPoint),this.otherPoint.copy(t.otherPoint),this.sidesNumber=t.sidesNumber,!0}dwgOut(t){return this.onDwgOut(t),t.centerPoint=this.centerPoint,t.otherPoint=this.otherPoint,t.sidesNumber=this.sidesNumber,t}};
@@ -1,92 +0,0 @@
1
- /** @module MxDbSVG*/
2
- import McGiWorldDraw from '../McGiWorldDraw';
3
- import MxDbEntity from '../MxDbEntity';
4
- import MxDbSVGText from '../MxDbSVGText';
5
- /**
6
- * MxDbSVG 绘制SVG图形.
7
- */
8
- export default class MxDbSVG extends MxDbEntity {
9
- private svgPos;
10
- private svg;
11
- private svgPath;
12
- private svgSize;
13
- private svgAlignmentRatio;
14
- /** 延z轴旋转的数值 */
15
- svgRotate: number;
16
- /** 是否倒置SVG图形 */
17
- svgReverse: boolean;
18
- svgMirror: boolean;
19
- private svgChildColor;
20
- svgMargin: THREE.Vector2;
21
- private isSvgDirtyLocation;
22
- private isLoadFromPath;
23
- private aryText;
24
- private svgBoxSize;
25
- /** 固定尺寸,图片和文字大小,取屏幕像素绘图单位。 */
26
- fixedSize: boolean;
27
- /**使用svg的颜色 */
28
- useSvgColor: boolean;
29
- setSvgChildColor(aryColor: number[]): void;
30
- getSvgChildColor(): number[];
31
- private calcVewSize;
32
- worldDraw(pWorldDraw: McGiWorldDraw): void;
33
- /**
34
- * 设置SVG的路径
35
- * @param path 路径
36
- * @param preload 是否提前加载SVG
37
- * */
38
- setSvgPath(path: string, preload?: boolean): Promise<void>;
39
- /**
40
- * 获取SVG的路径
41
- * */
42
- getSvgPath(): string;
43
- /**
44
- * 设置SVG显示位置
45
- * @param pos THREE.Vector3
46
- * */
47
- setSvgPostion(pos: THREE.Vector3): void;
48
- /**
49
- * 获取SVG显示位置
50
- * */
51
- getSvgPostion(): THREE.Vector3;
52
- /**
53
- * 设置SVG大小
54
- * @param size THREE.Vector2 x表示宽度y表示高度
55
- * */
56
- setSvgSize(size: THREE.Vector2): void;
57
- getSvgSize(): THREE.Vector2;
58
- /** 设置SVG 的调整比例
59
- * @param alignmentRatio THREE.Vector2
60
- * */
61
- setSvgAlignmentRatio(alignmentRatio: THREE.Vector2): void;
62
- getSvgAlignmentRatio(): THREE.Vector2;
63
- /** 获取文字数组下标中的文字
64
- * @param index 数组下标
65
- * @return {@link MxDbSVGText}
66
- * */
67
- getText(index: number): MxDbSVGText | null;
68
- /** 添加文字
69
- * @param txt {@link MxDbSVGText}
70
- * */
71
- addText(txt: MxDbSVGText): void;
72
- getGripPoints(): Array<THREE.Vector3>;
73
- moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
74
- private calcSvgPosition;
75
- dwgIn(obj: any): boolean;
76
- dwgOut(obj: any): object;
77
- create(): MxDbEntity;
78
- transformBy(mat: THREE.Matrix4): void;
79
- getTypeName(): string;
80
- /**
81
- * 设置颜色
82
- * @param color 颜色值
83
- * */
84
- setColor(color: number | string | THREE.Color): void;
85
- /**
86
- * 设置svg对象
87
- * */
88
- setSvg(svg: any): void;
89
- private calcSvgBoxSize;
90
- reComputeSVG(): void;
91
- protected onViewChange(): boolean;
92
- }
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,s,i,e){return new(i||(i=Promise))(function(o,r){function g(t){try{a(e.next(t))}catch(t){r(t)}}function h(t){try{a(e.throw(t))}catch(t){r(t)}}function a(t){var s;t.done?o(t.value):(s=t.value,s instanceof i?s:new i(function(t){t(s)})).then(g,h)}a((e=e.apply(t,s||[])).next())})};import MxDbEntity from"../MxDbEntity";import MxDbSVGText from"../MxDbSVGText";import MxThreeJS from"../MxThreeJS";import MxType from"../MxType";export default class MxDbSVG extends MxDbEntity{constructor(){super(...arguments),this.svgPos=new THREE.Vector3,this.svg=null,this.svgPath="",this.svgSize=new THREE.Vector2(50,50),this.svgAlignmentRatio=new THREE.Vector2(0,0),this.svgRotate=0,this.svgReverse=!1,this.svgMirror=!1,this.svgChildColor=[],this.svgMargin=new THREE.Vector2(0,0),this.isSvgDirtyLocation=!1,this.isLoadFromPath=!0,this.aryText=[],this.svgBoxSize=null,this.fixedSize=!1,this.useSvgColor=!1}setSvgChildColor(t){if(this.svgChildColor=t,!this.useSvgColor&&this.svg){let t=new THREE.Color(this.getColor()),s=0,i=this;this.svg.traverse(function(e){e.material&&(s<i.svgChildColor.length?e.material.color=new THREE.Color(i.svgChildColor[s]):e.material.color=t,s++)}),this.setNeedUpdateDisplay(!0)}}getSvgChildColor(){return this.svgChildColor}calcVewSize(t){let s=this.svgSize.x,i=this.svgSize.y;return i<=0&&(i=this.svgBoxSize?this.svgBoxSize.y/this.svgBoxSize.x*s:s),this.fixedSize&&(s=t.screenCoordLong2Doc(s),i=t.screenCoordLong2Doc(i)),[s,i]}worldDraw(t){let s=t.getMxObject();this.calcSvgPosition(s);let[i,e]=this.calcVewSize(s),o=new THREE.Matrix4;o.makeScale(this.svgMirror?-1:1,this.svgReverse?-1:1,1);let r=new THREE.Matrix4;r.makeRotationZ(this.svgRotate);let g=new THREE.Matrix4,h=new THREE.Vector3(this.svgPos.x-i*this.svgAlignmentRatio.x,this.svgPos.y-e*this.svgAlignmentRatio.y,0);g.makeTranslation(h.x,h.y,h.z),r.multiply(o),r.premultiply(g);let a=new THREE.Vector3(0,0,0),v=new THREE.Vector3(i,0,0),l=new THREE.Vector3(i,e,0),n=new THREE.Vector3(0,e,0);if(a.applyMatrix4(r),v.applyMatrix4(r),l.applyMatrix4(r),n.applyMatrix4(r),1==t.getType()){if(this.aryText.forEach(i=>{if(i.txt.length>0){let e=new THREE.Vector3(i.txtPos.x,i.txtPos.y,0);this.fixedSize&&(i.txtPos.x>0?e.x=this.svgPos.x+s.screenCoordLong2Doc(i.txtPos.x):e.x=this.svgPos.x-s.screenCoordLong2Doc(i.txtPos.x),i.txtPos.y>0?e.y=this.svgPos.y+s.screenCoordLong2Doc(i.txtPos.y):e.y=this.svgPos.y-s.screenCoordLong2Doc(i.txtPos.y));let o=void 0;i.color&&(o=t.getColor(),t.setColor(i.color));let r=i.txtHeight;this.fixedSize&&(r=s.screenCoordLong2Doc(i.txtHeight)),i._txtObject=t.drawText(i.txt,r,0,e),i._txtAspectRatio=-1,o&&t.setColor(o)}}),this.svg)t.drawEntity(this.svg);else if(this.svgPath.length>0&&this.isLoadFromPath){let i=this,e=t.getMxObject();MxThreeJS.loadSVG(this.svgPath,void 0,o=>{if(o){let r=o;if(r.boxSize)i.svgBoxSize=r.boxSize.clone();else{let t=(new THREE.Box3).setFromObject(o);i.svgBoxSize||(i.svgBoxSize=new THREE.Vector3),i.svgBoxSize.x=t.max.x-t.min.x,i.svgBoxSize.y=t.max.y-t.min.y}let[g,h]=i.calcVewSize(s);i.svgBoxSize&&(o.scale.x=g/i.svgBoxSize.x,o.scale.y=h/i.svgBoxSize.y),o.scale.z=o.scale.x,i.svgReverse&&(o.scale.y*=-1),i.svgMirror&&(o.scale.x*=-1),o.rotateZ(i.svgRotate),i.isSvgDirtyLocation=!0;let a=new THREE.Color(t.getColor()),v=0;o.traverse(function(t){t.material&&(t.material=t.material.clone(),t.material.transparent=!0,t.material.depthTest=!1,i.useSvgColor||(v<i.svgChildColor.length?t.material.color=new THREE.Color(i.svgChildColor[v]):t.material.color=a),v++)}),i.svg=o,i.setNeedUpdateDisplay(),e.updateDisplay()}else console.log("mx LoadSVG:"+i.svgPath+" failed");i.isLoadFromPath=!1})}t.drawSelectLine(a,l),t.drawSelectLine(v,n),t.drawSelectLine(a,v),t.drawSelectLine(v,l),t.drawSelectLine(l,n),t.drawSelectLine(n,a)}else t.drawLine(a,v),t.drawLine(v,l),t.drawLine(l,n),t.drawLine(n,a)}setSvgPath(t,s=!1){return __awaiter(this,void 0,void 0,function*(){this.svgPath=t,this.svg=null,this.isLoadFromPath=!0,this.svgBoxSize=null,s&&(yield MxThreeJS.loadSVG(t))})}getSvgPath(){return this.svgPath}setSvgPostion(t){this.svgPos=t.clone(),this.isSvgDirtyLocation=!0}getSvgPostion(){return this.svgPos}setSvgSize(t){this.svgSize=t,this.isSvgDirtyLocation=!0}getSvgSize(){return this.svgSize}setSvgAlignmentRatio(t){this.svgAlignmentRatio=t,this.isSvgDirtyLocation=!0}getSvgAlignmentRatio(){return this.svgAlignmentRatio}getText(t){return t<this.aryText.length?this.aryText[t]:null}addText(t){this.aryText.push(t)}getGripPoints(){let t=[];return t.push(this.svgPos),t}moveGripPointsAt(t,s){return 0==t&&(this.svgPos.add(s),this.fixedSize||this.aryText.forEach(t=>{t.txtPos.add(s)})),this.isSvgDirtyLocation=!0,!0}calcSvgPosition(t){if(!this.svg||!this.isSvgDirtyLocation)return;this.isSvgDirtyLocation=!1;let[s,i]=this.calcVewSize(t);this.svg.position.x=this.svgPos.x-s*this.svgAlignmentRatio.x-this.svgMargin.x*s,this.svg.position.y=this.svgPos.y-i*this.svgAlignmentRatio.y-this.svgMargin.y*i}dwgIn(t){this.onDwgIn(t),this.fixedSize=t.fixedSize,this.fixedSize?this.svg=null:t.type==MxType.MxCloneType.kClone&&t.svg&&(this.svg=t.svg.clone()),this.svgPos.copy(t.svgPos),this.svgPath=t.svgPath.substr(0),this.svgSize.copy(t.svgSize),this.svgAlignmentRatio.copy(t.svgAlignmentRatio),this.isSvgDirtyLocation=!0,this.svg||(this.isLoadFromPath=!0),this.svgBoxSize=null;let s=t.txts;return this.aryText=[],s.forEach(t=>{let s=new MxDbSVGText;s.txt=t.txt,s.txtHeight=t.txtHeight,s.txtPos.copy(t.txtPos),this.aryText.push(s)}),this.svgRotate=t.svgRotate,this.useSvgColor=t.useSvgColor,this.svgReverse=t.svgReverse,this.svgMirror=t.svgMirror,this.svgMargin=t.svgMargin,t.svgChildColor?this.svgChildColor=t.svgChildColor:this.svgChildColor=[],!0}dwgOut(t){return this.onDwgOut(t),t.type==MxType.MxCloneType.kClone&&(t.svg=this.svg),t.svgPath=this.svgPath,t.svgPos=this.svgPos,t.svgSize=this.svgSize,t.svgAlignmentRatio=this.svgAlignmentRatio,t.txts=[],this.aryText.forEach(s=>{let i={txtPos:s.txtPos,txt:s.txt,txtHeight:s.txtHeight,color:s.color,_txtAspectRatio:s._txtAspectRatio};t.txts.push(i)}),t.fixedSize=this.fixedSize,t.svgRotate=this.svgRotate,t.useSvgColor=this.useSvgColor,t.svgReverse=this.svgReverse,t.svgMirror=this.svgMirror,t.svgMargin=this.svgMargin,t.svgChildColor=this.svgChildColor,t}create(){return new MxDbSVG}transformBy(t){this.svgPos.applyMatrix4(t),this.isSvgDirtyLocation=!0,this.fixedSize||this.aryText.forEach(s=>{s.txtPos.applyMatrix4(t)})}getTypeName(){return"MxDbSVG"}setColor(t){if(super.setColor(t),this.svg){let t=new THREE.Color(this.color);this.svg.traverse(function(s){s.material&&(s.material.color=t)})}}setSvg(t){this.svg=t,this.isLoadFromPath=!1,this.svgBoxSize=null}calcSvgBoxSize(t){if(!this.svgBoxSize)if(t.boxSize)this.svgBoxSize=t.boxSize.clone();else{let s=(new THREE.Box3).setFromObject(t);this.svgBoxSize||(this.svgBoxSize=new THREE.Vector3),this.svgBoxSize.x=s.max.x-s.min.x,this.svgBoxSize.y=s.max.y-s.min.y}}reComputeSVG(){if(!this.svg)return;let t=this.getMxObject();if(!t)return;this.calcSvgBoxSize(this.svg);let[s,i]=this.calcVewSize(t);this.svgBoxSize&&(this.svg.scale.x=s/this.svgBoxSize.x,this.svg.scale.y=i/this.svgBoxSize.y),this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.svgMirror&&(this.svg.scale.x*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}onViewChange(){if(!this.fixedSize)return!1;let t=this.getMxObject();if(null==t)return!1;if(this.svg){this.calcSvgBoxSize(this.svg);let[s,i]=this.calcVewSize(t);this.svgBoxSize&&(this.svg.scale.x=s/this.svgBoxSize.x,this.svg.scale.y=i/this.svgBoxSize.y),this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.svgMirror&&(this.svg.scale.x*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}let s=this;return this.aryText.forEach(i=>{if(i._txtObject&&t){let e=t.screenCoordLong2Doc(i.txtHeight);e>1e-5&&(i._txtAspectRatio<=0&&(i._txtAspectRatio=i._txtObject.scale.x/i._txtObject.scale.y),i._txtObject.scale.set(i._txtAspectRatio*e,e,1),i.txtPos.x>0?i._txtObject.position.x=s.svgPos.x+t.screenCoordLong2Doc(i.txtPos.x):i._txtObject.position.x=s.svgPos.x-t.screenCoordLong2Doc(i.txtPos.x),i.txtPos.y>0?i._txtObject.position.y=s.svgPos.y+t.screenCoordLong2Doc(i.txtPos.y):i._txtObject.position.y=s.svgPos.y-t.screenCoordLong2Doc(i.txtPos.y),i._txtObject.updateMatrix())}}),!0}};
@@ -1,18 +0,0 @@
1
- /** @module MxDbSVG*/
2
- /**
3
- * MxDbSVGText 为SVG提供文字数据
4
- * */
5
- export default class MxDbSVGText {
6
- /** 文字的位置 */
7
- txtPos: THREE.Vector3;
8
- /** 文字内容 */
9
- txt: string;
10
- /** 文字高度 */
11
- txtHeight: number;
12
- /** 文字颜色 */
13
- color: number | string | THREE.Color | undefined;
14
- /** THREE.Sprite */
15
- _txtObject: THREE.Sprite | null;
16
- /** 比例 */
17
- _txtAspectRatio: number;
18
- }
@@ -1 +0,0 @@
1
- export default class MxDbSVGText{constructor(){this.txtPos=new THREE.Vector3,this.txt="",this.txtHeight=1,this.color=void 0,this._txtObject=null,this._txtAspectRatio=-1}};