@xtctwins/tctwins-bimx-viewer 0.1.0
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/README.md +0 -0
- package/dist/tctwins-bimx-viewer.min.es.js +847 -0
- package/dist/version.js +2 -0
- package/package.json +60 -0
- package/types/index.d.ts +6 -0
- package/types/src/BIMViewer.d.ts +668 -0
- package/types/src/BusyModal.d.ts +28 -0
- package/types/src/Controller.d.ts +142 -0
- package/types/src/EventTrigger.d.ts +23 -0
- package/types/src/IFCElementDescriptions/IFCElementDescriptions.d.ts +780 -0
- package/types/src/IFCObjectDefaults/ModelIFCObjectColors.d.ts +26 -0
- package/types/src/IFCObjectDefaults/ViewerIFCObjectColors.d.ts +161 -0
- package/types/src/TMap.d.ts +27 -0
- package/types/src/collision/ObjectsKdTree3.d.ts +37 -0
- package/types/src/contextMenus/CanvasContextMenu.d.ts +12 -0
- package/types/src/contextMenus/ModelsContextMenu.d.ts +13 -0
- package/types/src/contextMenus/ObjectContextMenu.d.ts +20 -0
- package/types/src/contextMenus/TreeViewContextMenu.d.ts +20 -0
- package/types/src/explorer/ClassesExplorer.d.ts +75 -0
- package/types/src/explorer/ModelsExplorer.d.ts +106 -0
- package/types/src/explorer/ObjectsExplorer.d.ts +44 -0
- package/types/src/explorer/StoreysExplorer.d.ts +58 -0
- package/types/src/inspector/PropertiesInspector.d.ts +39 -0
- package/types/src/messages.d.ts +373 -0
- package/types/src/server/OSSHelper.d.ts +4 -0
- package/types/src/server/Server.d.ts +129 -0
- package/types/src/toolbar/AnnotationTool.d.ts +71 -0
- package/types/src/toolbar/CommentsTool.d.ts +248 -0
- package/types/src/toolbar/FirstPersonMode.d.ts +55 -0
- package/types/src/toolbar/FitAction.d.ts +21 -0
- package/types/src/toolbar/HideTool.d.ts +13 -0
- package/types/src/toolbar/MarqueeSelectionTool.d.ts +28 -0
- package/types/src/toolbar/MeasureTool.d.ts +12 -0
- package/types/src/toolbar/MeasureTools/MeasureAngleTool.d.ts +115 -0
- package/types/src/toolbar/MeasureTools/MeasureDistanceTool.d.ts +123 -0
- package/types/src/toolbar/NavCubeMode.d.ts +21 -0
- package/types/src/toolbar/OrthoMode.d.ts +21 -0
- package/types/src/toolbar/QueryTool.d.ts +13 -0
- package/types/src/toolbar/ResetAction.d.ts +16 -0
- package/types/src/toolbar/SectionTool.d.ts +131 -0
- package/types/src/toolbar/SelectionTool.d.ts +14 -0
- package/types/src/toolbar/SettingTool.d.ts +13 -0
- package/types/src/toolbar/ShowSpacesMode.d.ts +22 -0
- package/types/src/toolbar/ThreeDMode.d.ts +20 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import BIMViewer from "./BIMViewer";
|
|
2
|
+
import Server from "./server/Server";
|
|
3
|
+
/**
|
|
4
|
+
* 事件机制基类。
|
|
5
|
+
* @class
|
|
6
|
+
*/
|
|
7
|
+
export default class Controller {
|
|
8
|
+
bimViewer: BIMViewer;
|
|
9
|
+
server: Server;
|
|
10
|
+
viewer: any;
|
|
11
|
+
protected _children: any;
|
|
12
|
+
protected _subIdMap: any;
|
|
13
|
+
protected _subIdEvents: any;
|
|
14
|
+
protected _eventSubs: any;
|
|
15
|
+
protected _events: any;
|
|
16
|
+
protected _eventCallDepth: number;
|
|
17
|
+
protected _enabled: any;
|
|
18
|
+
protected _active: any;
|
|
19
|
+
destroyed: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 创建一个Controller。
|
|
22
|
+
* @param {any} parent -
|
|
23
|
+
* @param {any} cfg -
|
|
24
|
+
* @param {Server} server -
|
|
25
|
+
* @param {any} viewer -
|
|
26
|
+
*/
|
|
27
|
+
constructor(parent: any, cfg?: any, server?: any, viewer?: any);
|
|
28
|
+
/**
|
|
29
|
+
* Fires an event on this Controller.
|
|
30
|
+
* @param {string} event - 事件类型名称。
|
|
31
|
+
* @param {object} value - 事件参数。
|
|
32
|
+
* @param {boolean} [forget=false] - When true, does not retain for subsequent subscribers.
|
|
33
|
+
*/
|
|
34
|
+
protected fire(event: string, value: any, forget?: boolean): void;
|
|
35
|
+
/**
|
|
36
|
+
* Subscribes to an event on this Controller.
|
|
37
|
+
*
|
|
38
|
+
* The callback is be called with this component as scope.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} event The event
|
|
41
|
+
* @param {Function} callback Called fired on the event
|
|
42
|
+
* @param {object} [scope=this] Scope for the callback
|
|
43
|
+
* @return {string} Handle to the subscription,
|
|
44
|
+
* which may be used to unsubscribe with {@link #off}.
|
|
45
|
+
*/
|
|
46
|
+
on(event: string, callback: Function, scope?: object): string;
|
|
47
|
+
/**
|
|
48
|
+
* Cancels an event subscription that was previously made with
|
|
49
|
+
* {@link Controller#on} or {@link Controller#once}.
|
|
50
|
+
*
|
|
51
|
+
* @param {string} subId Subscription ID
|
|
52
|
+
*/
|
|
53
|
+
off(subId: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Subscribes to the next occurrence of the given event,
|
|
56
|
+
* then un-subscribes as soon as the event is handled.
|
|
57
|
+
*
|
|
58
|
+
* This is equivalent to calling {@link Controller#on}, and then
|
|
59
|
+
* calling {@link Controller#off} inside the callback function.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} event Data event to listen to
|
|
62
|
+
* @param {Function} callback Called when fresh data is available at the event
|
|
63
|
+
* @param {object} [scope=this] Scope for the callback
|
|
64
|
+
*/
|
|
65
|
+
once(event: string, callback: Function, scope?: object): void;
|
|
66
|
+
/**
|
|
67
|
+
* Logs a console debugging message for this Controller.
|
|
68
|
+
*
|
|
69
|
+
* The console message will have this format:
|
|
70
|
+
* *````[LOG] [<component type> <component id>: <message>````*
|
|
71
|
+
*
|
|
72
|
+
* @protected
|
|
73
|
+
*
|
|
74
|
+
* @param {string} message The message to log
|
|
75
|
+
*/
|
|
76
|
+
log(message: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Logs a warning for this Controller to the JavaScript console.
|
|
79
|
+
*
|
|
80
|
+
* The console message will have this format:
|
|
81
|
+
* *````[WARN] [<component type> =<component id>: <message>````*
|
|
82
|
+
*
|
|
83
|
+
* @protected
|
|
84
|
+
*
|
|
85
|
+
* @param {string} message The message to log
|
|
86
|
+
*/
|
|
87
|
+
warn(message: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Logs an error for this Controller to the JavaScript console.
|
|
90
|
+
*
|
|
91
|
+
* The console message will have this format:
|
|
92
|
+
* *````[ERROR] [<component type> =<component id>: <message>````*
|
|
93
|
+
*
|
|
94
|
+
* @protected
|
|
95
|
+
*
|
|
96
|
+
* @param {string} message The message to log
|
|
97
|
+
*/
|
|
98
|
+
error(message: string): void;
|
|
99
|
+
protected _mutexActivation(controllers: Array<Controller>): void;
|
|
100
|
+
/**
|
|
101
|
+
* Enables or disables this Controller.
|
|
102
|
+
*
|
|
103
|
+
* Fires an "enabled" event on update.
|
|
104
|
+
*
|
|
105
|
+
* @protected
|
|
106
|
+
* @param {boolean} enabled Whether or not to enable.
|
|
107
|
+
*/
|
|
108
|
+
setEnabled(enabled: boolean): void;
|
|
109
|
+
/**
|
|
110
|
+
* Gets whether or not this Controller is enabled.
|
|
111
|
+
*
|
|
112
|
+
* @protected
|
|
113
|
+
*
|
|
114
|
+
* @returns {boolean}
|
|
115
|
+
*/
|
|
116
|
+
getEnabled(): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Activates or deactivates this Controller.
|
|
119
|
+
*
|
|
120
|
+
* Fires an "active" event on update.
|
|
121
|
+
*
|
|
122
|
+
* @protected
|
|
123
|
+
*
|
|
124
|
+
* @param {boolean} active Whether or not to activate.
|
|
125
|
+
*/
|
|
126
|
+
setActive(active: boolean): void;
|
|
127
|
+
/**
|
|
128
|
+
* Gets whether or not this Controller is active.
|
|
129
|
+
*
|
|
130
|
+
* @protected
|
|
131
|
+
*
|
|
132
|
+
* @returns {boolean}
|
|
133
|
+
*/
|
|
134
|
+
getActive(): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Destroys this Controller.
|
|
137
|
+
*
|
|
138
|
+
* @protected
|
|
139
|
+
*
|
|
140
|
+
*/
|
|
141
|
+
destroy(): void;
|
|
142
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 与外界通信的触发事件管理类
|
|
3
|
+
*/
|
|
4
|
+
export default class EventTrigger {
|
|
5
|
+
events: any;
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* 订阅事件
|
|
9
|
+
* @param event
|
|
10
|
+
* @param listener
|
|
11
|
+
*/
|
|
12
|
+
on(event: any, listener: any): void;
|
|
13
|
+
/**
|
|
14
|
+
* 触发事件
|
|
15
|
+
* @param event
|
|
16
|
+
* @param args
|
|
17
|
+
*/
|
|
18
|
+
emit(event: any, ...args: any[]): void;
|
|
19
|
+
/**
|
|
20
|
+
* 清除所有事件订阅
|
|
21
|
+
*/
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|