@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,668 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { BCFViewpointsPlugin, LocaleService, Viewer } from "@xtctwins/tctwins-core";
|
|
3
|
+
import EventTrigger from "./EventTrigger";
|
|
4
|
+
import Controller from "./Controller";
|
|
5
|
+
import ResetAction from "./toolbar/ResetAction";
|
|
6
|
+
import FitAction from "./toolbar/FitAction";
|
|
7
|
+
import FirstPersonMode from "./toolbar/FirstPersonMode";
|
|
8
|
+
import HideTool from "./toolbar/HideTool";
|
|
9
|
+
import ShowSpacesMode from "./toolbar/ShowSpacesMode";
|
|
10
|
+
import SectionTool from "./toolbar/SectionTool";
|
|
11
|
+
import NavCubeMode from "./toolbar/NavCubeMode";
|
|
12
|
+
import ModelsExplorer from "./explorer/ModelsExplorer";
|
|
13
|
+
import ObjectsExplorer from "./explorer/ObjectsExplorer";
|
|
14
|
+
import ClassesExplorer from "./explorer/ClassesExplorer";
|
|
15
|
+
import StoreysExplorer from "./explorer/StoreysExplorer";
|
|
16
|
+
import ThreeDMode from "./toolbar/ThreeDMode";
|
|
17
|
+
import OrthoMode from "./toolbar/OrthoMode";
|
|
18
|
+
import ObjectsKdTree3 from "./collision/ObjectsKdTree3";
|
|
19
|
+
import AnnotationTool from "./toolbar/AnnotationTool";
|
|
20
|
+
import MeasureTool from "./toolbar/MeasureTool";
|
|
21
|
+
import CommentsTool from "./toolbar/CommentsTool";
|
|
22
|
+
/**
|
|
23
|
+
* 核心模型视图窗口
|
|
24
|
+
* @type {BIMViewer}
|
|
25
|
+
*/
|
|
26
|
+
export default class BIMViewer extends Controller {
|
|
27
|
+
viewer: Viewer;
|
|
28
|
+
protected _objectsKdTree3: ObjectsKdTree3;
|
|
29
|
+
protected _modelsExplorer: ModelsExplorer;
|
|
30
|
+
protected _objectsExplorer: ObjectsExplorer;
|
|
31
|
+
protected _classesExplorer: ClassesExplorer;
|
|
32
|
+
protected _storeysExplorer: StoreysExplorer;
|
|
33
|
+
protected _resetAction: ResetAction;
|
|
34
|
+
protected _fitAction: FitAction;
|
|
35
|
+
protected _threeDMode: ThreeDMode;
|
|
36
|
+
protected _hideTool: HideTool;
|
|
37
|
+
protected _orthoMode: OrthoMode;
|
|
38
|
+
protected _firstPersonMode: FirstPersonMode;
|
|
39
|
+
protected _annotationTool: AnnotationTool;
|
|
40
|
+
protected _measureTool: MeasureTool;
|
|
41
|
+
protected _sectionTool: SectionTool;
|
|
42
|
+
protected _commentsTool: CommentsTool;
|
|
43
|
+
protected _showSpacesMode: ShowSpacesMode;
|
|
44
|
+
protected _navCubeMode: NavCubeMode;
|
|
45
|
+
protected _bcfViewpointsPlugin: BCFViewpointsPlugin;
|
|
46
|
+
protected _objectColorSource?: string;
|
|
47
|
+
protected _eventTrigger: EventTrigger;
|
|
48
|
+
private navCubeCanvasElement;
|
|
49
|
+
private viewerElement;
|
|
50
|
+
private _modelId;
|
|
51
|
+
private _hasOutlier;
|
|
52
|
+
private _outlierObjectIds;
|
|
53
|
+
protected _configs: any;
|
|
54
|
+
/**
|
|
55
|
+
* Constructs a BIMViewer.
|
|
56
|
+
* @param {Server} server Data access strategy.
|
|
57
|
+
* @param {*} cfg Configuration.
|
|
58
|
+
* @param {Boolean} [cfg.enableEditModels=false] Set ````true```` to show "Add", "Edit" and "Delete" options in the Models tab's context menu.
|
|
59
|
+
* @param {Boolean} [cfg.keyboardEventsElement] Optional reference to HTML element on which key events should be handled. Defaults to the HTML Document.
|
|
60
|
+
*/
|
|
61
|
+
constructor(cfg?: any);
|
|
62
|
+
get eventTrigger(): EventTrigger;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the LocaleService that was configured on this Viewer.
|
|
65
|
+
*
|
|
66
|
+
* @return {LocaleService} The LocaleService.
|
|
67
|
+
*/
|
|
68
|
+
get localeService(): LocaleService;
|
|
69
|
+
/**
|
|
70
|
+
* 初始化单击事件
|
|
71
|
+
*/
|
|
72
|
+
protected _initSingleClickEvent(): void;
|
|
73
|
+
/**
|
|
74
|
+
* 初始化右键事件
|
|
75
|
+
*/
|
|
76
|
+
protected _initRightClickEvent(): void;
|
|
77
|
+
/**
|
|
78
|
+
* 初始化双击事件
|
|
79
|
+
*/
|
|
80
|
+
protected _initDoubleClickEvent(): void;
|
|
81
|
+
protected _customizeViewer(): void;
|
|
82
|
+
protected _initConfigs(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Sets a batch of viewer configurations.
|
|
85
|
+
*
|
|
86
|
+
* Note that this method is not to be confused with {@link BIMViewer#setViewerState}, which batch-updates various states of the viewer's UI and 3D view.
|
|
87
|
+
*
|
|
88
|
+
* See [Viewer Configurations] for the list of available configurations.
|
|
89
|
+
*
|
|
90
|
+
* @param {*} viewerConfigs Map of key-value configuration pairs.
|
|
91
|
+
*/
|
|
92
|
+
setConfigs(viewerConfigs: any): void;
|
|
93
|
+
/**
|
|
94
|
+
* Sets a viewer configuration.
|
|
95
|
+
*
|
|
96
|
+
* See [Viewer Configurations] for the list of available configurations.
|
|
97
|
+
*
|
|
98
|
+
* @param {String} name Configuration name.
|
|
99
|
+
* @param {*} value Configuration value.
|
|
100
|
+
*/
|
|
101
|
+
setConfig(name: string, value: any): void;
|
|
102
|
+
/**
|
|
103
|
+
* Gets the value of a viewer configuration.
|
|
104
|
+
*
|
|
105
|
+
* These are set with {@link BIMViewer#setConfig} and {@link BIMViewer#setConfigs}.
|
|
106
|
+
*
|
|
107
|
+
* @param {String} name Configuration name.
|
|
108
|
+
* @ereturns {*} Configuration value.
|
|
109
|
+
*/
|
|
110
|
+
getConfig(name: string): any;
|
|
111
|
+
getConfigs(): any;
|
|
112
|
+
/**
|
|
113
|
+
* Returns the IDs of the models in the currently loaded project.
|
|
114
|
+
*
|
|
115
|
+
* @returns {String[]} The IDs of the models in the currently loaded project.
|
|
116
|
+
*/
|
|
117
|
+
modelId(): string;
|
|
118
|
+
/**
|
|
119
|
+
* Loads a model into the viewer.
|
|
120
|
+
*
|
|
121
|
+
* Assumes that the project containing the model is currently loaded.
|
|
122
|
+
*
|
|
123
|
+
* @param {String} modelId ID of the model to load. Must be the ID of one of the models in the currently loaded project.
|
|
124
|
+
* @param {Function} done Callback invoked on success.
|
|
125
|
+
* @param {Function} error Callback invoked on failure, into which the error message string is passed.
|
|
126
|
+
*/
|
|
127
|
+
loadModel(modelId: string, done: Function, error: Function): void;
|
|
128
|
+
/**
|
|
129
|
+
* 单独加载元数据
|
|
130
|
+
* @param deflatedMetadata
|
|
131
|
+
*/
|
|
132
|
+
loadMetadata(deflatedMetadata: Buffer, done?: Function): void;
|
|
133
|
+
/**
|
|
134
|
+
* Sets where the colors for model objects will be loaded from.
|
|
135
|
+
*
|
|
136
|
+
* Options are:
|
|
137
|
+
*
|
|
138
|
+
* * "model" - (default) load colors from models, and
|
|
139
|
+
* * "viewer" - load colors from the viewer's inbuilt table of colors for IFC types.
|
|
140
|
+
*
|
|
141
|
+
* This is "model" by default.
|
|
142
|
+
*
|
|
143
|
+
* @param {String} source Where colors will be loaded from - "model" or "viewer".
|
|
144
|
+
*/
|
|
145
|
+
setObjectColorSource(source: string): void;
|
|
146
|
+
/**
|
|
147
|
+
* 获取构件属性
|
|
148
|
+
* @param objectId
|
|
149
|
+
* @returns
|
|
150
|
+
*/
|
|
151
|
+
getObjectProperties(objectId: string): {
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
type: string;
|
|
155
|
+
propertySets: any;
|
|
156
|
+
} | null;
|
|
157
|
+
/**
|
|
158
|
+
* 获取模型信息
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
getModelInfo(): {
|
|
162
|
+
id: string | number;
|
|
163
|
+
createDate: string;
|
|
164
|
+
author: string;
|
|
165
|
+
objectCount: string | number;
|
|
166
|
+
propertySetCount: string | number;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Sets whether or not the given objects are visible.
|
|
170
|
+
*
|
|
171
|
+
* @param {String[]} objectIds IDs of objects.
|
|
172
|
+
* @param {Boolean} visible True to set objects visible, false to set them invisible.
|
|
173
|
+
*/
|
|
174
|
+
setObjectsVisible(objectIds: string[], visible: boolean): void;
|
|
175
|
+
/**
|
|
176
|
+
* Sets whether or not the given objects are selected.
|
|
177
|
+
*
|
|
178
|
+
* @param {String[]} objectIds IDs of objects.
|
|
179
|
+
* @param {Boolean} selected Whether or not to set the objects selected.
|
|
180
|
+
*/
|
|
181
|
+
setObjectsSelected(objectIds: string[], selected: boolean): void;
|
|
182
|
+
/**
|
|
183
|
+
* Sets whether or not the given objects are X-rayed.
|
|
184
|
+
*
|
|
185
|
+
* @param {String[]} objectIds IDs of objects.
|
|
186
|
+
* @param {Boolean} xrayed Whether or not to X-ray the objects.
|
|
187
|
+
*/
|
|
188
|
+
setObjectsXRayed(objectIds: string[], xrayed: boolean): void;
|
|
189
|
+
protected _withObjectsInSubtree(objectIds: string[], callback: Function): void;
|
|
190
|
+
/**
|
|
191
|
+
* Flies the camera to fit the given object in view.
|
|
192
|
+
*
|
|
193
|
+
* @param {String} objectId ID of the object
|
|
194
|
+
* @param {Function} done Callback invoked on completion
|
|
195
|
+
*/
|
|
196
|
+
flyToObject(objectId: string, done: Function): void;
|
|
197
|
+
/**
|
|
198
|
+
* Flies the camera to fit the given objects in view.
|
|
199
|
+
*
|
|
200
|
+
* @param {String[]} objectIds IDs of the objects
|
|
201
|
+
* @param {Function} done Callback invoked on completion
|
|
202
|
+
*/
|
|
203
|
+
viewFitObjects(objectIds: string[], done: Function): void;
|
|
204
|
+
/**
|
|
205
|
+
* 相机立刻聚焦到指定构建id的对象,没有转移视角动画
|
|
206
|
+
* @param {String} objectId
|
|
207
|
+
*/
|
|
208
|
+
jumpToObject(objectId: string): void;
|
|
209
|
+
/**
|
|
210
|
+
* 设置相机位置
|
|
211
|
+
* @param {Number[]} [params.eye] Eye position.
|
|
212
|
+
* @param {Number[]} [params.look] Point of interest.
|
|
213
|
+
* @param {Number[]} [params.up] Direction of "up".
|
|
214
|
+
*/
|
|
215
|
+
setCamera(params: any): void;
|
|
216
|
+
/**
|
|
217
|
+
* 相机移动到指定视角
|
|
218
|
+
* @param {Number[]} [params.eye] 相机位置.
|
|
219
|
+
* @param {Number[]} [params.look] 相机视点
|
|
220
|
+
* @param {Number[]} [params.up] 上方方向
|
|
221
|
+
*/
|
|
222
|
+
flyToNewView(params: any): void;
|
|
223
|
+
/**
|
|
224
|
+
* Fits the given models in view.
|
|
225
|
+
*
|
|
226
|
+
* @param {String[]} modelIds ID of the models.
|
|
227
|
+
* @param {Function} [done] Callback invoked on completion. Will be animated if this is given, otherwise will be instantaneous.
|
|
228
|
+
*/
|
|
229
|
+
viewFitModels(modelIds: string[], done: Function): void;
|
|
230
|
+
/**
|
|
231
|
+
* Switches the viewer between 2D and 3D viewing modes.
|
|
232
|
+
*
|
|
233
|
+
* @param {Boolean} enabled Set true to switch into 3D mode, else false to switch into 2D mode.
|
|
234
|
+
* @param {Function} done Callback to invoke when switch complete. Supplying this callback causes an animated transition. Otherwise, the transition will be instant.
|
|
235
|
+
*/
|
|
236
|
+
set3DEnabled(enabled: boolean, done: Function): void;
|
|
237
|
+
/**
|
|
238
|
+
* Gets whether the viewer is in 3D or 2D viewing mode.
|
|
239
|
+
*
|
|
240
|
+
* @returns {boolean} True when in 3D mode, else false.
|
|
241
|
+
*/
|
|
242
|
+
get3DEnabled(): boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Sets whether IFCSpace types are ever shown.
|
|
245
|
+
*
|
|
246
|
+
* @param {Boolean} shown Set true to allow IFCSpaces to be shown, else false to always keep them hidden.
|
|
247
|
+
*/
|
|
248
|
+
setSpacesShown(shown: boolean): void;
|
|
249
|
+
/**
|
|
250
|
+
* Gets whether the viewer allows IFCSpace types to be shown.
|
|
251
|
+
*
|
|
252
|
+
* @returns {boolean} True to allow IFCSpaces to be shown, else false to always keep them hidden.
|
|
253
|
+
*/
|
|
254
|
+
getSpacesShown(): boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Sets whether the viewer is in orthographic viewing mode.
|
|
257
|
+
*
|
|
258
|
+
* The viewer is either in orthographic mode or perspective mode. The viewer is in perspective mode by default.
|
|
259
|
+
*
|
|
260
|
+
* @param {Boolean} enabled Set true to switch into ortho mode, else false to switch into perspective mode.
|
|
261
|
+
* @param {Function} done Callback to invoke when switch complete. Supplying this callback causes an animated transition. Otherwise, the transition will be instant.
|
|
262
|
+
*/
|
|
263
|
+
setOrthoEnabled(enabled: boolean, done: Function): void;
|
|
264
|
+
/**
|
|
265
|
+
* Gets whether the viewer is in orthographic viewing mode.
|
|
266
|
+
*
|
|
267
|
+
* The viewer is either in orthographic mode or perspective mode. The viewer is in perspective mode by default.
|
|
268
|
+
*
|
|
269
|
+
* @returns {boolean} True when in ortho mode, else false when in perspective mode.
|
|
270
|
+
*/
|
|
271
|
+
getOrthoEnabled(): boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Transitions the viewer into an isolated view of the given building storey.
|
|
274
|
+
*
|
|
275
|
+
* Does nothing and logs an error if no object of the given ID is in the viewer, or if the object is not an ````IfcBuildingStorey````.
|
|
276
|
+
*
|
|
277
|
+
* @param {String} storeyObjectId ID of an ````IfcBuildingStorey```` object.
|
|
278
|
+
* @param {Function} [done] Optional callback to invoke on completion. When provided, the transition will be animated, with the camera flying into position. Otherwise, the transition will be instant, with the camera jumping into position.
|
|
279
|
+
*/
|
|
280
|
+
selectStorey(storeyObjectId: string, done?: Function): void;
|
|
281
|
+
/**
|
|
282
|
+
* Sets whether or not keyboard camera control is enabled.
|
|
283
|
+
*
|
|
284
|
+
* This is useful when we don't want key events over the canvas to clash with other UI elements outside the canvas.
|
|
285
|
+
*
|
|
286
|
+
* Default value is ````true````.
|
|
287
|
+
*
|
|
288
|
+
* @param {Boolean} enabled Set ````true```` to enable keyboard input.
|
|
289
|
+
*/
|
|
290
|
+
setKeyboardEnabled(enabled: boolean): void;
|
|
291
|
+
/**
|
|
292
|
+
* Gets whether keyboard camera control is enabled.
|
|
293
|
+
*
|
|
294
|
+
* This is useful when we don't want key events over the canvas to clash with other UI elements outside the canvas.
|
|
295
|
+
*
|
|
296
|
+
* Default value is ````true````.
|
|
297
|
+
*
|
|
298
|
+
* @returns {Boolean} Returns ````true```` if keyboard input is enabled.
|
|
299
|
+
*/
|
|
300
|
+
getKeyboardEnabled(): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Clears sections.
|
|
303
|
+
*
|
|
304
|
+
* Sections are the slicing planes, that we use to section models in order to see interior structures.
|
|
305
|
+
*/
|
|
306
|
+
clearSections(): void;
|
|
307
|
+
/**
|
|
308
|
+
* Disables all sections.
|
|
309
|
+
*/
|
|
310
|
+
disableSections(): void;
|
|
311
|
+
/**
|
|
312
|
+
* Enables all sections.
|
|
313
|
+
*/
|
|
314
|
+
enableSections(): void;
|
|
315
|
+
/**
|
|
316
|
+
* Inverts the direction of sections.
|
|
317
|
+
*/
|
|
318
|
+
flipSections(): void;
|
|
319
|
+
/**
|
|
320
|
+
* Hides the section edition control, if currently shown.
|
|
321
|
+
*/
|
|
322
|
+
hideSectionEditControl(): void;
|
|
323
|
+
/**
|
|
324
|
+
* spinner显隐设置
|
|
325
|
+
* @param show
|
|
326
|
+
*/
|
|
327
|
+
showSpinner(show?: boolean): void;
|
|
328
|
+
/**
|
|
329
|
+
* Returns the number of sections that currently exist.
|
|
330
|
+
*
|
|
331
|
+
* sections are the sliceing planes, that we use to slice models in order to see interior structures.
|
|
332
|
+
*
|
|
333
|
+
* @returns {Number} The number of sections.
|
|
334
|
+
*/
|
|
335
|
+
getNumSections(): number;
|
|
336
|
+
/**
|
|
337
|
+
* 更新包围盒 - 排除异常构建并更新包围盒
|
|
338
|
+
* @param exceptionIDs - 异常构建ID
|
|
339
|
+
* @param callback - 回调
|
|
340
|
+
*/
|
|
341
|
+
updateAABB(exceptionIDs: string[], callback: Function): void;
|
|
342
|
+
/**
|
|
343
|
+
* 销毁
|
|
344
|
+
*/
|
|
345
|
+
destroy(callback?: Function): void;
|
|
346
|
+
/**
|
|
347
|
+
* 设置对象被选中与否
|
|
348
|
+
* @param entity
|
|
349
|
+
* @param selected
|
|
350
|
+
*/
|
|
351
|
+
setEntitySelected(entity: any, selected?: boolean): void;
|
|
352
|
+
/**
|
|
353
|
+
* 选中其他对象
|
|
354
|
+
* @param entity
|
|
355
|
+
*/
|
|
356
|
+
setOthersSelected(entity: any): void;
|
|
357
|
+
/**
|
|
358
|
+
* 设置全部选中与否
|
|
359
|
+
* @param {Boolean} selected
|
|
360
|
+
*/
|
|
361
|
+
setAllObjectsSelected(selected: boolean): void;
|
|
362
|
+
/**
|
|
363
|
+
* 设置相机适应选中对象
|
|
364
|
+
* @param entity
|
|
365
|
+
*/
|
|
366
|
+
viewFitEntity(entity: any): void;
|
|
367
|
+
/**
|
|
368
|
+
* 相机适应所有选中对象
|
|
369
|
+
*/
|
|
370
|
+
viewFitSelectedObjects(): void;
|
|
371
|
+
/**
|
|
372
|
+
* Flies the camera to fit all objects in view.
|
|
373
|
+
*
|
|
374
|
+
* @param {Function} done Callback invoked on completion
|
|
375
|
+
*/
|
|
376
|
+
viewFitAll(done?: Function): void;
|
|
377
|
+
/**
|
|
378
|
+
* 设置选中对象隐藏与否
|
|
379
|
+
* @param entity
|
|
380
|
+
*/
|
|
381
|
+
setEntityHide(entity: any, visible?: boolean): void;
|
|
382
|
+
/**
|
|
383
|
+
* 隐藏选中对象以外的其他模型对象
|
|
384
|
+
* @param entity
|
|
385
|
+
* @returns
|
|
386
|
+
*/
|
|
387
|
+
setOthersHide(entity: any): void;
|
|
388
|
+
/**
|
|
389
|
+
* 显示所有对象
|
|
390
|
+
* @param {Boolean} visible True to set objects visible, false to set them invisible.
|
|
391
|
+
*/
|
|
392
|
+
setAllObjectsVisible(visible: boolean): void;
|
|
393
|
+
/**
|
|
394
|
+
* 设置选中对象透视与否
|
|
395
|
+
* @param entity
|
|
396
|
+
* @param xrayed
|
|
397
|
+
*/
|
|
398
|
+
setEntityXRayed(entity: any, xrayed?: boolean): void;
|
|
399
|
+
/**
|
|
400
|
+
* 设置其他对象透视
|
|
401
|
+
* @param entity
|
|
402
|
+
* @returns
|
|
403
|
+
*/
|
|
404
|
+
setOthersXRayed(entity: any): void;
|
|
405
|
+
/**
|
|
406
|
+
* 设置所有对象透视与否
|
|
407
|
+
* @param {Boolean} xrayed Whether or not to set all objects X-rayed.
|
|
408
|
+
*/
|
|
409
|
+
setAllObjectsXRayed(xrayed: boolean): void;
|
|
410
|
+
entityVisble(entity: any): any;
|
|
411
|
+
entityXRayed(entity: any): any;
|
|
412
|
+
entityChosed(entity: any): any;
|
|
413
|
+
/**
|
|
414
|
+
* 判断是否有被隐藏的
|
|
415
|
+
* @returns
|
|
416
|
+
*/
|
|
417
|
+
hiddenMoreThanOne(): boolean;
|
|
418
|
+
/**
|
|
419
|
+
* 判断是否有被透视的
|
|
420
|
+
* @returns
|
|
421
|
+
*/
|
|
422
|
+
xRayedMoreThanOne(): boolean;
|
|
423
|
+
/**
|
|
424
|
+
* 判断是否有被选中的
|
|
425
|
+
* @returns
|
|
426
|
+
*/
|
|
427
|
+
SelectedMoreThanOne(): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Sets the viewer's background color.
|
|
430
|
+
*
|
|
431
|
+
* @param {boolean}
|
|
432
|
+
*/
|
|
433
|
+
setBackgroundTransparent(trans?: boolean): void;
|
|
434
|
+
/**
|
|
435
|
+
* Sets the viewer's background color.
|
|
436
|
+
*
|
|
437
|
+
* @param {Number[]} rgbColor Three-element array of RGB values, each in range ````[0..1]````.
|
|
438
|
+
*/
|
|
439
|
+
setBackgroundColor(rgbColor: []): void;
|
|
440
|
+
/**
|
|
441
|
+
* 设置导航盒尺寸
|
|
442
|
+
* @param {number} size 默认是200
|
|
443
|
+
*/
|
|
444
|
+
setNavCubeSize(size: number): void;
|
|
445
|
+
/**
|
|
446
|
+
* 设置导航盒的位置
|
|
447
|
+
* @param {string} direction e.g."left","right","top","bottom"
|
|
448
|
+
* @param {number} pos
|
|
449
|
+
*/
|
|
450
|
+
setNavCubePosition(direction: string, pos: number): void;
|
|
451
|
+
/**
|
|
452
|
+
* 更新canvas
|
|
453
|
+
*/
|
|
454
|
+
updateCanvas(): void;
|
|
455
|
+
/**
|
|
456
|
+
* 设置测量鼠标偏移量
|
|
457
|
+
* @param offsetX
|
|
458
|
+
* @param offsetY
|
|
459
|
+
*/
|
|
460
|
+
setMeasureOffSet(offsetX: number, offsetY: number): void;
|
|
461
|
+
/**
|
|
462
|
+
* 设置批注鼠标偏移量
|
|
463
|
+
* @param offsetX
|
|
464
|
+
* @param offsetY
|
|
465
|
+
*/
|
|
466
|
+
setCommentsOffset(offsetX: number, offsetY: number): void;
|
|
467
|
+
/**
|
|
468
|
+
* 设置鼠标吸附点灵敏度
|
|
469
|
+
* @param radius
|
|
470
|
+
*/
|
|
471
|
+
setSnapRadius(radius: number): void;
|
|
472
|
+
/**
|
|
473
|
+
* 设置是否是触屏模式
|
|
474
|
+
* @param {boolean} isTouch
|
|
475
|
+
*/
|
|
476
|
+
setIsTouch(isTouch: boolean): void;
|
|
477
|
+
/**
|
|
478
|
+
* 调整光照强度 0-100
|
|
479
|
+
* @param num
|
|
480
|
+
*/
|
|
481
|
+
setLightIntensity(num: number): void;
|
|
482
|
+
/**
|
|
483
|
+
* 设置空间构建的颜色模式;默认 1
|
|
484
|
+
* @param {number} colorState
|
|
485
|
+
*/
|
|
486
|
+
setSpaceMaterialColor(colorState: number): void;
|
|
487
|
+
/**
|
|
488
|
+
* set edges Enable
|
|
489
|
+
* @param {boolean} edgesEnabled
|
|
490
|
+
*/
|
|
491
|
+
setEdgesEnabled(edgesEnabled?: boolean): void;
|
|
492
|
+
/**
|
|
493
|
+
* 是否开启环境光
|
|
494
|
+
* @param {boolean} saoEnabled
|
|
495
|
+
*/
|
|
496
|
+
setSAOEnabled(saoEnabled?: boolean): void;
|
|
497
|
+
setDTXEnabled(dtxEnabled?: boolean): void;
|
|
498
|
+
setPBREnabled(pbrEnabled?: boolean): void;
|
|
499
|
+
/**
|
|
500
|
+
* 视图复位 - 恢复默认视图
|
|
501
|
+
*/
|
|
502
|
+
resetView(): void;
|
|
503
|
+
/**
|
|
504
|
+
* 自适应 - 在当前相机视角适应视图填充画面
|
|
505
|
+
*/
|
|
506
|
+
fitView(): void;
|
|
507
|
+
/**
|
|
508
|
+
* 标注开关
|
|
509
|
+
* @param active
|
|
510
|
+
* @param callback
|
|
511
|
+
*/
|
|
512
|
+
SetAnnotationToolActive(active?: boolean, callback?: Function): void;
|
|
513
|
+
/**
|
|
514
|
+
* 批注开关
|
|
515
|
+
* @param active
|
|
516
|
+
* @param callback
|
|
517
|
+
*/
|
|
518
|
+
SetCommentsToolActive(active?: boolean, callback?: Function): void;
|
|
519
|
+
/**
|
|
520
|
+
* 第一人称视角
|
|
521
|
+
* @param active
|
|
522
|
+
* @param callback
|
|
523
|
+
*/
|
|
524
|
+
SetFirstPersonModeActive(active?: boolean, callback?: Function): void;
|
|
525
|
+
/**
|
|
526
|
+
* 角度测量开关
|
|
527
|
+
* @param active
|
|
528
|
+
* @param callback
|
|
529
|
+
*/
|
|
530
|
+
SetMeasureAngleActive(active?: boolean, callback?: Function): void;
|
|
531
|
+
/**
|
|
532
|
+
* 距离测量开关
|
|
533
|
+
* @param active
|
|
534
|
+
* @param callback
|
|
535
|
+
*/
|
|
536
|
+
SetMeasureDistanceActive(active?: boolean, callback?: Function): void;
|
|
537
|
+
/**
|
|
538
|
+
* 剖切工具开关
|
|
539
|
+
* @param active
|
|
540
|
+
* @param callback
|
|
541
|
+
*/
|
|
542
|
+
SetSectionToolActive(active?: boolean, callback?: Function): void;
|
|
543
|
+
/**
|
|
544
|
+
* 隐藏工具开关
|
|
545
|
+
* @param active
|
|
546
|
+
* @param callback
|
|
547
|
+
*/
|
|
548
|
+
SetHideToolActive(active: boolean, callback?: Function): void;
|
|
549
|
+
/**
|
|
550
|
+
* 框选开关
|
|
551
|
+
* @param active
|
|
552
|
+
* @param callback
|
|
553
|
+
*/
|
|
554
|
+
SetMarqueeSelectionActive(active: boolean, callback?: Function): void;
|
|
555
|
+
/**
|
|
556
|
+
* 相机视角开关
|
|
557
|
+
* @param active
|
|
558
|
+
* @param callback
|
|
559
|
+
*/
|
|
560
|
+
SetOrthoModeActive(active: boolean, callback?: Function): void;
|
|
561
|
+
/**
|
|
562
|
+
* 显示空间功能开关
|
|
563
|
+
* @param active
|
|
564
|
+
* @param callback
|
|
565
|
+
*/
|
|
566
|
+
SetShowSpaceModeActive(active?: boolean, callback?: Function): void;
|
|
567
|
+
/**
|
|
568
|
+
* 3d/2d视角开关
|
|
569
|
+
* @param active
|
|
570
|
+
* @param callback
|
|
571
|
+
*/
|
|
572
|
+
SetThreeDModeActive(active: boolean, callback?: Function): void;
|
|
573
|
+
/**
|
|
574
|
+
* 漫游
|
|
575
|
+
*/
|
|
576
|
+
get firstPersonMode(): FirstPersonMode;
|
|
577
|
+
/**
|
|
578
|
+
* 角度测量
|
|
579
|
+
*/
|
|
580
|
+
get measureAngleTool(): import("./toolbar/MeasureTools/MeasureAngleTool").default;
|
|
581
|
+
/**
|
|
582
|
+
* 距离测量
|
|
583
|
+
*/
|
|
584
|
+
get measureDistanceTool(): import("./toolbar/MeasureTools/MeasureDistanceTool").default;
|
|
585
|
+
/**
|
|
586
|
+
* 剖切
|
|
587
|
+
*/
|
|
588
|
+
get sectionTool(): SectionTool;
|
|
589
|
+
/**
|
|
590
|
+
* 批注
|
|
591
|
+
*/
|
|
592
|
+
get commentTool(): CommentsTool;
|
|
593
|
+
/**
|
|
594
|
+
* 标注
|
|
595
|
+
*/
|
|
596
|
+
get annotationTool(): AnnotationTool;
|
|
597
|
+
/**
|
|
598
|
+
* 结构树object(对象)
|
|
599
|
+
*/
|
|
600
|
+
get objectsExplorer(): ObjectsExplorer;
|
|
601
|
+
/**
|
|
602
|
+
* 结构树class(类别)
|
|
603
|
+
*/
|
|
604
|
+
get classesExplorer(): ClassesExplorer;
|
|
605
|
+
/**
|
|
606
|
+
* 结构树storey(楼层)
|
|
607
|
+
*/
|
|
608
|
+
get storeysExplorer(): StoreysExplorer;
|
|
609
|
+
/**
|
|
610
|
+
* 模型加载器
|
|
611
|
+
*/
|
|
612
|
+
get modelsExplorer(): ModelsExplorer;
|
|
613
|
+
/**
|
|
614
|
+
* 相机视角
|
|
615
|
+
*/
|
|
616
|
+
get orthoMode(): OrthoMode;
|
|
617
|
+
get navCubeMode(): NavCubeMode;
|
|
618
|
+
/**
|
|
619
|
+
* 设置相机方向
|
|
620
|
+
* @param {number} dirNum
|
|
621
|
+
*/
|
|
622
|
+
setDirection(dirNum: number): void;
|
|
623
|
+
/**
|
|
624
|
+
* 单击模型对象
|
|
625
|
+
* @param entity
|
|
626
|
+
*/
|
|
627
|
+
singleChoseEntity(entity: any): void;
|
|
628
|
+
/**
|
|
629
|
+
* 单击点击空白
|
|
630
|
+
*/
|
|
631
|
+
singleChosedSpace(): void;
|
|
632
|
+
/**
|
|
633
|
+
* 双击模型对象
|
|
634
|
+
* @param entity
|
|
635
|
+
*/
|
|
636
|
+
doubleChoseEntity(entity: any): void;
|
|
637
|
+
/**
|
|
638
|
+
* 回到正常视图
|
|
639
|
+
*/
|
|
640
|
+
choseSpace(): void;
|
|
641
|
+
/**
|
|
642
|
+
* 按照指定角度旋转相机
|
|
643
|
+
* @param {number} angleInc
|
|
644
|
+
* @returns
|
|
645
|
+
*/
|
|
646
|
+
orbitYawCamera: (angleInc: number) => Promise<void>;
|
|
647
|
+
cameraEnable: (pointerEnabled?: boolean) => void;
|
|
648
|
+
/**
|
|
649
|
+
* 初始预览环周截图
|
|
650
|
+
* @param sizeOrCallback
|
|
651
|
+
* @param done
|
|
652
|
+
* @returns
|
|
653
|
+
*/
|
|
654
|
+
getPreShot(sizeOrCallback?: number, done?: Function): string;
|
|
655
|
+
/**
|
|
656
|
+
* 设置遮挡截图
|
|
657
|
+
* @param callback
|
|
658
|
+
*/
|
|
659
|
+
setShelterCanvas(callback?: Function): void;
|
|
660
|
+
/**
|
|
661
|
+
* 模型截图
|
|
662
|
+
* @param width
|
|
663
|
+
* @param height
|
|
664
|
+
* @param isDownload
|
|
665
|
+
* @returns
|
|
666
|
+
*/
|
|
667
|
+
shot: (width: number, height: number, isDownload: boolean) => string;
|
|
668
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import Controller from './Controller';
|
|
2
|
+
/**
|
|
3
|
+
* 表示一个忙碌模态框
|
|
4
|
+
* @class
|
|
5
|
+
*/
|
|
6
|
+
export default class BusyModal extends Controller {
|
|
7
|
+
protected _modal: HTMLDivElement | null;
|
|
8
|
+
protected _modalVisible: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 实例化一个忙碌模态框
|
|
11
|
+
* @params {any} parent -
|
|
12
|
+
* @params {any} cfg - 配置参数
|
|
13
|
+
*/
|
|
14
|
+
constructor(parent: any, cfg?: any);
|
|
15
|
+
/**
|
|
16
|
+
* 显示模态框
|
|
17
|
+
* @params {string} message - 显示内容
|
|
18
|
+
*/
|
|
19
|
+
show(message: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* 隐藏模态框
|
|
22
|
+
*/
|
|
23
|
+
hide(): void;
|
|
24
|
+
/**
|
|
25
|
+
* 销毁模态框
|
|
26
|
+
*/
|
|
27
|
+
destroy(): void;
|
|
28
|
+
}
|