mx3d 0.0.47 → 0.0.48

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.
Files changed (4) hide show
  1. package/index.d.ts +166 -158
  2. package/mx3d.js +1 -311
  3. package/mx3d.min.js +4 -4
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  @author gzmaijing
3
3
  @email mj@gzmaijing.com
4
4
  */
5
- declare module MX3D{
6
- export class App {
5
+ declare module MX3D {
6
+ export class App {
7
7
  canvas: HTMLCanvasElement;
8
8
  engine: BABYLON.Engine;
9
9
  scene: BABYLON.Scene;
@@ -16,19 +16,19 @@ export class App {
16
16
  Project: Project;
17
17
  ToolTips: ToolTips;
18
18
  constructor(_config: {
19
- container: HTMLElement;
20
- sl?: string;
21
- rl?: string;
19
+ container: HTMLElement;
20
+ sl?: string;
21
+ rl?: string;
22
22
  });
23
23
  load(_config: {
24
- pk: string;
25
- progress?: Function;
26
- complete?: Function;
24
+ pk: string;
25
+ progress?: Function;
26
+ complete?: Function;
27
27
  }): Promise<void>;
28
28
  dispose(): void;
29
- }
29
+ }
30
30
 
31
- export class Capacity {
31
+ export class Capacity {
32
32
  anchor: IObject;
33
33
  mesh: BABYLON.Mesh;
34
34
  ratio: number;
@@ -36,25 +36,25 @@ export class Capacity {
36
36
  textMesh: BABYLON.Mesh;
37
37
  constructor(_object: IObject, _RATIO: number);
38
38
  dispose(): void;
39
- }
39
+ }
40
40
 
41
- export class CapacityBuilder {
41
+ export class CapacityBuilder {
42
42
  static createCapacity(_obj: IObject, _RATIO: number, _text: string, _fontSize?: string): void;
43
43
  static createTextMesh(_obj: IObject, _text: string, _RATIO: number, _fontSize?: string, _color?: string): void;
44
- }
44
+ }
45
45
 
46
- export class EffectMgr {
46
+ export class EffectMgr {
47
47
  static colors: {};
48
48
  static init(): void;
49
- }
49
+ }
50
50
 
51
- export enum EffectType {
51
+ export enum EffectType {
52
52
  Opaque = 0,
53
53
  Flash = 1,
54
54
  Transparent = 2
55
- }
55
+ }
56
56
 
57
- export class Environment {
57
+ export class Environment {
58
58
  app: App;
59
59
  lights: any;
60
60
  _color: BABYLON.Color4;
@@ -78,18 +78,18 @@ export class Environment {
78
78
  hideFps(): void;
79
79
  showDebug(): void;
80
80
  setLightIntensity(_intensity?: number): void;
81
- }
81
+ }
82
82
 
83
- export enum EventType {
83
+ export enum EventType {
84
84
  leftClick = "leftClick",
85
85
  rightClick = "rightClick",
86
86
  doubleClick = "doubleClick",
87
87
  eover = "eover",
88
88
  longPress = "longPress",
89
89
  out = "out"
90
- }
90
+ }
91
91
 
92
- export class HeatMap implements BaseNode {
92
+ export class HeatMap implements BaseNode {
93
93
  id: string;
94
94
  anchor: IObject;
95
95
  mesh: BABYLON.Mesh;
@@ -99,92 +99,92 @@ export class HeatMap implements BaseNode {
99
99
  isEnabled(_bool: boolean): void;
100
100
  set displayValues(_value: boolean);
101
101
  dispose(): void;
102
- }
102
+ }
103
103
 
104
- export class HeatMapBuilder {
104
+ export class HeatMapBuilder {
105
105
  static createMatrixCloud(_data: {
106
- anchor: IObject;
107
- value: {
108
- maxX: number;
109
- maxY: number;
110
- data: Array<{
111
- x: number;
112
- y: number;
113
- value: number;
114
- }>;
115
- };
116
- displayValues: boolean;
117
- height: number;
118
- isLevelRender: boolean;
119
- isAlpha: boolean;
120
- isParticle: boolean;
121
- radius: number;
122
- range: {
123
- max: number;
124
- min: number;
125
- };
106
+ anchor: IObject;
107
+ value: {
108
+ maxX: number;
109
+ maxY: number;
110
+ data: Array<{
111
+ x: number;
112
+ y: number;
113
+ value: number;
114
+ }>;
115
+ };
116
+ displayValues: boolean;
117
+ height: number;
118
+ isLevelRender: boolean;
119
+ isAlpha: boolean;
120
+ isParticle: boolean;
121
+ radius: number;
122
+ range: {
123
+ max: number;
124
+ min: number;
125
+ };
126
126
  }): void;
127
127
  static createPunctateCloud(_data: {
128
- anchor: IObject;
129
- value: number;
130
- radius: number;
131
- isLevelRender: boolean;
132
- displayValues: boolean;
133
- isAlpha: boolean;
134
- isParticle: boolean;
135
- range: {
136
- max: number;
137
- min: number;
138
- };
128
+ anchor: IObject;
129
+ value: number;
130
+ radius: number;
131
+ isLevelRender: boolean;
132
+ displayValues: boolean;
133
+ isAlpha: boolean;
134
+ isParticle: boolean;
135
+ range: {
136
+ max: number;
137
+ min: number;
138
+ };
139
139
  }): void;
140
140
  createColumnCloud(_data: {
141
- anchor: IObject;
142
- data: Array<{
143
- index: number;
144
- value: number;
145
- }>;
146
- isLevelRender: boolean;
147
- displayValues: boolean;
148
- isAlpha: boolean;
149
- isParticle: boolean;
150
- radius: number;
151
- range: {
152
- max: number;
153
- min: number;
154
- };
141
+ anchor: IObject;
142
+ data: Array<{
143
+ index: number;
144
+ value: number;
145
+ }>;
146
+ isLevelRender: boolean;
147
+ displayValues: boolean;
148
+ isAlpha: boolean;
149
+ isParticle: boolean;
150
+ radius: number;
151
+ range: {
152
+ max: number;
153
+ min: number;
154
+ };
155
155
  }): void;
156
- }
156
+ }
157
157
 
158
- export class Icon implements BaseNode {
158
+ export class Icon implements BaseNode {
159
159
  id: string;
160
160
  scene: BABYLON.Scene;
161
161
  pint: BABYLON.Mesh;
162
162
  rect: BABYLON.GUI.Rectangle;
163
163
  onPointerClick: Function;
164
164
  size: {
165
- width: number;
166
- height: number;
165
+ width: number;
166
+ height: number;
167
167
  };
168
168
  height: number;
169
169
  container: BABYLON.GUI.AdvancedDynamicTexture;
170
170
  constructor(_id: string, _scene: BABYLON.Scene);
171
171
  set background(_url: string);
172
172
  setTexts(_textArr: [{
173
- text: string;
174
- fontSize: string;
175
- color: string;
176
- top: number;
177
- left: number;
173
+ text: string;
174
+ fontSize: string;
175
+ color: string;
176
+ top: number;
177
+ left: number;
178
178
  }]): void;
179
179
  line(_line: {
180
- width: number;
181
- color: string;
180
+ width: number;
181
+ color: string;
182
182
  }): void;
183
183
  dispose(): void;
184
184
  isEnabled(_isEnabled: boolean): void;
185
- }
185
+ }
186
186
 
187
- export class IconFromMesh implements BaseNode {
187
+ export class IconFromMesh implements BaseNode {
188
188
  id: string;
189
189
  scene: BABYLON.Scene;
190
190
  instance: BABYLON.Mesh;
@@ -195,38 +195,44 @@ export class IconFromMesh implements BaseNode {
195
195
  addEventListener(_action: Function): void;
196
196
  setColor(_color: string): void;
197
197
  setContents(_textArr: [{
198
- text: string;
199
- fontSize: string;
200
- top: number;
201
- left: number;
202
- color?: string;
198
+ text: string;
199
+ fontSize: string;
200
+ top: number;
201
+ left: number;
202
+ color?: string;
203
203
  }]): void;
204
204
  dispose(): void;
205
205
  isEnabled(_bool: boolean): void;
206
- }
206
+ }
207
207
 
208
- export class UI {
208
+ export class UI {
209
209
  static createIconFromMesh(_id: string, _anchor: IObject, _url: string, _scaling: number, _height: number): void;
210
210
  static createIcon(_id: string, _anchor: IObject, _size: {
211
- width: number;
212
- height: number;
211
+ width: number;
212
+ height: number;
213
213
  }, _height: number): void;
214
- }
214
+ }
215
+
216
+ export class HubService {
217
+ static connection: any;
218
+ static listener(_Url: string): Promise<void>;
219
+ static start(): Promise<void>;
220
+ }
215
221
 
216
- export class Directional extends LightObject {
222
+ export class Directional extends LightObject {
217
223
  direction: BABYLON.Vector3;
218
224
  position: BABYLON.Vector3;
219
225
  light: BABYLON.DirectionalLight;
220
226
  load(): void;
221
- }
227
+ }
222
228
 
223
- export class Hemispheric extends LightObject {
229
+ export class Hemispheric extends LightObject {
224
230
  direction: BABYLON.Vector3;
225
231
  light: BABYLON.HemisphericLight;
226
232
  load(): void;
227
- }
233
+ }
228
234
 
229
- export interface ILightObject {
235
+ export interface ILightObject {
230
236
  id: string;
231
237
  sceneId: string;
232
238
  name: string;
@@ -235,9 +241,9 @@ export interface ILightObject {
235
241
  lightType: string;
236
242
  intensity: number;
237
243
  load: Function;
238
- }
244
+ }
239
245
 
240
- export class LightObject implements ILightObject {
246
+ export class LightObject implements ILightObject {
241
247
  id: string;
242
248
  sceneId: string;
243
249
  name: string;
@@ -249,22 +255,23 @@ export class LightObject implements ILightObject {
249
255
  app: App;
250
256
  constructor(_app: App);
251
257
  load(): void;
252
- }
258
+ }
253
259
 
254
- export enum LightType {
260
+ export enum LightType {
255
261
  Point = "Point",
256
262
  Spot = "Spot",
257
263
  Directional = "Directional",
258
264
  Hemispheric = "Hemispheric"
259
- }
260
- export class Point extends LightObject {
265
+ }
266
+
267
+ export class Point extends LightObject {
261
268
  position: BABYLON.Vector3;
262
269
  light: BABYLON.PointLight;
263
270
  range: number;
264
271
  load(): void;
265
- }
272
+ }
266
273
 
267
- export class Spot extends LightObject {
274
+ export class Spot extends LightObject {
268
275
  direction: BABYLON.Vector3;
269
276
  position: BABYLON.Vector3;
270
277
  angle: number;
@@ -272,12 +279,12 @@ export class Spot extends LightObject {
272
279
  range: number;
273
280
  light: BABYLON.SpotLight;
274
281
  load(): void;
275
- }
282
+ }
276
283
 
277
- export class CabinetObject extends DefaultObject {
278
- }
284
+ export class CabinetObject extends DefaultObject {
285
+ }
279
286
 
280
- export class ConduitObject extends DefaultObject {
287
+ export class ConduitObject extends DefaultObject {
281
288
  alpha: number;
282
289
  color: string;
283
290
  bind(_m: any): void;
@@ -287,14 +294,14 @@ export class ConduitObject extends DefaultObject {
287
294
  setFlash(_level?: number): void;
288
295
  setOpaque(): void;
289
296
  setTransparent(_alpha?: number): void;
290
- }
297
+ }
291
298
 
292
- export class CornerObject extends DefaultObject {
299
+ export class CornerObject extends DefaultObject {
293
300
  height: number;
294
301
  bind(_m: any): void;
295
- }
302
+ }
296
303
 
297
- export class DefaultObject implements IObject {
304
+ export class DefaultObject implements IObject {
298
305
  app: App;
299
306
  id: string;
300
307
  name: string;
@@ -327,27 +334,27 @@ export class DefaultObject implements IObject {
327
334
  setTransparent(_alpha?: number): void;
328
335
  play(): void;
329
336
  stop(): void;
330
- }
337
+ }
331
338
 
332
- export class DoorObject extends DefaultObject {
339
+ export class DoorObject extends DefaultObject {
333
340
  height: number;
334
341
  bind(_m: any): void;
335
- }
342
+ }
336
343
 
337
- export class FloorObject extends DefaultObject {
344
+ export class FloorObject extends DefaultObject {
338
345
  height: number;
339
346
  bind(_m: any): void;
340
- }
347
+ }
341
348
 
342
- export interface IBase {
349
+ export interface IBase {
343
350
  app: App;
344
351
  id: string;
345
352
  name: string;
346
353
  parentId: string;
347
354
  objectType: string;
348
- }
355
+ }
349
356
 
350
- export interface IObject extends IBase {
357
+ export interface IObject extends IBase {
351
358
  customNumber: string;
352
359
  customType: string;
353
360
  modelId: string;
@@ -366,16 +373,16 @@ export interface IObject extends IBase {
366
373
  play(isloop: boolean): any;
367
374
  stop(): any;
368
375
  computeView(): any;
369
- }
376
+ }
370
377
 
371
- export class LeakWaterObject extends DefaultObject {
378
+ export class LeakWaterObject extends DefaultObject {
372
379
  bind(_l: any): void;
373
380
  computeView(): void;
374
381
  addEventListener(_type: string, _callback: Function): void;
375
382
  removeEventListener(_type: string): void;
376
- }
383
+ }
377
384
 
378
- export enum ObjectType {
385
+ export enum ObjectType {
379
386
  Region = "Region",
380
387
  Cabinet = "Cabinet",
381
388
  Corner = "Corner",
@@ -388,9 +395,9 @@ export enum ObjectType {
388
395
  Wall = "Wall",
389
396
  Window = "Window",
390
397
  Conduit = "Conduit"
391
- }
398
+ }
392
399
 
393
- export class Project {
400
+ export class Project {
394
401
  app: App;
395
402
  id: string;
396
403
  root: IObject;
@@ -409,9 +416,9 @@ export class Project {
409
416
  findObjectByCustomNumber(): void;
410
417
  findObjectsByCustomType(): void;
411
418
  switchLevel(_id?: string, _isFocus?: boolean, _includeSub?: boolean): void;
412
- }
419
+ }
413
420
 
414
- export class RegionObject extends DefaultObject {
421
+ export class RegionObject extends DefaultObject {
415
422
  index: number;
416
423
  height: number;
417
424
  constructor(app: App, _storey: any);
@@ -422,39 +429,39 @@ export class RegionObject extends DefaultObject {
422
429
  setEnabled(_value: boolean): void;
423
430
  getBounding(): void;
424
431
  dispose(): void;
425
- }
432
+ }
426
433
 
427
- export class UI3DTextObject extends DefaultObject {
434
+ export class UI3DTextObject extends DefaultObject {
428
435
  bind(_u: any): void;
429
- }
436
+ }
430
437
 
431
- export class VirtualBoxObject extends DefaultObject {
438
+ export class VirtualBoxObject extends DefaultObject {
432
439
  bind(_m: any): Promise<void>;
433
- }
440
+ }
434
441
 
435
- export class WallObject extends DefaultObject {
442
+ export class WallObject extends DefaultObject {
436
443
  nativeMaterial: BABYLON.StandardMaterial;
437
444
  baseModel: any;
438
445
  height: number;
439
446
  bind(_w: any): void;
440
- }
447
+ }
441
448
 
442
- export class WindowObject extends DefaultObject {
449
+ export class WindowObject extends DefaultObject {
443
450
  height: number;
444
451
  bind(_m: any): void;
445
- }
452
+ }
446
453
 
447
- export class ArrayEx<T> extends Array<T> {
454
+ export class ArrayEx<T> extends Array<T> {
448
455
  remove(_val: any): void;
449
- }
456
+ }
450
457
 
451
- export interface BaseNode {
458
+ export interface BaseNode {
452
459
  id: string;
453
460
  dispose(): any;
454
461
  isEnabled(bool: boolean): any;
455
- }
462
+ }
456
463
 
457
- export class Camera {
464
+ export class Camera {
458
465
  app: App;
459
466
  camera: BABYLON.ArcRotateCamera;
460
467
  frustrum: number;
@@ -467,11 +474,11 @@ export class Camera {
467
474
  lookToTheFront(_object: IObject, _sheep?: number): void;
468
475
  computeCameraView(): void;
469
476
  _wheel(_p: any): void;
470
- }
477
+ }
471
478
 
472
- export class Dictionary<T> {
479
+ export class Dictionary<T> {
473
480
  map: {
474
- [key: string]: T;
481
+ [key: string]: T;
475
482
  };
476
483
  constructor();
477
484
  add(_key: string, _value: T): void;
@@ -481,13 +488,13 @@ export class Dictionary<T> {
481
488
  showAll(): void;
482
489
  count(): void;
483
490
  clear(): void;
484
- }
491
+ }
485
492
 
486
- export class GUID {
493
+ export class GUID {
487
494
  static getGUID(_length: number): void;
488
- }
495
+ }
489
496
 
490
- export class Resources {
497
+ export class Resources {
491
498
  app: App;
492
499
  walls: Dictionary<BABYLON.AbstractMesh>;
493
500
  resources: Dictionary<BABYLON.AssetContainer>;
@@ -506,9 +513,9 @@ export class Resources {
506
513
  GetMergeMaterial(_textureData: any, _scene: BABYLON.Scene): void;
507
514
  delete(_isAll?: boolean): void;
508
515
  GetWalls(_url: string, _projectId: string): Promise<void>;
509
- }
516
+ }
510
517
 
511
- export class Sight {
518
+ export class Sight {
512
519
  alpha: number;
513
520
  focus: BABYLON.Vector3;
514
521
  radius: number;
@@ -521,9 +528,9 @@ export class Sight {
521
528
  toString(): void;
522
529
  setLimit(_miniLimit: number, _maxiLimit: number): void;
523
530
  setBeta(_minBeta: number, _maxBeta: number): void;
524
- }
531
+ }
525
532
 
526
- export class Tools {
533
+ export class Tools {
527
534
  static vector3ToJson(_old: BABYLON.Vector3): any;
528
535
  static vector3ARRToJson(_olds: BABYLON.Vector3[]): void;
529
536
  static ToVector3(_old: any): void;
@@ -540,9 +547,9 @@ export class Tools {
540
547
  static getAngleFromVector2(_startV: BABYLON.Vector2, _coreV: BABYLON.Vector2, _endV: BABYLON.Vector2): void;
541
548
  static getAngleFromVector3(_startV: BABYLON.Vector3, _coreV: BABYLON.Vector3, _endV: BABYLON.Vector3): void;
542
549
  static RandomNumBoth(_Min: any, _Max: any): void;
543
- }
550
+ }
544
551
 
545
- export class ToolTips {
552
+ export class ToolTips {
546
553
  app: App;
547
554
  url: string;
548
555
  ele: HTMLDivElement;
@@ -555,5 +562,6 @@ export class ToolTips {
555
562
  close(): void;
556
563
  setBackground(_url: string): void;
557
564
  dispose(): void;
558
- }
559
- }
565
+ }
566
+
567
+ }