mxdraw 0.1.28 → 0.1.31
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/lib/MxModule/MxDbArea/MxDbArea.js +1 -1
- package/dist/lib/MxModule/MxDbCloudLine/MxDbCloudLine.js +1 -1
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -1
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.js +1 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/lib/doc.js +1 -1
- package/dist/mxdraw.es5.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +1 -2
- package/dist/types/MxModule/McGeTool/McGeTool.d.ts +3 -2
- package/dist/types/MxModule/McGiWorldDraw/McGiWorldDraw.d.ts +1 -2
- package/dist/types/MxModule/Mx3PointArc/Mx3PointArc.d.ts +1 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.d.ts +2 -1
- package/dist/types/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.d.ts +9 -1
- package/dist/types/MxModule/MxDbAnyLine/MxDbAnyLine.d.ts +4 -1
- package/dist/types/MxModule/MxDbArea/MxDbArea.d.ts +18 -0
- package/dist/types/MxModule/MxDbCloudLine/MxDbCloudLine.d.ts +22 -2
- package/dist/types/MxModule/MxDbCoord/MxDbCoord.d.ts +3 -1
- package/dist/types/MxModule/MxDbEllipse/MxDbEllipse.d.ts +3 -1
- package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +60 -103
- package/dist/types/MxModule/MxDbImage/MxDbImage.d.ts +15 -0
- package/dist/types/MxModule/MxDbLeadComment/MxDbLeadComment.d.ts +7 -0
- package/dist/types/MxModule/MxDbLine/MxDbLine.d.ts +4 -0
- package/dist/types/MxModule/MxDbPolyline/MxDbPolyline.d.ts +8 -1
- package/dist/types/MxModule/MxDbRect/MxDbRect.d.ts +6 -0
- package/dist/types/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.d.ts +9 -0
- package/dist/types/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.d.ts +4 -1
- package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +39 -3
- package/dist/types/MxModule/MxDbSVGText/MxDbSVGText.d.ts +10 -2
- package/dist/types/MxModule/MxDbText/MxDbText.d.ts +5 -1
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +1 -1
- package/dist/types/MxModule/MxFun/MxFun.d.ts +1 -2
- package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +7 -9
- package/dist/types/MxModule/MxType/MxType.d.ts +0 -1
- package/dist/types/doc.d.ts +36 -22
- package/dist/types/tools/three/index.d.ts +2 -3
- package/package.json +1 -1
|
@@ -3,9 +3,8 @@ import * as THREE from 'three';
|
|
|
3
3
|
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
4
|
import MxDbEntity from '../MxDbEntity';
|
|
5
5
|
import MxDbSVGText from '../MxDbSVGText';
|
|
6
|
-
import { ColorType } from '../MxType/MxType';
|
|
7
6
|
/**
|
|
8
|
-
* MxDbSVG SVG
|
|
7
|
+
* MxDbSVG 绘制SVG图形.
|
|
9
8
|
*/
|
|
10
9
|
export default class MxDbSVG extends MxDbEntity {
|
|
11
10
|
private svgPos;
|
|
@@ -13,26 +12,59 @@ export default class MxDbSVG extends MxDbEntity {
|
|
|
13
12
|
private svgPath;
|
|
14
13
|
private svgSize;
|
|
15
14
|
private svgAlignmentRatio;
|
|
15
|
+
/** 延z轴旋转的数值 */
|
|
16
16
|
svgRotate: number;
|
|
17
|
+
/** 是否倒置SVG图形 */
|
|
17
18
|
svgReverse: boolean;
|
|
18
19
|
svgMargin: THREE.Vector2;
|
|
19
20
|
private isSvgDirtyLocation;
|
|
20
21
|
private isLoadFromPath;
|
|
21
22
|
private aryText;
|
|
22
23
|
private svgBoxSize;
|
|
24
|
+
/** 固定尺寸,图片和文字大小,取屏幕像素绘图单位。 */
|
|
23
25
|
fixedSize: boolean;
|
|
26
|
+
/**使用svg的颜色 */
|
|
24
27
|
useSvgColor: boolean;
|
|
25
28
|
private calcVewSize;
|
|
26
29
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
30
|
+
/**
|
|
31
|
+
* 设置SVG的路径
|
|
32
|
+
* @param path 路径
|
|
33
|
+
* @param preload 是否提前加载SVG
|
|
34
|
+
* */
|
|
27
35
|
setSvgPath(path: string, preload?: boolean): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* 获取SVG的路径
|
|
38
|
+
* */
|
|
28
39
|
getSvgPath(): string;
|
|
40
|
+
/**
|
|
41
|
+
* 设置SVG显示位置
|
|
42
|
+
* @param pos THREE.Vector3
|
|
43
|
+
* */
|
|
29
44
|
setSvgPostion(pos: THREE.Vector3): void;
|
|
45
|
+
/**
|
|
46
|
+
* 获取SVG显示位置
|
|
47
|
+
* */
|
|
30
48
|
getSvgPostion(): THREE.Vector3;
|
|
49
|
+
/**
|
|
50
|
+
* 设置SVG大小
|
|
51
|
+
* @param size THREE.Vector2 x表示宽度y表示高度
|
|
52
|
+
* */
|
|
31
53
|
setSvgSize(size: THREE.Vector2): void;
|
|
32
54
|
getSvgSize(): THREE.Vector2;
|
|
55
|
+
/** 设置SVG 的调整比例
|
|
56
|
+
* @param alignmentRatio THREE.Vector2
|
|
57
|
+
* */
|
|
33
58
|
setSvgAlignmentRatio(alignmentRatio: THREE.Vector2): void;
|
|
34
59
|
getSvgAlignmentRatio(): THREE.Vector2;
|
|
60
|
+
/** 获取文字数组下标中的文字
|
|
61
|
+
* @param index 数组下标
|
|
62
|
+
* @return {@link MxDbSVGText}
|
|
63
|
+
* */
|
|
35
64
|
getText(index: number): MxDbSVGText | null;
|
|
65
|
+
/** 添加文字
|
|
66
|
+
* @param txt {@link MxDbSVGText}
|
|
67
|
+
* */
|
|
36
68
|
addText(txt: MxDbSVGText): void;
|
|
37
69
|
getGripPoints(): Array<THREE.Vector3>;
|
|
38
70
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
@@ -42,6 +74,10 @@ export default class MxDbSVG extends MxDbEntity {
|
|
|
42
74
|
create(): MxDbEntity;
|
|
43
75
|
transformBy(mat: THREE.Matrix4): void;
|
|
44
76
|
getTypeName(): string;
|
|
45
|
-
|
|
77
|
+
/**
|
|
78
|
+
* 设置颜色
|
|
79
|
+
* @param color 颜色值
|
|
80
|
+
* */
|
|
81
|
+
setColor(color: number | string | THREE.Color): void;
|
|
46
82
|
protected onViewChange(): boolean;
|
|
47
83
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
/** @module MxDbSVG*/
|
|
2
2
|
import * as THREE from 'three';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* MxDbSVGText 为SVG提供文字数据
|
|
5
|
+
* */
|
|
4
6
|
export default class MxDbSVGText {
|
|
7
|
+
/** 文字的位置 */
|
|
5
8
|
txtPos: THREE.Vector3;
|
|
9
|
+
/** 文字内容 */
|
|
6
10
|
txt: string;
|
|
11
|
+
/** 文字高度 */
|
|
7
12
|
txtHeight: number;
|
|
8
|
-
|
|
13
|
+
/** 文字颜色 */
|
|
14
|
+
color: number | string | THREE.Color | undefined;
|
|
15
|
+
/** THREE.Sprite */
|
|
9
16
|
_txtObject: THREE.Sprite | null;
|
|
17
|
+
/** 比例 */
|
|
10
18
|
_txtAspectRatio: number;
|
|
11
19
|
}
|
|
@@ -3,12 +3,16 @@ import { Vector3 } from 'three';
|
|
|
3
3
|
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
4
|
import MxDbEntity from '../MxDbEntity';
|
|
5
5
|
/**
|
|
6
|
-
* MxDbText
|
|
6
|
+
* MxDbText 绘制文字
|
|
7
7
|
*/
|
|
8
8
|
export default class MxDbText extends MxDbEntity {
|
|
9
|
+
/** 文字所在位置*/
|
|
9
10
|
position: Vector3;
|
|
11
|
+
/** 文字内容*/
|
|
10
12
|
text: string;
|
|
13
|
+
/** 文字高度*/
|
|
11
14
|
height: number;
|
|
15
|
+
/** 角度*/
|
|
12
16
|
angle: number;
|
|
13
17
|
getTypeName(): string;
|
|
14
18
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
@@ -3,7 +3,6 @@ import { MeshLambertMaterial } from 'three';
|
|
|
3
3
|
import MxDbEntity from '../MxDbEntity';
|
|
4
4
|
import mxUiData from '../loadCoreCode/mxUiData';
|
|
5
5
|
import { MxDrawObjectType } from '../MxDrawObject/MxDrawObject';
|
|
6
|
-
import { ColorType } from '../MxType/MxType';
|
|
7
6
|
interface CanvasParent extends HTMLElement {
|
|
8
7
|
tabindex?: number;
|
|
9
8
|
}
|
|
@@ -86,7 +85,7 @@ export interface MxFunType {
|
|
|
86
85
|
initDynamicCreate(dynCreate: any): void;
|
|
87
86
|
openFile(sFile: string | string[], useWebsocket: boolean): boolean;
|
|
88
87
|
getMxJigCmdManager(): CmdMangerType;
|
|
89
|
-
loadSVG(url: string, color?:
|
|
88
|
+
loadSVG(url: string, color?: number | string | THREE.Color, callResult?: any): void;
|
|
90
89
|
getTHREE(): any;
|
|
91
90
|
}
|
|
92
91
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Vector3, Line, Object3D, Points, Sprite, Mesh, MeshBasicMaterial } from 'three';
|
|
2
|
-
declare type ColorType = number | string | THREE.Color;
|
|
3
2
|
/**
|
|
4
3
|
* MxThreeJS 模块
|
|
5
4
|
* ##### 使用说明:
|
|
@@ -57,7 +56,7 @@ export default class MxThreeJS {
|
|
|
57
56
|
* Mx.MxThreeJS.createLine(new Three.Vector3(1,10,0), new Three.Vector3(1,300,0), 0)
|
|
58
57
|
* ```
|
|
59
58
|
*/
|
|
60
|
-
createLine(vPt1: Vector3, vPt2: Vector3, iColor:
|
|
59
|
+
createLine(vPt1: Vector3, vPt2: Vector3, iColor: number | string | THREE.Color): Line;
|
|
61
60
|
/**
|
|
62
61
|
* 创建Three.js圆对象。
|
|
63
62
|
* @param mCenterPt 圆中心点
|
|
@@ -69,7 +68,7 @@ export default class MxThreeJS {
|
|
|
69
68
|
* Mx.MxThreeJS.createCircle(new Three.Vector3(1,10,0), 10, 0)
|
|
70
69
|
* ```
|
|
71
70
|
*/
|
|
72
|
-
createCircle(mCenterPt: Vector3, dRadius: number, iColor:
|
|
71
|
+
createCircle(mCenterPt: Vector3, dRadius: number, iColor: number | string | THREE.Color): Object3D;
|
|
73
72
|
/**
|
|
74
73
|
* 创建Three.js点对象。
|
|
75
74
|
* @param mPt 点位置
|
|
@@ -80,7 +79,7 @@ export default class MxThreeJS {
|
|
|
80
79
|
* Mx.MxThreeJS.createPoint(new Three.Vector3(1,10,0), 0)
|
|
81
80
|
* ```
|
|
82
81
|
*/
|
|
83
|
-
createPoint(mPt: Vector3, iColor:
|
|
82
|
+
createPoint(mPt: Vector3, iColor: number | string | THREE.Color): Points;
|
|
84
83
|
/**
|
|
85
84
|
* 创建Three.js 文字
|
|
86
85
|
* @param message 文字信息
|
|
@@ -110,7 +109,7 @@ export default class MxThreeJS {
|
|
|
110
109
|
* )
|
|
111
110
|
* ```
|
|
112
111
|
*/
|
|
113
|
-
createTriangle(points: Array<Vector3>, iColor:
|
|
112
|
+
createTriangle(points: Array<Vector3>, iColor: number | string | THREE.Color, opacity?: number): Mesh | null;
|
|
114
113
|
/**
|
|
115
114
|
* 创建连续直线
|
|
116
115
|
* @param points 由多个点组成的数组
|
|
@@ -121,7 +120,7 @@ export default class MxThreeJS {
|
|
|
121
120
|
* Mx.MxThreeJS.createLines([new THREE.Vector3(1,2,2),new THREE.Vector3(1,65,4),new THREE.Vector3(12,2,2)], 0)
|
|
122
121
|
* ```
|
|
123
122
|
*/
|
|
124
|
-
createLines(points: Array<Vector3>, iColor:
|
|
123
|
+
createLines(points: Array<Vector3>, iColor: number | string | THREE.Color): Line;
|
|
125
124
|
/**
|
|
126
125
|
* 创建虚线
|
|
127
126
|
* @param points 由多个点组成的数组
|
|
@@ -134,7 +133,7 @@ export default class MxThreeJS {
|
|
|
134
133
|
* Mx.MxThreeJS.createDashedLines([new THREE.Vector3(1,2,2),new THREE.Vector3(1,65,4),new THREE.Vector3(12,2,2)], 10, 20, 2)
|
|
135
134
|
* ```
|
|
136
135
|
*/
|
|
137
|
-
createDashedLines(points: Array<Vector3>, iColor:
|
|
136
|
+
createDashedLines(points: Array<Vector3>, iColor: number | string | THREE.Color, dashSize: number, gapSize: number): Line;
|
|
138
137
|
/**
|
|
139
138
|
* 创建Image
|
|
140
139
|
* @param pos 图片中心点位置,屏幕坐标,屏幕坐标的Y轴向上。坐标原点在左下角.
|
|
@@ -164,6 +163,5 @@ export default class MxThreeJS {
|
|
|
164
163
|
* })
|
|
165
164
|
* ```
|
|
166
165
|
*/
|
|
167
|
-
loadSVG(url: string, color?:
|
|
166
|
+
loadSVG(url: string, color?: number | string | THREE.Color, callResult?: (threeobj: Object3D, aryMeterial: Array<MeshBasicMaterial>) => void): Promise<THREE.Object3D | null>;
|
|
168
167
|
}
|
|
169
|
-
export {};
|
package/dist/types/doc.d.ts
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import useCanvasResizeListener from './MxModule/useCanvasResizeListener
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
|
|
1
|
+
import loadCoreCode from './MxModule/loadCoreCode';
|
|
2
|
+
import store from './MxModule/store';
|
|
3
|
+
import MxFun from './MxModule/MxFun';
|
|
4
|
+
import MxThreeJS from './MxModule/MxThreeJS';
|
|
5
|
+
import MrxDbgUiPrPoint from './MxModule/MrxDbgUiPrPoint';
|
|
6
|
+
import McEdGetPointWorldDrawObject from './MxModule/McEdGetPointWorldDrawObject';
|
|
7
|
+
import useCanvasResizeListener from './MxModule/useCanvasResizeListener';
|
|
8
|
+
import MrxDbgUiPrBaseReturn from './MxModule/MrxDbgUiPrBaseReturn';
|
|
9
|
+
import MxDbEntity from './MxModule/MxDbEntity';
|
|
10
|
+
import MxDbImage from './MxModule/MxDbImage';
|
|
11
|
+
import MxDbSVG from './MxModule/MxDbSVG';
|
|
12
|
+
import MxDbSVGText from './MxModule/MxDbSVGText';
|
|
13
|
+
import MxDbPolyline from './MxModule/MxDbPolyline';
|
|
14
|
+
import MxDb2LineAngularDimension from './MxModule/MxDb2LineAngularDimension';
|
|
15
|
+
import Mx3PointArc from './MxModule/Mx3PointArc';
|
|
16
|
+
import MxDbCoord from './MxModule/MxDbCoord';
|
|
17
|
+
import MxDbLine from './MxModule/MxDbLine';
|
|
18
|
+
import MxDbRect from './MxModule/MxDbRect';
|
|
19
|
+
import MxDbAlignedDimension from './MxModule/MxDbAlignedDimension';
|
|
20
|
+
import MxFilters from './MxModule/MxFilters';
|
|
21
|
+
import McGiWorldDraw from './MxModule/McGiWorldDraw';
|
|
22
|
+
import McGiWorldDrawType from './MxModule/McGiWorldDrawType';
|
|
23
|
+
import MxType from './MxModule/MxType';
|
|
24
|
+
import Mxassembly from './MxModule/Mxassembly';
|
|
25
|
+
import MxDbArea from './MxModule/MxDbArea';
|
|
26
|
+
import MxDbAnyLine from './MxModule/MxDbAnyLine';
|
|
27
|
+
import MxDbCloudLine from './MxModule/MxDbCloudLine';
|
|
28
|
+
import MxDbRegularPolygon from './MxModule/MxDbRegularPolygon';
|
|
29
|
+
import McGePoint3d from './MxModule/McGePoint3d';
|
|
30
|
+
import McGePoint3dArray from './MxModule/McGePoint3dArray';
|
|
31
|
+
import McGeTool from './MxModule/McGeTool';
|
|
32
|
+
import MxDbLeadComment from './MxModule/MxDbLeadComment';
|
|
33
|
+
import MxDbRectBoxLeadComment from './MxModule/MxDbRectBoxLeadComment';
|
|
34
|
+
import MxDbEllipse from './MxModule/MxDbEllipse';
|
|
35
|
+
import MxDbText from './MxModule/MxDbText';
|
|
36
|
+
export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea, MxDbAnyLine, MxDbCloudLine, MxDbLeadComment, MxDbRectBoxLeadComment, MxDbEllipse, MxDbText, MxDbRegularPolygon };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ColorType } from '@/MxModule/MxType/MxType';
|
|
2
1
|
import { Vector3, Color, Line, Geometry, LineLoop } from 'three';
|
|
3
2
|
/**
|
|
4
3
|
* 移动geometry坐标。
|
|
@@ -58,7 +57,7 @@ export declare function createThreePointArc(pt1: Vector3, pt2: Vector3, pt3: Vec
|
|
|
58
57
|
export declare function createAnyLine(points: Vector3[]): Line;
|
|
59
58
|
/**
|
|
60
59
|
* 绘制椭圆 */
|
|
61
|
-
export declare function createThreeEllipse(pt1: Vector3, pt3: Vector3, color:
|
|
60
|
+
export declare function createThreeEllipse(pt1: Vector3, pt3: Vector3, color: number | string | THREE.Color): Line;
|
|
62
61
|
export declare function computeRegularPolygonVertices(centerPt?: Vector3, pt?: Vector3, segments?: number): Vector3[];
|
|
63
62
|
/**
|
|
64
63
|
* 创建正多边形
|
|
@@ -66,4 +65,4 @@ export declare function computeRegularPolygonVertices(centerPt?: Vector3, pt?: V
|
|
|
66
65
|
* @param pt 边角一点
|
|
67
66
|
* @param segments 边数
|
|
68
67
|
* */
|
|
69
|
-
export declare function createThreeRegularPolygon(centerPt: Vector3, pt: Vector3, segments: number, color:
|
|
68
|
+
export declare function createThreeRegularPolygon(centerPt: Vector3, pt: Vector3, segments: number, color: number | string | THREE.Color): LineLoop;
|