mx3d 2025.5.6 → 2025.5.21

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/index.d.ts CHANGED
@@ -1,135 +1,147 @@
1
- declare module '*.jpg';
2
- declare module '*.png';
3
- declare module '*.env';
1
+ import * as axios from 'axios';
2
+ import { Scene } from '@babylonjs/core/scene';
3
+ import { Engine } from '@babylonjs/core/Engines/engine';
4
+ import { AdvancedDynamicTexture } from '@babylonjs/gui/2D/advancedDynamicTexture';
5
+ import { GlowLayer } from '@babylonjs/core/Layers/glowLayer';
6
+ import { PositionGizmo } from '@babylonjs/core/Gizmos/positionGizmo';
7
+ import { Vector3 } from '@babylonjs/core/Maths/math.vector';
8
+ import { Mesh } from '@babylonjs/core/Meshes/mesh';
9
+ import { InstancedMesh } from '@babylonjs/core/Meshes/instancedMesh';
10
+ import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
11
+ import { FreeCamera } from '@babylonjs/core/Cameras/freeCamera';
12
+ import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
13
+ import { Texture } from '@babylonjs/core/Materials/Textures/texture';
14
+ import { NodeMaterial } from '@babylonjs/core/Materials/Node/nodeMaterial';
15
+ import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
16
+ import { AssetContainer } from '@babylonjs/core/assetContainer';
17
+ import { CustomMaterial } from '@babylonjs/materials/custom/customMaterial';
18
+ import { PointerInfo } from '@babylonjs/core/Events/pointerEvents';
19
+ import { KeyboardInfo } from '@babylonjs/core/Events/keyboardEvents';
20
+ import { HighlightLayer } from '@babylonjs/core/Layers/highlightLayer';
21
+ import { Color3 } from '@babylonjs/core/Maths/math.color';
22
+ import { TextBlock, MultiLine, Rectangle } from '@babylonjs/gui/2D/controls';
23
+
24
+ declare enum StatusType {
25
+ Opaque = 0,
26
+ Flash = 1,
27
+ Transparent = 2
28
+ }
4
29
 
5
- declare module 'mx3d' {
6
- let accessToken: string;
7
- let pk: string;
8
- let sl: string;
9
- let rl: string;
30
+ declare class Sight {
31
+ alpha: number;
32
+ focus: Vector3;
33
+ radius: number;
34
+ beta: number;
35
+ minimumLimit: number;
36
+ maximumLimit: number;
37
+ minBeta: number;
38
+ maxBeta: number;
39
+ toJosn(_sightJson: any): void;
40
+ toString(): string;
41
+ setLimit(_miniLimit: number, _maxiLimit: number): void;
42
+ setBeta(_minBeta: number, _maxBeta: number): void;
43
+ }
10
44
 
11
- export class AlarmFlashing {
12
- static colors: {
13
- 1: Runtime.Color3;
14
- 2: Runtime.Color3;
15
- 3: Runtime.Color3;
16
- 4: Runtime.Color3;
17
- 5: Runtime.Color3;
18
- 6: Runtime.Color3;
19
- };
20
- static init(): void;
21
- }
45
+ declare enum ObjectType {
46
+ Cabinet = "Cabinet",
47
+ RackModel = "RackModel",
48
+ Corner = "Corner",
49
+ Other = "Other",
50
+ Door = "Door",
51
+ Floor = "Floor",
52
+ LeakWater = "LeakWater",
53
+ UI3D = "UI3D",
54
+ VirtualBox = "VirtualBox",
55
+ Wall = "Wall",
56
+ Window = "Window",
57
+ Conduit = "Conduit",
58
+ Building = "Building",
59
+ Storey = "Storey",
60
+ Campus = "Campus",
61
+ Project = "Project"
62
+ }
22
63
 
23
- export class App {
24
- canvas: HTMLCanvasElement;
25
- engine: Runtime.Engine;
26
- scene: Runtime.Scene;
27
- camera: CameraController;
28
- iEvent: IEvent;
29
- highlightLayer: Runtime.HighlightLayer;
30
- container: Runtime.AdvancedDynamicTexture;
31
- fps: HTMLDivElement;
32
- resources: Resources;
33
- environment: Environment;
34
- project: Project;
35
- toolTips: ToolTips;
36
- gl: Runtime.GlowLayer;
37
- positionGizmo: Runtime.PositionGizmo;
38
- private SM2;
39
- constructor(_config: { container: HTMLElement; sl?: string; rl?: string });
40
- load(_config: { pk?: string; fileUrl?: string; isDefaultLevel?: boolean; isDefaultMutual?: boolean; progress?: Function; complete?: Function; onError?: Function }): Promise<Error>;
41
- isDefaultMutual: boolean;
42
- set defaultMutual(value: boolean);
43
- dispose(): void;
44
- }
64
+ declare class BaseModel {
65
+ extension: string;
66
+ groupId: string;
67
+ heat: number;
68
+ height: number;
69
+ insertTime: string;
70
+ isTiling: boolean;
71
+ length: number;
72
+ modelId: string;
73
+ modelName: string;
74
+ modelType: ObjectType;
75
+ modelTypeName: string;
76
+ width: number;
77
+ }
45
78
 
46
- export class Builder {
47
- static createMatrixCloud(_data: {
48
- anchor: IObject;
49
- value: {
50
- maxX: number;
51
- maxY: number;
52
- data: Array<{
53
- x: number;
54
- y: number;
55
- value: number;
56
- }>;
57
- };
58
- displayValues: boolean;
59
- height: number;
60
- isLevelRender: boolean;
61
- isAlpha: boolean;
62
- isParticle: boolean;
63
- radius: number;
64
- range: {
65
- max: number;
66
- min: number;
67
- };
68
- }): HeatMap;
69
- private static _getMatrixParticleTex;
70
- static createPunctateCloud(_data: {
71
- anchor: IObject;
72
- value: number;
73
- radius: number;
74
- isLevelRender: boolean;
75
- displayValues: boolean;
76
- isAlpha: boolean;
77
- isParticle: boolean;
78
- range: {
79
- max: number;
80
- min: number;
81
- };
82
- }): HeatMap;
83
- static createColumnCloud(_data: {
84
- anchor: IObject;
85
- data: Array<{
86
- index: number;
87
- value: number;
88
- }>;
89
- isLevelRender: boolean;
90
- displayValues: boolean;
91
- isAlpha: boolean;
92
- isParticle: boolean;
93
- radius: number;
94
- range: {
95
- max: number;
96
- min: number;
97
- };
98
- }): HeatMap;
99
- private static _getColumnarParticleTex;
100
- private static createTempVlaue;
101
- static createCapacity(obj: IObject, RATIO: number, _text: string, _fontSize?: string): Capacity;
102
- static createTextMesh(obj: IObject, _text: string, RATIO: number, _fontSize?: string, _color?: string): Runtime.Mesh;
103
- static create2DLine(
104
- _id: string,
105
- _objs: Array<IObject>,
106
- _options?: {
107
- width: number;
108
- color: string;
109
- isDotted: boolean;
110
- },
111
- ): Line;
112
- static create3DLine(
113
- _id: string,
114
- _objs: Array<IObject>,
115
- _options?: {
116
- width: number;
117
- color: string;
118
- },
119
- ): LineFromMesh;
120
- }
79
+ interface IBase {
80
+ app: App;
81
+ id: string;
82
+ name: string;
83
+ parentId: string;
84
+ objectType: string;
85
+ customNumber: string;
86
+ customType: string;
87
+ baseModel: BaseModel | undefined;
88
+ instance: Mesh | InstancedMesh;
89
+ Sight: Sight;
90
+ loadProperties(_m: any): void;
91
+ bind(): any;
92
+ completed(): any;
93
+ setEnabled(isEnabled: boolean): any;
94
+ toJson(): any;
95
+ getInto(_isFocus?: boolean): any;
96
+ goBack(): any;
97
+ }
121
98
 
122
- export class Capacity {
123
- anchor: IObject;
124
- mesh: Runtime.Mesh;
125
- ratio: number;
126
- color: string;
127
- textMesh: Runtime.Mesh;
128
- constructor(_object: IObject, RATIO: number);
129
- dispose(): void;
130
- }
99
+ declare enum EventType {
100
+ leftClick = "leftClick",
101
+ rightClick = "rightClick",
102
+ doubleClick = "doubleClick",
103
+ eover = "eover",
104
+ longPress = "longPress",
105
+ out = "out",
106
+ click = "click"
107
+ }
108
+
109
+ interface IObject extends IBase {
110
+ statusType: StatusType;
111
+ showBoundingBox: boolean;
112
+ optimization(isOptimization: boolean): any;
113
+ setFlash(level: number): any;
114
+ setTransparent(): any;
115
+ setOpaque(): any;
116
+ addEventListener(type: EventType, callback: Function): any;
117
+ removeEventListener(type: EventType): any;
118
+ computeView(): any;
119
+ alwaysActive(): any;
120
+ }
121
+
122
+ declare class CameraController {
123
+ app: App;
124
+ arcRotateCamera: ArcRotateCamera;
125
+ frustrum: number;
126
+ freeCamera: FreeCamera;
127
+ _isAutoRotation: boolean;
128
+ autoRotationSpeed: number;
129
+ constructor(_app: App);
130
+ orthographic(_object?: IBase): void;
131
+ startAutoRotation(_autoRotationSpeed?: number): void;
132
+ stopAutoRotation(): void;
133
+ perspective(_object?: IBase): void;
134
+ flyTo(_Sight?: Sight, _sheep?: number): void;
135
+ flyToObject(_object: IObject, _sheep?: number): void;
136
+ lookToTheFront(_object: IObject, _sheep?: number): void;
137
+ getSightJson(): string;
138
+ private computeCameraView;
139
+ _wheel(p: any): void;
140
+ switchArcRotateCamera(): void;
141
+ switchFPSCamera(): void;
142
+ }
131
143
 
132
- export class Environment {
144
+ declare class Environment {
133
145
  private app;
134
146
  private lights;
135
147
  private _color;
@@ -156,1059 +168,359 @@ declare module 'mx3d' {
156
168
  showFps(cssText?: string): void;
157
169
  hideFps(): void;
158
170
  showDebug(): void;
159
- }
171
+ }
172
+
173
+ declare class Dictionary<T> {
174
+ map: {
175
+ [key: string]: T;
176
+ };
177
+ constructor();
178
+ add(key: string, value: T): void;
179
+ find(key: string): T;
180
+ remove(key: string): void;
181
+ termRemove(callback: Function): void;
182
+ showAll(): void;
183
+ count(): number;
184
+ clear(): void;
185
+ }
160
186
 
161
- export class HeatMap implements BaseNode {
187
+ declare class Project {
188
+ private app;
162
189
  id: string;
163
- anchor: IObject;
164
- mesh: Runtime.Mesh;
165
- displayValue: boolean;
166
- texts: Array<Runtime.TextBlock>;
167
- constructor(_anchor: IObject);
168
- isEnabled(_bool: boolean): void;
169
- set displayValues(_value: boolean);
190
+ current: IBase;
191
+ root: string;
192
+ levelEvent: Function;
193
+ objectDatas: Dictionary<IBase>;
194
+ constructor(_app: App);
195
+ clear(): void;
196
+ optimization(): void;
197
+ getChildsById(_id: string, _includeSub?: boolean): Array<IBase>;
198
+ getSceneTree(_id?: string, _excludeTypes?: Array<string>): any;
199
+ findObjectById(_id: string): IBase;
200
+ findObjectByCustomNumber(_customNumber: string): IBase;
201
+ findObjectsByCustomType(_customType: string, queryParameters?: {
202
+ isCurrent: boolean;
203
+ isEnabled: boolean;
204
+ }): Array<IBase>;
205
+ findObjectsByType(_type: ObjectType): Array<IBase>;
206
+ computeSight(_objs: Array<IBase>): any;
207
+ switchLevel(_id?: string, _isFocus?: boolean): void;
208
+ goBack(): void;
209
+ getObjectTypes(_parentId?: string): Array<ObjectType>;
210
+ getCustomTypes(_parentId?: string): Array<ObjectType>;
211
+ }
212
+
213
+ declare class Resources {
214
+ app: App;
215
+ walls: Dictionary<AbstractMesh>;
216
+ resources: Dictionary<AssetContainer>;
217
+ ndoeMats: Dictionary<NodeMaterial>;
218
+ transparentBox: Mesh;
219
+ BOX: Mesh;
220
+ FogTex: Texture;
221
+ wallTop: StandardMaterial;
222
+ constructor(_app: App);
223
+ loadModelMesh(baseModel: any): Promise<AssetContainer>;
224
+ loadModelMeshAsync(baseModel: any, callback: Function): void;
225
+ Materials: Dictionary<StandardMaterial>;
226
+ Textures: Dictionary<Texture>;
227
+ GetMaterial(textureData: any): StandardMaterial;
228
+ GetTexture(textureData: any): Texture;
229
+ LoadLightMap(id: string, name: string): Texture;
230
+ MergeMaterials: Dictionary<CustomMaterial>;
231
+ GetMergeMaterial(textureData: any): CustomMaterial;
232
+ delete(isAll?: boolean): void;
233
+ GetWalls(url: string, projectId: string): Promise<void>;
234
+ setTransparent(_visibility?: number): void;
235
+ setTransparentById(modelId: string, _visibility?: number): void;
236
+ }
237
+
238
+ declare class ToolTips {
239
+ app: App;
240
+ url: string;
241
+ ele: HTMLDivElement;
242
+ private _text;
243
+ set text(vlaue: string);
244
+ constructor(_app: App);
245
+ update(e: PointerInfo): void;
246
+ close(): void;
247
+ setBackground(_url: string): void;
170
248
  dispose(): void;
171
- }
249
+ }
172
250
 
173
- export class Icon implements BaseNode {
174
- id: string;
175
- scene: Runtime.Scene;
176
- pint: Runtime.Mesh;
177
- private textDics;
178
- private _line;
179
- rect: Runtime.Rectangle;
180
- private _background;
181
- size: {
182
- width: number;
183
- height: number;
251
+ interface IEvent {
252
+ runRender(): void;
253
+ onPointer(e: PointerInfo): void;
254
+ onKeyboard(e: KeyboardInfo): void;
255
+ registerAfterRender(): void;
256
+ }
257
+
258
+ declare class App {
259
+ canvas: HTMLCanvasElement;
260
+ engine: Engine;
261
+ scene: Scene;
262
+ camera: CameraController;
263
+ iEvent: IEvent;
264
+ highlightLayer: HighlightLayer;
265
+ container: AdvancedDynamicTexture;
266
+ fps: HTMLDivElement;
267
+ resources: Resources;
268
+ environment: Environment;
269
+ project: Project;
270
+ toolTips: ToolTips;
271
+ gl: GlowLayer;
272
+ positionGizmo: PositionGizmo;
273
+ private SM2;
274
+ constructor(_config: {
275
+ container: HTMLElement;
276
+ sl?: string;
277
+ rl?: string;
278
+ });
279
+ load(_config: {
280
+ pk?: string;
281
+ fileUrl?: string;
282
+ isDefaultLevel?: boolean;
283
+ isDefaultMutual?: boolean;
284
+ progress?: Function;
285
+ complete?: Function;
286
+ onError?: Function;
287
+ }): Promise<Error>;
288
+ isDefaultMutual: boolean;
289
+ set defaultMutual(value: boolean);
290
+ dispose(): void;
291
+ }
292
+
293
+ declare class AlarmFlashing {
294
+ static colors: {
295
+ 1: Color3;
296
+ 2: Color3;
297
+ 3: Color3;
298
+ 4: Color3;
299
+ 5: Color3;
300
+ 6: Color3;
184
301
  };
185
- height: number;
186
- container: Runtime.AdvancedDynamicTexture;
187
- constructor(_id: string, _scene: Runtime.Scene);
188
- set background(_url: string);
189
- addEventListener(_action: Function): void;
190
- setTexts(
191
- _textArr: [
192
- {
193
- text: string;
194
- fontSize: string;
195
- color: string;
196
- top: number;
197
- left: number;
198
- },
199
- ],
200
- ): void;
201
- line(_line: { width: number; color: string }): void;
302
+ static init(): void;
303
+ }
304
+
305
+ declare class Capacity {
306
+ anchor: IObject;
307
+ mesh: Mesh;
308
+ ratio: number;
309
+ color: string;
310
+ textMesh: Mesh;
311
+ constructor(_object: IObject, RATIO: number);
202
312
  dispose(): void;
203
- isEnabled(_isEnabled: boolean): void;
204
- }
313
+ }
205
314
 
206
- export class IconFromMesh implements BaseNode {
315
+ interface BaseNode {
207
316
  id: string;
208
- scene: Runtime.Scene;
209
- instance: Runtime.Mesh;
210
- url: string;
211
- scaling: number;
212
- textArr: [
213
- {
214
- text: string;
215
- fontSize: string;
216
- top: number;
217
- left: number;
218
- color?: string;
219
- },
220
- ];
221
- constructor(_id: string, _anchor: Runtime.Vector3, _scaling: number, _height: number, _scene: Runtime.Scene);
222
- setBackground(_url: string): Promise<unknown>;
223
- addEventListener(_action: Function): void;
224
- setColor(color: string): void;
225
- setContents(
226
- _textArr: [
227
- {
228
- text: string;
229
- fontSize: string;
230
- top: number;
231
- left: number;
232
- color?: string;
233
- },
234
- ],
235
- ): Promise<unknown>;
236
- dispose(): void;
317
+ dispose(): any;
318
+ isEnabled(bool: boolean): any;
319
+ }
320
+
321
+ declare class HeatMap implements BaseNode {
322
+ id: string;
323
+ anchor: IObject;
324
+ mesh: Mesh;
325
+ displayValue: boolean;
326
+ texts: Array<TextBlock>;
327
+ constructor(_anchor: IObject);
237
328
  isEnabled(_bool: boolean): void;
238
- }
329
+ set displayValues(_value: boolean);
330
+ dispose(): void;
331
+ }
239
332
 
240
- export class Line {
333
+ declare class LineFromMesh {
241
334
  id: string;
242
335
  objs: Array<IObject>;
243
- instance: Runtime.MultiLine;
336
+ instance: Mesh;
244
337
  color: string;
245
338
  width: number;
246
- isDotted: boolean;
247
339
  update(): void;
248
340
  addEventListener(_action: Function): void;
249
341
  isEnabled(_isEnabled: boolean): void;
250
342
  dispose(): void;
251
- }
343
+ }
252
344
 
253
- export class LineFromMesh {
345
+ declare class Line {
254
346
  id: string;
255
347
  objs: Array<IObject>;
256
- instance: Runtime.Mesh;
348
+ instance: MultiLine;
257
349
  color: string;
258
350
  width: number;
351
+ isDotted: boolean;
259
352
  update(): void;
260
353
  addEventListener(_action: Function): void;
261
354
  isEnabled(_isEnabled: boolean): void;
262
355
  dispose(): void;
263
- }
264
-
265
- enum StatusType {
266
- Opaque = 0,
267
- Flash = 1,
268
- Transparent = 2,
269
- }
356
+ }
270
357
 
271
- export class UI {
272
- static createIconFromMesh(_id: string, _anchor: IObject, _scaling: number, _height: number): IconFromMesh;
273
- static createIcon(
274
- _id: string,
275
- _anchor: IObject,
276
- _size: {
277
- width: number;
358
+ declare class Builder {
359
+ static createMatrixCloud(_data: {
360
+ anchor: IObject;
361
+ value: {
362
+ maxX: number;
363
+ maxY: number;
364
+ data: Array<{
365
+ x: number;
366
+ y: number;
367
+ value: number;
368
+ }>;
369
+ };
370
+ displayValues: boolean;
278
371
  height: number;
279
- },
280
- _height: number,
281
- ): Icon;
282
- }
283
-
284
- export class TileLoader {
285
- app: App;
286
- constructor(_app: App);
287
- load(url: string): Promise<void>;
288
- }
289
-
290
- export class CloudEffect implements IEffect {
291
- app: App;
292
- cloudNum: number;
293
- canvas: HTMLCanvasElement;
294
- canvasCloudCtx: CanvasRenderingContext2D;
295
- clouds: Array<Cloud>;
296
- X: number;
297
- Y: number;
298
- constructor(_app: App);
299
- start(): void;
300
- close(): void;
301
- render(): void;
302
- clearCanvasCloud(): void;
303
- }
304
- export class Cloud {
305
- rainSpeed: number;
306
- ctx: CanvasRenderingContext2D;
307
- c: string;
308
- x: number;
309
- y: number;
310
- r: number;
311
- v: {
312
- x: number;
313
- y: number;
314
- };
315
- color: {
316
- r: number;
317
- g: number;
318
- b: number;
319
- a: number;
320
- };
321
- X: number;
322
- constructor(ctx: any, x: any, y: any, _X: any);
323
- init(x: number, y: number): void;
324
- draw(): void;
325
- gradient(): CanvasGradient;
326
- updatePosition(): void;
327
- wrapPosition(): void;
328
- render(): void;
329
- }
330
-
331
- enum EffectType {
332
- Thunder = 'Thunder',
333
- Rain = 'Rain',
334
- Cloud = 'Cloud',
335
- }
336
- export class Effect {
337
- static effects: Dictionary<IEffect>;
338
- static add(_effectType: EffectType, _app: App): void;
339
- static remove(_effectType: EffectType): void;
340
- static removeAll(): void;
341
- }
342
-
343
- interface IEffect {
344
- start: Function;
345
- close: Function;
346
- }
347
-
348
- export class RainEffect implements IEffect {
349
- app: App;
350
- rainNum: number;
351
- canvas: HTMLCanvasElement;
352
- canvasRainCtx: CanvasRenderingContext2D;
353
- rains: Array<Rain>;
354
- X: number;
355
- Y: number;
356
- constructor(_app: App);
357
- start(): void;
358
- close(): void;
359
- render(): void;
360
- clearCanvasRain(): void;
361
- }
362
- export class Rain {
363
- rainSpeed: number;
364
- ctx: CanvasRenderingContext2D;
365
- Y: number;
366
- x: number;
367
- y: number;
368
- r: number;
369
- c: string;
370
- v: {
371
- y: number;
372
- };
373
- constructor(ctx: any, x: any, y: any, r: any, _Y: any);
374
- init(x: number, y: number, r: number): void;
375
- draw(): void;
376
- updatePosition(): void;
377
- wrapPosition(): void;
378
- render(): void;
379
- }
380
-
381
- export class ThunderEffect implements IEffect {
382
- app: App;
383
- thunderNum: number;
384
- canvas: HTMLCanvasElement;
385
- canvasThunderCtx: CanvasRenderingContext2D;
386
- thunders: Array<Thunder>;
387
- X: number;
388
- Y: number;
389
- constructor(_app: App);
390
- start(): void;
391
- close(): void;
392
- render(): void;
393
- clearCanvasThunder(): void;
394
- }
395
- export class Thunder {
396
- ctx: CanvasRenderingContext2D;
397
- x: number;
398
- y: number;
399
- r: number;
400
- l: any;
401
- c: string;
402
- Y: number;
403
- X: number;
404
- constructor(ctx: any, x: any, y: any, r: any, _X: any, _Y: any);
405
- init(x: number, y: number, r: number): void;
406
- draw(): void;
407
- updateParams(): void;
408
- render(): void;
409
- }
410
-
411
- export class DefaultEvent implements IEvent {
412
- app: App;
413
- isMove: number;
414
- waitingTime: number;
415
- touchtime: number;
416
- constructor(_app: App);
417
- registerAfterRender(): void;
418
- runRender(): void;
419
- onPointer(pointerInfo: Runtime.PointerInfo): void;
420
- onKeyboard(kbInfo: Runtime.KeyboardInfo): void;
421
- }
422
-
423
- enum EventType {
424
- leftClick = 'leftClick',
425
- rightClick = 'rightClick',
426
- doubleClick = 'doubleClick',
427
- eover = 'eover',
428
- longPress = 'longPress',
429
- out = 'out',
430
- click = 'click',
431
- }
432
-
433
- export class FPSCameraEvent implements IEvent {
434
- app: App;
435
- isFPS: boolean;
436
- angle: number;
437
- direction: Runtime.Vector3;
438
- isMoveLeft: boolean;
439
- isMoveRight: boolean;
440
- isMoveDown: boolean;
441
- isMoveUp: boolean;
442
- constructor(_app: App);
443
- registerAfterRender(): void;
444
- runRender(): void;
445
- onPointer(pointerInfo: Runtime.PointerInfo): void;
446
- onKeyboard(_e: Runtime.KeyboardInfo): void;
447
- }
448
-
449
- interface IEvent {
450
- runRender(): void;
451
- onPointer(e: Runtime.PointerInfo): void;
452
- onKeyboard(e: Runtime.KeyboardInfo): void;
453
- registerAfterRender(): void;
454
- }
455
-
456
- export class ElectricMap {
457
- private container;
458
- private engine;
459
- private scene;
460
- private camera;
461
- private modelUrl;
462
- private dataUrl;
463
- private maxPotential;
464
- private minPotential;
465
- private colors;
466
- private sphere;
467
- private boxs;
468
- constructor(_container: HTMLCanvasElement, _modelUrl: string, _dataUrl: string);
469
- load(): Promise<void>;
470
- private laodData;
471
- private generateGridCubesFromBoundingBox;
472
- private valueToColor;
473
- }
474
-
475
- export class ElectricMap {
476
- private container;
477
- private engine;
478
- private scene;
479
- private camera;
480
- private modelUrl;
481
- private dataUrl;
482
- private maxPotential;
483
- private minPotential;
484
- private colors;
485
- private sphere;
486
- private outModel;
487
- private outModel1;
488
- constructor(_container: HTMLCanvasElement, _modelUrl: string, _dataUrl: string);
489
- load(): Promise<void>;
490
- setBuffer(index?: number): void;
491
- screenshot(): Promise<void>;
492
- private laodData;
493
- private valueToColor;
494
- }
372
+ isLevelRender: boolean;
373
+ isAlpha: boolean;
374
+ isParticle: boolean;
375
+ radius: number;
376
+ range: {
377
+ max: number;
378
+ min: number;
379
+ };
380
+ }): HeatMap;
381
+ private static _getMatrixParticleTex;
382
+ static createPunctateCloud(_data: {
383
+ anchor: IObject;
384
+ value: number;
385
+ radius: number;
386
+ isLevelRender: boolean;
387
+ displayValues: boolean;
388
+ isAlpha: boolean;
389
+ isParticle: boolean;
390
+ range: {
391
+ max: number;
392
+ min: number;
393
+ };
394
+ }): HeatMap;
395
+ static createColumnCloud(_data: {
396
+ anchor: IObject;
397
+ data: Array<{
398
+ index: number;
399
+ value: number;
400
+ }>;
401
+ isLevelRender: boolean;
402
+ displayValues: boolean;
403
+ isAlpha: boolean;
404
+ isParticle: boolean;
405
+ radius: number;
406
+ range: {
407
+ max: number;
408
+ min: number;
409
+ };
410
+ }): HeatMap;
411
+ private static _getColumnarParticleTex;
412
+ private static createTempVlaue;
413
+ static createCapacity(obj: IObject, RATIO: number, _text: string, _fontSize?: string): Capacity;
414
+ static createTextMesh(obj: IObject, _text: string, RATIO: number, _fontSize?: string, _color?: string): Mesh;
415
+ static create2DLine(_id: string, _objs: Array<IObject>, _options?: {
416
+ width: number;
417
+ color: string;
418
+ isDotted: boolean;
419
+ }): Line;
420
+ static create3DLine(_id: string, _objs: Array<IObject>, _options?: {
421
+ width: number;
422
+ color: string;
423
+ }): LineFromMesh;
424
+ }
495
425
 
496
- export class BABYLONLayer implements CustomLayerInterface {
426
+ declare class Icon implements BaseNode {
497
427
  id: string;
498
- type: 'custom';
499
- renderingMode?: '3d' | '2d';
500
- map: Map;
501
- worldMatrix: Matrix;
502
- camera: Camera;
503
428
  scene: Scene;
504
- engine: Engine;
505
- highlightLayer: HighlightLayer;
506
- iEvent: DefaultEvent;
507
- container: AdvancedDynamicTexture;
508
- toolTips: ToolTips;
509
- environment: Environment;
510
- resources: Resources;
511
- project: Project;
512
- positionGizmo: PositionGizmo;
513
- constructor(_map: Map, _worldMatrix: Matrix);
514
- render(gl: any, matrix: any): void;
515
- onAdd(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): Promise<void>;
516
- }
517
-
518
- export class CoordinateConverter {
519
- private sourceProjection;
520
- private targetProjection;
521
- private originXY;
522
- private translationVector;
523
- private rotationAngle;
524
- constructor(originLonLat: [number, number], originXY: Vector2, rotationAngle: number);
525
- lonLatToXY(lonLat: [number, number]): Vector2;
526
- xyToLonLat(xy: Vector2): [number, number];
527
- }
528
-
529
- export class GeoJsonLayer {
530
- static convert(container: HTMLElement): Promise<void>;
531
- }
532
-
533
- export class GisLayer {
534
- map: maplibregl.Map;
535
- worldOrigin: maplibregl.LngLatLike;
536
- worldAltitude: number;
537
- worldRotate: number[];
538
- MAPTILER_KEY: string;
539
- WEBGLLayer: BABYLONLayer;
540
- constructor(container: HTMLElement);
541
- }
542
-
543
- export class HubService {
544
- static connection: any;
545
- static listener(_Url: string): Promise<void>;
546
- static start(): Promise<void>;
547
- }
548
-
549
- export class Directional extends LightObject {
550
- direction: Runtime.Vector3;
551
- position: Runtime.Vector3;
552
- light: Runtime.DirectionalLight;
553
- load(): void;
554
- }
555
-
556
- export class Hemispheric extends LightObject {
557
- direction: Runtime.Vector3;
558
- light: Runtime.HemisphericLight;
559
- load(): void;
560
- }
561
-
562
- interface ILightObject {
563
- id: string;
564
- sceneId: string;
565
- name: string;
566
- light: Runtime.Light;
567
- color: string;
568
- lightType: string;
569
- intensity: number;
570
- load: Function;
571
- }
572
-
573
- export class LightObject implements ILightObject {
574
- id: string;
575
- sceneId: string;
576
- name: string;
577
- light: Runtime.Light;
578
- color: string;
579
- objectType: string;
580
- lightType: string;
581
- intensity: number;
582
- app: App;
583
- constructor(_app: App);
584
- load(): void;
585
- }
586
-
587
- enum LightType {
588
- Point = 'Point',
589
- Spot = 'Spot',
590
- Directional = 'Directional',
591
- Hemispheric = 'Hemispheric',
592
- }
593
- declare let typeFromat: Function;
594
- typeFromat;
595
-
596
- export class Point extends LightObject {
597
- position: Runtime.Vector3;
598
- light: Runtime.PointLight;
599
- range: number;
600
- load(): void;
601
- }
602
-
603
- export class Spot extends LightObject {
604
- direction: Runtime.Vector3;
605
- position: Runtime.Vector3;
606
- angle: number;
607
- exponent: number;
608
- range: number;
609
- light: Runtime.SpotLight;
610
- load(): void;
611
- }
612
-
613
- export class MJGLLoader {
614
- static load(app: App, _data: any, progress?: Function): Promise<void>;
615
- }
616
-
617
- export class Mx3dLoader {
618
- static load(app: App, _data: any, progress?: Function): Promise<void>;
619
- }
620
-
621
- export class Mx3dV1Loader {
622
- static load(app: App, _data: any, progress?: Function): Promise<void>;
623
- }
624
-
625
- export class BaseModel {
626
- extension: string;
627
- groupId: string;
628
- heat: number;
629
- height: number;
630
- insertTime: string;
631
- isTiling: boolean;
632
- length: number;
633
- modelId: string;
634
- modelName: string;
635
- modelType: ObjectType;
636
- modelTypeName: string;
637
- width: number;
638
- }
639
-
640
- export class BuildingObject extends DefaultObject {
641
- completed(): void;
642
- getInto(_isFocus?: boolean): void;
643
- goBack(): void;
644
- }
645
-
646
- export class CabinetObject extends DefaultObject {
647
- rack: Runtime.Mesh | Runtime.InstancedMesh;
648
- computeView(): void;
649
- setEnabled(_value: boolean): void;
650
- bind(): void;
651
- loadRacks(_data: Array<RackModel>): void;
652
- unloadRacks(): void;
653
- open(): void;
654
- close(): void;
655
- }
656
-
657
- export class CampusObject extends IRegion {
658
- position: Runtime.Vector3;
659
- rotation: Runtime.Vector3;
660
- addEventListener(_type: string, _callback: Function): void;
661
- removeEventListener(_type: string): void;
662
- setEnabled(_isEnabled: boolean): void;
663
- loadProperties(_m: any): void;
664
- bind(): void;
665
- }
666
-
667
- export class ConduitObject extends DefaultObject {
668
- alpha: number;
669
- color: string;
670
- pints: Runtime.Vector3[];
671
- radius: number;
672
- loadProperties(_m: any): void;
673
- setEnabled(_value: boolean): void;
674
- bind(): void;
675
- setColor(_color?: string): void;
676
- reColor(): void;
677
- computeView(): void;
678
- setFlash(_level?: number): void;
679
- setOpaque(): void;
680
- setTransparent(alpha?: number): void;
681
- }
682
-
683
- export class Config {
684
- static project: string;
685
- }
686
-
687
- export class CornerObject implements IObject {
688
- app: App;
689
- id: string;
690
- name: string;
691
- parentId: string;
692
- objectType: string;
693
- height: number;
694
- customNumber: string;
695
- customType: string;
696
- instance: Runtime.Mesh | Runtime.InstancedMesh;
697
- Sight: Sight;
698
- statusType: StatusType;
699
- showBoundingBox: boolean;
700
- pints: any;
701
- constructor(_app: App);
702
- getInto(): void;
703
- goBack(): void;
704
- baseModel: baseModel;
705
- loadProperties(_m: any): void;
706
- alwaysActive(): void;
707
- optimization(_isOptimization: boolean): void;
708
- setFlash(_level: number): void;
709
- setEnabled(isEnabled: any): void;
710
- addEventListener(_type: string, _callback: Function): void;
711
- removeEventListener(_type: string): void;
712
- computeView(): void;
713
- bind(): boolean;
714
- toJson(): {
715
- id: string;
716
- parentId: string;
717
- name: string;
718
- customNumber: string;
719
- customType: string;
720
- objectType: string;
721
- };
722
- completed(): void;
723
- setOpaque(): void;
724
- setTransparent(): void;
725
- }
726
-
727
- export class DefaultObject implements IObject {
728
- app: App;
729
- id: string;
730
- name: string;
731
- customNumber: string;
732
- customType: string;
733
- parentId: string;
734
- baseModel: baseModel;
735
- instance: Runtime.Mesh | Runtime.InstancedMesh;
736
- objectType: string;
737
- action: Runtime.ActionManager;
738
- executes: Dictionary<Runtime.ExecuteCodeAction>;
739
- clickEvents: Dictionary<Function>;
740
- touchtime: number;
741
- statusType: StatusType;
742
- Sight: Sight;
743
- animation: boolean;
744
- isLoop: boolean;
745
- isAutoPlay: boolean;
746
- position: Runtime.Vector3;
747
- rotation: Runtime.Vector3;
748
- scaling: Runtime.Vector3;
749
- constructor(_app: App);
750
- loadProperties(_m: any): void;
751
- setEnabled(_value: boolean): void;
752
- set showBoundingBox(_value: boolean);
753
- get showBoundingBox(): boolean;
754
- set isPickable(_value: boolean);
755
- get isPickable(): boolean;
756
- bind(): void;
757
- completed(): void;
758
- computeView(): void;
759
- optimization(_isOptimization: boolean): void;
760
- alwaysActive(): void;
761
- addEventListener(type: EventType, callback: Function): void;
762
- removeEventListener(type: string): void;
763
- setFlash(_level: number): void;
764
- setOpaque(): void;
765
- setTransparent(alpha?: number, enableEdges?: boolean): void;
766
- setColor(_color?: string): void;
767
- play(): void;
768
- stop(): void;
769
- toJson(): {
770
- id: string;
771
- parentId: string;
772
- name: string;
773
- customNumber: string;
774
- customType: string;
775
- objectType: string;
776
- };
777
- getInto(): void;
778
- goBack(): void;
779
- }
780
-
781
- export class DoorObject extends DefaultObject {
782
- height: number;
783
- loadProperties(_m: any): void;
784
- setEnabled(_value: boolean): void;
785
- bind(): void;
786
- }
787
-
788
- export class EmptyProject implements IBase {
789
- app: App;
790
- id: string;
791
- name: string;
792
- parentId: string;
793
- objectType: string;
794
- customNumber: string;
795
- customType: string;
796
- baseModel: BaseModel;
797
- instance: Mesh | InstancedMesh;
798
- Sight: Sight;
799
- storey: StoreyObject | CampusObject;
800
- loadProperties(_m: any): void;
801
- bind(): void;
802
- completed(): void;
803
- setEnabled(_isEnabled: boolean): void;
804
- toJson(): {
805
- id: string;
806
- parentId: string;
807
- name: string;
808
- objectType: string;
809
- };
810
- getInto(_isFocus?: boolean): void;
811
- goBack(): void;
812
- }
813
-
814
- export class FloorObject extends DefaultObject {
815
- height: number;
816
- vectors: Runtime.Vector3[];
817
- buckles: Runtime.Vector3[][];
818
- loadProperties(_m: any): void;
819
- setEnabled(_value: boolean): void;
820
- bind(): void;
821
- computeView(): void;
822
- setOpaque(): void;
823
- }
824
-
825
- interface IBase {
826
- app: App;
827
- id: string;
828
- name: string;
829
- parentId: string;
830
- objectType: string;
831
- customNumber: string;
832
- customType: string;
833
- baseModel: BaseModel | undefined;
834
- instance: Runtime.Mesh | Runtime.InstancedMesh;
835
- Sight: Sight;
836
- loadProperties(_m: any): void;
837
- bind(): any;
838
- completed(): any;
839
- setEnabled(isEnabled: boolean): any;
840
- toJson(): any;
841
- getInto(_isFocus?: boolean): any;
842
- goBack(): any;
843
- }
844
-
845
- interface IObject extends IBase {
846
- statusType: StatusType;
847
- showBoundingBox: boolean;
848
- optimization(isOptimization: boolean): any;
849
- setFlash(level: number): any;
850
- setTransparent(): any;
851
- setOpaque(): any;
852
- addEventListener(type: EventType, callback: Function): any;
853
- removeEventListener(type: EventType): any;
854
- computeView(): any;
855
- alwaysActive(): any;
856
- }
857
-
858
- export class IRegion implements IBase {
859
- app: App;
860
- id: string;
861
- name: string;
862
- parentId: string;
863
- objectType: string;
864
- baseModel: baseModel;
865
- customNumber: string;
866
- customType: string;
867
- autoSight: boolean;
868
- Sight: Sight;
869
- instance: Runtime.Mesh | Runtime.InstancedMesh;
870
- position: Runtime.Vector3;
871
- rotation: Runtime.Vector3;
872
- index: number;
873
- layerName: string;
874
- layerHeight: number;
875
- action: Runtime.ActionManager;
876
- executes: Dictionary<Runtime.ExecuteCodeAction>;
877
- clickEvents: Dictionary<Function>;
878
- touchtime: number;
879
- constructor(_app: App);
880
- loadProperties(_m: any): void;
881
- bind(): void;
882
- completed(): void;
883
- setEnabled(_isEnabled: boolean): void;
884
- addEventListener(type: string, callback: Function): void;
885
- removeEventListener(type: string): void;
886
- load(isOptimized: boolean, _objs: Array<any>): void;
887
- toJson(): {
888
- id: string;
889
- parentId: string;
890
- name: string;
891
- customNumber: string;
892
- customType: string;
893
- objectType: string;
894
- index: number;
895
- layerHeight: number;
896
- layerName: string;
897
- };
898
- computeView(): void;
899
- getInto(): void;
900
- goBack(): void;
901
- }
902
-
903
- export class LeakWaterObject extends DefaultObject {
904
- lines: Runtime.Vector3[];
905
- loadProperties(_l: any): void;
906
- setEnabled(_value: boolean): void;
907
- bind(): void;
908
- completed(): void;
909
- computeView(): void;
910
- addEventListener(type: string, callback: Function): void;
911
- removeEventListener(type: string): void;
912
- }
913
-
914
- enum ObjectType {
915
- Cabinet = 'Cabinet',
916
- RackModel = 'RackModel',
917
- Corner = 'Corner',
918
- Other = 'Other',
919
- Door = 'Door',
920
- Floor = 'Floor',
921
- LeakWater = 'LeakWater',
922
- UI3D = 'UI3D',
923
- VirtualBox = 'VirtualBox',
924
- Wall = 'Wall',
925
- Window = 'Window',
926
- Conduit = 'Conduit',
927
- Building = 'Building',
928
- Storey = 'Storey',
929
- Campus = 'Campus',
930
- Project = 'Project',
931
- }
932
-
933
- export class OptimizedWallObject extends DefaultObject {
934
- nativeMaterial: Runtime.StandardMaterial;
935
- loadProperties(_w: any): void;
936
- bind(): void;
937
- }
938
-
939
- export class Project {
940
- private app;
941
- id: string;
942
- current: IBase;
943
- root: string;
944
- levelEvent: Function;
945
- objectDatas: Dictionary<IBase>;
946
- constructor(_app: App);
947
- clear(): void;
948
- optimization(): void;
949
- getChildsById(_id: string, _includeSub?: boolean): Array<IBase>;
950
- getSceneTree(_id?: string, _excludeTypes?: Array<string>): any;
951
- findObjectById(_id: string): IBase;
952
- findObjectByCustomNumber(_customNumber: string): IBase;
953
- findObjectsByCustomType(
954
- _customType: string,
955
- queryParameters?: {
956
- isCurrent: boolean;
957
- isEnabled: boolean;
958
- },
959
- ): Array<IBase>;
960
- findObjectsByType(_type: ObjectType): Array<IBase>;
961
- computeSight(_objs: Array<IBase>): any;
962
- switchLevel(_id?: string, _isFocus?: boolean): void;
963
- goBack(): void;
964
- getObjectTypes(_parentId?: string): Array<ObjectType>;
965
- getCustomTypes(_parentId?: string): Array<ObjectType>;
966
- }
967
-
968
- export class RackModel {
969
- id: string;
970
- name: string;
971
- uHeight: number;
972
- uStart: number;
973
- color: string;
974
- frontImgUrl: string;
975
- backImgUrl: string;
976
- direction: boolean;
977
- width: number;
978
- depth: number;
979
- }
980
-
981
- export class RackObject implements IObject {
982
- app: App;
983
- id: string;
984
- name: string;
985
- parentId: string;
986
- objectType: ObjectType;
987
- customNumber: string;
988
- customType: string;
989
- baseModel: BaseModel;
990
- instance: Mesh | InstancedMesh;
991
- Sight: Sight;
992
- statusType: StatusType;
993
- showBoundingBox: boolean;
994
- action: Runtime.ActionManager;
995
- executes: Dictionary<Runtime.ExecuteCodeAction>;
996
- clickEvents: Dictionary<Function>;
997
- touchtime: number;
998
- uHeight: number;
999
- uStart: number;
1000
- color: string;
1001
- frontImgUrl: string;
1002
- backImgUrl: string;
1003
- direction: boolean;
1004
- width: number;
1005
- depth: number;
1006
- constructor(_app: App, _parentId: string);
1007
- setEnabled(isEnabled: boolean): void;
1008
- loadProperties(_m: RackModel): void;
1009
- bind(): void;
1010
- optimization(_isOptimization: boolean): void;
1011
- alwaysActive(): void;
1012
- addEventListener(type: EventType, callback: Function): void;
1013
- removeEventListener(type: string): void;
1014
- setFlash(_level: number): void;
1015
- setOpaque(): void;
1016
- setTransparent(alpha?: number): void;
1017
- setColor(_color?: string): void;
1018
- computeView(): void;
1019
- completed(): void;
1020
- toJson(): {
1021
- id: string;
1022
- parentId: string;
1023
- name: string;
1024
- customNumber: string;
1025
- customType: string;
1026
- objectType: ObjectType;
1027
- };
1028
- getInto(): void;
1029
- goBack(): void;
1030
- }
1031
-
1032
- export class StoreyObject extends IRegion {
1033
- scaling: Runtime.Vector3;
1034
- autoSight: boolean;
1035
- loadProperties(_m: any): void;
1036
- bind(): void;
1037
- alwaysActive(): void;
1038
- completed(): void;
1039
- computeView(): void;
1040
- getInto(_isFocus?: boolean): void;
1041
- }
1042
-
1043
- export class UI3DTextObject extends DefaultObject {
1044
- tconfig: {
1045
- color: string;
1046
- position: any;
1047
- rotation: any;
1048
- scaling: any;
1049
- clearColor: string;
429
+ pint: Mesh;
430
+ private textDics;
431
+ private _line;
432
+ rect: Rectangle;
433
+ private _background;
434
+ size: {
435
+ width: number;
436
+ height: number;
1050
437
  };
1051
- isLookAt: boolean;
1052
- setEnabled(_value: boolean): void;
1053
- loadProperties(_u: any): void;
1054
- bind(): void;
1055
- }
1056
-
1057
- export class VirtualBoxObject extends DefaultObject {
1058
- virtualType: string;
1059
- color: Runtime.Color3;
1060
- alpha: number;
1061
- isEdges: boolean;
1062
- edgesWidth: number;
1063
- edgesColor: Runtime.Color4;
1064
- loadProperties(_m: any): void;
1065
- setEnabled(_value: boolean): void;
1066
- bind(): void;
1067
- }
1068
-
1069
- export class WallObject extends DefaultObject {
1070
- nativeMaterial: Runtime.StandardMaterial;
1071
- height: number;
1072
- walls: Runtime.Mesh[];
1073
- loadProperties(_m: any): void;
1074
- setEnabled(_value: boolean): void;
1075
- bind(): void;
1076
- completed(): void;
1077
- setOpaque(): void;
1078
- }
1079
-
1080
- export class WindowObject extends DefaultObject {
1081
438
  height: number;
1082
- loadProperties(_m: any): void;
1083
- setEnabled(_value: boolean): void;
1084
- bind(): void;
1085
- }
1086
-
1087
- export class ArrayEx<T> extends Array<T> {
1088
- remove(val: any): void;
1089
- }
439
+ container: AdvancedDynamicTexture;
440
+ constructor(_id: string, _scene: Scene);
441
+ set background(_url: string);
442
+ addEventListener(_action: Function): void;
443
+ setTexts(_textArr: [{
444
+ text: string;
445
+ fontSize: string;
446
+ color: string;
447
+ top: number;
448
+ left: number;
449
+ }]): void;
450
+ line(_line: {
451
+ width: number;
452
+ color: string;
453
+ }): void;
454
+ dispose(): void;
455
+ isEnabled(_isEnabled: boolean): void;
456
+ }
1090
457
 
1091
- interface BaseNode {
458
+ declare class IconFromMesh implements BaseNode {
1092
459
  id: string;
1093
- dispose(): any;
1094
- isEnabled(bool: boolean): any;
1095
- }
1096
-
1097
- export class CameraController {
1098
- app: App;
1099
- arcRotateCamera: Runtime.ArcRotateCamera;
1100
- frustrum: number;
1101
- freeCamera: Runtime.FreeCamera;
1102
- _isAutoRotation: boolean;
1103
- autoRotationSpeed: number;
1104
- constructor(_app: App);
1105
- orthographic(_object?: IBase): void;
1106
- startAutoRotation(_autoRotationSpeed?: number): void;
1107
- stopAutoRotation(): void;
1108
- perspective(_object?: IBase): void;
1109
- flyTo(_Sight?: Sight, _sheep?: number): void;
1110
- flyToObject(_object: IObject, _sheep?: number): void;
1111
- lookToTheFront(_object: IObject, _sheep?: number): void;
1112
- getSightJson(): string;
1113
- private computeCameraView;
1114
- _wheel(p: any): void;
1115
- switchArcRotateCamera(): void;
1116
- switchFPSCamera(): void;
1117
- }
1118
-
1119
- export class Dictionary<T> {
1120
- map: {
1121
- [key: string]: T;
1122
- };
1123
- constructor();
1124
- add(key: string, value: T): void;
1125
- find(key: string): T;
1126
- remove(key: string): void;
1127
- termRemove(callback: Function): void;
1128
- showAll(): void;
1129
- count(): number;
1130
- clear(): void;
1131
- }
1132
-
1133
- export class GUID {
1134
- static getGUID(length: number): string;
1135
- }
1136
-
1137
- export class RES {
1138
- static de(str: string): any;
1139
- static en(word: any): string;
1140
- }
460
+ scene: Scene;
461
+ instance: Mesh;
462
+ url: string;
463
+ scaling: number;
464
+ textArr: [{
465
+ text: string;
466
+ fontSize: string;
467
+ top: number;
468
+ left: number;
469
+ color?: string;
470
+ }];
471
+ constructor(_id: string, _anchor: Vector3, _scaling: number, _height: number, _scene: Scene);
472
+ setBackground(_url: string): Promise<unknown>;
473
+ addEventListener(_action: Function): void;
474
+ setColor(color: string): void;
475
+ setContents(_textArr: [{
476
+ text: string;
477
+ fontSize: string;
478
+ top: number;
479
+ left: number;
480
+ color?: string;
481
+ }]): Promise<unknown>;
482
+ dispose(): void;
483
+ isEnabled(_bool: boolean): void;
484
+ }
1141
485
 
1142
- export class Resources {
1143
- app: App;
1144
- walls: Dictionary<Runtime.AbstractMesh>;
1145
- resources: Dictionary<Runtime.AssetContainer>;
1146
- ndoeMats: Dictionary<Runtime.NodeMaterial>;
1147
- transparentBox: Runtime.Mesh;
1148
- BOX: Runtime.Mesh;
1149
- FogTex: Runtime.Texture;
1150
- wallTop: Runtime.StandardMaterial;
1151
- constructor(_app: App);
1152
- loadModelMesh(baseModel: any): Promise<Runtime.AssetContainer>;
1153
- loadModelMeshAsync(baseModel: any, callback: Function): void;
1154
- Materials: Dictionary<Runtime.StandardMaterial>;
1155
- Textures: Dictionary<Runtime.Texture>;
1156
- GetMaterial(textureData: any): Runtime.StandardMaterial;
1157
- GetTexture(textureData: any): Runtime.Texture;
1158
- LoadLightMap(id: string, name: string): Runtime.Texture;
1159
- MergeMaterials: Dictionary<Runtime.CustomMaterial>;
1160
- GetMergeMaterial(textureData: any): Runtime.CustomMaterial;
1161
- delete(isAll?: boolean): void;
1162
- GetWalls(url: string, projectId: string): Promise<void>;
1163
- setTransparent(_visibility?: number): void;
1164
- setTransparentById(modelId: string, _visibility?: number): void;
1165
- }
486
+ declare class UI {
487
+ static createIconFromMesh(_id: string, _anchor: IObject, _scaling: number, _height: number): IconFromMesh;
488
+ static createIcon(_id: string, _anchor: IObject, _size: {
489
+ width: number;
490
+ height: number;
491
+ }, _height: number): Icon;
492
+ }
1166
493
 
1167
- export class Sight {
1168
- alpha: number;
1169
- focus: Runtime.Vector3;
1170
- radius: number;
1171
- beta: number;
1172
- minimumLimit: number;
1173
- maximumLimit: number;
1174
- minBeta: number;
1175
- maxBeta: number;
1176
- toJosn(_sightJson: any): void;
1177
- toString(): string;
1178
- setLimit(_miniLimit: number, _maxiLimit: number): void;
1179
- setBeta(_minBeta: number, _maxBeta: number): void;
1180
- }
494
+ interface IEffect {
495
+ start: Function;
496
+ close: Function;
497
+ }
1181
498
 
1182
- export class ToolTips {
1183
- app: App;
1184
- url: string;
1185
- ele: HTMLDivElement;
1186
- private _text;
1187
- set text(vlaue: string);
1188
- constructor(_app: App);
1189
- update(e: Runtime.PointerInfo): void;
1190
- close(): void;
1191
- setBackground(_url: string): void;
1192
- dispose(): void;
1193
- }
499
+ declare enum EffectType {
500
+ Thunder = "Thunder",
501
+ Rain = "Rain",
502
+ Cloud = "Cloud"
503
+ }
504
+ declare class Effect {
505
+ static effects: Dictionary<IEffect>;
506
+ static add(_effectType: EffectType, _app: App): void;
507
+ static remove(_effectType: EffectType): void;
508
+ static removeAll(): void;
509
+ }
1194
510
 
1195
- export class Tools {
1196
- static vector3ToJson(old: Runtime.Vector3): any;
1197
- static vector3ARRToJson(olds: Runtime.Vector3[]): Runtime.Vector3[];
1198
- static ToVector3(old: any): Runtime.Vector3;
1199
- static ToARRVector3(olds: any[]): Runtime.Vector3[];
1200
- static computeBounds(mscene: Runtime.Mesh | AbstractMesh): Runtime.BoundingInfo;
1201
- static computeBoundsToARR(_meshs: Array<Runtime.Mesh>): Runtime.BoundingInfo;
1202
- static Expand(polygon: Array<Runtime.Vector3>, expand: number): Array<Runtime.Vector3>;
1203
- static norm(x: number, y: number): number;
1204
- static MergeMeshes(meshes: Array<Runtime.Mesh>, app: App): Runtime.Mesh;
1205
- static DeconsTructMesh(mesh: any, height: any, app: App): Array<Runtime.Mesh>;
1206
- static getVisualAngle(_bound: Runtime.BoundingInfo, app: App): any;
1207
- static pathTransformation(oldPath: Array<Runtime.Vector3>, radius: number): any[];
1208
- static createTube(id: string, paths: Array<Runtime.Vector3>, radius: number, app: App): Runtime.Mesh;
1209
- static getAngleFromVector2(startV: Runtime.Vector2, coreV: Runtime.Vector2, endV: Runtime.Vector2): number;
1210
- static getAngleFromVector3(startV: Runtime.Vector3, coreV: Runtime.Vector3, endV: Runtime.Vector3): number;
1211
- static RandomNumBoth(Min: any, Max: any): any;
1212
- static rand(min: number, max: number): number;
1213
- }
511
+ declare class MX3D {
512
+ static set accessToken(token: string);
513
+ static get accessToken(): string;
514
+ static App: typeof App;
515
+ static Request: axios.AxiosInstance;
516
+ static AlarmFlashing: typeof AlarmFlashing;
517
+ static UI: typeof UI;
518
+ static Builder: typeof Builder;
519
+ static ObjectType: typeof ObjectType;
520
+ static EffectType: typeof EffectType;
521
+ static EventType: typeof EventType;
522
+ static StatusType: typeof StatusType;
523
+ static Effect: typeof Effect;
1214
524
  }
525
+
526
+ export { MX3D as default };