mxdraw 0.1.334 → 0.1.336
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/mxdraw.d.ts +134 -127
- package/dist/mxdraw.esm.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/package.json +1 -1
package/dist/mxdraw.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as three from 'three';
|
|
2
2
|
import { Color } from 'three';
|
|
3
|
-
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* 加载MxDraw库的核心代码 才能使用Mx的其他模块
|
|
@@ -1866,7 +1865,6 @@ declare class MxTempMarkDraw {
|
|
|
1866
1865
|
/** @module MxDrawObject */
|
|
1867
1866
|
|
|
1868
1867
|
interface MxDrawObjectType {
|
|
1869
|
-
renderer: THREE.WebGLRenderer;
|
|
1870
1868
|
addEvent(arg0: string, arg1: (...parmes: any) => any): void;
|
|
1871
1869
|
setIniset(arg0: iniConfig): void;
|
|
1872
1870
|
getScene(): THREE.Scene;
|
|
@@ -1924,26 +1922,26 @@ interface MxDrawObjectType {
|
|
|
1924
1922
|
}
|
|
1925
1923
|
/**
|
|
1926
1924
|
* mxdraw事件
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1925
|
+
* @example
|
|
1926
|
+
* ```typescript
|
|
1927
|
+
* 响应夹点编辑事件
|
|
1928
|
+
* mxcad.mxdraw.on("objectGripEdit",(grips)=>{
|
|
1929
|
+
* grips.forEach((grip)=>{
|
|
1930
|
+
* let id = new McObjectId(grip.id,grip.type == "mxcad" ? McObjectIdType.kMxCAD :McObjectIdType.kMxDraw);
|
|
1931
|
+
* console.log(id.getMcDbEntity());
|
|
1932
|
+
* });
|
|
1933
|
+
* console.log(grips);
|
|
1934
|
+
* })
|
|
1935
|
+
* ```
|
|
1938
1936
|
*/
|
|
1939
1937
|
type MxDrawEvents = {
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1938
|
+
loadComplete: () => void;
|
|
1939
|
+
render: () => void;
|
|
1940
|
+
addResizeEvent: (resize: Function) => void;
|
|
1941
|
+
initObject: () => void;
|
|
1942
|
+
openFileComplete: (iResult: number) => void;
|
|
1943
|
+
saveFileComplete: (iResult: number, sServerResult: string) => void;
|
|
1944
|
+
uiSetLayerData: (layerList: {
|
|
1947
1945
|
name: string;
|
|
1948
1946
|
id: number;
|
|
1949
1947
|
off?: number;
|
|
@@ -1952,11 +1950,11 @@ type MxDrawEvents = {
|
|
|
1952
1950
|
zerolayer?: number;
|
|
1953
1951
|
isState?: boolean;
|
|
1954
1952
|
}[]) => void;
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1953
|
+
viewchange: () => void;
|
|
1954
|
+
MxEntitySelectChange: (ids: number[]) => void;
|
|
1955
|
+
objectGripEdit: (entity: MxDbEntity) => void;
|
|
1956
|
+
whetherEditTheGripPoint: (entity: MxDbEntity) => void;
|
|
1957
|
+
databaseModify: () => void;
|
|
1960
1958
|
} & RendererEventsType;
|
|
1961
1959
|
/**
|
|
1962
1960
|
* 引入mxdraw库不会挂载MxDrawObject 只能在以下特定函数中获取
|
|
@@ -1979,10 +1977,6 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
1979
1977
|
* ```
|
|
1980
1978
|
*/
|
|
1981
1979
|
getMxObjectImplement(): any;
|
|
1982
|
-
/**
|
|
1983
|
-
* @instance
|
|
1984
|
-
*/
|
|
1985
|
-
renderer: THREE.WebGLRenderer;
|
|
1986
1980
|
/**
|
|
1987
1981
|
* 获取Three.js绘图场景
|
|
1988
1982
|
* @returns THREE.Scene
|
|
@@ -1992,6 +1986,19 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
1992
1986
|
* 设置多选模式。
|
|
1993
1987
|
*/
|
|
1994
1988
|
setMultipleSelect(isMultipleSelect: boolean): void;
|
|
1989
|
+
/**
|
|
1990
|
+
* 当前是否是mapbox兼容模式在运行
|
|
1991
|
+
* @example
|
|
1992
|
+
* ```typescript
|
|
1993
|
+
*
|
|
1994
|
+
*
|
|
1995
|
+
* ```
|
|
1996
|
+
*/
|
|
1997
|
+
isMapBox(): boolean;
|
|
1998
|
+
/**
|
|
1999
|
+
* @instance
|
|
2000
|
+
*/
|
|
2001
|
+
renderer: THREE.WebGLRenderer;
|
|
1995
2002
|
/**
|
|
1996
2003
|
* 获取Three.js相机对象
|
|
1997
2004
|
* @returns THREE.Camera
|
|
@@ -2056,14 +2063,14 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2056
2063
|
*/
|
|
2057
2064
|
setViewColor(color: number): void;
|
|
2058
2065
|
/**
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2066
|
+
* 返回视区背景色,
|
|
2067
|
+
* @param color 如0xFFFFFF 白色
|
|
2068
|
+
* @returns void
|
|
2069
|
+
* @example
|
|
2070
|
+
* ```typescript
|
|
2071
|
+
*
|
|
2072
|
+
* ```
|
|
2073
|
+
*/
|
|
2067
2074
|
getViewColor(): number;
|
|
2068
2075
|
/**
|
|
2069
2076
|
* 设置视区背景色,
|
|
@@ -2164,12 +2171,12 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2164
2171
|
*/
|
|
2165
2172
|
zoomW(minPt: THREE.Vector3, maxPt: THREE.Vector3, isWorld?: boolean, animate?: boolean, autoRegen?: boolean): void;
|
|
2166
2173
|
/**
|
|
2167
|
-
|
|
2168
|
-
|
|
2174
|
+
* 保存当前显示范围.
|
|
2175
|
+
*/
|
|
2169
2176
|
saveZoom(): void;
|
|
2170
2177
|
/**
|
|
2171
|
-
|
|
2172
|
-
|
|
2178
|
+
* 恢复当前显示范围.
|
|
2179
|
+
*/
|
|
2173
2180
|
recoverZoom(): void;
|
|
2174
2181
|
/**
|
|
2175
2182
|
* 把当前显示范围移到指定的位置,dCenX,dCenY是DWG图纸坐标。
|
|
@@ -2418,23 +2425,23 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2418
2425
|
*/
|
|
2419
2426
|
getMxCurrentSelect(): Array<number>;
|
|
2420
2427
|
/**
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2428
|
+
* 得到图上当前选择的MxCAD对象.
|
|
2429
|
+
* @returns Array<number> 返回对象的id数组.
|
|
2430
|
+
* @example
|
|
2431
|
+
* ```typescript
|
|
2432
|
+
*
|
|
2433
|
+
*
|
|
2434
|
+
* ```
|
|
2435
|
+
*/
|
|
2429
2436
|
getMxCADCurrentSelect(): Array<number>;
|
|
2430
2437
|
/**
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
+
* 得到图上当前选择对象时,选择范围点.
|
|
2439
|
+
* @example
|
|
2440
|
+
* ```typescript
|
|
2441
|
+
*
|
|
2442
|
+
*
|
|
2443
|
+
* ```
|
|
2444
|
+
*/
|
|
2438
2445
|
getSelectPoints(): {
|
|
2439
2446
|
point1: THREE.Vector3;
|
|
2440
2447
|
point2: THREE.Vector3;
|
|
@@ -2451,24 +2458,24 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2451
2458
|
*/
|
|
2452
2459
|
addMxCurrentSelect(id: number, isFireSelectChange?: boolean, isDisplayGrid?: boolean): boolean;
|
|
2453
2460
|
/**
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2461
|
+
* 把MxCAD对象添加到当前选择中.
|
|
2462
|
+
* @returns void
|
|
2463
|
+
* @example
|
|
2464
|
+
* ```typescript
|
|
2465
|
+
*
|
|
2466
|
+
*
|
|
2467
|
+
* ```
|
|
2468
|
+
*/
|
|
2462
2469
|
addMxCADCurrentSelect(id: number, isFireSelectChange?: boolean, isDisplayGrid?: boolean): boolean;
|
|
2463
2470
|
/**
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2471
|
+
* 触发选择状态改变事件
|
|
2472
|
+
* @returns void
|
|
2473
|
+
* @example
|
|
2474
|
+
* ```typescript
|
|
2475
|
+
*
|
|
2476
|
+
*
|
|
2477
|
+
* ```
|
|
2478
|
+
*/
|
|
2472
2479
|
fireSelectChange(isMxCAD: boolean): void;
|
|
2473
2480
|
/**
|
|
2474
2481
|
* 清除当前所有选择
|
|
@@ -2513,18 +2520,18 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2513
2520
|
*/
|
|
2514
2521
|
getAllMxEntity(): Array<MxDbEntity>;
|
|
2515
2522
|
/**
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2523
|
+
* 设置鼠标中键移动视区。
|
|
2524
|
+
* @param iMethod 设置是否可以鼠标中键移动视区,iMethod= true,iMethod=1
|
|
2525
|
+
* iMethod = 0,中键不移动视区,左键移动
|
|
2526
|
+
* iMethod = 1,中键移动视区,左键不移动
|
|
2527
|
+
* iMethod = 2,中键移动视区,左键移动视区
|
|
2528
|
+
* @returns
|
|
2529
|
+
* @example
|
|
2530
|
+
* ```typescript
|
|
2531
|
+
*
|
|
2532
|
+
*
|
|
2533
|
+
* ```
|
|
2534
|
+
*/
|
|
2528
2535
|
setViewMovementMethod(iMethod: boolean | number): void;
|
|
2529
2536
|
/**
|
|
2530
2537
|
* setMouseMiddlePan函数与setViewMovementMethod一样,为了兼容老程序暂没删除,将来会删除
|
|
@@ -2687,7 +2694,7 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2687
2694
|
*
|
|
2688
2695
|
* ```
|
|
2689
2696
|
*/
|
|
2690
|
-
getOrbitControls():
|
|
2697
|
+
getOrbitControls(): any;
|
|
2691
2698
|
/**
|
|
2692
2699
|
* 禁用或启用视区的移动,放大,缩小等操作.
|
|
2693
2700
|
* @example
|
|
@@ -2705,12 +2712,12 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2705
2712
|
*/
|
|
2706
2713
|
getMxDatabase(): MxDbDatabase;
|
|
2707
2714
|
/**
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2715
|
+
* 得到临时标记绘制对象
|
|
2716
|
+
* @example
|
|
2717
|
+
* ```typescript
|
|
2718
|
+
*
|
|
2719
|
+
* ```
|
|
2720
|
+
*/
|
|
2714
2721
|
getTempMarkDraw(): MxTempMarkDraw;
|
|
2715
2722
|
/**
|
|
2716
2723
|
* 设置鼠标中键的滚动的缩放比例,在PC上,默认值4,手机上默认值,1.5
|
|
@@ -2768,14 +2775,14 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2768
2775
|
docCoord2Cad(x: number, y: number, z: number): THREE.Vector3;
|
|
2769
2776
|
docCoord2Cad2(pt: THREE.Vector3): THREE.Vector3;
|
|
2770
2777
|
/**
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2778
|
+
* 视区坐标到CAD坐标.
|
|
2779
|
+
* @returns number
|
|
2780
|
+
* @example
|
|
2781
|
+
* ```typescript
|
|
2782
|
+
*
|
|
2783
|
+
*
|
|
2784
|
+
* ```
|
|
2785
|
+
*/
|
|
2779
2786
|
viewCoord2Cad(x: number, y: number, z: number): THREE.Vector3;
|
|
2780
2787
|
/**
|
|
2781
2788
|
*CAD坐标到视区坐标.
|
|
@@ -2949,40 +2956,40 @@ declare class MxDrawObject extends Node<MxDrawEvents, Node<any, any>> {
|
|
|
2949
2956
|
*/
|
|
2950
2957
|
clearAllObject(): any;
|
|
2951
2958
|
/**
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
+
* 设置点选支持多选,默认不支持。
|
|
2960
|
+
* @example
|
|
2961
|
+
* ```typescript
|
|
2962
|
+
*
|
|
2963
|
+
*
|
|
2964
|
+
* ```
|
|
2965
|
+
*/
|
|
2959
2966
|
setPointMultipleSelect(isMultipleSelect?: boolean): void;
|
|
2960
2967
|
/**
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
+
* 当前是否为白色白背景色
|
|
2969
|
+
* @example
|
|
2970
|
+
* ```typescript
|
|
2971
|
+
*
|
|
2972
|
+
*
|
|
2973
|
+
* ```
|
|
2974
|
+
*/
|
|
2968
2975
|
isWhiteViewColor(): boolean;
|
|
2969
2976
|
/**
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
+
* 根据当前颜色,自动对color进行反色,比如:背景色是白色,自动取黑色.
|
|
2978
|
+
* @example
|
|
2979
|
+
* ```typescript
|
|
2980
|
+
*
|
|
2981
|
+
*
|
|
2982
|
+
* ```
|
|
2983
|
+
*/
|
|
2977
2984
|
automaticInversionColor(color: number): number;
|
|
2978
2985
|
/**
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
+
* 启动或停止动画渲染
|
|
2987
|
+
* @example
|
|
2988
|
+
* ```typescript
|
|
2989
|
+
*
|
|
2990
|
+
*
|
|
2991
|
+
* ```
|
|
2992
|
+
*/
|
|
2986
2993
|
renderLoop(isLoop?: boolean): void;
|
|
2987
2994
|
}
|
|
2988
2995
|
|