@loaders.gl/3d-tiles 3.4.13 → 3.4.15
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/dist/dist.min.js +117 -120
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/cesium-ion-loader.js +27 -61
- package/dist/es5/cesium-ion-loader.js.map +1 -1
- package/dist/es5/index.js +8 -8
- package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js +30 -42
- package/dist/es5/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js +57 -59
- package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-batch-table.js +177 -223
- package/dist/es5/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-feature-table.js +52 -71
- package/dist/es5/lib/classes/tile-3d-feature-table.js.map +1 -1
- package/dist/es5/lib/constants.js +4 -4
- package/dist/es5/lib/constants.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js +15 -18
- package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-composite.js +6 -9
- package/dist/es5/lib/encoders/encode-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js +14 -19
- package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js +15 -18
- package/dist/es5/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile.js +3 -3
- package/dist/es5/lib/encoders/encode-3d-tile.js.map +1 -1
- package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js +6 -6
- package/dist/es5/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/ion/ion.js +63 -155
- package/dist/es5/lib/ion/ion.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js +17 -17
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js +3 -3
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js +3 -3
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js +166 -198
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js +25 -53
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js +3 -3
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js +57 -129
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js +19 -17
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-utils.js +7 -7
- package/dist/es5/lib/parsers/helpers/parse-utils.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js +10 -29
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js +12 -39
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js +8 -27
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-header.js +99 -197
- package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js +37 -55
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js +110 -162
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile.js +21 -59
- package/dist/es5/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/es5/lib/utils/obb/s2-corners-to-obb.js +10 -12
- package/dist/es5/lib/utils/obb/s2-corners-to-obb.js.map +1 -1
- package/dist/es5/lib/utils/s2/converters/s2-to-boundary.js +22 -20
- package/dist/es5/lib/utils/s2/converters/s2-to-boundary.js.map +1 -1
- package/dist/es5/lib/utils/s2/converters/s2-to-obb-points.js +9 -9
- package/dist/es5/lib/utils/s2/converters/s2-to-obb-points.js.map +1 -1
- package/dist/es5/lib/utils/s2/converters/s2-to-region.js +14 -18
- package/dist/es5/lib/utils/s2/converters/s2-to-region.js.map +1 -1
- package/dist/es5/lib/utils/s2/index.js +13 -13
- package/dist/es5/lib/utils/s2/s2-geometry-functions.js +2 -2
- package/dist/es5/lib/utils/s2/s2-geometry-functions.js.map +1 -1
- package/dist/es5/lib/utils/s2/s2-token-functions.js +10 -10
- package/dist/es5/lib/utils/s2/s2-token-functions.js.map +1 -1
- package/dist/es5/lib/utils/s2/s2geometry/s2-cell-utils.js +3 -3
- package/dist/es5/lib/utils/s2/s2geometry/s2-cell-utils.js.map +1 -1
- package/dist/es5/lib/utils/s2/s2geometry/s2-geometry.js +48 -54
- package/dist/es5/lib/utils/s2/s2geometry/s2-geometry.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/es5/tile-3d-subtree-loader.js +1 -1
- package/dist/es5/tile-3d-subtree-loader.js.map +1 -1
- package/dist/es5/tile-3d-writer.js +5 -4
- package/dist/es5/tile-3d-writer.js.map +1 -1
- package/dist/es5/tiles-3d-loader.js +37 -100
- package/dist/es5/tiles-3d-loader.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/package.json +7 -7
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
9
|
var _loaderUtils = require("@loaders.gl/loader-utils");
|
|
12
10
|
var _tile3dAccessorUtils = require("./helpers/tile-3d-accessor-utils");
|
|
@@ -14,19 +12,16 @@ var _tile3dBatchTableHierarchy = require("./tile-3d-batch-table-hierarchy");
|
|
|
14
12
|
function defined(x) {
|
|
15
13
|
return x !== undefined && x !== null;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var IGNORED_PROPERTY_FIELDS = {
|
|
15
|
+
const clone = (x, y) => x;
|
|
16
|
+
const IGNORED_PROPERTY_FIELDS = {
|
|
21
17
|
HIERARCHY: true,
|
|
22
18
|
extensions: true,
|
|
23
19
|
extras: true
|
|
24
20
|
};
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
class Tile3DBatchTableParser {
|
|
22
|
+
constructor(json, binary, featureCount) {
|
|
27
23
|
var _this$json;
|
|
28
|
-
|
|
29
|
-
(0, _classCallCheck2.default)(this, Tile3DBatchTableParser);
|
|
24
|
+
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
30
25
|
(0, _defineProperty2.default)(this, "json", void 0);
|
|
31
26
|
(0, _defineProperty2.default)(this, "binary", void 0);
|
|
32
27
|
(0, _defineProperty2.default)(this, "featureCount", void 0);
|
|
@@ -40,7 +35,7 @@ var Tile3DBatchTableParser = function () {
|
|
|
40
35
|
this.featureCount = featureCount;
|
|
41
36
|
this._extensions = ((_this$json = this.json) === null || _this$json === void 0 ? void 0 : _this$json.extensions) || {};
|
|
42
37
|
this._properties = {};
|
|
43
|
-
for (
|
|
38
|
+
for (const propertyName in this.json) {
|
|
44
39
|
if (!IGNORED_PROPERTY_FIELDS[propertyName]) {
|
|
45
40
|
this._properties[propertyName] = this.json[propertyName];
|
|
46
41
|
}
|
|
@@ -50,236 +45,195 @@ var Tile3DBatchTableParser = function () {
|
|
|
50
45
|
this._hierarchy = (0, _tile3dBatchTableHierarchy.initializeHierarchy)(this, this.json, this.binary);
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
|
-
(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var result = (0, _tile3dBatchTableHierarchy.traverseHierarchy)(this._hierarchy, batchId, function (hierarchy, instanceIndex) {
|
|
70
|
-
var classId = hierarchy.classIds[instanceIndex];
|
|
71
|
-
var instanceClass = hierarchy.classes[classId];
|
|
72
|
-
return instanceClass.name === className;
|
|
73
|
-
});
|
|
74
|
-
return defined(result);
|
|
75
|
-
}
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
key: "isExactClass",
|
|
80
|
-
value: function isExactClass(batchId, className) {
|
|
81
|
-
(0, _loaderUtils.assert)(typeof className === 'string', className);
|
|
82
|
-
return this.getExactClassName(batchId) === className;
|
|
48
|
+
getExtension(extensionName) {
|
|
49
|
+
return this.json && this.json.extensions && this.json.extensions[extensionName];
|
|
50
|
+
}
|
|
51
|
+
memorySizeInBytes() {
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
isClass(batchId, className) {
|
|
55
|
+
this._checkBatchId(batchId);
|
|
56
|
+
(0, _loaderUtils.assert)(typeof className === 'string', className);
|
|
57
|
+
if (this._hierarchy) {
|
|
58
|
+
const result = (0, _tile3dBatchTableHierarchy.traverseHierarchy)(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
59
|
+
const classId = hierarchy.classIds[instanceIndex];
|
|
60
|
+
const instanceClass = hierarchy.classes[classId];
|
|
61
|
+
return instanceClass.name === className;
|
|
62
|
+
});
|
|
63
|
+
return defined(result);
|
|
83
64
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
isExactClass(batchId, className) {
|
|
68
|
+
(0, _loaderUtils.assert)(typeof className === 'string', className);
|
|
69
|
+
return this.getExactClassName(batchId) === className;
|
|
70
|
+
}
|
|
71
|
+
getExactClassName(batchId) {
|
|
72
|
+
this._checkBatchId(batchId);
|
|
73
|
+
if (this._hierarchy) {
|
|
74
|
+
const classId = this._hierarchy.classIds[batchId];
|
|
75
|
+
const instanceClass = this._hierarchy.classes[classId];
|
|
76
|
+
return instanceClass.name;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
hasProperty(batchId, name) {
|
|
81
|
+
this._checkBatchId(batchId);
|
|
82
|
+
(0, _loaderUtils.assert)(typeof name === 'string', name);
|
|
83
|
+
return defined(this._properties[name]) || this._hasPropertyInHierarchy(batchId, name);
|
|
84
|
+
}
|
|
85
|
+
getPropertyNames(batchId, results) {
|
|
86
|
+
this._checkBatchId(batchId);
|
|
87
|
+
results = defined(results) ? results : [];
|
|
88
|
+
results.length = 0;
|
|
89
|
+
const propertyNames = Object.keys(this._properties);
|
|
90
|
+
results.push(...propertyNames);
|
|
91
|
+
if (this._hierarchy) {
|
|
92
|
+
this._getPropertyNamesInHierarchy(batchId, results);
|
|
93
|
+
}
|
|
94
|
+
return results;
|
|
95
|
+
}
|
|
96
|
+
getProperty(batchId, name) {
|
|
97
|
+
this._checkBatchId(batchId);
|
|
98
|
+
(0, _loaderUtils.assert)(typeof name === 'string', name);
|
|
99
|
+
if (this._binaryProperties) {
|
|
100
|
+
const binaryProperty = this._binaryProperties[name];
|
|
101
|
+
if (defined(binaryProperty)) {
|
|
102
|
+
return this._getBinaryProperty(binaryProperty, batchId);
|
|
92
103
|
}
|
|
93
|
-
return undefined;
|
|
94
104
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
this._checkBatchId(batchId);
|
|
99
|
-
(0, _loaderUtils.assert)(typeof name === 'string', name);
|
|
100
|
-
return defined(this._properties[name]) || this._hasPropertyInHierarchy(batchId, name);
|
|
105
|
+
const propertyValues = this._properties[name];
|
|
106
|
+
if (defined(propertyValues)) {
|
|
107
|
+
return clone(propertyValues[batchId], true);
|
|
101
108
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this._checkBatchId(batchId);
|
|
107
|
-
results = defined(results) ? results : [];
|
|
108
|
-
results.length = 0;
|
|
109
|
-
var propertyNames = Object.keys(this._properties);
|
|
110
|
-
(_results = results).push.apply(_results, propertyNames);
|
|
111
|
-
if (this._hierarchy) {
|
|
112
|
-
this._getPropertyNamesInHierarchy(batchId, results);
|
|
109
|
+
if (this._hierarchy) {
|
|
110
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name);
|
|
111
|
+
if (defined(hierarchyProperty)) {
|
|
112
|
+
return hierarchyProperty;
|
|
113
113
|
}
|
|
114
|
-
return results;
|
|
115
114
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
var propertyValues = this._properties[name];
|
|
128
|
-
if (defined(propertyValues)) {
|
|
129
|
-
return clone(propertyValues[batchId], true);
|
|
130
|
-
}
|
|
131
|
-
if (this._hierarchy) {
|
|
132
|
-
var hierarchyProperty = this._getHierarchyProperty(batchId, name);
|
|
133
|
-
if (defined(hierarchyProperty)) {
|
|
134
|
-
return hierarchyProperty;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
key: "setProperty",
|
|
141
|
-
value: function setProperty(batchId, name, value) {
|
|
142
|
-
var featureCount = this.featureCount;
|
|
143
|
-
this._checkBatchId(batchId);
|
|
144
|
-
(0, _loaderUtils.assert)(typeof name === 'string', name);
|
|
145
|
-
if (this._binaryProperties) {
|
|
146
|
-
var binaryProperty = this._binaryProperties[name];
|
|
147
|
-
if (binaryProperty) {
|
|
148
|
-
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (this._hierarchy) {
|
|
153
|
-
if (this._setHierarchyProperty(this, batchId, name, value)) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
var propertyValues = this._properties[name];
|
|
158
|
-
if (!defined(propertyValues)) {
|
|
159
|
-
this._properties[name] = new Array(featureCount);
|
|
160
|
-
propertyValues = this._properties[name];
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
setProperty(batchId, name, value) {
|
|
118
|
+
const featureCount = this.featureCount;
|
|
119
|
+
this._checkBatchId(batchId);
|
|
120
|
+
(0, _loaderUtils.assert)(typeof name === 'string', name);
|
|
121
|
+
if (this._binaryProperties) {
|
|
122
|
+
const binaryProperty = this._binaryProperties[name];
|
|
123
|
+
if (binaryProperty) {
|
|
124
|
+
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
125
|
+
return;
|
|
161
126
|
}
|
|
162
|
-
propertyValues[batchId] = clone(value, true);
|
|
163
127
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
var valid = batchId >= 0 && batchId < this.featureCount;
|
|
168
|
-
if (!valid) {
|
|
169
|
-
throw new Error('batchId not in range [0, featureCount - 1].');
|
|
128
|
+
if (this._hierarchy) {
|
|
129
|
+
if (this._setHierarchyProperty(this, batchId, name, value)) {
|
|
130
|
+
return;
|
|
170
131
|
}
|
|
171
132
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
key: "_setBinaryProperty",
|
|
179
|
-
value: function _setBinaryProperty(binaryProperty, index, value) {
|
|
180
|
-
binaryProperty.pack(value, binaryProperty.typedArray, index);
|
|
133
|
+
let propertyValues = this._properties[name];
|
|
134
|
+
if (!defined(propertyValues)) {
|
|
135
|
+
this._properties[name] = new Array(featureCount);
|
|
136
|
+
propertyValues = this._properties[name];
|
|
181
137
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
var binaryProperty = this._initializeBinaryProperty(name, property);
|
|
189
|
-
if (binaryProperty) {
|
|
190
|
-
binaryProperties = binaryProperties || {};
|
|
191
|
-
binaryProperties[name] = binaryProperty;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return binaryProperties;
|
|
138
|
+
propertyValues[batchId] = clone(value, true);
|
|
139
|
+
}
|
|
140
|
+
_checkBatchId(batchId) {
|
|
141
|
+
const valid = batchId >= 0 && batchId < this.featureCount;
|
|
142
|
+
if (!valid) {
|
|
143
|
+
throw new Error('batchId not in range [0, featureCount - 1].');
|
|
195
144
|
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
};
|
|
145
|
+
}
|
|
146
|
+
_getBinaryProperty(binaryProperty, index) {
|
|
147
|
+
return binaryProperty.unpack(binaryProperty.typedArray, index);
|
|
148
|
+
}
|
|
149
|
+
_setBinaryProperty(binaryProperty, index, value) {
|
|
150
|
+
binaryProperty.pack(value, binaryProperty.typedArray, index);
|
|
151
|
+
}
|
|
152
|
+
_initializeBinaryProperties() {
|
|
153
|
+
let binaryProperties = null;
|
|
154
|
+
for (const name in this._properties) {
|
|
155
|
+
const property = this._properties[name];
|
|
156
|
+
const binaryProperty = this._initializeBinaryProperty(name, property);
|
|
157
|
+
if (binaryProperty) {
|
|
158
|
+
binaryProperties = binaryProperties || {};
|
|
159
|
+
binaryProperties[name] = binaryProperty;
|
|
210
160
|
}
|
|
211
|
-
return null;
|
|
212
161
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
162
|
+
return binaryProperties;
|
|
163
|
+
}
|
|
164
|
+
_initializeBinaryProperty(name, property) {
|
|
165
|
+
if ('byteOffset' in property) {
|
|
166
|
+
const tile3DAccessor = property;
|
|
167
|
+
(0, _loaderUtils.assert)(this.binary, "Property ".concat(name, " requires a batch table binary."));
|
|
168
|
+
(0, _loaderUtils.assert)(tile3DAccessor.type, "Property ".concat(name, " requires a type."));
|
|
169
|
+
const accessor = (0, _tile3dAccessorUtils.createTypedArrayFromAccessor)(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
170
|
+
return {
|
|
171
|
+
typedArray: accessor.values,
|
|
172
|
+
componentCount: accessor.size,
|
|
173
|
+
unpack: accessor.unpacker,
|
|
174
|
+
pack: accessor.packer
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
_hasPropertyInHierarchy(batchId, name) {
|
|
180
|
+
if (!this._hierarchy) {
|
|
181
|
+
return false;
|
|
225
182
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
183
|
+
const result = (0, _tile3dBatchTableHierarchy.traverseHierarchy)(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
184
|
+
const classId = hierarchy.classIds[instanceIndex];
|
|
185
|
+
const instances = hierarchy.classes[classId].instances;
|
|
186
|
+
return defined(instances[name]);
|
|
187
|
+
});
|
|
188
|
+
return defined(result);
|
|
189
|
+
}
|
|
190
|
+
_getPropertyNamesInHierarchy(batchId, results) {
|
|
191
|
+
(0, _tile3dBatchTableHierarchy.traverseHierarchy)(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
192
|
+
const classId = hierarchy.classIds[instanceIndex];
|
|
193
|
+
const instances = hierarchy.classes[classId].instances;
|
|
194
|
+
for (const name in instances) {
|
|
195
|
+
if (instances.hasOwnProperty(name)) {
|
|
196
|
+
if (results.indexOf(name) === -1) {
|
|
197
|
+
results.push(name);
|
|
237
198
|
}
|
|
238
199
|
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (defined(propertyValues.typedArray)) {
|
|
252
|
-
return _this._getBinaryProperty(propertyValues, indexInClass);
|
|
253
|
-
}
|
|
254
|
-
return clone(propertyValues[indexInClass], true);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
_getHierarchyProperty(batchId, name) {
|
|
204
|
+
return (0, _tile3dBatchTableHierarchy.traverseHierarchy)(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
205
|
+
const classId = hierarchy.classIds[instanceIndex];
|
|
206
|
+
const instanceClass = hierarchy.classes[classId];
|
|
207
|
+
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
208
|
+
const propertyValues = instanceClass.instances[name];
|
|
209
|
+
if (defined(propertyValues)) {
|
|
210
|
+
if (defined(propertyValues.typedArray)) {
|
|
211
|
+
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
255
212
|
}
|
|
256
|
-
return
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
propertyValues[indexInClass] = clone(value, true);
|
|
274
|
-
}
|
|
275
|
-
return true;
|
|
213
|
+
return clone(propertyValues[indexInClass], true);
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
_setHierarchyProperty(batchTable, batchId, name, value) {
|
|
219
|
+
const result = (0, _tile3dBatchTableHierarchy.traverseHierarchy)(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
220
|
+
const classId = hierarchy.classIds[instanceIndex];
|
|
221
|
+
const instanceClass = hierarchy.classes[classId];
|
|
222
|
+
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
223
|
+
const propertyValues = instanceClass.instances[name];
|
|
224
|
+
if (defined(propertyValues)) {
|
|
225
|
+
(0, _loaderUtils.assert)(instanceIndex === batchId, "Inherited property \"".concat(name, "\" is read-only."));
|
|
226
|
+
if (defined(propertyValues.typedArray)) {
|
|
227
|
+
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
228
|
+
} else {
|
|
229
|
+
propertyValues[indexInClass] = clone(value, true);
|
|
276
230
|
}
|
|
277
|
-
return
|
|
278
|
-
}
|
|
279
|
-
return
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
return false;
|
|
234
|
+
});
|
|
235
|
+
return defined(result);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
284
238
|
exports.default = Tile3DBatchTableParser;
|
|
285
239
|
//# sourceMappingURL=tile-3d-batch-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile-3d-batch-table.js","names":["_loaderUtils","require","_tile3dAccessorUtils","_tile3dBatchTableHierarchy","defined","x","undefined","clone","y","IGNORED_PROPERTY_FIELDS","HIERARCHY","extensions","extras","Tile3DBatchTableParser","json","binary","featureCount","_this$json","options","arguments","length","_classCallCheck2","default","_defineProperty2","assert","_extensions","_properties","propertyName","_binaryProperties","_initializeBinaryProperties","_hierarchy","initializeHierarchy","_createClass2","key","value","getExtension","extensionName","memorySizeInBytes","isClass","batchId","className","_checkBatchId","result","traverseHierarchy","hierarchy","instanceIndex","classId","classIds","instanceClass","classes","name","isExactClass","getExactClassName","hasProperty","_hasPropertyInHierarchy","getPropertyNames","results","_results","propertyNames","Object","keys","push","apply","_getPropertyNamesInHierarchy","getProperty","binaryProperty","_getBinaryProperty","propertyValues","hierarchyProperty","_getHierarchyProperty","setProperty","_setBinaryProperty","_setHierarchyProperty","Array","valid","Error","index","unpack","typedArray","pack","binaryProperties","property","_initializeBinaryProperty","tile3DAccessor","concat","type","accessor","createTypedArrayFromAccessor","buffer","byteOffset","values","componentCount","size","unpacker","packer","instances","hasOwnProperty","indexOf","_this","indexInClass","classIndexes","batchTable","_this2","exports"],"sources":["../../../../src/lib/classes/tile-3d-batch-table.ts"],"sourcesContent":["// This file is derived from the Cesium code base under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nimport {assert} from '@loaders.gl/loader-utils';\n\nimport {createTypedArrayFromAccessor} from './helpers/tile-3d-accessor-utils';\nimport {initializeHierarchy, traverseHierarchy} from './tile-3d-batch-table-hierarchy';\n\nfunction defined(x) {\n return x !== undefined && x !== null;\n}\n\nconst clone = (x, y) => x;\n\n// These top level fields in the batch table json are not properties\nconst IGNORED_PROPERTY_FIELDS = {\n HIERARCHY: true, // Deprecated HIERARCHY property\n extensions: true,\n extras: true\n};\n\n// The size of this array equals the maximum instance count among all loaded tiles, which has the potential to be large.\nexport default class Tile3DBatchTableParser {\n json;\n binary;\n featureCount;\n _extensions;\n // Copy all top-level property fields from the json object, ignoring special fields\n _properties;\n _binaryProperties;\n // TODO: hierarchy support is only partially implemented and not tested\n _hierarchy;\n\n constructor(json, binary, featureCount, options = {}) {\n assert(featureCount >= 0);\n this.json = json || {};\n this.binary = binary;\n this.featureCount = featureCount;\n\n this._extensions = this.json?.extensions || {};\n\n // Copy all top-level property fields from the json object, ignoring special fields\n this._properties = {};\n for (const propertyName in this.json) {\n if (!IGNORED_PROPERTY_FIELDS[propertyName]) {\n this._properties[propertyName] = this.json[propertyName];\n }\n }\n\n this._binaryProperties = this._initializeBinaryProperties();\n\n // TODO: hierarchy support is only partially implemented and not tested\n if (options['3DTILES_batch_table_hierarchy']) {\n this._hierarchy = initializeHierarchy(this, this.json, this.binary);\n }\n }\n\n getExtension(extensionName) {\n return this.json && this.json.extensions && this.json.extensions[extensionName];\n }\n\n memorySizeInBytes(): number {\n return 0;\n }\n\n isClass(batchId, className: string): boolean {\n this._checkBatchId(batchId);\n assert(typeof className === 'string', className);\n\n // extension: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n // PERFORMANCE_IDEA : cache results in the ancestor classes\n // to speed up this check if this area becomes a hotspot\n // PERFORMANCE_IDEA : treat class names as integers for faster comparisons\n const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instanceClass = hierarchy.classes[classId];\n return instanceClass.name === className;\n });\n return defined(result);\n }\n\n return false;\n }\n\n isExactClass(batchId, className) {\n assert(typeof className === 'string', className);\n\n return this.getExactClassName(batchId) === className;\n }\n\n getExactClassName(batchId) {\n this._checkBatchId(batchId);\n\n // extension: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n const classId = this._hierarchy.classIds[batchId];\n const instanceClass = this._hierarchy.classes[classId];\n return instanceClass.name;\n }\n\n return undefined;\n }\n\n hasProperty(batchId, name) {\n this._checkBatchId(batchId);\n assert(typeof name === 'string', name);\n\n return defined(this._properties[name]) || this._hasPropertyInHierarchy(batchId, name);\n }\n\n getPropertyNames(batchId, results) {\n this._checkBatchId(batchId);\n\n results = defined(results) ? results : [];\n results.length = 0;\n\n const propertyNames = Object.keys(this._properties);\n results.push(...propertyNames);\n\n if (this._hierarchy) {\n this._getPropertyNamesInHierarchy(batchId, results);\n }\n\n return results;\n }\n\n getProperty(batchId, name) {\n this._checkBatchId(batchId);\n assert(typeof name === 'string', name);\n\n if (this._binaryProperties) {\n const binaryProperty = this._binaryProperties[name];\n if (defined(binaryProperty)) {\n return this._getBinaryProperty(binaryProperty, batchId);\n }\n }\n\n const propertyValues = this._properties[name];\n if (defined(propertyValues)) {\n return clone(propertyValues[batchId], true);\n }\n\n // EXTENSION: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n const hierarchyProperty = this._getHierarchyProperty(batchId, name);\n if (defined(hierarchyProperty)) {\n return hierarchyProperty;\n }\n }\n\n return undefined;\n }\n\n setProperty(batchId, name, value) {\n const featureCount = this.featureCount;\n\n this._checkBatchId(batchId);\n assert(typeof name === 'string', name);\n\n if (this._binaryProperties) {\n const binaryProperty = this._binaryProperties[name];\n if (binaryProperty) {\n this._setBinaryProperty(binaryProperty, batchId, value);\n return;\n }\n }\n\n // EXTENSION: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n if (this._setHierarchyProperty(this, batchId, name, value)) {\n return;\n }\n }\n\n let propertyValues = this._properties[name];\n if (!defined(propertyValues)) {\n // Property does not exist. Create it.\n this._properties[name] = new Array(featureCount);\n propertyValues = this._properties[name];\n }\n\n propertyValues[batchId] = clone(value, true);\n }\n\n // PRIVATE METHODS\n\n _checkBatchId(batchId) {\n const valid = batchId >= 0 && batchId < this.featureCount;\n if (!valid) {\n throw new Error('batchId not in range [0, featureCount - 1].');\n }\n }\n\n _getBinaryProperty(binaryProperty, index) {\n return binaryProperty.unpack(binaryProperty.typedArray, index);\n }\n\n _setBinaryProperty(binaryProperty, index, value) {\n binaryProperty.pack(value, binaryProperty.typedArray, index);\n }\n\n _initializeBinaryProperties() {\n let binaryProperties: Record<string, any> | null = null;\n for (const name in this._properties) {\n const property = this._properties[name];\n const binaryProperty = this._initializeBinaryProperty(name, property);\n // Store any information needed to access the binary data, including the typed array,\n // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n if (binaryProperty) {\n binaryProperties = binaryProperties || {};\n binaryProperties[name] = binaryProperty;\n }\n }\n return binaryProperties;\n }\n\n _initializeBinaryProperty(name, property) {\n if ('byteOffset' in property) {\n // This is a binary property\n const tile3DAccessor = property;\n\n assert(this.binary, `Property ${name} requires a batch table binary.`);\n assert(tile3DAccessor.type, `Property ${name} requires a type.`);\n\n const accessor = createTypedArrayFromAccessor(\n tile3DAccessor,\n this.binary.buffer,\n this.binary.byteOffset | 0,\n this.featureCount\n );\n\n // Store any information needed to access the binary data, including the typed array,\n // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n return {\n typedArray: accessor.values,\n componentCount: accessor.size,\n unpack: accessor.unpacker,\n pack: accessor.packer\n };\n }\n\n return null;\n }\n\n // EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy\n\n _hasPropertyInHierarchy(batchId, name) {\n if (!this._hierarchy) {\n return false;\n }\n\n const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instances = hierarchy.classes[classId].instances;\n return defined(instances[name]);\n });\n\n return defined(result);\n }\n\n _getPropertyNamesInHierarchy(batchId, results) {\n traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instances = hierarchy.classes[classId].instances;\n for (const name in instances) {\n if (instances.hasOwnProperty(name)) {\n if (results.indexOf(name) === -1) {\n results.push(name);\n }\n }\n }\n });\n }\n\n _getHierarchyProperty(batchId, name) {\n return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instanceClass = hierarchy.classes[classId];\n const indexInClass = hierarchy.classIndexes[instanceIndex];\n const propertyValues = instanceClass.instances[name];\n if (defined(propertyValues)) {\n if (defined(propertyValues.typedArray)) {\n return this._getBinaryProperty(propertyValues, indexInClass);\n }\n return clone(propertyValues[indexInClass], true);\n }\n return null;\n });\n }\n\n _setHierarchyProperty(batchTable, batchId, name, value) {\n const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instanceClass = hierarchy.classes[classId];\n const indexInClass = hierarchy.classIndexes[instanceIndex];\n const propertyValues = instanceClass.instances[name];\n if (defined(propertyValues)) {\n assert(instanceIndex === batchId, `Inherited property \"${name}\" is read-only.`);\n if (defined(propertyValues.typedArray)) {\n this._setBinaryProperty(propertyValues, indexInClass, value);\n } else {\n propertyValues[indexInClass] = clone(value, true);\n }\n return true;\n }\n return false;\n });\n return defined(result);\n }\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEA,SAASG,OAAOA,CAACC,CAAC,EAAE;EAClB,OAAOA,CAAC,KAAKC,SAAS,IAAID,CAAC,KAAK,IAAI;AACtC;AAEA,IAAME,KAAK,GAAG,SAARA,KAAKA,CAAIF,CAAC,EAAEG,CAAC;EAAA,OAAKH,CAAC;AAAA;AAGzB,IAAMI,uBAAuB,GAAG;EAC9BC,SAAS,EAAE,IAAI;EACfC,UAAU,EAAE,IAAI;EAChBC,MAAM,EAAE;AACV,CAAC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B,CAAC;UAC/E,IAAI9C,OAAO,CAAC+D,cAAc,CAACW,UAAU,CAAC,EAAE;YACtCwB,MAAI,CAAC/B,kBAAkB,CAACJ,cAAc,EAAEgC,YAAY,EAAEjE,KAAK,CAAC;UAC9D,CAAC,MAAM;YACLiC,cAAc,CAACgC,YAAY,CAAC,GAAG5F,KAAK,CAAC2B,KAAK,EAAE,IAAI,CAAC;UACnD;UACA,OAAO,IAAI;QACb;QACA,OAAO,KAAK;MACd,CAAC,CAAC;MACF,OAAO9B,OAAO,CAACsC,MAAM,CAAC;IACxB;EAAC;EAAA,OAAA7B,sBAAA;AAAA;AAAA0F,OAAA,CAAAjF,OAAA,GAAAT,sBAAA"}
|
|
1
|
+
{"version":3,"file":"tile-3d-batch-table.js","names":["_loaderUtils","require","_tile3dAccessorUtils","_tile3dBatchTableHierarchy","defined","x","undefined","clone","y","IGNORED_PROPERTY_FIELDS","HIERARCHY","extensions","extras","Tile3DBatchTableParser","constructor","json","binary","featureCount","_this$json","options","arguments","length","_defineProperty2","default","assert","_extensions","_properties","propertyName","_binaryProperties","_initializeBinaryProperties","_hierarchy","initializeHierarchy","getExtension","extensionName","memorySizeInBytes","isClass","batchId","className","_checkBatchId","result","traverseHierarchy","hierarchy","instanceIndex","classId","classIds","instanceClass","classes","name","isExactClass","getExactClassName","hasProperty","_hasPropertyInHierarchy","getPropertyNames","results","propertyNames","Object","keys","push","_getPropertyNamesInHierarchy","getProperty","binaryProperty","_getBinaryProperty","propertyValues","hierarchyProperty","_getHierarchyProperty","setProperty","value","_setBinaryProperty","_setHierarchyProperty","Array","valid","Error","index","unpack","typedArray","pack","binaryProperties","property","_initializeBinaryProperty","tile3DAccessor","concat","type","accessor","createTypedArrayFromAccessor","buffer","byteOffset","values","componentCount","size","unpacker","packer","instances","hasOwnProperty","indexOf","indexInClass","classIndexes","batchTable","exports"],"sources":["../../../../src/lib/classes/tile-3d-batch-table.ts"],"sourcesContent":["// This file is derived from the Cesium code base under Apache 2 license\n// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md\n\nimport {assert} from '@loaders.gl/loader-utils';\n\nimport {createTypedArrayFromAccessor} from './helpers/tile-3d-accessor-utils';\nimport {initializeHierarchy, traverseHierarchy} from './tile-3d-batch-table-hierarchy';\n\nfunction defined(x) {\n return x !== undefined && x !== null;\n}\n\nconst clone = (x, y) => x;\n\n// These top level fields in the batch table json are not properties\nconst IGNORED_PROPERTY_FIELDS = {\n HIERARCHY: true, // Deprecated HIERARCHY property\n extensions: true,\n extras: true\n};\n\n// The size of this array equals the maximum instance count among all loaded tiles, which has the potential to be large.\nexport default class Tile3DBatchTableParser {\n json;\n binary;\n featureCount;\n _extensions;\n // Copy all top-level property fields from the json object, ignoring special fields\n _properties;\n _binaryProperties;\n // TODO: hierarchy support is only partially implemented and not tested\n _hierarchy;\n\n constructor(json, binary, featureCount, options = {}) {\n assert(featureCount >= 0);\n this.json = json || {};\n this.binary = binary;\n this.featureCount = featureCount;\n\n this._extensions = this.json?.extensions || {};\n\n // Copy all top-level property fields from the json object, ignoring special fields\n this._properties = {};\n for (const propertyName in this.json) {\n if (!IGNORED_PROPERTY_FIELDS[propertyName]) {\n this._properties[propertyName] = this.json[propertyName];\n }\n }\n\n this._binaryProperties = this._initializeBinaryProperties();\n\n // TODO: hierarchy support is only partially implemented and not tested\n if (options['3DTILES_batch_table_hierarchy']) {\n this._hierarchy = initializeHierarchy(this, this.json, this.binary);\n }\n }\n\n getExtension(extensionName) {\n return this.json && this.json.extensions && this.json.extensions[extensionName];\n }\n\n memorySizeInBytes(): number {\n return 0;\n }\n\n isClass(batchId, className: string): boolean {\n this._checkBatchId(batchId);\n assert(typeof className === 'string', className);\n\n // extension: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n // PERFORMANCE_IDEA : cache results in the ancestor classes\n // to speed up this check if this area becomes a hotspot\n // PERFORMANCE_IDEA : treat class names as integers for faster comparisons\n const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instanceClass = hierarchy.classes[classId];\n return instanceClass.name === className;\n });\n return defined(result);\n }\n\n return false;\n }\n\n isExactClass(batchId, className) {\n assert(typeof className === 'string', className);\n\n return this.getExactClassName(batchId) === className;\n }\n\n getExactClassName(batchId) {\n this._checkBatchId(batchId);\n\n // extension: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n const classId = this._hierarchy.classIds[batchId];\n const instanceClass = this._hierarchy.classes[classId];\n return instanceClass.name;\n }\n\n return undefined;\n }\n\n hasProperty(batchId, name) {\n this._checkBatchId(batchId);\n assert(typeof name === 'string', name);\n\n return defined(this._properties[name]) || this._hasPropertyInHierarchy(batchId, name);\n }\n\n getPropertyNames(batchId, results) {\n this._checkBatchId(batchId);\n\n results = defined(results) ? results : [];\n results.length = 0;\n\n const propertyNames = Object.keys(this._properties);\n results.push(...propertyNames);\n\n if (this._hierarchy) {\n this._getPropertyNamesInHierarchy(batchId, results);\n }\n\n return results;\n }\n\n getProperty(batchId, name) {\n this._checkBatchId(batchId);\n assert(typeof name === 'string', name);\n\n if (this._binaryProperties) {\n const binaryProperty = this._binaryProperties[name];\n if (defined(binaryProperty)) {\n return this._getBinaryProperty(binaryProperty, batchId);\n }\n }\n\n const propertyValues = this._properties[name];\n if (defined(propertyValues)) {\n return clone(propertyValues[batchId], true);\n }\n\n // EXTENSION: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n const hierarchyProperty = this._getHierarchyProperty(batchId, name);\n if (defined(hierarchyProperty)) {\n return hierarchyProperty;\n }\n }\n\n return undefined;\n }\n\n setProperty(batchId, name, value) {\n const featureCount = this.featureCount;\n\n this._checkBatchId(batchId);\n assert(typeof name === 'string', name);\n\n if (this._binaryProperties) {\n const binaryProperty = this._binaryProperties[name];\n if (binaryProperty) {\n this._setBinaryProperty(binaryProperty, batchId, value);\n return;\n }\n }\n\n // EXTENSION: 3DTILES_batch_table_hierarchy\n if (this._hierarchy) {\n if (this._setHierarchyProperty(this, batchId, name, value)) {\n return;\n }\n }\n\n let propertyValues = this._properties[name];\n if (!defined(propertyValues)) {\n // Property does not exist. Create it.\n this._properties[name] = new Array(featureCount);\n propertyValues = this._properties[name];\n }\n\n propertyValues[batchId] = clone(value, true);\n }\n\n // PRIVATE METHODS\n\n _checkBatchId(batchId) {\n const valid = batchId >= 0 && batchId < this.featureCount;\n if (!valid) {\n throw new Error('batchId not in range [0, featureCount - 1].');\n }\n }\n\n _getBinaryProperty(binaryProperty, index) {\n return binaryProperty.unpack(binaryProperty.typedArray, index);\n }\n\n _setBinaryProperty(binaryProperty, index, value) {\n binaryProperty.pack(value, binaryProperty.typedArray, index);\n }\n\n _initializeBinaryProperties() {\n let binaryProperties: Record<string, any> | null = null;\n for (const name in this._properties) {\n const property = this._properties[name];\n const binaryProperty = this._initializeBinaryProperty(name, property);\n // Store any information needed to access the binary data, including the typed array,\n // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n if (binaryProperty) {\n binaryProperties = binaryProperties || {};\n binaryProperties[name] = binaryProperty;\n }\n }\n return binaryProperties;\n }\n\n _initializeBinaryProperty(name, property) {\n if ('byteOffset' in property) {\n // This is a binary property\n const tile3DAccessor = property;\n\n assert(this.binary, `Property ${name} requires a batch table binary.`);\n assert(tile3DAccessor.type, `Property ${name} requires a type.`);\n\n const accessor = createTypedArrayFromAccessor(\n tile3DAccessor,\n this.binary.buffer,\n this.binary.byteOffset | 0,\n this.featureCount\n );\n\n // Store any information needed to access the binary data, including the typed array,\n // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).\n return {\n typedArray: accessor.values,\n componentCount: accessor.size,\n unpack: accessor.unpacker,\n pack: accessor.packer\n };\n }\n\n return null;\n }\n\n // EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy\n\n _hasPropertyInHierarchy(batchId, name) {\n if (!this._hierarchy) {\n return false;\n }\n\n const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instances = hierarchy.classes[classId].instances;\n return defined(instances[name]);\n });\n\n return defined(result);\n }\n\n _getPropertyNamesInHierarchy(batchId, results) {\n traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instances = hierarchy.classes[classId].instances;\n for (const name in instances) {\n if (instances.hasOwnProperty(name)) {\n if (results.indexOf(name) === -1) {\n results.push(name);\n }\n }\n }\n });\n }\n\n _getHierarchyProperty(batchId, name) {\n return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instanceClass = hierarchy.classes[classId];\n const indexInClass = hierarchy.classIndexes[instanceIndex];\n const propertyValues = instanceClass.instances[name];\n if (defined(propertyValues)) {\n if (defined(propertyValues.typedArray)) {\n return this._getBinaryProperty(propertyValues, indexInClass);\n }\n return clone(propertyValues[indexInClass], true);\n }\n return null;\n });\n }\n\n _setHierarchyProperty(batchTable, batchId, name, value) {\n const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {\n const classId = hierarchy.classIds[instanceIndex];\n const instanceClass = hierarchy.classes[classId];\n const indexInClass = hierarchy.classIndexes[instanceIndex];\n const propertyValues = instanceClass.instances[name];\n if (defined(propertyValues)) {\n assert(instanceIndex === batchId, `Inherited property \"${name}\" is read-only.`);\n if (defined(propertyValues.typedArray)) {\n this._setBinaryProperty(propertyValues, indexInClass, value);\n } else {\n propertyValues[indexInClass] = clone(value, true);\n }\n return true;\n }\n return false;\n });\n return defined(result);\n }\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEA,SAASG,OAAOA,CAACC,CAAC,EAAE;EAClB,OAAOA,CAAC,KAAKC,SAAS,IAAID,CAAC,KAAK,IAA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