mx3d 0.2.1 → 0.2.2

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
@@ -10,7 +10,6 @@ import { EffectType } from "./components/EffectType";
10
10
  import { EventType } from "./components/EventType";
11
11
  import UI from "./components/UI";
12
12
  import Builder from "./components/Builder";
13
- import HubService from "./HubService";
14
13
  import Earth from "./mapboxgl/Earth";
15
14
  export default class MX3D {
16
15
  static accessToken: string;
@@ -21,7 +20,6 @@ export default class MX3D {
21
20
  static Earth: typeof Earth;
22
21
  static Tools: typeof Tools;
23
22
  static EffectMgr: typeof EffectMgr;
24
- static HubService: typeof HubService;
25
23
  static UI: typeof UI;
26
24
  static Builder: typeof Builder;
27
25
  static EffectType: typeof EffectType;
@@ -0,0 +1,3 @@
1
+ import DefaultObject from "./DefaultObject";
2
+ export default class BuildingObject extends DefaultObject {
3
+ }
@@ -0,0 +1,9 @@
1
+ import IRegion from "./IRegion";
2
+ export default class CampusObject extends IRegion {
3
+ addEventListener(_type: string, _callback: Function): void;
4
+ removeEventListener(_type: string): void;
5
+ showBoundingBox: boolean;
6
+ setEnabled(_isEnabled: boolean): void;
7
+ loadProperties(_m: any): void;
8
+ bind(): void;
9
+ }
@@ -2,7 +2,10 @@ import DefaultObject from "./DefaultObject";
2
2
  export default class ConduitObject extends DefaultObject {
3
3
  alpha: number;
4
4
  color: string;
5
- bind(_m: any): void;
5
+ pints: BABYLON.Vector3[];
6
+ radius: number;
7
+ loadProperties(_m: any): void;
8
+ bind(): void;
6
9
  setColor(r: number, b: number, g: number): void;
7
10
  reColor(): void;
8
11
  computeView(): void;
@@ -1,5 +1,41 @@
1
- import DefaultObject from "./DefaultObject";
2
- export default class CornerObject extends DefaultObject {
1
+ import IObject from "./IObject";
2
+ import App from "src/App";
3
+ import { EffectType } from "src/components/EffectType";
4
+ import Sight from "src/tools/Sight";
5
+ import baseModel from "./baseModel";
6
+ export default class CornerObject implements IObject {
7
+ app: App;
8
+ id: string;
9
+ name: string;
10
+ parentId: string;
11
+ objectType: string;
3
12
  height: number;
4
- bind(_m: any): boolean;
13
+ customNumber: string;
14
+ customType: string;
15
+ instance: BABYLON.Mesh | BABYLON.InstancedMesh;
16
+ Sight: Sight;
17
+ effectType: EffectType;
18
+ showBoundingBox: boolean;
19
+ pints: any;
20
+ constructor(_app: App);
21
+ baseModel: baseModel;
22
+ loadProperties(_m: any): void;
23
+ alwaysActive(): void;
24
+ optimization(_isOptimization: boolean): void;
25
+ setFlash(_level: number): void;
26
+ setTransparent(): void;
27
+ setOpaque(): void;
28
+ setEnabled(isEnabled: any): void;
29
+ addEventListener(_type: string, _callback: Function): void;
30
+ removeEventListener(_type: string): void;
31
+ computeView(): void;
32
+ bind(): boolean;
33
+ toJson(): {
34
+ id: string;
35
+ parentId: string;
36
+ name: string;
37
+ customNumber: string;
38
+ customType: string;
39
+ objectType: string;
40
+ };
5
41
  }
@@ -3,6 +3,7 @@ import Dictionary from "../tools/Dictionary";
3
3
  import { EffectType } from "../components/EffectType";
4
4
  import IObject from "./IObject";
5
5
  import Sight from "../tools/Sight";
6
+ import baseModel from "./baseModel";
6
7
  export default class DefaultObject implements IObject {
7
8
  app: App;
8
9
  id: string;
@@ -10,7 +11,7 @@ export default class DefaultObject implements IObject {
10
11
  customNumber: string;
11
12
  customType: string;
12
13
  parentId: string;
13
- modelId: string;
14
+ baseModel: baseModel;
14
15
  instance: BABYLON.Mesh | BABYLON.InstancedMesh;
15
16
  objectType: string;
16
17
  action: BABYLON.ActionManager;
@@ -20,13 +21,17 @@ export default class DefaultObject implements IObject {
20
21
  effectType: EffectType;
21
22
  Sight: Sight;
22
23
  animation: boolean;
23
- isloop: boolean;
24
+ isLoop: boolean;
24
25
  isAutoPlay: boolean;
26
+ position: BABYLON.Vector3;
27
+ rotation: BABYLON.Vector3;
28
+ scaling: BABYLON.Vector3;
25
29
  constructor(_app: App);
30
+ loadProperties(_m: any): void;
26
31
  setEnabled(_value: boolean): void;
27
32
  set showBoundingBox(_value: boolean);
28
33
  get showBoundingBox(): boolean;
29
- bind(_m: any): void;
34
+ bind(): void;
30
35
  computeView(): void;
31
36
  optimization(_isOptimization: boolean): void;
32
37
  alwaysActive(): void;
@@ -37,4 +42,12 @@ export default class DefaultObject implements IObject {
37
42
  setTransparent(alpha?: number): void;
38
43
  play(): void;
39
44
  stop(): void;
45
+ toJson(): {
46
+ id: string;
47
+ parentId: string;
48
+ name: string;
49
+ customNumber: string;
50
+ customType: string;
51
+ objectType: string;
52
+ };
40
53
  }
@@ -1,5 +1,6 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class DoorObject extends DefaultObject {
3
3
  height: number;
4
- bind(_m: any): void;
4
+ loadProperties(_m: any): void;
5
+ bind(): void;
5
6
  }
@@ -1,5 +1,8 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class FloorObject extends DefaultObject {
3
3
  height: number;
4
- bind(_m: any): void;
4
+ vectors: BABYLON.Vector3[];
5
+ buckles: BABYLON.Vector3[][];
6
+ loadProperties(_m: any): void;
7
+ bind(): void;
5
8
  }
package/models/IBase.d.ts CHANGED
@@ -1,8 +1,19 @@
1
+ import Sight from "../tools/Sight";
1
2
  import App from "../App";
3
+ import BaseModel from "./baseModel";
2
4
  export default interface IBase {
3
5
  app: App;
4
6
  id: string;
5
7
  name: string;
6
8
  parentId: string;
7
9
  objectType: string;
10
+ customNumber: string;
11
+ customType: string;
12
+ baseModel: BaseModel;
13
+ instance: BABYLON.Mesh | BABYLON.InstancedMesh;
14
+ Sight: Sight;
15
+ loadProperties(_m: any): void;
16
+ bind(): any;
17
+ setEnabled(isEnabled: boolean): any;
18
+ toJson(): any;
8
19
  }
@@ -1,23 +1,14 @@
1
1
  import { EffectType } from "../components/EffectType";
2
2
  import IBase from "./IBase";
3
- import Sight from "../tools/Sight";
4
3
  export default interface IObject extends IBase {
5
- customNumber: string;
6
- customType: string;
7
- modelId: string;
8
- instance: BABYLON.Mesh | BABYLON.InstancedMesh;
9
- Sight: Sight;
10
4
  effectType: EffectType;
11
- bind(_m?: any): any;
12
- optimization(isOptimization: boolean): any;
13
5
  showBoundingBox: boolean;
6
+ optimization(isOptimization: boolean): any;
14
7
  setFlash(level: number): any;
15
8
  setTransparent(): any;
16
9
  setOpaque(): any;
17
- setEnabled(isEnabled: any): any;
18
10
  addEventListener(type: string, callback: Function): any;
19
11
  removeEventListener(type: string): any;
20
- play(isloop: boolean): any;
21
- stop(): any;
22
12
  computeView(): any;
13
+ alwaysActive(): any;
23
14
  }
@@ -0,0 +1,44 @@
1
+ import App from "../App";
2
+ import Dictionary from "../tools/Dictionary";
3
+ import baseModel from "./baseModel";
4
+ import IBase from "./IBase";
5
+ import Sight from "../tools/Sight";
6
+ export default class IRegion implements IBase {
7
+ app: App;
8
+ id: string;
9
+ name: string;
10
+ parentId: string;
11
+ objectType: string;
12
+ baseModel: baseModel;
13
+ customNumber: string;
14
+ customType: string;
15
+ Sight: Sight;
16
+ instance: BABYLON.Mesh | BABYLON.InstancedMesh;
17
+ position: BABYLON.Vector3;
18
+ rotation: BABYLON.Vector3;
19
+ index: number;
20
+ layerName: string;
21
+ layerHeight: number;
22
+ action: BABYLON.ActionManager;
23
+ executes: Dictionary<BABYLON.ExecuteCodeAction>;
24
+ clickEvents: Dictionary<Function>;
25
+ touchtime: number;
26
+ constructor(_app: App);
27
+ loadProperties(_m: any): void;
28
+ bind(): void;
29
+ setEnabled(_isEnabled: boolean): void;
30
+ addEventListener(type: string, callback: Function): void;
31
+ removeEventListener(type: string): void;
32
+ load(isOptimized: boolean, _objs: Array<any>): void;
33
+ toJson(): {
34
+ id: string;
35
+ parentId: string;
36
+ name: string;
37
+ customNumber: string;
38
+ customType: string;
39
+ objectType: string;
40
+ index: number;
41
+ layerHeight: number;
42
+ layerName: string;
43
+ };
44
+ }
@@ -1,6 +1,8 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class LeakWaterObject extends DefaultObject {
3
- bind(_l: any): void;
3
+ lines: BABYLON.Vector3[];
4
+ loadProperties(_l: any): void;
5
+ bind(): void;
4
6
  computeView(): void;
5
7
  addEventListener(type: string, callback: Function): void;
6
8
  removeEventListener(type: string): void;
@@ -1,5 +1,4 @@
1
1
  export declare enum ObjectType {
2
- Region = "Region",
3
2
  Cabinet = "Cabinet",
4
3
  Corner = "Corner",
5
4
  Other = "Other",
@@ -10,5 +9,8 @@ export declare enum ObjectType {
10
9
  VirtualBox = "VirtualBox",
11
10
  Wall = "Wall",
12
11
  Window = "Window",
13
- Conduit = "Conduit"
12
+ Conduit = "Conduit",
13
+ Building = "Building",
14
+ Storey = "Storey",
15
+ Campus = "Campus"
14
16
  }
@@ -1,5 +1,6 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class OptimizedWallObject extends DefaultObject {
3
3
  nativeMaterial: BABYLON.StandardMaterial;
4
- bind(_w: any): void;
4
+ loadProperties(_w: any): void;
5
+ bind(): void;
5
6
  }
@@ -1,33 +1,26 @@
1
- import IObject from "./IObject";
2
1
  import App from "../App";
3
2
  import { ObjectType } from "./ObjectType";
4
3
  import Dictionary from "../tools/Dictionary";
5
- import RegionObject from "./RegionObject";
4
+ import IBase from "./IBase";
5
+ import IRegion from "./IRegion";
6
6
  export default class Project {
7
7
  app: App;
8
8
  id: string;
9
- current: RegionObject;
10
- root: IObject;
11
- objectDatas: Dictionary<IObject>;
9
+ current: IBase;
10
+ root: IRegion;
11
+ objectDatas: Dictionary<IBase>;
12
12
  constructor(_app: App);
13
13
  clear(): void;
14
14
  optimization(): void;
15
- getChildsById(_id?: string, _includeSub?: boolean): IObject[];
16
- getSceneTree(_id?: string, _excludeTypes?: Array<string>): {
17
- name: string;
18
- id: string;
19
- customNumber: string;
20
- modelType: string;
21
- customType: string;
22
- children: any[];
23
- };
24
- findObjectById(_id: string): IObject;
15
+ getChildsById(_id?: string, _includeSub?: boolean): IBase[];
16
+ getSceneTree(_id?: string, _excludeTypes?: Array<string>): any;
17
+ findObjectById(_id: string): IBase;
25
18
  findObjectByCustomNumber(_customNumber: string): any;
26
19
  findObjectsByCustomType(_customType: string, queryParameters?: {
27
20
  isCurrent: boolean;
28
21
  isEnabled: boolean;
29
22
  }): any[];
30
- findObjectsByType(_type: ObjectType): IObject[];
31
- computeSight(_objs: Array<IObject>): any;
23
+ findObjectsByType(_type: ObjectType): IBase[];
24
+ computeSight(_objs: Array<IBase>): any;
32
25
  switchLevel(_id?: string, _isFocus?: boolean, _includeSub?: boolean): void;
33
26
  }
@@ -0,0 +1,6 @@
1
+ import IRegion from "./IRegion";
2
+ export default class StoreyObject extends IRegion {
3
+ scaling: BABYLON.Vector3;
4
+ loadProperties(_m: any): void;
5
+ bind(): void;
6
+ }
@@ -1,4 +1,12 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class UI3DTextObject extends DefaultObject {
3
- bind(_u: any): void;
3
+ tconfig: {
4
+ color: string;
5
+ position: BABYLON.Vector3;
6
+ rotation: BABYLON.Vector3;
7
+ scaling: BABYLON.Vector3;
8
+ clearColor: string;
9
+ };
10
+ loadProperties(_u: any): void;
11
+ bind(): void;
4
12
  }
@@ -1,4 +1,11 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class VirtualBoxObject extends DefaultObject {
3
- bind(_m: any): Promise<void>;
3
+ virtualType: string;
4
+ color: BABYLON.Color3;
5
+ alpha: number;
6
+ isEdges: boolean;
7
+ edgesWidth: number;
8
+ edgesColor: BABYLON.Color4;
9
+ loadProperties(_m: any): void;
10
+ bind(): void;
4
11
  }
@@ -1,7 +1,8 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class WallObject extends DefaultObject {
3
3
  nativeMaterial: BABYLON.StandardMaterial;
4
- baseModel: any;
5
4
  height: number;
6
- bind(_w: any): void;
5
+ walls: BABYLON.Mesh[];
6
+ loadProperties(_m: any): void;
7
+ bind(): void;
7
8
  }
@@ -1,5 +1,6 @@
1
1
  import DefaultObject from "./DefaultObject";
2
2
  export default class WindowObject extends DefaultObject {
3
3
  height: number;
4
- bind(_m: any): void;
4
+ loadProperties(_m: any): void;
5
+ bind(): void;
5
6
  }
@@ -0,0 +1,15 @@
1
+ import { ObjectType } from "./ObjectType";
2
+ export default class BaseModel {
3
+ extension: string;
4
+ groupId: string;
5
+ heat: number;
6
+ height: number;
7
+ insertTime: string;
8
+ isTiling: boolean;
9
+ length: number;
10
+ modelId: string;
11
+ modelName: string;
12
+ modelType: ObjectType;
13
+ modelTypeName: string;
14
+ width: number;
15
+ }