-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
GltfGpmLocal.js
145 lines (136 loc) · 3.75 KB
/
GltfGpmLocal.js
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import defined from "../../../../Core/defined.js";
import Check from "../../../../Core/Check.js";
import RuntimeError from "../../../../Core/RuntimeError.js";
import StorageType from "./StorageType.js";
/**
* The GPM metadata for a Ground-Space Indirect implementation stored
* locally (i.e. a tile and/or leaf node).
*
* @private
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
*/
function GltfGpmLocal(options) {
//>>includeStart('debug', pragmas.debug);
Check.typeOf.string("options.storageType", options.storageType);
//>>includeEnd('debug');
this._storageType = options.storageType;
this._anchorPointsIndirect = options.anchorPointsIndirect;
this._anchorPointsDirect = options.anchorPointsDirect;
this._intraTileCorrelationGroups = options.intraTileCorrelationGroups;
this._covarianceDirect = options.covarianceDirect;
//>>includeStart('debug', pragmas.debug);
if (this.storageType === StorageType.Indirect) {
if (!defined(this.anchorPointsIndirect)) {
throw new RuntimeError(
"The anchorPointsIndirect are required for 'Indirect' storage"
);
}
if (!defined(this.intraTileCorrelationGroups)) {
throw new RuntimeError(
"The intraTileCorrelationGroups are required for 'Indirect' storage"
);
}
if (defined(this.anchorPointsDirect)) {
throw new RuntimeError(
"The anchorPointsDirect must be omitted for 'Indirect' storage"
);
}
if (defined(this.covarianceDirect)) {
throw new RuntimeError(
"The covarianceDirect must be omitted for 'Indirect' storage"
);
}
} else {
// Direct storage
if (!defined(this.anchorPointsDirect)) {
throw new RuntimeError(
"The anchorPointsDirect are required for 'Direct' storage"
);
}
if (!defined(this.covarianceDirect)) {
throw new RuntimeError(
"The covarianceDirect is required for 'Direct' storage"
);
}
if (defined(this.anchorPointsIndirect)) {
throw new RuntimeError(
"The anchorPointsIndirect must be omitted for 'Direct' storage"
);
}
if (defined(this.intraTileCorrelationGroups)) {
throw new RuntimeError(
"The intraTileCorrelationGroups must be omitted for 'Direct' storage"
);
}
}
//>>includeEnd('debug');
}
Object.defineProperties(GltfGpmLocal.prototype, {
/**
* Specifies if covariance storage is indirect or direct.
*
* @memberof GltfGpmLocal.prototype
* @type {StorageType}
* @readonly
* @private
*/
storageType: {
get: function () {
return this._storageType;
},
},
/**
* Array of stored indirect anchor points
*
* @memberof GltfGpmLocal.prototype
* @type {AnchorPointIndirect[]}
* @readonly
* @private
*/
anchorPointsIndirect: {
get: function () {
return this._anchorPointsIndirect;
},
},
/**
* Array of stored direct anchor points
*
* @memberof GltfGpmLocal.prototype
* @type {AnchorPointDirect[]}
* @readonly
* @private
*/
anchorPointsDirect: {
get: function () {
return this._anchorPointsDirect;
},
},
/**
* Metadata identifying parameters using same correlation modeling and
* associated correlation parameters
*
* @memberof GltfGpmLocal.prototype
* @type {CorrelationGroup[]}
* @readonly
* @private
*/
intraTileCorrelationGroups: {
get: function () {
return this._intraTileCorrelationGroups;
},
},
/**
* The full covariance of anchor point parameters
*
* @memberof GltfGpmLocal.prototype
* @type {Matrix3}
* @readonly
* @private
*/
covarianceDirect: {
get: function () {
return this._covarianceDirect;
},
},
});
export default GltfGpmLocal;