bruce-cesium 7.3.1 → 7.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bruce-cesium.es5.js +154 -120
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +152 -118
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-gatherer.js +9 -1
- package/dist/lib/rendering/entity-gatherer.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +49 -47
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +49 -48
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +44 -21
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +2 -2
- package/dist/types/rendering/render-managers/tilesets/tileset-entities-render-manager.d.ts +2 -2
- package/dist/types/rendering/visuals-register.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -9114,12 +9114,13 @@
|
|
|
9114
9114
|
ReassignMenuItem(params) {
|
|
9115
9115
|
var _a;
|
|
9116
9116
|
const { fromMenuItemId, toMenuItemId, toMenuItemType, toPriority, requestRender, source, lazy, onBatch, onComplete } = params;
|
|
9117
|
+
const noop = () => { };
|
|
9117
9118
|
if (!fromMenuItemId || !toMenuItemId || fromMenuItemId === toMenuItemId) {
|
|
9118
|
-
return;
|
|
9119
|
+
return noop;
|
|
9119
9120
|
}
|
|
9120
9121
|
const entityIds = this.entityIdsByMenuItem[fromMenuItemId];
|
|
9121
9122
|
if (!entityIds) {
|
|
9122
|
-
return;
|
|
9123
|
+
return noop;
|
|
9123
9124
|
}
|
|
9124
9125
|
const idsSnapshot = Array.from(entityIds);
|
|
9125
9126
|
const regoSnapshot = new Map();
|
|
@@ -9130,7 +9131,7 @@
|
|
|
9130
9131
|
}
|
|
9131
9132
|
}
|
|
9132
9133
|
const reassignOne = (entityId) => {
|
|
9133
|
-
var _a, _b;
|
|
9134
|
+
var _a, _b, _c;
|
|
9134
9135
|
const regos = this.rego[entityId];
|
|
9135
9136
|
if (!regos) {
|
|
9136
9137
|
return null;
|
|
@@ -9149,6 +9150,7 @@
|
|
|
9149
9150
|
}
|
|
9150
9151
|
rego.menuItemId = toMenuItemId;
|
|
9151
9152
|
rego.menuItemType = toMenuItemType;
|
|
9153
|
+
const priorityChanged = toPriority != null && rego.priority !== toPriority;
|
|
9152
9154
|
if (toPriority != null) {
|
|
9153
9155
|
rego.priority = toPriority;
|
|
9154
9156
|
}
|
|
@@ -9174,15 +9176,17 @@
|
|
|
9174
9176
|
}
|
|
9175
9177
|
this.unindexMenuItemEntityIfAbsent(fromMenuItemId, entityId);
|
|
9176
9178
|
this.indexMenuItemEntity(toMenuItemId, entityId);
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9179
|
+
// Don't queue if no register-level visual changes are required.
|
|
9180
|
+
if (priorityChanged || ((_c = this.states[entityId]) === null || _c === void 0 ? void 0 : _c[toMenuItemId])) {
|
|
9181
|
+
this.queueUpdate({
|
|
9182
|
+
entityId,
|
|
9183
|
+
refresh: true
|
|
9184
|
+
});
|
|
9185
|
+
}
|
|
9181
9186
|
return rego;
|
|
9182
9187
|
};
|
|
9183
9188
|
if (lazy) {
|
|
9184
|
-
this.startLazyReassign(idsSnapshot, reassignOne, requestRender, onBatch, onComplete);
|
|
9185
|
-
return;
|
|
9189
|
+
return this.startLazyReassign(idsSnapshot, reassignOne, requestRender, onBatch, onComplete);
|
|
9186
9190
|
}
|
|
9187
9191
|
for (const entityId of idsSnapshot) {
|
|
9188
9192
|
reassignOne(entityId);
|
|
@@ -9190,17 +9194,12 @@
|
|
|
9190
9194
|
if (requestRender != false) {
|
|
9191
9195
|
this.viewer.scene.requestRender();
|
|
9192
9196
|
}
|
|
9197
|
+
return noop;
|
|
9193
9198
|
}
|
|
9194
9199
|
startLazyReassign(entityIds, reassignOne, requestRender, onBatch, onComplete) {
|
|
9195
9200
|
const BATCH_SIZE = 5000;
|
|
9196
9201
|
let index = 0;
|
|
9197
|
-
const
|
|
9198
|
-
if (this.Disposed) {
|
|
9199
|
-
clearInterval(interval);
|
|
9200
|
-
this.activeChunkedIntervals.delete(interval);
|
|
9201
|
-
return;
|
|
9202
|
-
}
|
|
9203
|
-
const end = Math.min(index + BATCH_SIZE, entityIds.length);
|
|
9202
|
+
const runTo = (end) => {
|
|
9204
9203
|
const batch = [];
|
|
9205
9204
|
for (; index < end; index++) {
|
|
9206
9205
|
const rego = reassignOne(entityIds[index]);
|
|
@@ -9214,6 +9213,14 @@
|
|
|
9214
9213
|
if (requestRender != false) {
|
|
9215
9214
|
this.viewer.scene.requestRender();
|
|
9216
9215
|
}
|
|
9216
|
+
};
|
|
9217
|
+
const interval = setInterval(() => {
|
|
9218
|
+
if (this.Disposed) {
|
|
9219
|
+
clearInterval(interval);
|
|
9220
|
+
this.activeChunkedIntervals.delete(interval);
|
|
9221
|
+
return;
|
|
9222
|
+
}
|
|
9223
|
+
runTo(Math.min(index + BATCH_SIZE, entityIds.length));
|
|
9217
9224
|
if (index >= entityIds.length) {
|
|
9218
9225
|
clearInterval(interval);
|
|
9219
9226
|
this.activeChunkedIntervals.delete(interval);
|
|
@@ -9221,6 +9228,14 @@
|
|
|
9221
9228
|
}
|
|
9222
9229
|
}, 10);
|
|
9223
9230
|
this.activeChunkedIntervals.add(interval);
|
|
9231
|
+
return (finishRemaining) => {
|
|
9232
|
+
clearInterval(interval);
|
|
9233
|
+
this.activeChunkedIntervals.delete(interval);
|
|
9234
|
+
if (finishRemaining && !this.Disposed) {
|
|
9235
|
+
runTo(entityIds.length);
|
|
9236
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
9237
|
+
}
|
|
9238
|
+
};
|
|
9224
9239
|
}
|
|
9225
9240
|
/**
|
|
9226
9241
|
* Locates a visual corresponding to a given entity id.
|
|
@@ -9343,7 +9358,7 @@
|
|
|
9343
9358
|
}
|
|
9344
9359
|
}
|
|
9345
9360
|
const removeOne = (entityId) => {
|
|
9346
|
-
var _a;
|
|
9361
|
+
var _a, _b;
|
|
9347
9362
|
const entityRegos = this.rego[entityId];
|
|
9348
9363
|
if (!entityRegos) {
|
|
9349
9364
|
return;
|
|
@@ -9382,15 +9397,24 @@
|
|
|
9382
9397
|
if (source !== EUpdateSource.TREE_CASCADE) {
|
|
9383
9398
|
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(update);
|
|
9384
9399
|
}
|
|
9385
|
-
|
|
9400
|
+
// Only worth refreshing while the Entity is still drawn by something else, since
|
|
9401
|
+
// losing this rego can change which of the survivors wins. With none left there is
|
|
9402
|
+
// nothing to restyle, and queueing one per removed Entity is what turns disabling a
|
|
9403
|
+
// large menu item into minutes of scheduled work.
|
|
9404
|
+
if (doesInclude && ((_b = this.rego[entityId]) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
9386
9405
|
this.queueUpdate({
|
|
9387
9406
|
entityId: entityId,
|
|
9388
9407
|
refresh: false
|
|
9389
9408
|
});
|
|
9390
9409
|
}
|
|
9391
9410
|
};
|
|
9411
|
+
const finish = () => {
|
|
9412
|
+
this.releaseMenuItemCollection(menuItemId);
|
|
9413
|
+
this.RemoveTilesetsByMenuItem(menuItemId);
|
|
9414
|
+
onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
9415
|
+
};
|
|
9392
9416
|
if (lazy) {
|
|
9393
|
-
this.startLazyRemoval(entityIds, removeOne,
|
|
9417
|
+
this.startLazyRemoval(entityIds, removeOne, finish);
|
|
9394
9418
|
return;
|
|
9395
9419
|
}
|
|
9396
9420
|
WithSuspendedCCollections(this.allSceneCollections(), () => {
|
|
@@ -9398,8 +9422,7 @@
|
|
|
9398
9422
|
removeOne(entityId);
|
|
9399
9423
|
}
|
|
9400
9424
|
});
|
|
9401
|
-
|
|
9402
|
-
this.RemoveTilesetsByMenuItem(menuItemId);
|
|
9425
|
+
finish();
|
|
9403
9426
|
}
|
|
9404
9427
|
else if (entityId) {
|
|
9405
9428
|
const entityRegos = this.rego[entityId];
|
|
@@ -14371,6 +14394,14 @@
|
|
|
14371
14394
|
this.disposed = true;
|
|
14372
14395
|
this.hDisposals.forEach((d) => d());
|
|
14373
14396
|
this.hDisposals = [];
|
|
14397
|
+
// A tick still awaiting a response resumes after this, and anything left here would have it
|
|
14398
|
+
// ask for the whole set again on the way out.
|
|
14399
|
+
this.eIdQueue = [];
|
|
14400
|
+
this.eIdQueued.clear();
|
|
14401
|
+
this.priorityCount = 0;
|
|
14402
|
+
this.allEIds.clear();
|
|
14403
|
+
this.lastFoundDateTimes.clear();
|
|
14404
|
+
this.entityDataOverrides.clear();
|
|
14374
14405
|
}
|
|
14375
14406
|
checkRange(force) {
|
|
14376
14407
|
const min = this.viewer.clock.startTime.toString();
|
|
@@ -14383,7 +14414,7 @@
|
|
|
14383
14414
|
}
|
|
14384
14415
|
}
|
|
14385
14416
|
onTick(force) {
|
|
14386
|
-
if (this.runningTick) {
|
|
14417
|
+
if (this.runningTick || this.disposed) {
|
|
14387
14418
|
return;
|
|
14388
14419
|
}
|
|
14389
14420
|
const rTime = this.viewer.clock.currentTime.toString();
|
|
@@ -16182,9 +16213,12 @@
|
|
|
16182
16213
|
// Removal callbacks for this instance's own tile stream listeners.
|
|
16183
16214
|
this.tileLoadRemoval = null;
|
|
16184
16215
|
this.tileUnloadRemoval = null;
|
|
16185
|
-
//
|
|
16186
|
-
// synchronous pass over potentially millions of regos.
|
|
16187
|
-
this.
|
|
16216
|
+
// Cancels AdoptHandoff()'s chunked re-parent of handed-off content, which runs across ticks
|
|
16217
|
+
// instead of one synchronous pass over potentially millions of regos.
|
|
16218
|
+
this.handoffReassignCancel = null;
|
|
16219
|
+
// Menu item the in-flight re-parent is still pulling regos off, so a teardown mid-swap can
|
|
16220
|
+
// clear both sides rather than orphaning whatever had not moved yet.
|
|
16221
|
+
this.handoffSourceMenuItemId = null;
|
|
16188
16222
|
this.styler = new exports.TilesetRenderEngine.Styler();
|
|
16189
16223
|
this.modelTreeUpdate = new BModels.BruceEvent();
|
|
16190
16224
|
// Quick look-up of the model tree nodes by entity/geomId.
|
|
@@ -16513,7 +16547,7 @@
|
|
|
16513
16547
|
}
|
|
16514
16548
|
// Returns null (fall back to a normal Dispose()) if the tileset hasn't finished loading yet.
|
|
16515
16549
|
PrepareHandoff() {
|
|
16516
|
-
var _a, _b, _c;
|
|
16550
|
+
var _a, _b, _c, _d;
|
|
16517
16551
|
if (this.disposed || !this.cTileset || this.cTileset.isDestroyed()) {
|
|
16518
16552
|
return null;
|
|
16519
16553
|
}
|
|
@@ -16525,15 +16559,15 @@
|
|
|
16525
16559
|
clearInterval(this.featureQueueInterval);
|
|
16526
16560
|
this.featureQueueInterval = null;
|
|
16527
16561
|
}
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
|
|
16531
|
-
|
|
16562
|
+
// Settle a re-parent still in flight, so what is handed on is not split across two menu items.
|
|
16563
|
+
(_a = this.handoffReassignCancel) === null || _a === void 0 ? void 0 : _a.call(this, true);
|
|
16564
|
+
this.handoffReassignCancel = null;
|
|
16565
|
+
this.handoffSourceMenuItemId = null;
|
|
16532
16566
|
// Not transferred, the receiving manager sets up its own fresh copy if needed.
|
|
16533
16567
|
this.viewerDateTimeDispose();
|
|
16534
|
-
(
|
|
16535
|
-
(
|
|
16536
|
-
(
|
|
16568
|
+
(_b = this.styler) === null || _b === void 0 ? void 0 : _b.Dispose();
|
|
16569
|
+
(_c = this.tileLoadRemoval) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
16570
|
+
(_d = this.tileUnloadRemoval) === null || _d === void 0 ? void 0 : _d.call(this);
|
|
16537
16571
|
this.tileLoadRemoval = null;
|
|
16538
16572
|
this.tileUnloadRemoval = null;
|
|
16539
16573
|
const payload = {
|
|
@@ -16583,13 +16617,6 @@
|
|
|
16583
16617
|
}
|
|
16584
16618
|
});
|
|
16585
16619
|
// Same visuals, same registrations so just re-keyed onto this menu item.
|
|
16586
|
-
this.visualsManager.ReassignMenuItem({
|
|
16587
|
-
fromMenuItemId: payload.sourceMenuItemId,
|
|
16588
|
-
toMenuItemId: this.item.id,
|
|
16589
|
-
toMenuItemType: this.item.Type,
|
|
16590
|
-
toPriority: this.renderPriority,
|
|
16591
|
-
requestRender: false
|
|
16592
|
-
});
|
|
16593
16620
|
this.onCTilesetLoad();
|
|
16594
16621
|
this.styler.Init({
|
|
16595
16622
|
viewer: this.viewer,
|
|
@@ -16603,33 +16630,32 @@
|
|
|
16603
16630
|
scenario: (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.Scenario,
|
|
16604
16631
|
historic: (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.historic,
|
|
16605
16632
|
});
|
|
16606
|
-
|
|
16633
|
+
// A swap runs inside a render pass, so re-parenting a whole tileset in one go stalls it.
|
|
16634
|
+
// Each batch is restyled as it lands rather than after a second walk of the same set.
|
|
16635
|
+
this.handoffSourceMenuItemId = payload.sourceMenuItemId;
|
|
16636
|
+
this.handoffReassignCancel = this.visualsManager.ReassignMenuItem({
|
|
16637
|
+
fromMenuItemId: payload.sourceMenuItemId,
|
|
16638
|
+
toMenuItemId: this.item.id,
|
|
16639
|
+
toMenuItemType: this.item.Type,
|
|
16640
|
+
toPriority: this.renderPriority,
|
|
16641
|
+
requestRender: false,
|
|
16642
|
+
lazy: true,
|
|
16643
|
+
onBatch: (regos) => {
|
|
16644
|
+
if (this.disposed) {
|
|
16645
|
+
return;
|
|
16646
|
+
}
|
|
16647
|
+
this.styler.QueueEntities(regos, true);
|
|
16648
|
+
},
|
|
16649
|
+
onComplete: () => {
|
|
16650
|
+
this.handoffReassignCancel = null;
|
|
16651
|
+
this.handoffSourceMenuItemId = null;
|
|
16652
|
+
}
|
|
16653
|
+
});
|
|
16607
16654
|
this.viewer.scene.requestRender();
|
|
16608
16655
|
if (((_d = this.item.BruceEntity) === null || _d === void 0 ? void 0 : _d.historic) && this.tileset) {
|
|
16609
16656
|
this.viewerDateTimeSub(this.tileset);
|
|
16610
16657
|
}
|
|
16611
16658
|
}
|
|
16612
|
-
queueHandoffRestyle(regos) {
|
|
16613
|
-
if (!regos.length) {
|
|
16614
|
-
return;
|
|
16615
|
-
}
|
|
16616
|
-
const BATCH_SIZE = 5000;
|
|
16617
|
-
let index = 0;
|
|
16618
|
-
this.handoffRestyleInterval = setInterval(() => {
|
|
16619
|
-
if (this.disposed) {
|
|
16620
|
-
clearInterval(this.handoffRestyleInterval);
|
|
16621
|
-
this.handoffRestyleInterval = null;
|
|
16622
|
-
return;
|
|
16623
|
-
}
|
|
16624
|
-
const end = Math.min(index + BATCH_SIZE, regos.length);
|
|
16625
|
-
this.styler.QueueEntities(regos.slice(index, end), true);
|
|
16626
|
-
index = end;
|
|
16627
|
-
if (index >= regos.length) {
|
|
16628
|
-
clearInterval(this.handoffRestyleInterval);
|
|
16629
|
-
this.handoffRestyleInterval = null;
|
|
16630
|
-
}
|
|
16631
|
-
}, 10);
|
|
16632
|
-
}
|
|
16633
16659
|
/**
|
|
16634
16660
|
* @param tile
|
|
16635
16661
|
* @param load indicates if we are loading or unloading the tile.
|
|
@@ -17181,33 +17207,40 @@
|
|
|
17181
17207
|
this.doDispose();
|
|
17182
17208
|
}
|
|
17183
17209
|
doDispose() {
|
|
17184
|
-
var _a, _b;
|
|
17210
|
+
var _a, _b, _c;
|
|
17185
17211
|
if (this.featureQueueInterval) {
|
|
17186
17212
|
clearInterval(this.featureQueueInterval);
|
|
17187
17213
|
this.featureQueueInterval = null;
|
|
17188
17214
|
this.featureQueue = [];
|
|
17189
17215
|
}
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
this.handoffRestyleInterval = null;
|
|
17193
|
-
}
|
|
17216
|
+
(_a = this.handoffReassignCancel) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
17217
|
+
this.handoffReassignCancel = null;
|
|
17194
17218
|
if (this.cTileset) {
|
|
17195
17219
|
const viewer = this.viewer;
|
|
17196
17220
|
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
17197
17221
|
this.cTileset.show = false;
|
|
17198
17222
|
this.viewer.scene.primitives.remove(this.cTileset);
|
|
17199
|
-
(
|
|
17223
|
+
(_b = exports.TilesetRenderEngine.GetMemoryWatcher(viewer)) === null || _b === void 0 ? void 0 : _b.Unwatch(this.cTileset);
|
|
17200
17224
|
this.viewer.scene.requestRender();
|
|
17201
17225
|
}
|
|
17202
17226
|
this.cTileset = null;
|
|
17203
17227
|
}
|
|
17204
|
-
(
|
|
17228
|
+
(_c = this.styler) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
17205
17229
|
this.visualsManager.RemoveRegos({
|
|
17206
17230
|
menuItemId: this.item.id,
|
|
17207
17231
|
doRemove: false,
|
|
17208
17232
|
source: exports.VisualsRegister.EUpdateSource.TILESET_DISPOSE,
|
|
17209
17233
|
lazy: true
|
|
17210
17234
|
});
|
|
17235
|
+
if (this.handoffSourceMenuItemId) {
|
|
17236
|
+
this.visualsManager.RemoveRegos({
|
|
17237
|
+
menuItemId: this.handoffSourceMenuItemId,
|
|
17238
|
+
doRemove: false,
|
|
17239
|
+
source: exports.VisualsRegister.EUpdateSource.TILESET_DISPOSE,
|
|
17240
|
+
lazy: true
|
|
17241
|
+
});
|
|
17242
|
+
this.handoffSourceMenuItemId = null;
|
|
17243
|
+
}
|
|
17211
17244
|
this.viewerDateTimeDispose();
|
|
17212
17245
|
}
|
|
17213
17246
|
async ReRender(params) {
|
|
@@ -19960,9 +19993,12 @@
|
|
|
19960
19993
|
// Removal callbacks for this instance's own tile stream listeners.
|
|
19961
19994
|
this.tileLoadRemoval = null;
|
|
19962
19995
|
this.tileUnloadRemoval = null;
|
|
19963
|
-
//
|
|
19964
|
-
// synchronous pass over potentially millions of regos.
|
|
19965
|
-
this.
|
|
19996
|
+
// Cancels AdoptHandoff()'s chunked re-parent of handed-off content, which runs across ticks
|
|
19997
|
+
// instead of one synchronous pass over potentially millions of regos.
|
|
19998
|
+
this.handoffReassignCancel = null;
|
|
19999
|
+
// Menu item the in-flight re-parent is still pulling regos off, so a teardown mid-swap can
|
|
20000
|
+
// clear both sides rather than orphaning whatever had not moved yet.
|
|
20001
|
+
this.handoffSourceMenuItemId = null;
|
|
19966
20002
|
this.styler = new exports.TilesetRenderEngine.Styler();
|
|
19967
20003
|
// Entity ID -> rego.
|
|
19968
20004
|
// We retain this information as a quick look-up on what has been registered.
|
|
@@ -20275,31 +20311,36 @@
|
|
|
20275
20311
|
this.doDispose();
|
|
20276
20312
|
}
|
|
20277
20313
|
doDispose() {
|
|
20278
|
-
var _a, _b;
|
|
20314
|
+
var _a, _b, _c;
|
|
20279
20315
|
if (this.featureQueueInterval) {
|
|
20280
20316
|
clearInterval(this.featureQueueInterval);
|
|
20281
20317
|
this.featureQueueInterval = null;
|
|
20282
20318
|
this.featureQueue = [];
|
|
20283
20319
|
}
|
|
20284
|
-
|
|
20285
|
-
|
|
20286
|
-
this.handoffRestyleInterval = null;
|
|
20287
|
-
}
|
|
20320
|
+
(_a = this.handoffReassignCancel) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
20321
|
+
this.handoffReassignCancel = null;
|
|
20288
20322
|
if (this.cTileset) {
|
|
20289
20323
|
const viewer = this.viewer;
|
|
20290
20324
|
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.isDestroyed()) && this.viewer.scene.primitives.contains(this.cTileset)) {
|
|
20291
20325
|
this.cTileset.show = false;
|
|
20292
20326
|
this.viewer.scene.primitives.remove(this.cTileset);
|
|
20293
|
-
(
|
|
20327
|
+
(_b = exports.TilesetRenderEngine.GetMemoryWatcher(viewer)) === null || _b === void 0 ? void 0 : _b.Unwatch(this.cTileset);
|
|
20294
20328
|
this.viewer.scene.requestRender();
|
|
20295
20329
|
}
|
|
20296
20330
|
this.cTileset = null;
|
|
20297
20331
|
}
|
|
20298
|
-
(
|
|
20332
|
+
(_c = this.styler) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
20299
20333
|
this.visualsManager.RemoveRegos({
|
|
20300
20334
|
menuItemId: this.item.id,
|
|
20301
20335
|
lazy: true
|
|
20302
20336
|
});
|
|
20337
|
+
if (this.handoffSourceMenuItemId) {
|
|
20338
|
+
this.visualsManager.RemoveRegos({
|
|
20339
|
+
menuItemId: this.handoffSourceMenuItemId,
|
|
20340
|
+
lazy: true
|
|
20341
|
+
});
|
|
20342
|
+
this.handoffSourceMenuItemId = null;
|
|
20343
|
+
}
|
|
20303
20344
|
}
|
|
20304
20345
|
onCTilesetLoad() {
|
|
20305
20346
|
if (this.item.FlyTo) {
|
|
@@ -20339,7 +20380,7 @@
|
|
|
20339
20380
|
}
|
|
20340
20381
|
// Returns null (fall back to a normal Dispose()) if the tileset hasn't finished loading yet.
|
|
20341
20382
|
PrepareHandoff() {
|
|
20342
|
-
var _a, _b, _c;
|
|
20383
|
+
var _a, _b, _c, _d;
|
|
20343
20384
|
if (this.disposed || !this.cTileset || this.cTileset.isDestroyed()) {
|
|
20344
20385
|
return null;
|
|
20345
20386
|
}
|
|
@@ -20351,13 +20392,13 @@
|
|
|
20351
20392
|
clearInterval(this.featureQueueInterval);
|
|
20352
20393
|
this.featureQueueInterval = null;
|
|
20353
20394
|
}
|
|
20354
|
-
|
|
20355
|
-
|
|
20356
|
-
|
|
20357
|
-
|
|
20358
|
-
(
|
|
20359
|
-
(
|
|
20360
|
-
(
|
|
20395
|
+
// Settle a re-parent still in flight, so what is handed on is not split across two menu items.
|
|
20396
|
+
(_a = this.handoffReassignCancel) === null || _a === void 0 ? void 0 : _a.call(this, true);
|
|
20397
|
+
this.handoffReassignCancel = null;
|
|
20398
|
+
this.handoffSourceMenuItemId = null;
|
|
20399
|
+
(_b = this.styler) === null || _b === void 0 ? void 0 : _b.Dispose();
|
|
20400
|
+
(_c = this.tileLoadRemoval) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
20401
|
+
(_d = this.tileUnloadRemoval) === null || _d === void 0 ? void 0 : _d.call(this);
|
|
20361
20402
|
this.tileLoadRemoval = null;
|
|
20362
20403
|
this.tileUnloadRemoval = null;
|
|
20363
20404
|
const payload = {
|
|
@@ -20399,14 +20440,8 @@
|
|
|
20399
20440
|
console.error(e);
|
|
20400
20441
|
}
|
|
20401
20442
|
});
|
|
20402
|
-
this.
|
|
20403
|
-
|
|
20404
|
-
toMenuItemId: this.item.id,
|
|
20405
|
-
toMenuItemType: this.item.Type,
|
|
20406
|
-
toPriority: this.renderPriority,
|
|
20407
|
-
requestRender: false
|
|
20408
|
-
});
|
|
20409
|
-
if (Manager.NeedsStyler(this.item)) {
|
|
20443
|
+
const needsStyler = Manager.NeedsStyler(this.item);
|
|
20444
|
+
if (needsStyler) {
|
|
20410
20445
|
this.styler.Init({
|
|
20411
20446
|
viewer: this.viewer,
|
|
20412
20447
|
api: this.getters.GetBruceApi(),
|
|
@@ -20420,8 +20455,28 @@
|
|
|
20420
20455
|
applyStyles: Boolean(this.item.ApplyStyles),
|
|
20421
20456
|
monitor: this.monitor
|
|
20422
20457
|
});
|
|
20423
|
-
this.queueHandoffRestyle(this.visualsManager.GetRegos({ menuItemId: this.item.id }));
|
|
20424
20458
|
}
|
|
20459
|
+
// A swap runs inside a render pass, so re-parenting a whole Entities Set in one go stalls it.
|
|
20460
|
+
// Each batch is restyled as it lands rather than after a second walk of the same set.
|
|
20461
|
+
this.handoffSourceMenuItemId = payload.sourceMenuItemId;
|
|
20462
|
+
this.handoffReassignCancel = this.visualsManager.ReassignMenuItem({
|
|
20463
|
+
fromMenuItemId: payload.sourceMenuItemId,
|
|
20464
|
+
toMenuItemId: this.item.id,
|
|
20465
|
+
toMenuItemType: this.item.Type,
|
|
20466
|
+
toPriority: this.renderPriority,
|
|
20467
|
+
requestRender: false,
|
|
20468
|
+
lazy: true,
|
|
20469
|
+
onBatch: (regos) => {
|
|
20470
|
+
if (this.disposed || !needsStyler) {
|
|
20471
|
+
return;
|
|
20472
|
+
}
|
|
20473
|
+
this.styler.QueueEntities(regos, true);
|
|
20474
|
+
},
|
|
20475
|
+
onComplete: () => {
|
|
20476
|
+
this.handoffReassignCancel = null;
|
|
20477
|
+
this.handoffSourceMenuItemId = null;
|
|
20478
|
+
}
|
|
20479
|
+
});
|
|
20425
20480
|
this.onCTilesetLoad();
|
|
20426
20481
|
let attenuation = this.item.attenuation;
|
|
20427
20482
|
if (!attenuation && attenuation != false) {
|
|
@@ -20440,27 +20495,6 @@
|
|
|
20440
20495
|
});
|
|
20441
20496
|
this.viewer.scene.requestRender();
|
|
20442
20497
|
}
|
|
20443
|
-
queueHandoffRestyle(regos) {
|
|
20444
|
-
if (!regos.length) {
|
|
20445
|
-
return;
|
|
20446
|
-
}
|
|
20447
|
-
const BATCH_SIZE = 5000;
|
|
20448
|
-
let index = 0;
|
|
20449
|
-
this.handoffRestyleInterval = setInterval(() => {
|
|
20450
|
-
if (this.disposed) {
|
|
20451
|
-
clearInterval(this.handoffRestyleInterval);
|
|
20452
|
-
this.handoffRestyleInterval = null;
|
|
20453
|
-
return;
|
|
20454
|
-
}
|
|
20455
|
-
const end = Math.min(index + BATCH_SIZE, regos.length);
|
|
20456
|
-
this.styler.QueueEntities(regos.slice(index, end), true);
|
|
20457
|
-
index = end;
|
|
20458
|
-
if (index >= regos.length) {
|
|
20459
|
-
clearInterval(this.handoffRestyleInterval);
|
|
20460
|
-
this.handoffRestyleInterval = null;
|
|
20461
|
-
}
|
|
20462
|
-
}, 10);
|
|
20463
|
-
}
|
|
20464
20498
|
/*
|
|
20465
20499
|
* Reads a numeric feature property, returning null for anything that is not one.
|
|
20466
20500
|
*/
|
|
@@ -46256,7 +46290,7 @@ void main() {
|
|
|
46256
46290
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
46257
46291
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
46258
46292
|
|
|
46259
|
-
const VERSION = "7.3.
|
|
46293
|
+
const VERSION = "7.3.2";
|
|
46260
46294
|
/**
|
|
46261
46295
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
46262
46296
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|