@loaders.gl/3d-tiles 3.1.0-beta.7 → 3.1.3
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/bundle.js +5 -10008
- package/dist/dist.min.js +12179 -0
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/cesium-ion-loader.js +78 -23
- 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 +42 -30
- 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 +59 -57
- package/dist/es5/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-batch-table.js +238 -201
- package/dist/es5/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/es5/lib/classes/tile-3d-feature-table.js +78 -62
- package/dist/es5/lib/classes/tile-3d-feature-table.js.map +1 -1
- package/dist/es5/lib/constants.js +6 -5
- package/dist/es5/lib/constants.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js +22 -15
- package/dist/es5/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-composite.js +13 -6
- package/dist/es5/lib/encoders/encode-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/encoders/encode-3d-tile-instanced-model.js +23 -14
- 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 +22 -15
- 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 +197 -69
- package/dist/es5/lib/ion/ion.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/normalize-3d-tile-colors.js +18 -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 +270 -0
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -0
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-gltf-view.js +66 -26
- 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 +4 -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 +141 -53
- 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 +17 -19
- package/dist/es5/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/es5/lib/parsers/helpers/parse-utils.js +8 -7
- package/dist/es5/lib/parsers/helpers/parse-utils.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js +36 -10
- package/dist/es5/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js +48 -12
- package/dist/es5/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js +45 -0
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -0
- package/dist/es5/lib/parsers/parse-3d-tile-header.js +161 -14
- package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-instanced-model.js +63 -38
- 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 +198 -117
- package/dist/es5/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile.js +74 -15
- package/dist/es5/lib/parsers/parse-3d-tile.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 -5
- package/dist/es5/tile-3d-writer.js.map +1 -1
- package/dist/es5/tiles-3d-loader.js +142 -37
- package/dist/es5/tiles-3d-loader.js.map +1 -1
- package/dist/esm/lib/constants.js +2 -1
- package/dist/esm/lib/constants.js.map +1 -1
- package/dist/esm/lib/ion/ion.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js +173 -0
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -0
- package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-gltf.js +10 -0
- package/dist/esm/lib/parsers/parse-3d-tile-gltf.js.map +1 -0
- package/dist/esm/lib/parsers/parse-3d-tile-header.js +67 -0
- package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile.js +4 -0
- package/dist/esm/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/esm/tiles-3d-loader.js +9 -2
- package/dist/esm/tiles-3d-loader.js.map +1 -1
- package/dist/lib/constants.d.ts +1 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +2 -1
- package/dist/lib/ion/ion.d.ts +3 -3
- package/dist/lib/ion/ion.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +39 -0
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -0
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +189 -0
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +2 -2
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +1 -0
- package/dist/lib/parsers/parse-3d-tile-batched-model.js +1 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts +2 -0
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -0
- package/dist/lib/parsers/parse-3d-tile-gltf.js +18 -0
- package/dist/lib/parsers/parse-3d-tile-header.d.ts +16 -0
- package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.js +67 -1
- package/dist/lib/parsers/parse-3d-tile.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile.js +3 -0
- package/dist/tiles-3d-loader.d.ts.map +1 -1
- package/dist/tiles-3d-loader.js +8 -1
- package/dist/types.d.ts +6 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/lib/constants.ts +2 -1
- package/src/lib/ion/{ion.js → ion.ts} +0 -0
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +255 -0
- package/src/lib/parsers/helpers/parse-3d-tile-subtree.ts +4 -3
- package/src/lib/parsers/parse-3d-tile-gltf.js +16 -0
- package/src/lib/parsers/parse-3d-tile-header.ts +82 -1
- package/src/lib/parsers/parse-3d-tile.ts +4 -0
- package/src/tiles-3d-loader.ts +17 -2
- package/src/types.ts +7 -2
|
@@ -8,6 +8,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.parsePointCloud3DTile = parsePointCloud3DTile;
|
|
9
9
|
exports.loadDraco = loadDraco;
|
|
10
10
|
|
|
11
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
+
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
|
+
|
|
11
17
|
var _draco = require("@loaders.gl/draco");
|
|
12
18
|
|
|
13
19
|
var _math = require("@loaders.gl/math");
|
|
@@ -28,20 +34,44 @@ var _normalize3dTileNormals = require("./helpers/normalize-3d-tile-normals");
|
|
|
28
34
|
|
|
29
35
|
var _normalize3dTilePositions = require("./helpers/normalize-3d-tile-positions");
|
|
30
36
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
38
|
+
|
|
39
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
40
|
+
|
|
41
|
+
function parsePointCloud3DTile(_x, _x2, _x3, _x4, _x5) {
|
|
42
|
+
return _parsePointCloud3DTile.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function _parsePointCloud3DTile() {
|
|
46
|
+
_parsePointCloud3DTile = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tile, arrayBuffer, byteOffset, options, context) {
|
|
47
|
+
var _parsePointCloudTable, featureTable, batchTable;
|
|
48
|
+
|
|
49
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
50
|
+
while (1) {
|
|
51
|
+
switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
byteOffset = (0, _parse3dTileHeader.parse3DTileHeaderSync)(tile, arrayBuffer, byteOffset);
|
|
54
|
+
byteOffset = (0, _parse3dTileTables.parse3DTileTablesHeaderSync)(tile, arrayBuffer, byteOffset);
|
|
55
|
+
byteOffset = (0, _parse3dTileTables.parse3DTileTablesSync)(tile, arrayBuffer, byteOffset, options);
|
|
56
|
+
initializeTile(tile);
|
|
57
|
+
_parsePointCloudTable = parsePointCloudTables(tile), featureTable = _parsePointCloudTable.featureTable, batchTable = _parsePointCloudTable.batchTable;
|
|
58
|
+
_context.next = 7;
|
|
59
|
+
return parseDraco(tile, featureTable, batchTable, options, context);
|
|
60
|
+
|
|
61
|
+
case 7:
|
|
62
|
+
parsePositions(tile, featureTable, options);
|
|
63
|
+
parseColors(tile, featureTable, batchTable);
|
|
64
|
+
parseNormals(tile, featureTable);
|
|
65
|
+
return _context.abrupt("return", byteOffset);
|
|
66
|
+
|
|
67
|
+
case 11:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context.stop();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}, _callee);
|
|
73
|
+
}));
|
|
74
|
+
return _parsePointCloud3DTile.apply(this, arguments);
|
|
45
75
|
}
|
|
46
76
|
|
|
47
77
|
function initializeTile(tile) {
|
|
@@ -58,8 +88,8 @@ function initializeTile(tile) {
|
|
|
58
88
|
}
|
|
59
89
|
|
|
60
90
|
function parsePointCloudTables(tile) {
|
|
61
|
-
|
|
62
|
-
|
|
91
|
+
var featureTable = new _tile3dFeatureTable.default(tile.featureTableJson, tile.featureTableBinary);
|
|
92
|
+
var pointsLength = featureTable.getGlobalProperty('POINTS_LENGTH');
|
|
63
93
|
|
|
64
94
|
if (!Number.isFinite(pointsLength)) {
|
|
65
95
|
throw new Error('POINTS_LENGTH must be defined');
|
|
@@ -70,10 +100,10 @@ function parsePointCloudTables(tile) {
|
|
|
70
100
|
tile.pointsLength = pointsLength;
|
|
71
101
|
tile.pointCount = pointsLength;
|
|
72
102
|
tile.rtcCenter = featureTable.getGlobalProperty('RTC_CENTER', _math.GL.FLOAT, 3);
|
|
73
|
-
|
|
103
|
+
var batchTable = parseBatchIds(tile, featureTable);
|
|
74
104
|
return {
|
|
75
|
-
featureTable,
|
|
76
|
-
batchTable
|
|
105
|
+
featureTable: featureTable,
|
|
106
|
+
batchTable: batchTable
|
|
77
107
|
};
|
|
78
108
|
}
|
|
79
109
|
|
|
@@ -82,7 +112,7 @@ function parsePositions(tile, featureTable, options) {
|
|
|
82
112
|
if (featureTable.hasProperty('POSITION')) {
|
|
83
113
|
tile.attributes.positions = featureTable.getPropertyArray('POSITION', _math.GL.FLOAT, 3);
|
|
84
114
|
} else if (featureTable.hasProperty('POSITION_QUANTIZED')) {
|
|
85
|
-
|
|
115
|
+
var positions = featureTable.getPropertyArray('POSITION_QUANTIZED', _math.GL.UNSIGNED_SHORT, 3);
|
|
86
116
|
tile.isQuantized = true;
|
|
87
117
|
tile.quantizedRange = (1 << 16) - 1;
|
|
88
118
|
tile.quantizedVolumeScale = featureTable.getGlobalProperty('QUANTIZED_VOLUME_SCALE', _math.GL.FLOAT, 3);
|
|
@@ -108,7 +138,7 @@ function parsePositions(tile, featureTable, options) {
|
|
|
108
138
|
|
|
109
139
|
function parseColors(tile, featureTable, batchTable) {
|
|
110
140
|
if (!tile.attributes.colors) {
|
|
111
|
-
|
|
141
|
+
var colors = null;
|
|
112
142
|
|
|
113
143
|
if (featureTable.hasProperty('RGBA')) {
|
|
114
144
|
colors = featureTable.getPropertyArray('RGBA', _math.GL.UNSIGNED_BYTE, 4);
|
|
@@ -130,7 +160,7 @@ function parseColors(tile, featureTable, batchTable) {
|
|
|
130
160
|
|
|
131
161
|
function parseNormals(tile, featureTable) {
|
|
132
162
|
if (!tile.attributes.normals) {
|
|
133
|
-
|
|
163
|
+
var normals = null;
|
|
134
164
|
|
|
135
165
|
if (featureTable.hasProperty('NORMAL')) {
|
|
136
166
|
normals = featureTable.getPropertyArray('NORMAL', _math.GL.FLOAT, 3);
|
|
@@ -144,22 +174,20 @@ function parseNormals(tile, featureTable) {
|
|
|
144
174
|
}
|
|
145
175
|
|
|
146
176
|
function parseBatchIds(tile, featureTable) {
|
|
147
|
-
|
|
177
|
+
var batchTable = null;
|
|
148
178
|
|
|
149
179
|
if (!tile.batchIds && featureTable.hasProperty('BATCH_ID')) {
|
|
150
180
|
tile.batchIds = featureTable.getPropertyArray('BATCH_ID', _math.GL.UNSIGNED_SHORT, 1);
|
|
151
181
|
|
|
152
182
|
if (tile.batchIds) {
|
|
153
|
-
|
|
183
|
+
var batchFeatureLength = featureTable.getGlobalProperty('BATCH_LENGTH');
|
|
154
184
|
|
|
155
185
|
if (!batchFeatureLength) {
|
|
156
186
|
throw new Error('Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.');
|
|
157
187
|
}
|
|
158
188
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
batchTableBinary
|
|
162
|
-
} = tile;
|
|
189
|
+
var batchTableJson = tile.batchTableJson,
|
|
190
|
+
batchTableBinary = tile.batchTableBinary;
|
|
163
191
|
batchTable = new _tile3dBatchTable.default(batchTableJson, batchTableBinary, batchFeatureLength);
|
|
164
192
|
}
|
|
165
193
|
}
|
|
@@ -167,99 +195,152 @@ function parseBatchIds(tile, featureTable) {
|
|
|
167
195
|
return batchTable;
|
|
168
196
|
}
|
|
169
197
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
let dracoFeatureTableProperties;
|
|
173
|
-
let dracoBatchTableProperties;
|
|
174
|
-
const batchTableDraco = tile.batchTableJson && tile.batchTableJson.extensions && tile.batchTableJson.extensions['3DTILES_draco_point_compression'];
|
|
175
|
-
|
|
176
|
-
if (batchTableDraco) {
|
|
177
|
-
dracoBatchTableProperties = batchTableDraco.properties;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
const featureTableDraco = featureTable.getExtension('3DTILES_draco_point_compression');
|
|
181
|
-
|
|
182
|
-
if (featureTableDraco) {
|
|
183
|
-
dracoFeatureTableProperties = featureTableDraco.properties;
|
|
184
|
-
const dracoByteOffset = featureTableDraco.byteOffset;
|
|
185
|
-
const dracoByteLength = featureTableDraco.byteLength;
|
|
186
|
-
|
|
187
|
-
if (!dracoFeatureTableProperties || !Number.isFinite(dracoByteOffset) || !dracoByteLength) {
|
|
188
|
-
throw new Error('Draco properties, byteOffset, and byteLength must be defined');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
dracoBuffer = tile.featureTableBinary.slice(dracoByteOffset, dracoByteOffset + dracoByteLength);
|
|
192
|
-
tile.hasPositions = Number.isFinite(dracoFeatureTableProperties.POSITION);
|
|
193
|
-
tile.hasColors = Number.isFinite(dracoFeatureTableProperties.RGB) || Number.isFinite(dracoFeatureTableProperties.RGBA);
|
|
194
|
-
tile.hasNormals = Number.isFinite(dracoFeatureTableProperties.NORMAL);
|
|
195
|
-
tile.hasBatchIds = Number.isFinite(dracoFeatureTableProperties.BATCH_ID);
|
|
196
|
-
tile.isTranslucent = Number.isFinite(dracoFeatureTableProperties.RGBA);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (!dracoBuffer) {
|
|
200
|
-
return true;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const dracoData = {
|
|
204
|
-
buffer: dracoBuffer,
|
|
205
|
-
properties: { ...dracoFeatureTableProperties,
|
|
206
|
-
...dracoBatchTableProperties
|
|
207
|
-
},
|
|
208
|
-
featureTableProperties: dracoFeatureTableProperties,
|
|
209
|
-
batchTableProperties: dracoBatchTableProperties,
|
|
210
|
-
dequantizeInShader: false
|
|
211
|
-
};
|
|
212
|
-
return await loadDraco(tile, dracoData, options, context);
|
|
198
|
+
function parseDraco(_x6, _x7, _x8, _x9, _x10) {
|
|
199
|
+
return _parseDraco.apply(this, arguments);
|
|
213
200
|
}
|
|
214
201
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
202
|
+
function _parseDraco() {
|
|
203
|
+
_parseDraco = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(tile, featureTable, batchTable, options, context) {
|
|
204
|
+
var dracoBuffer, dracoFeatureTableProperties, dracoBatchTableProperties, batchTableDraco, featureTableDraco, dracoByteOffset, dracoByteLength, dracoData;
|
|
205
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
206
|
+
while (1) {
|
|
207
|
+
switch (_context2.prev = _context2.next) {
|
|
208
|
+
case 0:
|
|
209
|
+
batchTableDraco = tile.batchTableJson && tile.batchTableJson.extensions && tile.batchTableJson.extensions['3DTILES_draco_point_compression'];
|
|
210
|
+
|
|
211
|
+
if (batchTableDraco) {
|
|
212
|
+
dracoBatchTableProperties = batchTableDraco.properties;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
featureTableDraco = featureTable.getExtension('3DTILES_draco_point_compression');
|
|
216
|
+
|
|
217
|
+
if (!featureTableDraco) {
|
|
218
|
+
_context2.next = 15;
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
dracoFeatureTableProperties = featureTableDraco.properties;
|
|
223
|
+
dracoByteOffset = featureTableDraco.byteOffset;
|
|
224
|
+
dracoByteLength = featureTableDraco.byteLength;
|
|
225
|
+
|
|
226
|
+
if (!(!dracoFeatureTableProperties || !Number.isFinite(dracoByteOffset) || !dracoByteLength)) {
|
|
227
|
+
_context2.next = 9;
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
throw new Error('Draco properties, byteOffset, and byteLength must be defined');
|
|
232
|
+
|
|
233
|
+
case 9:
|
|
234
|
+
dracoBuffer = tile.featureTableBinary.slice(dracoByteOffset, dracoByteOffset + dracoByteLength);
|
|
235
|
+
tile.hasPositions = Number.isFinite(dracoFeatureTableProperties.POSITION);
|
|
236
|
+
tile.hasColors = Number.isFinite(dracoFeatureTableProperties.RGB) || Number.isFinite(dracoFeatureTableProperties.RGBA);
|
|
237
|
+
tile.hasNormals = Number.isFinite(dracoFeatureTableProperties.NORMAL);
|
|
238
|
+
tile.hasBatchIds = Number.isFinite(dracoFeatureTableProperties.BATCH_ID);
|
|
239
|
+
tile.isTranslucent = Number.isFinite(dracoFeatureTableProperties.RGBA);
|
|
240
|
+
|
|
241
|
+
case 15:
|
|
242
|
+
if (dracoBuffer) {
|
|
243
|
+
_context2.next = 17;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return _context2.abrupt("return", true);
|
|
248
|
+
|
|
249
|
+
case 17:
|
|
250
|
+
dracoData = {
|
|
251
|
+
buffer: dracoBuffer,
|
|
252
|
+
properties: _objectSpread(_objectSpread({}, dracoFeatureTableProperties), dracoBatchTableProperties),
|
|
253
|
+
featureTableProperties: dracoFeatureTableProperties,
|
|
254
|
+
batchTableProperties: dracoBatchTableProperties,
|
|
255
|
+
dequantizeInShader: false
|
|
256
|
+
};
|
|
257
|
+
_context2.next = 20;
|
|
258
|
+
return loadDraco(tile, dracoData, options, context);
|
|
259
|
+
|
|
260
|
+
case 20:
|
|
261
|
+
return _context2.abrupt("return", _context2.sent);
|
|
262
|
+
|
|
263
|
+
case 21:
|
|
264
|
+
case "end":
|
|
265
|
+
return _context2.stop();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, _callee2);
|
|
269
|
+
}));
|
|
270
|
+
return _parseDraco.apply(this, arguments);
|
|
271
|
+
}
|
|
246
272
|
|
|
247
|
-
|
|
273
|
+
function loadDraco(_x11, _x12, _x13, _x14) {
|
|
274
|
+
return _loadDraco.apply(this, arguments);
|
|
275
|
+
}
|
|
248
276
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
277
|
+
function _loadDraco() {
|
|
278
|
+
_loadDraco = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(tile, dracoData, options, context) {
|
|
279
|
+
var parse, dracoOptions, data, decodedPositions, decodedColors, decodedNormals, decodedBatchIds, isQuantizedDraco, isOctEncodedDraco, quantization, range, batchTableAttributes, _i, _Object$keys, attributeName;
|
|
280
|
+
|
|
281
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
282
|
+
while (1) {
|
|
283
|
+
switch (_context3.prev = _context3.next) {
|
|
284
|
+
case 0:
|
|
285
|
+
parse = context.parse;
|
|
286
|
+
dracoOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
287
|
+
draco: _objectSpread(_objectSpread({}, options.draco), {}, {
|
|
288
|
+
extraAttributes: dracoData.batchTableProperties || {}
|
|
289
|
+
})
|
|
290
|
+
});
|
|
291
|
+
delete dracoOptions['3d-tiles'];
|
|
292
|
+
_context3.next = 5;
|
|
293
|
+
return parse(dracoData.buffer, _draco.DracoLoader, dracoOptions);
|
|
294
|
+
|
|
295
|
+
case 5:
|
|
296
|
+
data = _context3.sent;
|
|
297
|
+
decodedPositions = data.attributes.POSITION && data.attributes.POSITION.value;
|
|
298
|
+
decodedColors = data.attributes.COLOR_0 && data.attributes.COLOR_0.value;
|
|
299
|
+
decodedNormals = data.attributes.NORMAL && data.attributes.NORMAL.value;
|
|
300
|
+
decodedBatchIds = data.attributes.BATCH_ID && data.attributes.BATCH_ID.value;
|
|
301
|
+
isQuantizedDraco = decodedPositions && data.attributes.POSITION.value.quantization;
|
|
302
|
+
isOctEncodedDraco = decodedNormals && data.attributes.NORMAL.value.quantization;
|
|
303
|
+
|
|
304
|
+
if (isQuantizedDraco) {
|
|
305
|
+
quantization = data.POSITION.data.quantization;
|
|
306
|
+
range = quantization.range;
|
|
307
|
+
tile.quantizedVolumeScale = new _core.Vector3(range, range, range);
|
|
308
|
+
tile.quantizedVolumeOffset = new _core.Vector3(quantization.minValues);
|
|
309
|
+
tile.quantizedRange = (1 << quantization.quantizationBits) - 1.0;
|
|
310
|
+
tile.isQuantizedDraco = true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (isOctEncodedDraco) {
|
|
314
|
+
tile.octEncodedRange = (1 << data.NORMAL.data.quantization.quantizationBits) - 1.0;
|
|
315
|
+
tile.isOctEncodedDraco = true;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
batchTableAttributes = {};
|
|
319
|
+
|
|
320
|
+
if (dracoData.batchTableProperties) {
|
|
321
|
+
for (_i = 0, _Object$keys = Object.keys(dracoData.batchTableProperties); _i < _Object$keys.length; _i++) {
|
|
322
|
+
attributeName = _Object$keys[_i];
|
|
323
|
+
|
|
324
|
+
if (data.attributes[attributeName] && data.attributes[attributeName].value) {
|
|
325
|
+
batchTableAttributes[attributeName.toLowerCase()] = data.attributes[attributeName].value;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
tile.attributes = _objectSpread({
|
|
331
|
+
positions: decodedPositions,
|
|
332
|
+
colors: (0, _normalize3dTileColors.normalize3DTileColorAttribute)(tile, decodedColors, undefined),
|
|
333
|
+
normals: decodedNormals,
|
|
334
|
+
batchIds: decodedBatchIds
|
|
335
|
+
}, batchTableAttributes);
|
|
336
|
+
|
|
337
|
+
case 17:
|
|
338
|
+
case "end":
|
|
339
|
+
return _context3.stop();
|
|
340
|
+
}
|
|
253
341
|
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
tile.attributes = {
|
|
258
|
-
positions: decodedPositions,
|
|
259
|
-
colors: (0, _normalize3dTileColors.normalize3DTileColorAttribute)(tile, decodedColors, undefined),
|
|
260
|
-
normals: decodedNormals,
|
|
261
|
-
batchIds: decodedBatchIds,
|
|
262
|
-
...batchTableAttributes
|
|
263
|
-
};
|
|
342
|
+
}, _callee3);
|
|
343
|
+
}));
|
|
344
|
+
return _loadDraco.apply(this, arguments);
|
|
264
345
|
}
|
|
265
346
|
//# sourceMappingURL=parse-3d-tile-point-cloud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/parsers/parse-3d-tile-point-cloud.ts"],"names":["parsePointCloud3DTile","tile","arrayBuffer","byteOffset","options","context","initializeTile","featureTable","batchTable","parsePointCloudTables","parseDraco","parsePositions","parseColors","parseNormals","attributes","positions","colors","normals","batchIds","isQuantized","isTranslucent","isRGB565","isOctEncoded16P","Tile3DFeatureTable","featureTableJson","featureTableBinary","pointsLength","getGlobalProperty","Number","isFinite","Error","featuresLength","pointCount","rtcCenter","GL","FLOAT","parseBatchIds","hasProperty","getPropertyArray","UNSIGNED_SHORT","quantizedRange","quantizedVolumeScale","quantizedVolumeOffset","UNSIGNED_BYTE","constantRGBA","batchFeatureLength","batchTableJson","batchTableBinary","Tile3DBatchTable","dracoBuffer","dracoFeatureTableProperties","dracoBatchTableProperties","batchTableDraco","extensions","properties","featureTableDraco","getExtension","dracoByteOffset","dracoByteLength","byteLength","slice","hasPositions","POSITION","hasColors","RGB","RGBA","hasNormals","NORMAL","hasBatchIds","BATCH_ID","dracoData","buffer","featureTableProperties","batchTableProperties","dequantizeInShader","loadDraco","parse","dracoOptions","draco","extraAttributes","data","DracoLoader","decodedPositions","value","decodedColors","COLOR_0","decodedNormals","decodedBatchIds","isQuantizedDraco","quantization","isOctEncodedDraco","range","Vector3","minValues","quantizationBits","octEncodedRange","batchTableAttributes","attributeName","Object","keys","toLowerCase","undefined"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,eAAeA,qBAAf,CAAqCC,IAArC,EAA2CC,WAA3C,EAAwDC,UAAxD,EAAoEC,OAApE,EAA6EC,OAA7E,EAAsF;AAC3FF,EAAAA,UAAU,GAAG,8CAAsBF,IAAtB,EAA4BC,WAA5B,EAAyCC,UAAzC,CAAb;AACAA,EAAAA,UAAU,GAAG,oDAA4BF,IAA5B,EAAkCC,WAAlC,EAA+CC,UAA/C,CAAb;AACAA,EAAAA,UAAU,GAAG,8CAAsBF,IAAtB,EAA4BC,WAA5B,EAAyCC,UAAzC,EAAqDC,OAArD,CAAb;AACAE,EAAAA,cAAc,CAACL,IAAD,CAAd;AAEA,QAAM;AAACM,IAAAA,YAAD;AAAeC,IAAAA;AAAf,MAA6BC,qBAAqB,CAACR,IAAD,CAAxD;AAEA,QAAMS,UAAU,CAACT,IAAD,EAAOM,YAAP,EAAqBC,UAArB,EAAiCJ,OAAjC,EAA0CC,OAA1C,CAAhB;AAEAM,EAAAA,cAAc,CAACV,IAAD,EAAOM,YAAP,EAAqBH,OAArB,CAAd;AACAQ,EAAAA,WAAW,CAACX,IAAD,EAAOM,YAAP,EAAqBC,UAArB,CAAX;AACAK,EAAAA,YAAY,CAACZ,IAAD,EAAOM,YAAP,CAAZ;AAEA,SAAOJ,UAAP;AACD;;AAED,SAASG,cAAT,CAAwBL,IAAxB,EAA8B;AAE5BA,EAAAA,IAAI,CAACa,UAAL,GAAkB;AAChBC,IAAAA,SAAS,EAAE,IADK;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AAZ,CAAiBS,YAAjB,CAA8BK,gBAApC,IAAwD,GAA/E;AACA7F,IAAAA,IAAI,CAACyF,iBAAL,GAAyB,IAAzB;AACD;;AAGD,QAAMM,oBAAoB,GAAG,EAA7B;;AACA,MAAI1B,SAAS,CAACG,oBAAd,EAAoC;AAClC,SAAK,MAAMwB,aAAX,IAA4BC,MAAM,CAACC,IAAP,CAAY7B,SAAS,CAACG,oBAAtB,CAA5B,EAAyE;AACvE,UAAIO,IAAI,CAAClE,UAAL,CAAgBmF,aAAhB,KAAkCjB,IAAI,CAAClE,UAAL,CAAgBmF,aAAhB,EAA+Bd,KAArE,EAA4E;AAC1Ea,QAAAA,oBAAoB,CAACC,aAAa,CAACG,WAAd,EAAD,CAApB,GAAoDpB,IAAI,CAAClE,UAAL,CAAgBmF,aAAhB,EAA+Bd,KAAnF;AACD;AACF;AACF;;AAEDlF,EAAAA,IAAI,CAACa,UAAL,GAAkB;AAChBC,IAAAA,SAAS,EAAEmE,gBADK;AAEhBlE,IAAAA,MAAM,EAAE,0DAA8Bf,IAA9B,EAAoCmF,aAApC,EAAmDiB,SAAnD,CAFQ;AAGhBpF,IAAAA,OAAO,EAAEqE,cAHO;AAIhBpE,IAAAA,QAAQ,EAAEqE,eAJM;AAKhB,OAAGS;AALa,GAAlB;AAOD","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 {DracoLoader} from '@loaders.gl/draco';\nimport {GL} from '@loaders.gl/math';\nimport {Vector3} from '@math.gl/core';\n\nimport Tile3DFeatureTable from '../classes/tile-3d-feature-table';\nimport Tile3DBatchTable from '../classes/tile-3d-batch-table';\nimport {parse3DTileHeaderSync} from './helpers/parse-3d-tile-header';\nimport {parse3DTileTablesHeaderSync, parse3DTileTablesSync} from './helpers/parse-3d-tile-tables';\nimport {normalize3DTileColorAttribute} from './helpers/normalize-3d-tile-colors';\nimport {normalize3DTileNormalAttribute} from './helpers/normalize-3d-tile-normals';\nimport {normalize3DTilePositionAttribute} from './helpers/normalize-3d-tile-positions';\n\nexport async function parsePointCloud3DTile(tile, arrayBuffer, byteOffset, options, context) {\n byteOffset = parse3DTileHeaderSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileTablesHeaderSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileTablesSync(tile, arrayBuffer, byteOffset, options);\n initializeTile(tile);\n\n const {featureTable, batchTable} = parsePointCloudTables(tile);\n\n await parseDraco(tile, featureTable, batchTable, options, context);\n\n parsePositions(tile, featureTable, options);\n parseColors(tile, featureTable, batchTable);\n parseNormals(tile, featureTable);\n\n return byteOffset;\n}\n\nfunction initializeTile(tile) {\n // Initialize point cloud tile defaults\n tile.attributes = {\n positions: null,\n colors: null,\n normals: null,\n batchIds: null\n };\n tile.isQuantized = false;\n tile.isTranslucent = false;\n tile.isRGB565 = false;\n tile.isOctEncoded16P = false;\n}\n\nfunction parsePointCloudTables(tile) {\n const featureTable = new Tile3DFeatureTable(tile.featureTableJson, tile.featureTableBinary);\n\n const pointsLength = featureTable.getGlobalProperty('POINTS_LENGTH');\n if (!Number.isFinite(pointsLength)) {\n throw new Error('POINTS_LENGTH must be defined');\n }\n featureTable.featuresLength = pointsLength;\n\n tile.featuresLength = pointsLength;\n tile.pointsLength = pointsLength;\n tile.pointCount = pointsLength;\n\n tile.rtcCenter = featureTable.getGlobalProperty('RTC_CENTER', GL.FLOAT, 3);\n\n const batchTable = parseBatchIds(tile, featureTable);\n\n return {featureTable, batchTable};\n}\n\nfunction parsePositions(tile, featureTable, options) {\n if (!tile.attributes.positions) {\n if (featureTable.hasProperty('POSITION')) {\n tile.attributes.positions = featureTable.getPropertyArray('POSITION', GL.FLOAT, 3);\n } else if (featureTable.hasProperty('POSITION_QUANTIZED')) {\n const positions = featureTable.getPropertyArray('POSITION_QUANTIZED', GL.UNSIGNED_SHORT, 3);\n\n tile.isQuantized = true;\n tile.quantizedRange = (1 << 16) - 1;\n\n tile.quantizedVolumeScale = featureTable.getGlobalProperty(\n 'QUANTIZED_VOLUME_SCALE',\n GL.FLOAT,\n 3\n );\n if (!tile.quantizedVolumeScale) {\n throw new Error('QUANTIZED_VOLUME_SCALE must be defined for quantized positions.');\n }\n\n tile.quantizedVolumeOffset = featureTable.getGlobalProperty(\n 'QUANTIZED_VOLUME_OFFSET',\n GL.FLOAT,\n 3\n );\n if (!tile.quantizedVolumeOffset) {\n throw new Error('QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.');\n }\n\n tile.attributes.positions = normalize3DTilePositionAttribute(tile, positions, options);\n }\n }\n\n if (!tile.attributes.positions) {\n throw new Error('Either POSITION or POSITION_QUANTIZED must be defined.');\n }\n}\n\nfunction parseColors(tile, featureTable, batchTable) {\n if (!tile.attributes.colors) {\n let colors = null;\n if (featureTable.hasProperty('RGBA')) {\n colors = featureTable.getPropertyArray('RGBA', GL.UNSIGNED_BYTE, 4);\n tile.isTranslucent = true;\n } else if (featureTable.hasProperty('RGB')) {\n colors = featureTable.getPropertyArray('RGB', GL.UNSIGNED_BYTE, 3);\n } else if (featureTable.hasProperty('RGB565')) {\n colors = featureTable.getPropertyArray('RGB565', GL.UNSIGNED_SHORT, 1);\n tile.isRGB565 = true;\n }\n\n tile.attributes.colors = normalize3DTileColorAttribute(tile, colors, batchTable);\n }\n\n if (featureTable.hasProperty('CONSTANT_RGBA')) {\n tile.constantRGBA = featureTable.getGlobalProperty('CONSTANT_RGBA', GL.UNSIGNED_BYTE, 4);\n }\n}\n\nfunction parseNormals(tile, featureTable) {\n if (!tile.attributes.normals) {\n let normals = null;\n if (featureTable.hasProperty('NORMAL')) {\n normals = featureTable.getPropertyArray('NORMAL', GL.FLOAT, 3);\n } else if (featureTable.hasProperty('NORMAL_OCT16P')) {\n normals = featureTable.getPropertyArray('NORMAL_OCT16P', GL.UNSIGNED_BYTE, 2);\n tile.isOctEncoded16P = true;\n }\n\n tile.attributes.normals = normalize3DTileNormalAttribute(tile, normals);\n }\n}\n\nfunction parseBatchIds(tile, featureTable) {\n let batchTable: Tile3DBatchTable | null = null;\n if (!tile.batchIds && featureTable.hasProperty('BATCH_ID')) {\n tile.batchIds = featureTable.getPropertyArray('BATCH_ID', GL.UNSIGNED_SHORT, 1);\n\n if (tile.batchIds) {\n const batchFeatureLength = featureTable.getGlobalProperty('BATCH_LENGTH');\n if (!batchFeatureLength) {\n throw new Error('Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.');\n }\n const {batchTableJson, batchTableBinary} = tile;\n batchTable = new Tile3DBatchTable(batchTableJson, batchTableBinary, batchFeatureLength);\n }\n }\n return batchTable;\n}\n\n// eslint-disable-next-line complexity\nasync function parseDraco(tile, featureTable, batchTable, options, context) {\n let dracoBuffer;\n let dracoFeatureTableProperties;\n let dracoBatchTableProperties;\n const batchTableDraco =\n tile.batchTableJson &&\n tile.batchTableJson.extensions &&\n tile.batchTableJson.extensions['3DTILES_draco_point_compression'];\n if (batchTableDraco) {\n dracoBatchTableProperties = batchTableDraco.properties;\n }\n\n const featureTableDraco = featureTable.getExtension('3DTILES_draco_point_compression');\n if (featureTableDraco) {\n dracoFeatureTableProperties = featureTableDraco.properties;\n const dracoByteOffset = featureTableDraco.byteOffset;\n const dracoByteLength = featureTableDraco.byteLength;\n if (!dracoFeatureTableProperties || !Number.isFinite(dracoByteOffset) || !dracoByteLength) {\n throw new Error('Draco properties, byteOffset, and byteLength must be defined');\n }\n\n dracoBuffer = tile.featureTableBinary.slice(dracoByteOffset, dracoByteOffset + dracoByteLength);\n\n tile.hasPositions = Number.isFinite(dracoFeatureTableProperties.POSITION);\n tile.hasColors =\n Number.isFinite(dracoFeatureTableProperties.RGB) ||\n Number.isFinite(dracoFeatureTableProperties.RGBA);\n tile.hasNormals = Number.isFinite(dracoFeatureTableProperties.NORMAL);\n tile.hasBatchIds = Number.isFinite(dracoFeatureTableProperties.BATCH_ID);\n tile.isTranslucent = Number.isFinite(dracoFeatureTableProperties.RGBA);\n }\n\n if (!dracoBuffer) {\n return true;\n }\n\n const dracoData = {\n buffer: dracoBuffer,\n properties: {...dracoFeatureTableProperties, ...dracoBatchTableProperties},\n featureTableProperties: dracoFeatureTableProperties,\n batchTableProperties: dracoBatchTableProperties,\n dequantizeInShader: false\n };\n\n return await loadDraco(tile, dracoData, options, context);\n}\n\n// eslint-disable-next-line complexity, max-statements\nexport async function loadDraco(tile, dracoData, options, context) {\n const {parse} = context;\n const dracoOptions = {\n ...options,\n draco: {\n ...options.draco,\n extraAttributes: dracoData.batchTableProperties || {}\n }\n };\n\n // The entire tileset might be included, too expensive to serialize\n delete dracoOptions['3d-tiles'];\n\n const data = await parse(dracoData.buffer, DracoLoader, dracoOptions);\n\n const decodedPositions = data.attributes.POSITION && data.attributes.POSITION.value;\n const decodedColors = data.attributes.COLOR_0 && data.attributes.COLOR_0.value;\n const decodedNormals = data.attributes.NORMAL && data.attributes.NORMAL.value;\n const decodedBatchIds = data.attributes.BATCH_ID && data.attributes.BATCH_ID.value;\n const isQuantizedDraco = decodedPositions && data.attributes.POSITION.value.quantization;\n const isOctEncodedDraco = decodedNormals && data.attributes.NORMAL.value.quantization;\n if (isQuantizedDraco) {\n // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n const quantization = data.POSITION.data.quantization;\n const range = quantization.range;\n tile.quantizedVolumeScale = new Vector3(range, range, range);\n tile.quantizedVolumeOffset = new Vector3(quantization.minValues);\n tile.quantizedRange = (1 << quantization.quantizationBits) - 1.0;\n tile.isQuantizedDraco = true;\n }\n if (isOctEncodedDraco) {\n tile.octEncodedRange = (1 << data.NORMAL.data.quantization.quantizationBits) - 1.0;\n tile.isOctEncodedDraco = true;\n }\n\n // Extra batch table attributes\n const batchTableAttributes = {};\n if (dracoData.batchTableProperties) {\n for (const attributeName of Object.keys(dracoData.batchTableProperties)) {\n if (data.attributes[attributeName] && data.attributes[attributeName].value) {\n batchTableAttributes[attributeName.toLowerCase()] = data.attributes[attributeName].value;\n }\n }\n }\n\n tile.attributes = {\n positions: decodedPositions,\n colors: normalize3DTileColorAttribute(tile, decodedColors, undefined),\n normals: decodedNormals,\n batchIds: decodedBatchIds,\n ...batchTableAttributes\n };\n}\n\n// TODO - this is the remaining code from Cesium's parser\n/*\n const batchTable = new Tile3DBatchTable(tile);\n\n // parseDracoBuffer(tile, featureTable, batchTable);\n\n if (!tile.attributes.positions) {\n throw new Error('Either POSITION or POSITION_QUANTIZED must be defined.');\n }\n}\n/*\n\n if (!tile.attributes.positions) {\n if (featureTable.hasProperty('POSITION')) {\n tile.attributes.positions = featureTable.getPropertyArray('POSITION', GL.FLOAT, 3);\n } else if (featureTable.hasProperty('POSITION_QUANTIZED')) {\n tile.attributes.positions = featureTable.getPropertyArray('POSITION_QUANTIZED', GL.UNSIGNED_SHORT, 3);\n\n\n if (!tile.colors) {\n if (featureTable.hasProperty('RGBA')) {\n tile.colors = featureTable.getPropertyArray('RGBA', GL.UNSIGNED_BYTE, 4);\n tile.isTranslucent = true;\n } else if (featureTable.hasProperty('RGB')) {\n tile.colors = featureTable.getPropertyArray('RGB', GL.UNSIGNED_BYTE, 3);\n } else if (featureTable.hasPropertry('RGB565')) {\n tile.colors = featureTable.getPropertyArray('RGB565', GL.UNSIGNED_SHORT, 1);\n tile.isRGB565 = true;\n }\n }\n\n if (!tile.attributes.normals) {\n if (featureTable.getPropertry('NORMAL')) {\n tile.attributes.normals = featureTable.getPropertyArray('NORMAL', GL.FLOAT, 3);\n } else if (featureTable.getProperty('NORMAL_OCT16P')) {\n tile.attributes.normals = featureTable.getPropertyArray('NORMAL_OCT16P', GL.UNSIGNED_BYTE, 2);\n tile.isOctEncoded16P = true;\n }\n }\n\n if (!tile.batchIds) {\n if (featureTable.hasProperty('BATCH_ID')) {\n tile.batchIds = featureTable.getPropertyArray('BATCH_ID', GL.UNSIGNED_SHORT, 1);\n }\n }\n\n if (!tile.attributes.positions) {\n throw new Error('Either POSITION or POSITION_QUANTIZED must be defined.');\n }\n\n if (featureTable.getPropertry('CONSTANT_RGBA')) {\n tile.constantRGBA = featureTable.getGlobalProperty('CONSTANT_RGBA', GL.UNSIGNED_BYTE, 4);\n }\n\n if (tile.batchIds) {\n const batchLength = featureTable.getGlobalProperty('BATCH_LENGTH');\n if (!defined(batchLength)) {\n throw new Error('Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.');\n }\n\n if (defined(batchTableBinary)) {\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n }\n\n if (defined(pointCloud._batchTableLoaded)) {\n pointCloud._batchTableLoaded(batchLength, batchTableJson, batchTableBinary);\n }\n }\n\n // If points are not batched and there are per-point properties, use these properties for styling purposes\n var styleableProperties;\n if (!hasBatchIds && defined(batchTableBinary)) {\n tile.styleableProperties = Cesium3DTileBatchTable.getBinaryProperties(\n pointsLength,\n batchTableJson,\n batchTableBinary\n );\n }\n\n tile.draco = draco;\n}\n\n// Separate parsing and decoding of Draco\nexport function parseDracoBuffer(tile, featureTable, batchTable) {\n let dracoBuffer;\n let dracoFeatureTableProperties;\n let dracoBatchTableProperties;\n\n const batchTableDraco = batchTable.getExtension('3DTILES_draco_point_compression');\n if (batchTableDraco) {\n dracoBatchTableProperties = batchTableDraco.properties;\n }\n\n const featureTableDraco = featureTable.getExtension('3DTILES_draco_point_compression');\n if (featureTableDraco) {\n dracoFeatureTableProperties = featureTableDraco.properties;\n const dracoByteOffset = featureTableDraco.byteOffset;\n const dracoByteLength = featureTableDraco.byteLength;\n if (!dracoFeatureTableProperties || !dracoByteOffset || !dracoByteLength) {\n throw new Error('Draco properties, byteOffset, and byteLength must be defined');\n }\n\n dracoBuffer = arraySlice(\n featureTableBinary,\n dracoByteOffset,\n dracoByteOffset + dracoByteLength\n );\n tile.hasPositions = dracoFeatureTableProperties.POSITION;\n tile.hasColors = dracoFeatureTableProperties.RGB || dracoFeatureTableProperties.RGBA;\n tile.hasNormals = dracoFeatureTableProperties.NORMAL;\n tile.hasBatchIds = dracoFeatureTableProperties.BATCH_ID;\n tile.isTranslucent = dracoFeatureTableProperties.RGBA;\n }\n\n if (dracoBuffer) {\n tile.draco = {\n buffer: dracoBuffer,\n properties: {...dracoFeatureTableProperties, ...dracoBatchTableProperties},\n featureTableProperties: dracoFeatureTableProperties,\n batchTableProperties: dracoBatchTableProperties,\n dequantizeInShader: false\n };\n\n tile.decodingState = DECODING_STATE.NEEDS_DECODE;\n }\n}\n\n/*\nfunction decodeDraco(tile, context) {\n if (tile.decodingState === DECODING_STATE.READY) {\n return false;\n }\n if (tile.decodingState === DECODING_STATE.NEEDS_DECODE) {\n var parsedContent = tile._parsedContent;\n var draco = parsedContent.draco;\n var decodePromise = DracoLoader.decodePointCloud(draco, context);\n if (defined(decodePromise)) {\n tile.decodingState = DECODING_STATE.DECODING;\n decodePromise.then(function(result) {\n tile.decodingState = DECODING_STATE.READY;\n var decodedPositions = defined(result.POSITION) ? result.POSITION.array : undefined;\n var decodedRgb = defined(result.RGB) ? result.RGB.array : undefined;\n var decodedRgba = defined(result.RGBA) ? result.RGBA.array : undefined;\n var decodedNormals = defined(result.NORMAL) ? result.NORMAL.array : undefined;\n var decodedBatchIds = defined(result.BATCH_ID) ? result.BATCH_ID.array : undefined;\n var isQuantizedDraco = defined(decodedPositions) && defined(result.POSITION.data.quantization);\n var isOctEncodedDraco = defined(decodedNormals) && defined(result.NORMAL.data.quantization);\n if (isQuantizedDraco) {\n // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n var quantization = result.POSITION.data.quantization;\n var range = quantization.range;\n tile._quantizedVolumeScale = Cartesian3.fromElements(range, range, range);\n tile._quantizedVolumeOffset = Cartesian3.unpack(quantization.minValues);\n tile._quantizedRange = (1 << quantization.quantizationBits) - 1.0;\n tile._isQuantizedDraco = true;\n }\n if (isOctEncodedDraco) {\n tile._octEncodedRange = (1 << result.NORMAL.data.quantization.quantizationBits) - 1.0;\n tile._isOctEncodedDraco = true;\n }\n var styleableProperties = parsedContent.styleableProperties;\n var batchTableProperties = draco.batchTableProperties;\n for (var name in batchTableProperties) {\n if (batchTableProperties.hasOwnProperty(name)) {\n var property = result[name];\n if (!defined(styleableProperties)) {\n styleableProperties = {};\n }\n styleableProperties[name] = {\n typedArray : property.array,\n componentCount : property.data.componentsPerAttribute\n };\n }\n }\n parsedContent.positions = defaultValue(decodedPositions, parsedContent.positions);\n parsedContent.colors = defaultValue(defaultValue(decodedRgba, decodedRgb), parsedContent.colors);\n parsedContent.normals = defaultValue(decodedNormals, parsedContent.normals);\n parsedContent.batchIds = defaultValue(decodedBatchIds, parsedContent.batchIds);\n parsedContent.styleableProperties = styleableProperties;\n }).otherwise(function(error) {\n tile.decodingState = DECODING_STATE.FAILED;\n tile._readyPromise.reject(error);\n });\n }\n }\n return true;\n}\n*/\n"],"file":"parse-3d-tile-point-cloud.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/parsers/parse-3d-tile-point-cloud.ts"],"names":["parsePointCloud3DTile","tile","arrayBuffer","byteOffset","options","context","initializeTile","parsePointCloudTables","featureTable","batchTable","parseDraco","parsePositions","parseColors","parseNormals","attributes","positions","colors","normals","batchIds","isQuantized","isTranslucent","isRGB565","isOctEncoded16P","Tile3DFeatureTable","featureTableJson","featureTableBinary","pointsLength","getGlobalProperty","Number","isFinite","Error","featuresLength","pointCount","rtcCenter","GL","FLOAT","parseBatchIds","hasProperty","getPropertyArray","UNSIGNED_SHORT","quantizedRange","quantizedVolumeScale","quantizedVolumeOffset","UNSIGNED_BYTE","constantRGBA","batchFeatureLength","batchTableJson","batchTableBinary","Tile3DBatchTable","batchTableDraco","extensions","dracoBatchTableProperties","properties","featureTableDraco","getExtension","dracoFeatureTableProperties","dracoByteOffset","dracoByteLength","byteLength","dracoBuffer","slice","hasPositions","POSITION","hasColors","RGB","RGBA","hasNormals","NORMAL","hasBatchIds","BATCH_ID","dracoData","buffer","featureTableProperties","batchTableProperties","dequantizeInShader","loadDraco","parse","dracoOptions","draco","extraAttributes","DracoLoader","data","decodedPositions","value","decodedColors","COLOR_0","decodedNormals","decodedBatchIds","isQuantizedDraco","quantization","isOctEncodedDraco","range","Vector3","minValues","quantizationBits","octEncodedRange","batchTableAttributes","Object","keys","attributeName","toLowerCase","undefined"],"mappings":";;;;;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;SAEsBA,qB;;;;;qFAAf,iBAAqCC,IAArC,EAA2CC,WAA3C,EAAwDC,UAAxD,EAAoEC,OAApE,EAA6EC,OAA7E;AAAA;;AAAA;AAAA;AAAA;AAAA;AACLF,YAAAA,UAAU,GAAG,8CAAsBF,IAAtB,EAA4BC,WAA5B,EAAyCC,UAAzC,CAAb;AACAA,YAAAA,UAAU,GAAG,oDAA4BF,IAA5B,EAAkCC,WAAlC,EAA+CC,UAA/C,CAAb;AACAA,YAAAA,UAAU,GAAG,8CAAsBF,IAAtB,EAA4BC,WAA5B,EAAyCC,UAAzC,EAAqDC,OAArD,CAAb;AACAE,YAAAA,cAAc,CAACL,IAAD,CAAd;AAJK,oCAM8BM,qBAAqB,CAACN,IAAD,CANnD,EAMEO,YANF,yBAMEA,YANF,EAMgBC,UANhB,yBAMgBA,UANhB;AAAA;AAAA,mBAQCC,UAAU,CAACT,IAAD,EAAOO,YAAP,EAAqBC,UAArB,EAAiCL,OAAjC,EAA0CC,OAA1C,CARX;;AAAA;AAULM,YAAAA,cAAc,CAACV,IAAD,EAAOO,YAAP,EAAqBJ,OAArB,CAAd;AACAQ,YAAAA,WAAW,CAACX,IAAD,EAAOO,YAAP,EAAqBC,UAArB,CAAX;AACAI,YAAAA,YAAY,CAACZ,IAAD,EAAOO,YAAP,CAAZ;AAZK,6CAcEL,UAdF;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AAiBP,S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AACyC,qBAAL,GAA6B,IAAIkD,aAAJ,CAAYH,YAAY,CAACI,SAAzB,CAA7B;AACA5F,cAAAA,IAAI,CAACuC,cAAL,GAAsB,CAAC,KAAKiD,YAAY,CAACK,gBAAnB,IAAuC,GAA7D;AACA7F,cAAAA,IAAI,CAACuF,gBAAL,GAAwB,IAAxB;AACD;;AACD,gBAAIE,iBAAJ,EAAuB;AACrBzF,cAAAA,IAAI,CAAC8F,eAAL,GAAuB,CAAC,KAAKd,IAAI,CAACd,MAAL,CAAYc,IAAZ,CAAiBQ,YAAjB,CAA8BK,gBAApC,IAAwD,GAA/E;AACA7F,cAAAA,IAAI,CAACyF,iBAAL,GAAyB,IAAzB;AACD;;AAGKM,YAAAA,oBArCD,GAqCwB,EArCxB;;AAsCL,gBAAI1B,SAAS,CAACG,oBAAd,EAAoC;AAClC,0CAA4BwB,MAAM,CAACC,IAAP,CAAY5B,SAAS,CAACG,oBAAtB,CAA5B,kCAAyE;AAA9D0B,gBAAAA,aAA8D;;AACvE,oBAAIlB,IAAI,CAACnE,UAAL,CAAgBqF,aAAhB,KAAkClB,IAAI,CAACnE,UAAL,CAAgBqF,aAAhB,EAA+BhB,KAArE,EAA4E;AAC1Ea,kBAAAA,oBAAoB,CAACG,aAAa,CAACC,WAAd,EAAD,CAApB,GAAoDnB,IAAI,CAACnE,UAAL,CAAgBqF,aAAhB,EAA+BhB,KAAnF;AACD;AACF;AACF;;AAEDlF,YAAAA,IAAI,CAACa,UAAL;AACEC,cAAAA,SAAS,EAAEmE,gBADb;AAEElE,cAAAA,MAAM,EAAE,0DAA8Bf,IAA9B,EAAoCmF,aAApC,EAAmDiB,SAAnD,CAFV;AAGEpF,cAAAA,OAAO,EAAEqE,cAHX;AAIEpE,cAAAA,QAAQ,EAAEqE;AAJZ,eAKKS,oBALL;;AA9CK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","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 {DracoLoader} from '@loaders.gl/draco';\nimport {GL} from '@loaders.gl/math';\nimport {Vector3} from '@math.gl/core';\n\nimport Tile3DFeatureTable from '../classes/tile-3d-feature-table';\nimport Tile3DBatchTable from '../classes/tile-3d-batch-table';\nimport {parse3DTileHeaderSync} from './helpers/parse-3d-tile-header';\nimport {parse3DTileTablesHeaderSync, parse3DTileTablesSync} from './helpers/parse-3d-tile-tables';\nimport {normalize3DTileColorAttribute} from './helpers/normalize-3d-tile-colors';\nimport {normalize3DTileNormalAttribute} from './helpers/normalize-3d-tile-normals';\nimport {normalize3DTilePositionAttribute} from './helpers/normalize-3d-tile-positions';\n\nexport async function parsePointCloud3DTile(tile, arrayBuffer, byteOffset, options, context) {\n byteOffset = parse3DTileHeaderSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileTablesHeaderSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileTablesSync(tile, arrayBuffer, byteOffset, options);\n initializeTile(tile);\n\n const {featureTable, batchTable} = parsePointCloudTables(tile);\n\n await parseDraco(tile, featureTable, batchTable, options, context);\n\n parsePositions(tile, featureTable, options);\n parseColors(tile, featureTable, batchTable);\n parseNormals(tile, featureTable);\n\n return byteOffset;\n}\n\nfunction initializeTile(tile) {\n // Initialize point cloud tile defaults\n tile.attributes = {\n positions: null,\n colors: null,\n normals: null,\n batchIds: null\n };\n tile.isQuantized = false;\n tile.isTranslucent = false;\n tile.isRGB565 = false;\n tile.isOctEncoded16P = false;\n}\n\nfunction parsePointCloudTables(tile) {\n const featureTable = new Tile3DFeatureTable(tile.featureTableJson, tile.featureTableBinary);\n\n const pointsLength = featureTable.getGlobalProperty('POINTS_LENGTH');\n if (!Number.isFinite(pointsLength)) {\n throw new Error('POINTS_LENGTH must be defined');\n }\n featureTable.featuresLength = pointsLength;\n\n tile.featuresLength = pointsLength;\n tile.pointsLength = pointsLength;\n tile.pointCount = pointsLength;\n\n tile.rtcCenter = featureTable.getGlobalProperty('RTC_CENTER', GL.FLOAT, 3);\n\n const batchTable = parseBatchIds(tile, featureTable);\n\n return {featureTable, batchTable};\n}\n\nfunction parsePositions(tile, featureTable, options) {\n if (!tile.attributes.positions) {\n if (featureTable.hasProperty('POSITION')) {\n tile.attributes.positions = featureTable.getPropertyArray('POSITION', GL.FLOAT, 3);\n } else if (featureTable.hasProperty('POSITION_QUANTIZED')) {\n const positions = featureTable.getPropertyArray('POSITION_QUANTIZED', GL.UNSIGNED_SHORT, 3);\n\n tile.isQuantized = true;\n tile.quantizedRange = (1 << 16) - 1;\n\n tile.quantizedVolumeScale = featureTable.getGlobalProperty(\n 'QUANTIZED_VOLUME_SCALE',\n GL.FLOAT,\n 3\n );\n if (!tile.quantizedVolumeScale) {\n throw new Error('QUANTIZED_VOLUME_SCALE must be defined for quantized positions.');\n }\n\n tile.quantizedVolumeOffset = featureTable.getGlobalProperty(\n 'QUANTIZED_VOLUME_OFFSET',\n GL.FLOAT,\n 3\n );\n if (!tile.quantizedVolumeOffset) {\n throw new Error('QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.');\n }\n\n tile.attributes.positions = normalize3DTilePositionAttribute(tile, positions, options);\n }\n }\n\n if (!tile.attributes.positions) {\n throw new Error('Either POSITION or POSITION_QUANTIZED must be defined.');\n }\n}\n\nfunction parseColors(tile, featureTable, batchTable) {\n if (!tile.attributes.colors) {\n let colors = null;\n if (featureTable.hasProperty('RGBA')) {\n colors = featureTable.getPropertyArray('RGBA', GL.UNSIGNED_BYTE, 4);\n tile.isTranslucent = true;\n } else if (featureTable.hasProperty('RGB')) {\n colors = featureTable.getPropertyArray('RGB', GL.UNSIGNED_BYTE, 3);\n } else if (featureTable.hasProperty('RGB565')) {\n colors = featureTable.getPropertyArray('RGB565', GL.UNSIGNED_SHORT, 1);\n tile.isRGB565 = true;\n }\n\n tile.attributes.colors = normalize3DTileColorAttribute(tile, colors, batchTable);\n }\n\n if (featureTable.hasProperty('CONSTANT_RGBA')) {\n tile.constantRGBA = featureTable.getGlobalProperty('CONSTANT_RGBA', GL.UNSIGNED_BYTE, 4);\n }\n}\n\nfunction parseNormals(tile, featureTable) {\n if (!tile.attributes.normals) {\n let normals = null;\n if (featureTable.hasProperty('NORMAL')) {\n normals = featureTable.getPropertyArray('NORMAL', GL.FLOAT, 3);\n } else if (featureTable.hasProperty('NORMAL_OCT16P')) {\n normals = featureTable.getPropertyArray('NORMAL_OCT16P', GL.UNSIGNED_BYTE, 2);\n tile.isOctEncoded16P = true;\n }\n\n tile.attributes.normals = normalize3DTileNormalAttribute(tile, normals);\n }\n}\n\nfunction parseBatchIds(tile, featureTable) {\n let batchTable: Tile3DBatchTable | null = null;\n if (!tile.batchIds && featureTable.hasProperty('BATCH_ID')) {\n tile.batchIds = featureTable.getPropertyArray('BATCH_ID', GL.UNSIGNED_SHORT, 1);\n\n if (tile.batchIds) {\n const batchFeatureLength = featureTable.getGlobalProperty('BATCH_LENGTH');\n if (!batchFeatureLength) {\n throw new Error('Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.');\n }\n const {batchTableJson, batchTableBinary} = tile;\n batchTable = new Tile3DBatchTable(batchTableJson, batchTableBinary, batchFeatureLength);\n }\n }\n return batchTable;\n}\n\n// eslint-disable-next-line complexity\nasync function parseDraco(tile, featureTable, batchTable, options, context) {\n let dracoBuffer;\n let dracoFeatureTableProperties;\n let dracoBatchTableProperties;\n const batchTableDraco =\n tile.batchTableJson &&\n tile.batchTableJson.extensions &&\n tile.batchTableJson.extensions['3DTILES_draco_point_compression'];\n if (batchTableDraco) {\n dracoBatchTableProperties = batchTableDraco.properties;\n }\n\n const featureTableDraco = featureTable.getExtension('3DTILES_draco_point_compression');\n if (featureTableDraco) {\n dracoFeatureTableProperties = featureTableDraco.properties;\n const dracoByteOffset = featureTableDraco.byteOffset;\n const dracoByteLength = featureTableDraco.byteLength;\n if (!dracoFeatureTableProperties || !Number.isFinite(dracoByteOffset) || !dracoByteLength) {\n throw new Error('Draco properties, byteOffset, and byteLength must be defined');\n }\n\n dracoBuffer = tile.featureTableBinary.slice(dracoByteOffset, dracoByteOffset + dracoByteLength);\n\n tile.hasPositions = Number.isFinite(dracoFeatureTableProperties.POSITION);\n tile.hasColors =\n Number.isFinite(dracoFeatureTableProperties.RGB) ||\n Number.isFinite(dracoFeatureTableProperties.RGBA);\n tile.hasNormals = Number.isFinite(dracoFeatureTableProperties.NORMAL);\n tile.hasBatchIds = Number.isFinite(dracoFeatureTableProperties.BATCH_ID);\n tile.isTranslucent = Number.isFinite(dracoFeatureTableProperties.RGBA);\n }\n\n if (!dracoBuffer) {\n return true;\n }\n\n const dracoData = {\n buffer: dracoBuffer,\n properties: {...dracoFeatureTableProperties, ...dracoBatchTableProperties},\n featureTableProperties: dracoFeatureTableProperties,\n batchTableProperties: dracoBatchTableProperties,\n dequantizeInShader: false\n };\n\n return await loadDraco(tile, dracoData, options, context);\n}\n\n// eslint-disable-next-line complexity, max-statements\nexport async function loadDraco(tile, dracoData, options, context) {\n const {parse} = context;\n const dracoOptions = {\n ...options,\n draco: {\n ...options.draco,\n extraAttributes: dracoData.batchTableProperties || {}\n }\n };\n\n // The entire tileset might be included, too expensive to serialize\n delete dracoOptions['3d-tiles'];\n\n const data = await parse(dracoData.buffer, DracoLoader, dracoOptions);\n\n const decodedPositions = data.attributes.POSITION && data.attributes.POSITION.value;\n const decodedColors = data.attributes.COLOR_0 && data.attributes.COLOR_0.value;\n const decodedNormals = data.attributes.NORMAL && data.attributes.NORMAL.value;\n const decodedBatchIds = data.attributes.BATCH_ID && data.attributes.BATCH_ID.value;\n const isQuantizedDraco = decodedPositions && data.attributes.POSITION.value.quantization;\n const isOctEncodedDraco = decodedNormals && data.attributes.NORMAL.value.quantization;\n if (isQuantizedDraco) {\n // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n const quantization = data.POSITION.data.quantization;\n const range = quantization.range;\n tile.quantizedVolumeScale = new Vector3(range, range, range);\n tile.quantizedVolumeOffset = new Vector3(quantization.minValues);\n tile.quantizedRange = (1 << quantization.quantizationBits) - 1.0;\n tile.isQuantizedDraco = true;\n }\n if (isOctEncodedDraco) {\n tile.octEncodedRange = (1 << data.NORMAL.data.quantization.quantizationBits) - 1.0;\n tile.isOctEncodedDraco = true;\n }\n\n // Extra batch table attributes\n const batchTableAttributes = {};\n if (dracoData.batchTableProperties) {\n for (const attributeName of Object.keys(dracoData.batchTableProperties)) {\n if (data.attributes[attributeName] && data.attributes[attributeName].value) {\n batchTableAttributes[attributeName.toLowerCase()] = data.attributes[attributeName].value;\n }\n }\n }\n\n tile.attributes = {\n positions: decodedPositions,\n colors: normalize3DTileColorAttribute(tile, decodedColors, undefined),\n normals: decodedNormals,\n batchIds: decodedBatchIds,\n ...batchTableAttributes\n };\n}\n\n// TODO - this is the remaining code from Cesium's parser\n/*\n const batchTable = new Tile3DBatchTable(tile);\n\n // parseDracoBuffer(tile, featureTable, batchTable);\n\n if (!tile.attributes.positions) {\n throw new Error('Either POSITION or POSITION_QUANTIZED must be defined.');\n }\n}\n/*\n\n if (!tile.attributes.positions) {\n if (featureTable.hasProperty('POSITION')) {\n tile.attributes.positions = featureTable.getPropertyArray('POSITION', GL.FLOAT, 3);\n } else if (featureTable.hasProperty('POSITION_QUANTIZED')) {\n tile.attributes.positions = featureTable.getPropertyArray('POSITION_QUANTIZED', GL.UNSIGNED_SHORT, 3);\n\n\n if (!tile.colors) {\n if (featureTable.hasProperty('RGBA')) {\n tile.colors = featureTable.getPropertyArray('RGBA', GL.UNSIGNED_BYTE, 4);\n tile.isTranslucent = true;\n } else if (featureTable.hasProperty('RGB')) {\n tile.colors = featureTable.getPropertyArray('RGB', GL.UNSIGNED_BYTE, 3);\n } else if (featureTable.hasPropertry('RGB565')) {\n tile.colors = featureTable.getPropertyArray('RGB565', GL.UNSIGNED_SHORT, 1);\n tile.isRGB565 = true;\n }\n }\n\n if (!tile.attributes.normals) {\n if (featureTable.getPropertry('NORMAL')) {\n tile.attributes.normals = featureTable.getPropertyArray('NORMAL', GL.FLOAT, 3);\n } else if (featureTable.getProperty('NORMAL_OCT16P')) {\n tile.attributes.normals = featureTable.getPropertyArray('NORMAL_OCT16P', GL.UNSIGNED_BYTE, 2);\n tile.isOctEncoded16P = true;\n }\n }\n\n if (!tile.batchIds) {\n if (featureTable.hasProperty('BATCH_ID')) {\n tile.batchIds = featureTable.getPropertyArray('BATCH_ID', GL.UNSIGNED_SHORT, 1);\n }\n }\n\n if (!tile.attributes.positions) {\n throw new Error('Either POSITION or POSITION_QUANTIZED must be defined.');\n }\n\n if (featureTable.getPropertry('CONSTANT_RGBA')) {\n tile.constantRGBA = featureTable.getGlobalProperty('CONSTANT_RGBA', GL.UNSIGNED_BYTE, 4);\n }\n\n if (tile.batchIds) {\n const batchLength = featureTable.getGlobalProperty('BATCH_LENGTH');\n if (!defined(batchLength)) {\n throw new Error('Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.');\n }\n\n if (defined(batchTableBinary)) {\n // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed\n batchTableBinary = new Uint8Array(batchTableBinary);\n }\n\n if (defined(pointCloud._batchTableLoaded)) {\n pointCloud._batchTableLoaded(batchLength, batchTableJson, batchTableBinary);\n }\n }\n\n // If points are not batched and there are per-point properties, use these properties for styling purposes\n var styleableProperties;\n if (!hasBatchIds && defined(batchTableBinary)) {\n tile.styleableProperties = Cesium3DTileBatchTable.getBinaryProperties(\n pointsLength,\n batchTableJson,\n batchTableBinary\n );\n }\n\n tile.draco = draco;\n}\n\n// Separate parsing and decoding of Draco\nexport function parseDracoBuffer(tile, featureTable, batchTable) {\n let dracoBuffer;\n let dracoFeatureTableProperties;\n let dracoBatchTableProperties;\n\n const batchTableDraco = batchTable.getExtension('3DTILES_draco_point_compression');\n if (batchTableDraco) {\n dracoBatchTableProperties = batchTableDraco.properties;\n }\n\n const featureTableDraco = featureTable.getExtension('3DTILES_draco_point_compression');\n if (featureTableDraco) {\n dracoFeatureTableProperties = featureTableDraco.properties;\n const dracoByteOffset = featureTableDraco.byteOffset;\n const dracoByteLength = featureTableDraco.byteLength;\n if (!dracoFeatureTableProperties || !dracoByteOffset || !dracoByteLength) {\n throw new Error('Draco properties, byteOffset, and byteLength must be defined');\n }\n\n dracoBuffer = arraySlice(\n featureTableBinary,\n dracoByteOffset,\n dracoByteOffset + dracoByteLength\n );\n tile.hasPositions = dracoFeatureTableProperties.POSITION;\n tile.hasColors = dracoFeatureTableProperties.RGB || dracoFeatureTableProperties.RGBA;\n tile.hasNormals = dracoFeatureTableProperties.NORMAL;\n tile.hasBatchIds = dracoFeatureTableProperties.BATCH_ID;\n tile.isTranslucent = dracoFeatureTableProperties.RGBA;\n }\n\n if (dracoBuffer) {\n tile.draco = {\n buffer: dracoBuffer,\n properties: {...dracoFeatureTableProperties, ...dracoBatchTableProperties},\n featureTableProperties: dracoFeatureTableProperties,\n batchTableProperties: dracoBatchTableProperties,\n dequantizeInShader: false\n };\n\n tile.decodingState = DECODING_STATE.NEEDS_DECODE;\n }\n}\n\n/*\nfunction decodeDraco(tile, context) {\n if (tile.decodingState === DECODING_STATE.READY) {\n return false;\n }\n if (tile.decodingState === DECODING_STATE.NEEDS_DECODE) {\n var parsedContent = tile._parsedContent;\n var draco = parsedContent.draco;\n var decodePromise = DracoLoader.decodePointCloud(draco, context);\n if (defined(decodePromise)) {\n tile.decodingState = DECODING_STATE.DECODING;\n decodePromise.then(function(result) {\n tile.decodingState = DECODING_STATE.READY;\n var decodedPositions = defined(result.POSITION) ? result.POSITION.array : undefined;\n var decodedRgb = defined(result.RGB) ? result.RGB.array : undefined;\n var decodedRgba = defined(result.RGBA) ? result.RGBA.array : undefined;\n var decodedNormals = defined(result.NORMAL) ? result.NORMAL.array : undefined;\n var decodedBatchIds = defined(result.BATCH_ID) ? result.BATCH_ID.array : undefined;\n var isQuantizedDraco = defined(decodedPositions) && defined(result.POSITION.data.quantization);\n var isOctEncodedDraco = defined(decodedNormals) && defined(result.NORMAL.data.quantization);\n if (isQuantizedDraco) {\n // Draco quantization range == quantized volume scale - size in meters of the quantized volume\n // Internal quantized range is the range of values of the quantized data, e.g. 255 for 8-bit, 1023 for 10-bit, etc\n var quantization = result.POSITION.data.quantization;\n var range = quantization.range;\n tile._quantizedVolumeScale = Cartesian3.fromElements(range, range, range);\n tile._quantizedVolumeOffset = Cartesian3.unpack(quantization.minValues);\n tile._quantizedRange = (1 << quantization.quantizationBits) - 1.0;\n tile._isQuantizedDraco = true;\n }\n if (isOctEncodedDraco) {\n tile._octEncodedRange = (1 << result.NORMAL.data.quantization.quantizationBits) - 1.0;\n tile._isOctEncodedDraco = true;\n }\n var styleableProperties = parsedContent.styleableProperties;\n var batchTableProperties = draco.batchTableProperties;\n for (var name in batchTableProperties) {\n if (batchTableProperties.hasOwnProperty(name)) {\n var property = result[name];\n if (!defined(styleableProperties)) {\n styleableProperties = {};\n }\n styleableProperties[name] = {\n typedArray : property.array,\n componentCount : property.data.componentsPerAttribute\n };\n }\n }\n parsedContent.positions = defaultValue(decodedPositions, parsedContent.positions);\n parsedContent.colors = defaultValue(defaultValue(decodedRgba, decodedRgb), parsedContent.colors);\n parsedContent.normals = defaultValue(decodedNormals, parsedContent.normals);\n parsedContent.batchIds = defaultValue(decodedBatchIds, parsedContent.batchIds);\n parsedContent.styleableProperties = styleableProperties;\n }).otherwise(function(error) {\n tile.decodingState = DECODING_STATE.FAILED;\n tile._readyPromise.reject(error);\n });\n }\n }\n return true;\n}\n*/\n"],"file":"parse-3d-tile-point-cloud.js"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.parse3DTile = parse3DTile;
|
|
7
9
|
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
|
|
8
14
|
var _constants = require("../constants");
|
|
9
15
|
|
|
10
16
|
var _parseUtils = require("./helpers/parse-utils");
|
|
@@ -17,25 +23,78 @@ var _parse3dTileInstancedModel = require("./parse-3d-tile-instanced-model");
|
|
|
17
23
|
|
|
18
24
|
var _parse3dTileComposite = require("./parse-3d-tile-composite");
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
var _parse3dTileGltf = require("./parse-3d-tile-gltf");
|
|
27
|
+
|
|
28
|
+
function parse3DTile(_x) {
|
|
29
|
+
return _parse3DTile.apply(this, arguments);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _parse3DTile() {
|
|
33
|
+
_parse3DTile = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(arrayBuffer) {
|
|
34
|
+
var byteOffset,
|
|
35
|
+
options,
|
|
36
|
+
context,
|
|
37
|
+
tile,
|
|
38
|
+
_args = arguments;
|
|
39
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
40
|
+
while (1) {
|
|
41
|
+
switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
byteOffset = _args.length > 1 && _args[1] !== undefined ? _args[1] : 0;
|
|
44
|
+
options = _args.length > 2 ? _args[2] : undefined;
|
|
45
|
+
context = _args.length > 3 ? _args[3] : undefined;
|
|
46
|
+
tile = _args.length > 4 && _args[4] !== undefined ? _args[4] : {};
|
|
47
|
+
tile.byteOffset = byteOffset;
|
|
48
|
+
tile.type = (0, _parseUtils.getMagicString)(arrayBuffer, byteOffset);
|
|
49
|
+
_context.t0 = tile.type;
|
|
50
|
+
_context.next = _context.t0 === _constants.TILE3D_TYPE.COMPOSITE ? 9 : _context.t0 === _constants.TILE3D_TYPE.BATCHED_3D_MODEL ? 12 : _context.t0 === _constants.TILE3D_TYPE.GLTF ? 15 : _context.t0 === _constants.TILE3D_TYPE.INSTANCED_3D_MODEL ? 18 : _context.t0 === _constants.TILE3D_TYPE.POINT_CLOUD ? 21 : 24;
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case 9:
|
|
54
|
+
_context.next = 11;
|
|
55
|
+
return (0, _parse3dTileComposite.parseComposite3DTile)(tile, arrayBuffer, byteOffset, options, context, parse3DTile);
|
|
56
|
+
|
|
57
|
+
case 11:
|
|
58
|
+
return _context.abrupt("return", _context.sent);
|
|
59
|
+
|
|
60
|
+
case 12:
|
|
61
|
+
_context.next = 14;
|
|
62
|
+
return (0, _parse3dTileBatchedModel.parseBatchedModel3DTile)(tile, arrayBuffer, byteOffset, options, context);
|
|
63
|
+
|
|
64
|
+
case 14:
|
|
65
|
+
return _context.abrupt("return", _context.sent);
|
|
66
|
+
|
|
67
|
+
case 15:
|
|
68
|
+
_context.next = 17;
|
|
69
|
+
return (0, _parse3dTileGltf.parseGltf3DTile)(tile, arrayBuffer, options, context);
|
|
70
|
+
|
|
71
|
+
case 17:
|
|
72
|
+
return _context.abrupt("return", _context.sent);
|
|
73
|
+
|
|
74
|
+
case 18:
|
|
75
|
+
_context.next = 20;
|
|
76
|
+
return (0, _parse3dTileInstancedModel.parseInstancedModel3DTile)(tile, arrayBuffer, byteOffset, options, context);
|
|
23
77
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return await (0, _parse3dTileComposite.parseComposite3DTile)(tile, arrayBuffer, byteOffset, options, context, parse3DTile);
|
|
78
|
+
case 20:
|
|
79
|
+
return _context.abrupt("return", _context.sent);
|
|
27
80
|
|
|
28
|
-
|
|
29
|
-
|
|
81
|
+
case 21:
|
|
82
|
+
_context.next = 23;
|
|
83
|
+
return (0, _parse3dTilePointCloud.parsePointCloud3DTile)(tile, arrayBuffer, byteOffset, options, context);
|
|
30
84
|
|
|
31
|
-
|
|
32
|
-
|
|
85
|
+
case 23:
|
|
86
|
+
return _context.abrupt("return", _context.sent);
|
|
33
87
|
|
|
34
|
-
|
|
35
|
-
|
|
88
|
+
case 24:
|
|
89
|
+
throw new Error("3DTileLoader: unknown type ".concat(tile.type));
|
|
36
90
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
91
|
+
case 25:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, _callee);
|
|
97
|
+
}));
|
|
98
|
+
return _parse3DTile.apply(this, arguments);
|
|
40
99
|
}
|
|
41
100
|
//# sourceMappingURL=parse-3d-tile.js.map
|