mxdraw 0.1.8 → 0.1.9
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/MxDbEntity/MxDbEntity.js +25 -12
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +140 -86
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +49 -32
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +18 -0
- package/dist/lib/MxModule/MxDbSVGText/index.js +5 -0
- package/dist/lib/MxModule/MxFun/MxFun.js +13 -0
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +2 -0
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +36 -23
- package/dist/lib/mxdraw.js +4 -1
- package/dist/lib/tools/three/index.js +21 -15
- package/dist/mxdraw.es5.js +3 -3
- package/dist/mxdraw.es5.js.map +1 -1
- package/dist/mxdraw.umd.js +3 -3
- package/dist/mxdraw.umd.js.map +1 -1
- package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +12 -4
- package/dist/types/MxModule/MxDbRect/MxDbRect.d.ts +21 -42
- package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +5 -9
- package/dist/types/MxModule/MxDbSVGText/MxDbSVGText.d.ts +7 -0
- package/dist/types/MxModule/MxDbSVGText/index.d.ts +3 -0
- package/dist/types/MxModule/MxFun/MxFun.d.ts +12 -0
- package/dist/types/mxdraw.d.ts +3 -1
- package/package.json +1 -1
|
@@ -21,8 +21,16 @@ import McGiWorldDraw from '../McGiWorldDraw';
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export default abstract class MxDbEntity {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
color: ColorType;
|
|
25
|
+
renderOrder: number;
|
|
26
|
+
/**
|
|
27
|
+
* opacity 设置透明度 0 ~ 1,1表示完全不透明,0表示全透明.
|
|
28
|
+
* */
|
|
29
|
+
opacity: number;
|
|
30
|
+
/**
|
|
31
|
+
* visible 该矩形对象是否可见
|
|
32
|
+
* */
|
|
33
|
+
visible: boolean;
|
|
26
34
|
/**
|
|
27
35
|
* 自定义对象的绘制函数。在方法中定义如何绘制图形
|
|
28
36
|
* @param pWorldDraw 绘制对象{@link McGiWorldDraw }
|
|
@@ -155,7 +163,7 @@ export default abstract class MxDbEntity {
|
|
|
155
163
|
*
|
|
156
164
|
* ```
|
|
157
165
|
*/
|
|
158
|
-
setColor(
|
|
166
|
+
setColor(color: ColorType): void;
|
|
159
167
|
/**
|
|
160
168
|
* 得到颜色
|
|
161
169
|
* @param
|
|
@@ -205,7 +213,7 @@ export default abstract class MxDbEntity {
|
|
|
205
213
|
*
|
|
206
214
|
* ```
|
|
207
215
|
*/
|
|
208
|
-
setRenderOrder(
|
|
216
|
+
setRenderOrder(renderOrder: number): void;
|
|
209
217
|
/**
|
|
210
218
|
* 得到显示顺序
|
|
211
219
|
* @param
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import MxDbEntity from '../MxDbEntity';
|
|
2
|
-
import {
|
|
2
|
+
import { Matrix4, Vector3 } from 'three';
|
|
3
3
|
import MxFilters from '../MxFilters';
|
|
4
4
|
import McGiWorldDraw from '../McGiWorldDraw';
|
|
5
5
|
/**
|
|
6
6
|
* MxRectEntity 矩形对象.
|
|
7
7
|
*/
|
|
8
8
|
export default class MxDbRect extends MxDbEntity {
|
|
9
|
+
private cornerRadius;
|
|
9
10
|
/**
|
|
10
11
|
* pt1: 构成矩形的第一个点
|
|
11
12
|
* */
|
|
@@ -15,60 +16,38 @@ export default class MxDbRect extends MxDbEntity {
|
|
|
15
16
|
* */
|
|
16
17
|
pt2: Vector3;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* 是否需要颜色填充.
|
|
19
20
|
* */
|
|
20
|
-
|
|
21
|
+
isSolidColorFill: boolean;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
* */
|
|
24
|
-
height: number;
|
|
25
|
-
/**
|
|
26
|
-
* cornerRadius(优先级大于radius属性): 圆角的半径 如[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4
|
|
27
|
-
* */
|
|
28
|
-
cornerRadius: number[];
|
|
29
|
-
/**
|
|
30
|
-
* radius(优先级低于cornerRadius属性): 所有圆角统一半径 (radius = 4) 通过MxFun.screenCoordLong2Doc方法转换为 (cornerRadius = [MxFun.screenCoordLong2Doc(4)...])
|
|
31
|
-
* */
|
|
32
|
-
radius: number | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* fillColor(优先级低于fillImageSrc属性): 设置颜色后 矩形线框会填充为带颜色的矩形
|
|
35
|
-
* */
|
|
36
|
-
fillColor: Color | string | number | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* transparent 开启透明度
|
|
39
|
-
* */
|
|
40
|
-
transparent: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* opacity 设置透明度 0 ~ 1
|
|
23
|
+
* fillImageParam 填充背景图片的参数设置(如果使用了滤镜则部分参数功能失效)
|
|
43
24
|
* */
|
|
44
|
-
|
|
25
|
+
private fillImageParam;
|
|
45
26
|
/**
|
|
46
|
-
*
|
|
27
|
+
* 设置滤镜对象{@link MxFilters} 默认为undefined | null 则不使用该滤镜效果
|
|
47
28
|
* */
|
|
48
|
-
|
|
29
|
+
private filter;
|
|
49
30
|
/**
|
|
50
31
|
* fillImageSrc(优先级低于fillColor属性) 填充背景图片的地址
|
|
51
32
|
* */
|
|
52
|
-
fillImageSrc
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* */
|
|
56
|
-
fillImageParam: {
|
|
57
|
-
offset?: Vector2;
|
|
58
|
-
repeat?: Vector2;
|
|
59
|
-
rotation?: number;
|
|
60
|
-
center?: Vector2;
|
|
61
|
-
} | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* 设置滤镜对象{@link MxFilters} 默认为undefined | null 则不使用该滤镜效果
|
|
64
|
-
* */
|
|
65
|
-
filter: MxFilters | undefined | null;
|
|
33
|
+
private fillImageSrc;
|
|
34
|
+
private isLoadMaterialFromPath;
|
|
35
|
+
private material;
|
|
66
36
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
67
37
|
getGripPoints(): Array<Vector3>;
|
|
68
38
|
moveGripPointsAt(index: number, offset: Vector3): boolean;
|
|
69
39
|
dwgIn(obj: any): boolean;
|
|
70
40
|
dwgOut(obj: any): object;
|
|
71
|
-
create():
|
|
41
|
+
create(): MxDbRect;
|
|
72
42
|
transformBy(mat: Matrix4): void;
|
|
43
|
+
/**
|
|
44
|
+
* setRadius 设置圆角 圆角的半径 如[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4
|
|
45
|
+
* @param { number | number[] } radius 圆角半径 为数组时[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4; 或者直接设置半径值 则四个角统一半径
|
|
46
|
+
* */
|
|
47
|
+
setRadius(radius: number | number[], isScreenCoord?: boolean): void;
|
|
73
48
|
getTypeName(): string;
|
|
49
|
+
getFilter(): MxFilters | undefined | null;
|
|
50
|
+
setFilter(filter: MxFilters | undefined | null): void;
|
|
51
|
+
setFillImagePath(sPath: string | undefined): void;
|
|
52
|
+
getFillImagePath(): string | undefined;
|
|
74
53
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
import McGiWorldDraw from '../McGiWorldDraw';
|
|
4
4
|
import MxDbEntity from '../MxDbEntity';
|
|
5
|
+
import MxDbSVGText from '../MxDbSVGText';
|
|
5
6
|
/**
|
|
6
7
|
* MxDbSVG SVG对象.
|
|
7
8
|
*/
|
|
@@ -13,9 +14,7 @@ export default class MxDbSVG extends MxDbEntity {
|
|
|
13
14
|
private svgAlignmentRatio;
|
|
14
15
|
private isSvgDirtyLocation;
|
|
15
16
|
private isLoadFromPath;
|
|
16
|
-
private
|
|
17
|
-
private txt;
|
|
18
|
-
private txtHeight;
|
|
17
|
+
private aryText;
|
|
19
18
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
20
19
|
setSvgPath(path: string): void;
|
|
21
20
|
getSvgPath(): string;
|
|
@@ -25,12 +24,8 @@ export default class MxDbSVG extends MxDbEntity {
|
|
|
25
24
|
getSvgSize(): THREE.Vector2;
|
|
26
25
|
setSvgAlignmentRatio(alignmentRatio: THREE.Vector2): void;
|
|
27
26
|
getSvgAlignmentRatio(): THREE.Vector2;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setText(txt: string): void;
|
|
31
|
-
getText(): string;
|
|
32
|
-
setTextPostion(pos: THREE.Vector3): void;
|
|
33
|
-
getTextPostion(): THREE.Vector3;
|
|
27
|
+
getText(index: number): MxDbSVGText | null;
|
|
28
|
+
addText(txt: MxDbSVGText): void;
|
|
34
29
|
getGripPoints(): Array<THREE.Vector3>;
|
|
35
30
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
36
31
|
private calcSvgPosition;
|
|
@@ -39,4 +34,5 @@ export default class MxDbSVG extends MxDbEntity {
|
|
|
39
34
|
create(): MxDbEntity;
|
|
40
35
|
transformBy(mat: THREE.Matrix4): void;
|
|
41
36
|
getTypeName(): string;
|
|
37
|
+
setColor(color: ColorType): void;
|
|
42
38
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import MxDrawObject from '../MxDrawObject';
|
|
2
2
|
import { MeshLambertMaterial } from 'three';
|
|
3
|
+
import MxDbEntity from '../MxDbEntity';
|
|
3
4
|
interface CanvasParent extends HTMLElement {
|
|
4
5
|
tabindex?: number;
|
|
5
6
|
}
|
|
@@ -450,5 +451,16 @@ export default class MxFun {
|
|
|
450
451
|
* ```
|
|
451
452
|
*/
|
|
452
453
|
openFile(sFile: string): boolean;
|
|
454
|
+
/**
|
|
455
|
+
* 添加一个MxDbEntity实体到当前绘图对象上。
|
|
456
|
+
* @param ent 实体对象
|
|
457
|
+
* @returns number 返回对象的id.
|
|
458
|
+
* @example
|
|
459
|
+
* ```typescript
|
|
460
|
+
*
|
|
461
|
+
*
|
|
462
|
+
* ```
|
|
463
|
+
*/
|
|
464
|
+
addToCurrentSpace(ent: MxDbEntity): number;
|
|
453
465
|
}
|
|
454
466
|
export {};
|
package/dist/types/mxdraw.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import MrxDbgUiPrBaseReturn from './MxModule/MrxDbgUiPrBaseReturn';
|
|
|
9
9
|
import MxDbEntity from './MxModule/MxDbEntity';
|
|
10
10
|
import MxDbImage from './MxModule/MxDbImage';
|
|
11
11
|
import MxDbSVG from './MxModule/MxDbSVG';
|
|
12
|
+
import MxDbSVGText from './MxModule/MxDbSVGText';
|
|
12
13
|
import MxDbLine from './MxModule/MxDbLine';
|
|
13
14
|
import MxDbRect from './MxModule/MxDbRect';
|
|
14
15
|
import MxDbAlignedDimension from './MxModule/MxDbAlignedDimension';
|
|
@@ -18,7 +19,7 @@ import McGiWorldDrawType from './MxModule/McGiWorldDrawType';
|
|
|
18
19
|
import MxType from './MxModule/MxType';
|
|
19
20
|
import Mxassembly from './MxModule/Mxassembly';
|
|
20
21
|
import McGeVector3d from './MxModule/McGeVector3d';
|
|
21
|
-
export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGeVector3d, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType };
|
|
22
|
+
export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGeVector3d, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType };
|
|
22
23
|
declare const _default: {
|
|
23
24
|
MxFun: import("./doc").MxFun;
|
|
24
25
|
Mxassembly: import("./MxModule/Mxassembly/Mxassembly").default;
|
|
@@ -30,6 +31,7 @@ declare const _default: {
|
|
|
30
31
|
MxDbImage: typeof MxDbImage;
|
|
31
32
|
MxDbLine: typeof MxDbLine;
|
|
32
33
|
MxDbSVG: typeof MxDbSVG;
|
|
34
|
+
MxDbSVGText: typeof MxDbSVGText;
|
|
33
35
|
MxDbRect: typeof MxDbRect;
|
|
34
36
|
MxDbAlignedDimension: typeof MxDbAlignedDimension;
|
|
35
37
|
useCanvasResizeListener: typeof useCanvasResizeListener;
|