-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMPSettings3D.ts
107 lines (98 loc) · 2.23 KB
/
MPSettings3D.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import MPUtils from "./MPUtils";
import { MPSolutionConfig } from "../../index"
/**
* A configuration object that governs layer settings for 3D features.
*
* Can be aquired with {@link MPSolutionConfig.settings3D}.
*
* @export
* @class MPSettings3D
* @typedef {MPSettings3D}
*/
export default class MPSettings3D {
/**
* Creates an instance of MPSettings3D.
*
* @constructor
* @private
* @param {?number} [_extrusionOpacity]
* @param {?number} [_wallOpacity]
*/
private constructor(
private _extrusionOpacity?: number,
private _wallOpacity?: number,
) { }
/**
* Creator for MPSettings3D, used to decode JSON from the MapsIndoors SDK.
*
* @public
* @static
* @param {MPSettings3DParams} object
* @returns {MPSettings3D}
*/
public static create(object: MPSettings3DParams): MPSettings3D {
return new MPSettings3D(
object?.extrusionOpacity,
object?.wallOpacity,
);
}
/**
* Set the opacity of extruded rooms.
*
* @public
* @type {number}
*/
public set extrusionOpacity(opacity: number) {
this._extrusionOpacity = opacity;
MPUtils.setExtrusionOpacity(opacity)
}
/**
* Get the opacity of extruded rooms.
*
* @public
* @type {number}
*/
public get extrusionOpacity(): number {
return this._extrusionOpacity!;
}
/**
* Set the opacity of extruded walls.
*
* @public
* @type {number}
*/
public set wallOpacity(opacity: number) {
this._wallOpacity = opacity;
MPUtils.setWallOpacity(opacity);
}
/**
* Get the opacity of extruded walls.
*
* @public
* @type {number}
*/
public get wallOpacity(): number {
return this._wallOpacity!;
}
}
/**
* Parameter interface for {@link MPSettings3D}.
*
* @export
* @interface MPSettings3DParams
* @typedef {MPSettings3DParams}
*/
export interface MPSettings3DParams {
/**
* The opacity of extruded rooms.
*
* @type {?number}
*/
extrusionOpacity?: number,
/**
* The opacity of extruded walls.
*
* @type {?number}
*/
wallOpacity?: number,
}