mx3d 2025.5.62 → 2025.5.281

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