bruce-cesium 6.4.4 → 6.4.6
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 +352 -50
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +352 -50
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/menu-item-manager.js +3 -2
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/entity-rerender-maintain-state.js +114 -0
- package/dist/lib/rendering/render-managers/common/entity-rerender-maintain-state.js.map +1 -0
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +43 -4
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +42 -4
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +100 -21
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +32 -7
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +2 -2
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +2 -2
- 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 +2 -2
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-styler.js +20 -5
- package/dist/lib/rendering/tileset-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/menu-item-manager.d.ts +1 -0
- package/dist/types/rendering/render-managers/common/entity-rerender-maintain-state.d.ts +25 -0
- package/dist/types/rendering/render-managers/entities/entities-ids-render-manager.d.ts +3 -1
- package/dist/types/rendering/render-managers/entities/entities-loaded-render-manager.d.ts +2 -0
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +3 -0
- package/dist/types/rendering/render-managers/entities/entity-render-manager.d.ts +2 -0
- package/dist/types/rendering/render-managers/render-manager.d.ts +1 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-arb-render-manager.d.ts +1 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +1 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-entities-render-manager.d.ts +1 -0
- package/dist/types/rendering/tileset-styler.d.ts +2 -1
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -7834,6 +7834,116 @@ class PointClustering {
|
|
|
7834
7834
|
}
|
|
7835
7835
|
}
|
|
7836
7836
|
|
|
7837
|
+
/**
|
|
7838
|
+
* Tracks per-entity rerender state for unsaved blob maintenance and stale API response suppression.
|
|
7839
|
+
*/
|
|
7840
|
+
class EntityReRenderMaintainState {
|
|
7841
|
+
constructor() {
|
|
7842
|
+
this.maintainedEntitiesById = {};
|
|
7843
|
+
this.apiRevisionByEntityId = {};
|
|
7844
|
+
this.skipApiRunByEntityId = {};
|
|
7845
|
+
this.checkRunId = 0;
|
|
7846
|
+
}
|
|
7847
|
+
setMaintainedEntities(entities) {
|
|
7848
|
+
var _a;
|
|
7849
|
+
for (let i = 0; i < entities.length; i++) {
|
|
7850
|
+
const entity = entities[i];
|
|
7851
|
+
const id = (_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
7852
|
+
if (!id) {
|
|
7853
|
+
continue;
|
|
7854
|
+
}
|
|
7855
|
+
this.maintainedEntitiesById[id] = entity;
|
|
7856
|
+
}
|
|
7857
|
+
}
|
|
7858
|
+
clearMaintainedEntities(entityIds) {
|
|
7859
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
7860
|
+
const id = entityIds[i];
|
|
7861
|
+
if (!id) {
|
|
7862
|
+
continue;
|
|
7863
|
+
}
|
|
7864
|
+
delete this.maintainedEntitiesById[id];
|
|
7865
|
+
}
|
|
7866
|
+
}
|
|
7867
|
+
getMaintainedEntities(entityIds) {
|
|
7868
|
+
const entities = [];
|
|
7869
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
7870
|
+
const id = entityIds[i];
|
|
7871
|
+
if (!id) {
|
|
7872
|
+
continue;
|
|
7873
|
+
}
|
|
7874
|
+
const entity = this.maintainedEntitiesById[id];
|
|
7875
|
+
if (entity) {
|
|
7876
|
+
entities.push(entity);
|
|
7877
|
+
}
|
|
7878
|
+
}
|
|
7879
|
+
return entities;
|
|
7880
|
+
}
|
|
7881
|
+
bumpApiRevisions(entityIds) {
|
|
7882
|
+
var _a;
|
|
7883
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
7884
|
+
const id = entityIds[i];
|
|
7885
|
+
if (!id) {
|
|
7886
|
+
continue;
|
|
7887
|
+
}
|
|
7888
|
+
this.apiRevisionByEntityId[id] = ((_a = this.apiRevisionByEntityId[id]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
7889
|
+
}
|
|
7890
|
+
}
|
|
7891
|
+
captureApiRevisions(entityIds) {
|
|
7892
|
+
var _a;
|
|
7893
|
+
const revisions = {};
|
|
7894
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
7895
|
+
const id = entityIds[i];
|
|
7896
|
+
if (!id) {
|
|
7897
|
+
continue;
|
|
7898
|
+
}
|
|
7899
|
+
revisions[id] = (_a = this.apiRevisionByEntityId[id]) !== null && _a !== void 0 ? _a : 0;
|
|
7900
|
+
}
|
|
7901
|
+
return revisions;
|
|
7902
|
+
}
|
|
7903
|
+
startCheckRun() {
|
|
7904
|
+
this.checkRunId += 1;
|
|
7905
|
+
return this.checkRunId;
|
|
7906
|
+
}
|
|
7907
|
+
getCurrentCheckRun() {
|
|
7908
|
+
return this.checkRunId;
|
|
7909
|
+
}
|
|
7910
|
+
markSkipForCurrentRun(entityIds, isRunningCheck) {
|
|
7911
|
+
if (!isRunningCheck) {
|
|
7912
|
+
return;
|
|
7913
|
+
}
|
|
7914
|
+
const runId = this.checkRunId;
|
|
7915
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
7916
|
+
const id = entityIds[i];
|
|
7917
|
+
if (!id) {
|
|
7918
|
+
continue;
|
|
7919
|
+
}
|
|
7920
|
+
this.skipApiRunByEntityId[id] = runId;
|
|
7921
|
+
}
|
|
7922
|
+
}
|
|
7923
|
+
shouldSkipInRun(entityId, runId) {
|
|
7924
|
+
return this.skipApiRunByEntityId[entityId] === runId;
|
|
7925
|
+
}
|
|
7926
|
+
filterNonSkippedIds(entityIds, runId) {
|
|
7927
|
+
return entityIds.filter((id) => {
|
|
7928
|
+
return id && !this.shouldSkipInRun(id, runId);
|
|
7929
|
+
});
|
|
7930
|
+
}
|
|
7931
|
+
filterCurrentApiEntities(params) {
|
|
7932
|
+
const { entities, revisions, runId } = params;
|
|
7933
|
+
return entities.filter((entity) => {
|
|
7934
|
+
var _a, _b, _c;
|
|
7935
|
+
const id = (_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
7936
|
+
if (!id) {
|
|
7937
|
+
return false;
|
|
7938
|
+
}
|
|
7939
|
+
if (runId != null && this.shouldSkipInRun(id, runId)) {
|
|
7940
|
+
return false;
|
|
7941
|
+
}
|
|
7942
|
+
return ((_b = this.apiRevisionByEntityId[id]) !== null && _b !== void 0 ? _b : 0) === ((_c = revisions[id]) !== null && _c !== void 0 ? _c : 0);
|
|
7943
|
+
});
|
|
7944
|
+
}
|
|
7945
|
+
}
|
|
7946
|
+
|
|
7837
7947
|
function isTurfAvailable() {
|
|
7838
7948
|
return window && window.turf != null;
|
|
7839
7949
|
}
|
|
@@ -8208,6 +8318,7 @@ var EntitiesRenderManager;
|
|
|
8208
8318
|
this.renderQueue = [];
|
|
8209
8319
|
this.renderQueueInterval = null;
|
|
8210
8320
|
this.sources = [];
|
|
8321
|
+
this.reRenderState = new EntityReRenderMaintainState();
|
|
8211
8322
|
// Highly experimental flag to try improve rendering large sets of polygons and polylines.
|
|
8212
8323
|
// Many things are not supported when this is enabled.
|
|
8213
8324
|
this.useGeojson = false;
|
|
@@ -8431,6 +8542,20 @@ var EntitiesRenderManager;
|
|
|
8431
8542
|
(_c = this.entityCheckQueue) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
8432
8543
|
this.entityCheckQueue = null;
|
|
8433
8544
|
}
|
|
8545
|
+
preventCurrentCheckApiRefresh(entityIds) {
|
|
8546
|
+
var _a;
|
|
8547
|
+
this.reRenderState.markSkipForCurrentRun(entityIds, this.isRunningCheck);
|
|
8548
|
+
if ((_a = this.entityCheckQueueIds) === null || _a === void 0 ? void 0 : _a.length) {
|
|
8549
|
+
const lookup = {};
|
|
8550
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
8551
|
+
const id = entityIds[i];
|
|
8552
|
+
if (id) {
|
|
8553
|
+
lookup[id] = true;
|
|
8554
|
+
}
|
|
8555
|
+
}
|
|
8556
|
+
this.entityCheckQueueIds = this.entityCheckQueueIds.filter(id => !lookup[id]);
|
|
8557
|
+
}
|
|
8558
|
+
}
|
|
8434
8559
|
Dispose() {
|
|
8435
8560
|
if (this.disposed) {
|
|
8436
8561
|
return;
|
|
@@ -8457,21 +8582,35 @@ var EntitiesRenderManager;
|
|
|
8457
8582
|
this.sources = [];
|
|
8458
8583
|
}
|
|
8459
8584
|
async ReRender(params) {
|
|
8460
|
-
var _a, _b;
|
|
8461
|
-
let { entityIds, force, entities } = params;
|
|
8585
|
+
var _a, _b, _c, _d;
|
|
8586
|
+
let { entityIds, force, entities, maintain } = params;
|
|
8462
8587
|
if (entities && !entityIds) {
|
|
8463
8588
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
8464
8589
|
}
|
|
8465
8590
|
if (entityIds == null) {
|
|
8466
8591
|
entityIds = Object.keys(this.renderedEntities);
|
|
8467
8592
|
}
|
|
8593
|
+
entityIds = entityIds.filter((x) => !!x);
|
|
8594
|
+
if (!entityIds.length) {
|
|
8595
|
+
return;
|
|
8596
|
+
}
|
|
8597
|
+
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
8598
|
+
entities = [].concat(entities).filter(x => { var _a; return entityIds.includes((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID); });
|
|
8599
|
+
if (force) {
|
|
8600
|
+
this.reRenderState.bumpApiRevisions(entityIds);
|
|
8601
|
+
this.preventCurrentCheckApiRefresh(entityIds);
|
|
8602
|
+
}
|
|
8603
|
+
}
|
|
8604
|
+
if (maintain === true && (entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
8605
|
+
this.reRenderState.setMaintainedEntities(entities);
|
|
8606
|
+
}
|
|
8607
|
+
else if (maintain !== true) {
|
|
8608
|
+
this.reRenderState.clearMaintainedEntities(entityIds);
|
|
8609
|
+
}
|
|
8468
8610
|
this.visualsManager.MarkStale({
|
|
8469
8611
|
entityIds: entityIds,
|
|
8470
8612
|
menuItemIds: [this.item.id]
|
|
8471
8613
|
});
|
|
8472
|
-
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
8473
|
-
entities = [].concat(entities).filter(x => { var _a; return entityIds.includes((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID); });
|
|
8474
|
-
}
|
|
8475
8614
|
// Forcing to skip queue and to render immediately.
|
|
8476
8615
|
if (force) {
|
|
8477
8616
|
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
@@ -8479,18 +8618,39 @@ var EntitiesRenderManager;
|
|
|
8479
8618
|
}
|
|
8480
8619
|
else {
|
|
8481
8620
|
try {
|
|
8482
|
-
const
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
}
|
|
8493
|
-
|
|
8621
|
+
const maintained = this.reRenderState.getMaintainedEntities(entityIds);
|
|
8622
|
+
const maintainedLookup = {};
|
|
8623
|
+
for (let i = 0; i < maintained.length; i++) {
|
|
8624
|
+
const id = (_b = (_a = maintained[i]) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID;
|
|
8625
|
+
if (id) {
|
|
8626
|
+
maintainedLookup[id] = true;
|
|
8627
|
+
}
|
|
8628
|
+
}
|
|
8629
|
+
if (maintained.length) {
|
|
8630
|
+
this.renderEntities(maintained, true);
|
|
8631
|
+
}
|
|
8632
|
+
const apiIds = entityIds.filter(id => !maintainedLookup[id]);
|
|
8633
|
+
if (apiIds.length) {
|
|
8634
|
+
const revisions = this.reRenderState.captureApiRevisions(apiIds);
|
|
8635
|
+
const data = await Entity$1.GetListByIds({
|
|
8636
|
+
api: this.apiGetter.getApi(),
|
|
8637
|
+
entityIds: apiIds,
|
|
8638
|
+
historicKey: (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.historicAttrKey,
|
|
8639
|
+
historicPoint: this.viewer.clock.currentTime.toString(),
|
|
8640
|
+
schemaId: (_d = this.item.BruceEntity) === null || _d === void 0 ? void 0 : _d.schemaId,
|
|
8641
|
+
expandSources: true,
|
|
8642
|
+
scenario: this.scenario,
|
|
8643
|
+
migrated: true,
|
|
8644
|
+
maxSearchTimeSec: 60 * 2
|
|
8645
|
+
});
|
|
8646
|
+
const resolved = this.reRenderState.filterCurrentApiEntities({
|
|
8647
|
+
entities: data.entities,
|
|
8648
|
+
revisions
|
|
8649
|
+
});
|
|
8650
|
+
if (resolved.length) {
|
|
8651
|
+
this.renderEntities(resolved, true);
|
|
8652
|
+
}
|
|
8653
|
+
}
|
|
8494
8654
|
}
|
|
8495
8655
|
catch (e) {
|
|
8496
8656
|
console.error(e);
|
|
@@ -8537,26 +8697,47 @@ var EntitiesRenderManager;
|
|
|
8537
8697
|
}
|
|
8538
8698
|
}
|
|
8539
8699
|
async doEntityCheck(ids) {
|
|
8700
|
+
var _a, _b;
|
|
8540
8701
|
if (this.isRunningCheck) {
|
|
8541
8702
|
this.entityCheckQueueIds = this.entityCheckQueueIds.concat(ids);
|
|
8542
8703
|
this.entityCheckQueue.Call();
|
|
8543
8704
|
return;
|
|
8544
8705
|
}
|
|
8545
|
-
ids.concat(this.entityCheckQueueIds);
|
|
8706
|
+
ids = ids.concat(this.entityCheckQueueIds);
|
|
8546
8707
|
this.entityCheckQueueIds = [];
|
|
8547
8708
|
ids = ids.filter((id, index) => {
|
|
8548
8709
|
return ids.indexOf(id) === index;
|
|
8549
8710
|
});
|
|
8550
8711
|
this.isRunningCheck = true;
|
|
8712
|
+
const runId = this.reRenderState.startCheckRun();
|
|
8551
8713
|
const api = this.apiGetter.getApi();
|
|
8552
8714
|
try {
|
|
8553
8715
|
if (this.disposed) {
|
|
8554
8716
|
return;
|
|
8555
8717
|
}
|
|
8556
8718
|
if (ids.length > 0) {
|
|
8719
|
+
const maintained = this.reRenderState.getMaintainedEntities(ids);
|
|
8720
|
+
const maintainedLookup = {};
|
|
8721
|
+
for (let i = 0; i < maintained.length; i++) {
|
|
8722
|
+
const id = (_b = (_a = maintained[i]) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID;
|
|
8723
|
+
if (id) {
|
|
8724
|
+
maintainedLookup[id] = true;
|
|
8725
|
+
}
|
|
8726
|
+
}
|
|
8727
|
+
if (maintained.length) {
|
|
8728
|
+
this.distributeForRender(maintained);
|
|
8729
|
+
}
|
|
8730
|
+
let apiIds = ids.filter((id) => {
|
|
8731
|
+
return !maintainedLookup[id] && !this.reRenderState.shouldSkipInRun(id, runId);
|
|
8732
|
+
});
|
|
8557
8733
|
const checkBatch = async () => {
|
|
8558
8734
|
var _a, _b;
|
|
8559
|
-
|
|
8735
|
+
apiIds = this.reRenderState.filterNonSkippedIds(apiIds, runId);
|
|
8736
|
+
const entityIds = apiIds.splice(0, CHECK_BATCH_SIZE);
|
|
8737
|
+
if (!entityIds.length) {
|
|
8738
|
+
return;
|
|
8739
|
+
}
|
|
8740
|
+
const revisions = this.reRenderState.captureApiRevisions(entityIds);
|
|
8560
8741
|
const { entities } = await Entity$1.GetListByIds({
|
|
8561
8742
|
api,
|
|
8562
8743
|
entityIds,
|
|
@@ -8571,9 +8752,16 @@ var EntitiesRenderManager;
|
|
|
8571
8752
|
if (this.disposed) {
|
|
8572
8753
|
return;
|
|
8573
8754
|
}
|
|
8574
|
-
this.
|
|
8755
|
+
const resolved = this.reRenderState.filterCurrentApiEntities({
|
|
8756
|
+
entities,
|
|
8757
|
+
revisions,
|
|
8758
|
+
runId
|
|
8759
|
+
});
|
|
8760
|
+
if (resolved.length) {
|
|
8761
|
+
this.distributeForRender(resolved);
|
|
8762
|
+
}
|
|
8575
8763
|
};
|
|
8576
|
-
while (
|
|
8764
|
+
while (apiIds.length > 0) {
|
|
8577
8765
|
await checkBatch();
|
|
8578
8766
|
}
|
|
8579
8767
|
}
|
|
@@ -9249,6 +9437,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9249
9437
|
// Highly experimental flag to try improve rendering large sets of polygons and polylines.
|
|
9250
9438
|
// Many things are not supported when this is enabled.
|
|
9251
9439
|
this.useGeojson = false;
|
|
9440
|
+
this.reRenderState = new EntityReRenderMaintainState();
|
|
9252
9441
|
const { viewer, apiGetter, monitor, item, register: visualsManager } = params;
|
|
9253
9442
|
this.viewer = viewer;
|
|
9254
9443
|
this.apiGetter = apiGetter;
|
|
@@ -9397,7 +9586,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9397
9586
|
this.sources = [];
|
|
9398
9587
|
}
|
|
9399
9588
|
async ReRender(params) {
|
|
9400
|
-
let { entityIds, force, entities } = params;
|
|
9589
|
+
let { entityIds, force, entities, maintain } = params;
|
|
9401
9590
|
if (entities && !entityIds) {
|
|
9402
9591
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
9403
9592
|
}
|
|
@@ -9411,8 +9600,21 @@ var EntitiesLoadedRenderManager;
|
|
|
9411
9600
|
return (_b = (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.Entities) === null || _b === void 0 ? void 0 : _b.find(y => { var _a; return ((_a = y === null || y === void 0 ? void 0 : y.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == x; });
|
|
9412
9601
|
});
|
|
9413
9602
|
}
|
|
9603
|
+
entityIds = entityIds.filter((x) => !!x);
|
|
9604
|
+
if (!entityIds.length) {
|
|
9605
|
+
return;
|
|
9606
|
+
}
|
|
9414
9607
|
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
9415
9608
|
entities = [].concat(entities).filter(x => { var _a; return entityIds.includes((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID); });
|
|
9609
|
+
if (force) {
|
|
9610
|
+
this.reRenderState.bumpApiRevisions(entityIds);
|
|
9611
|
+
}
|
|
9612
|
+
}
|
|
9613
|
+
if (maintain === true && (entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
9614
|
+
this.reRenderState.setMaintainedEntities(entities);
|
|
9615
|
+
}
|
|
9616
|
+
else if (maintain !== true) {
|
|
9617
|
+
this.reRenderState.clearMaintainedEntities(entityIds);
|
|
9416
9618
|
}
|
|
9417
9619
|
this.visualsManager.MarkStale({
|
|
9418
9620
|
entityIds: entityIds,
|
|
@@ -9447,14 +9649,31 @@ var EntitiesLoadedRenderManager;
|
|
|
9447
9649
|
}
|
|
9448
9650
|
}
|
|
9449
9651
|
async doEntityCheck(ids, force = false) {
|
|
9652
|
+
var _a, _b;
|
|
9450
9653
|
const api = this.apiGetter.getApi();
|
|
9451
9654
|
try {
|
|
9452
9655
|
if (this.disposed) {
|
|
9453
9656
|
return;
|
|
9454
9657
|
}
|
|
9455
9658
|
if (ids.length > 0) {
|
|
9659
|
+
const maintained = this.reRenderState.getMaintainedEntities(ids);
|
|
9660
|
+
const maintainedLookup = {};
|
|
9661
|
+
for (let i = 0; i < maintained.length; i++) {
|
|
9662
|
+
const id = (_b = (_a = maintained[i]) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID;
|
|
9663
|
+
if (id) {
|
|
9664
|
+
maintainedLookup[id] = true;
|
|
9665
|
+
}
|
|
9666
|
+
}
|
|
9667
|
+
if (maintained.length) {
|
|
9668
|
+
await this.onGetterUpdate(maintained, force);
|
|
9669
|
+
}
|
|
9670
|
+
let apiIds = ids.filter(id => !maintainedLookup[id]);
|
|
9456
9671
|
const checkBatch = async () => {
|
|
9457
|
-
const entityIds =
|
|
9672
|
+
const entityIds = apiIds.splice(0, CHECK_BATCH_SIZE$1);
|
|
9673
|
+
if (!entityIds.length) {
|
|
9674
|
+
return;
|
|
9675
|
+
}
|
|
9676
|
+
const revisions = this.reRenderState.captureApiRevisions(entityIds);
|
|
9458
9677
|
const { entities } = await Entity$1.GetListByIds({
|
|
9459
9678
|
api,
|
|
9460
9679
|
entityIds,
|
|
@@ -9465,9 +9684,15 @@ var EntitiesLoadedRenderManager;
|
|
|
9465
9684
|
if (this.disposed) {
|
|
9466
9685
|
return;
|
|
9467
9686
|
}
|
|
9468
|
-
this.
|
|
9687
|
+
const resolved = this.reRenderState.filterCurrentApiEntities({
|
|
9688
|
+
entities,
|
|
9689
|
+
revisions
|
|
9690
|
+
});
|
|
9691
|
+
if (resolved.length) {
|
|
9692
|
+
this.onGetterUpdate(resolved, force);
|
|
9693
|
+
}
|
|
9469
9694
|
};
|
|
9470
|
-
while (
|
|
9695
|
+
while (apiIds.length > 0) {
|
|
9471
9696
|
await checkBatch();
|
|
9472
9697
|
}
|
|
9473
9698
|
}
|
|
@@ -9954,6 +10179,7 @@ var EntitiesIdsRenderManager;
|
|
|
9954
10179
|
this.renderQueueActive = false;
|
|
9955
10180
|
this.renderQueue = [];
|
|
9956
10181
|
this.renderQueueForceFlags = [];
|
|
10182
|
+
this.reRenderState = new EntityReRenderMaintainState();
|
|
9957
10183
|
const { viewer, apiGetter, monitor, item, register: visualsManager } = params;
|
|
9958
10184
|
this.viewer = viewer;
|
|
9959
10185
|
this.apiGetter = apiGetter;
|
|
@@ -10023,7 +10249,7 @@ var EntitiesIdsRenderManager;
|
|
|
10023
10249
|
this.renderQueueActive = false;
|
|
10024
10250
|
}
|
|
10025
10251
|
async ReRender(params) {
|
|
10026
|
-
let { entityIds, force, entities } = params;
|
|
10252
|
+
let { entityIds, force, entities, maintain } = params;
|
|
10027
10253
|
if (entities && !entityIds) {
|
|
10028
10254
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
10029
10255
|
}
|
|
@@ -10037,12 +10263,28 @@ var EntitiesIdsRenderManager;
|
|
|
10037
10263
|
return (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.EntityIds.includes(x);
|
|
10038
10264
|
});
|
|
10039
10265
|
}
|
|
10266
|
+
entityIds = entityIds.filter((x) => !!x);
|
|
10267
|
+
if (!entityIds.length) {
|
|
10268
|
+
return;
|
|
10269
|
+
}
|
|
10270
|
+
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
10271
|
+
entities = [].concat(entities).filter(x => { var _a; return entityIds.includes((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID); });
|
|
10272
|
+
if (force) {
|
|
10273
|
+
this.reRenderState.bumpApiRevisions(entityIds);
|
|
10274
|
+
}
|
|
10275
|
+
}
|
|
10276
|
+
if (maintain === true && (entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
10277
|
+
this.reRenderState.setMaintainedEntities(entities);
|
|
10278
|
+
}
|
|
10279
|
+
else if (maintain !== true) {
|
|
10280
|
+
this.reRenderState.clearMaintainedEntities(entityIds);
|
|
10281
|
+
}
|
|
10040
10282
|
this.visualsManager.MarkStale({
|
|
10041
10283
|
entityIds: entityIds,
|
|
10042
10284
|
menuItemIds: [this.item.id]
|
|
10043
10285
|
});
|
|
10044
10286
|
if (entities === null || entities === void 0 ? void 0 : entities.length) {
|
|
10045
|
-
this.renderEntities(
|
|
10287
|
+
this.renderEntities(entities, force);
|
|
10046
10288
|
}
|
|
10047
10289
|
else {
|
|
10048
10290
|
this.onGetterUpdate(entityIds, force);
|
|
@@ -10066,18 +10308,35 @@ var EntitiesIdsRenderManager;
|
|
|
10066
10308
|
}
|
|
10067
10309
|
}
|
|
10068
10310
|
async onGetterUpdate(entityIds, force = false) {
|
|
10311
|
+
var _a, _b;
|
|
10069
10312
|
if (this.disposed || this.viewer.isDestroyed() || !(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
|
|
10070
10313
|
return;
|
|
10071
10314
|
}
|
|
10072
10315
|
try {
|
|
10316
|
+
const maintained = this.reRenderState.getMaintainedEntities(entityIds);
|
|
10317
|
+
const maintainedLookup = {};
|
|
10318
|
+
for (let i = 0; i < maintained.length; i++) {
|
|
10319
|
+
const id = (_b = (_a = maintained[i]) === null || _a === void 0 ? void 0 : _a.Bruce) === null || _b === void 0 ? void 0 : _b.ID;
|
|
10320
|
+
if (id) {
|
|
10321
|
+
maintainedLookup[id] = true;
|
|
10322
|
+
}
|
|
10323
|
+
}
|
|
10324
|
+
if (maintained.length) {
|
|
10325
|
+
await this.renderEntities(maintained, force);
|
|
10326
|
+
}
|
|
10327
|
+
const apiIds = entityIds.filter(id => !maintainedLookup[id]);
|
|
10328
|
+
if (!apiIds.length) {
|
|
10329
|
+
return;
|
|
10330
|
+
}
|
|
10073
10331
|
const api = this.apiGetter.getApi();
|
|
10332
|
+
const revisions = this.reRenderState.captureApiRevisions(apiIds);
|
|
10074
10333
|
let newDateTime = null;
|
|
10075
10334
|
if (this.item.BruceEntity.historic || this.item.BruceEntity.historicAttrKey) {
|
|
10076
10335
|
newDateTime = JulianDate.toDate(this.viewer.clock.currentTime).toISOString();
|
|
10077
10336
|
}
|
|
10078
10337
|
const { entities } = await Entity$1.GetListByIds({
|
|
10079
10338
|
api,
|
|
10080
|
-
entityIds,
|
|
10339
|
+
entityIds: apiIds,
|
|
10081
10340
|
historicPoint: newDateTime,
|
|
10082
10341
|
historicKey: this.item.BruceEntity.historicAttrKey,
|
|
10083
10342
|
expandSources: true,
|
|
@@ -10087,7 +10346,11 @@ var EntitiesIdsRenderManager;
|
|
|
10087
10346
|
// Honestly could lower down to 30 seconds, but we'll keep it high for now.
|
|
10088
10347
|
maxSearchTimeSec: 60 * 5,
|
|
10089
10348
|
});
|
|
10090
|
-
|
|
10349
|
+
const resolved = this.reRenderState.filterCurrentApiEntities({
|
|
10350
|
+
entities,
|
|
10351
|
+
revisions
|
|
10352
|
+
});
|
|
10353
|
+
await this.renderEntities(resolved, force);
|
|
10091
10354
|
}
|
|
10092
10355
|
catch (e) {
|
|
10093
10356
|
console.error(e);
|
|
@@ -10447,6 +10710,7 @@ var EntityRenderManager;
|
|
|
10447
10710
|
this.getter = null;
|
|
10448
10711
|
this.getterSub = null;
|
|
10449
10712
|
this.disposed = false;
|
|
10713
|
+
this.reRenderState = new EntityReRenderMaintainState();
|
|
10450
10714
|
const { viewer, apiGetter, monitor, item, register: visualsManager } = params;
|
|
10451
10715
|
this.viewer = viewer;
|
|
10452
10716
|
this.apiGetter = apiGetter;
|
|
@@ -10494,22 +10758,33 @@ var EntityRenderManager;
|
|
|
10494
10758
|
});
|
|
10495
10759
|
}
|
|
10496
10760
|
async ReRender(params) {
|
|
10497
|
-
let { entityIds, force, entities } = params;
|
|
10761
|
+
let { entityIds, force, entities, maintain } = params;
|
|
10498
10762
|
if (entities && !entityIds) {
|
|
10499
10763
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
10500
10764
|
}
|
|
10501
|
-
|
|
10765
|
+
const itemEntityId = this.item.BruceEntity.EntityId;
|
|
10766
|
+
if (entityIds && !entityIds.includes(itemEntityId)) {
|
|
10502
10767
|
return;
|
|
10503
10768
|
}
|
|
10769
|
+
const incoming = entities === null || entities === void 0 ? void 0 : entities.find(x => { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == itemEntityId; });
|
|
10770
|
+
if (incoming && force) {
|
|
10771
|
+
this.reRenderState.bumpApiRevisions([itemEntityId]);
|
|
10772
|
+
}
|
|
10773
|
+
if (maintain === true && incoming) {
|
|
10774
|
+
this.reRenderState.setMaintainedEntities([incoming]);
|
|
10775
|
+
}
|
|
10776
|
+
else if (maintain !== true) {
|
|
10777
|
+
this.reRenderState.clearMaintainedEntities([itemEntityId]);
|
|
10778
|
+
}
|
|
10504
10779
|
this.visualsManager.MarkStale({
|
|
10505
|
-
entityIds:
|
|
10780
|
+
entityIds: [itemEntityId],
|
|
10506
10781
|
menuItemIds: [this.item.id]
|
|
10507
10782
|
});
|
|
10508
|
-
if (
|
|
10509
|
-
await this.renderEntity(
|
|
10783
|
+
if (incoming) {
|
|
10784
|
+
await this.renderEntity(incoming, force);
|
|
10510
10785
|
}
|
|
10511
10786
|
else {
|
|
10512
|
-
await this.onGetterUpdate(
|
|
10787
|
+
await this.onGetterUpdate(itemEntityId, force);
|
|
10513
10788
|
}
|
|
10514
10789
|
}
|
|
10515
10790
|
async onGetterUpdate(id, force = false) {
|
|
@@ -10517,13 +10792,25 @@ var EntityRenderManager;
|
|
|
10517
10792
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
10518
10793
|
return;
|
|
10519
10794
|
}
|
|
10795
|
+
const maintained = this.reRenderState.getMaintainedEntities([id]);
|
|
10796
|
+
if (maintained.length) {
|
|
10797
|
+
await this.renderEntity(maintained[0], force);
|
|
10798
|
+
return;
|
|
10799
|
+
}
|
|
10520
10800
|
const api = this.apiGetter.getApi();
|
|
10801
|
+
const revisions = this.reRenderState.captureApiRevisions([id]);
|
|
10521
10802
|
const { entity } = await Entity$1.Get({
|
|
10522
10803
|
api,
|
|
10523
10804
|
entityId: id,
|
|
10524
10805
|
migrated: true
|
|
10525
10806
|
});
|
|
10526
|
-
this.
|
|
10807
|
+
const resolved = this.reRenderState.filterCurrentApiEntities({
|
|
10808
|
+
entities: entity ? [entity] : [],
|
|
10809
|
+
revisions
|
|
10810
|
+
});
|
|
10811
|
+
if (resolved.length) {
|
|
10812
|
+
this.renderEntity(resolved[0], force);
|
|
10813
|
+
}
|
|
10527
10814
|
}
|
|
10528
10815
|
catch (e) {
|
|
10529
10816
|
console.error(e);
|
|
@@ -11026,6 +11313,7 @@ class TilesetStyler {
|
|
|
11026
11313
|
// Indicates that we are retrieving historic records.
|
|
11027
11314
|
// This means that the current scene's time is included in the request.
|
|
11028
11315
|
this.historic = false;
|
|
11316
|
+
this.reRenderState = new EntityReRenderMaintainState();
|
|
11029
11317
|
// More expensive process.
|
|
11030
11318
|
// When an Entity is styled, the rego is reviewed and updated if needed.
|
|
11031
11319
|
// This is currently used for scenarios, and off by default to keep other processes faster.
|
|
@@ -11178,16 +11466,29 @@ class TilesetStyler {
|
|
|
11178
11466
|
* @param entityIds
|
|
11179
11467
|
* @param entities If an object is not available for a supplied Entity ID, then the cache for it is removed.
|
|
11180
11468
|
*/
|
|
11181
|
-
SetEntityCache(entityIds, entities) {
|
|
11469
|
+
SetEntityCache(entityIds, entities, maintain) {
|
|
11182
11470
|
if (!this.entityGatherer) {
|
|
11183
11471
|
console.warn("TilesetStyler: EntityGatherer not initialized, cannot set entity cache.");
|
|
11184
11472
|
return;
|
|
11185
11473
|
}
|
|
11474
|
+
if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
|
|
11475
|
+
return;
|
|
11476
|
+
}
|
|
11477
|
+
if (maintain === true && (entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
11478
|
+
this.reRenderState.setMaintainedEntities(entities);
|
|
11479
|
+
}
|
|
11480
|
+
else if (maintain !== true) {
|
|
11481
|
+
this.reRenderState.clearMaintainedEntities(entityIds);
|
|
11482
|
+
}
|
|
11483
|
+
let effectiveEntities = entities;
|
|
11484
|
+
if ((!effectiveEntities || !effectiveEntities.length) && maintain === true) {
|
|
11485
|
+
effectiveEntities = this.reRenderState.getMaintainedEntities(entityIds);
|
|
11486
|
+
}
|
|
11186
11487
|
// Turn the Entities array into an accessible dictionary.
|
|
11187
11488
|
const newDataMap = new Map();
|
|
11188
|
-
if (
|
|
11189
|
-
for (let i = 0; i <
|
|
11190
|
-
const entity =
|
|
11489
|
+
if (effectiveEntities) {
|
|
11490
|
+
for (let i = 0; i < effectiveEntities.length; i++) {
|
|
11491
|
+
const entity = effectiveEntities[i];
|
|
11191
11492
|
if (entity.Bruce) {
|
|
11192
11493
|
newDataMap.set(entity.Bruce.ID, entity);
|
|
11193
11494
|
}
|
|
@@ -11563,7 +11864,7 @@ class TilesetStyler {
|
|
|
11563
11864
|
if (!fill || fill.length <= 0) {
|
|
11564
11865
|
return false;
|
|
11565
11866
|
}
|
|
11566
|
-
return fill[0].type != 0;
|
|
11867
|
+
return fill[0].type != 0 || fill[0].value instanceof Function;
|
|
11567
11868
|
}
|
|
11568
11869
|
}
|
|
11569
11870
|
|
|
@@ -14057,7 +14358,7 @@ var TilesetCadRenderManager;
|
|
|
14057
14358
|
this.viewerDateTimeDispose();
|
|
14058
14359
|
}
|
|
14059
14360
|
async ReRender(params) {
|
|
14060
|
-
let { entityIds, force, entities } = params;
|
|
14361
|
+
let { entityIds, force, entities, maintain } = params;
|
|
14061
14362
|
if (entities && !entityIds) {
|
|
14062
14363
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
14063
14364
|
}
|
|
@@ -14071,7 +14372,7 @@ var TilesetCadRenderManager;
|
|
|
14071
14372
|
regos = regos.filter(r => entityIds.indexOf(r.entityId) >= 0);
|
|
14072
14373
|
}
|
|
14073
14374
|
// Update the cache so we use that data instead of requesting the records.
|
|
14074
|
-
this.styler.SetEntityCache(entityIds, entities);
|
|
14375
|
+
this.styler.SetEntityCache(entityIds, entities, maintain);
|
|
14075
14376
|
this.styler.QueueEntities(regos, true);
|
|
14076
14377
|
}
|
|
14077
14378
|
/**
|
|
@@ -15682,7 +15983,7 @@ var TilesetEntitiesRenderManager;
|
|
|
15682
15983
|
return rego;
|
|
15683
15984
|
}
|
|
15684
15985
|
async ReRender(params) {
|
|
15685
|
-
let { entityIds, force, entities } = params;
|
|
15986
|
+
let { entityIds, force, entities, maintain } = params;
|
|
15686
15987
|
if (entities && !entityIds) {
|
|
15687
15988
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
15688
15989
|
}
|
|
@@ -15696,7 +15997,7 @@ var TilesetEntitiesRenderManager;
|
|
|
15696
15997
|
regos = regos.filter(r => entityIds.indexOf(r.entityId) >= 0);
|
|
15697
15998
|
}
|
|
15698
15999
|
// Update the cache so we use that data instead of requesting the records.
|
|
15699
|
-
this.styler.SetEntityCache(entityIds, entities);
|
|
16000
|
+
this.styler.SetEntityCache(entityIds, entities, maintain);
|
|
15700
16001
|
this.styler.QueueEntities(regos, true);
|
|
15701
16002
|
}
|
|
15702
16003
|
}
|
|
@@ -16465,7 +16766,7 @@ var TilesetArbRenderManager;
|
|
|
16465
16766
|
});
|
|
16466
16767
|
}
|
|
16467
16768
|
async ReRender(params) {
|
|
16468
|
-
let { entityIds, force, entities } = params;
|
|
16769
|
+
let { entityIds, force, entities, maintain } = params;
|
|
16469
16770
|
if (entities && !entityIds) {
|
|
16470
16771
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
16471
16772
|
}
|
|
@@ -16479,7 +16780,7 @@ var TilesetArbRenderManager;
|
|
|
16479
16780
|
regos = regos.filter(r => entityIds.indexOf(r.entityId) >= 0);
|
|
16480
16781
|
}
|
|
16481
16782
|
// Update the cache so we use that data instead of requesting the records.
|
|
16482
|
-
this.styler.SetEntityCache(entityIds, entities);
|
|
16783
|
+
this.styler.SetEntityCache(entityIds, entities, maintain);
|
|
16483
16784
|
this.styler.QueueEntities(regos, true);
|
|
16484
16785
|
}
|
|
16485
16786
|
mapTilesetFeature(feature) {
|
|
@@ -19431,7 +19732,7 @@ var MenuItemManager;
|
|
|
19431
19732
|
* @param params
|
|
19432
19733
|
*/
|
|
19433
19734
|
async ReRender(params) {
|
|
19434
|
-
let { entityIds, entities, menuItemIds, force } = params;
|
|
19735
|
+
let { entityIds, entities, menuItemIds, force, maintain } = params;
|
|
19435
19736
|
if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length) && !(entities === null || entities === void 0 ? void 0 : entities.length)) {
|
|
19436
19737
|
return;
|
|
19437
19738
|
}
|
|
@@ -19445,7 +19746,8 @@ var MenuItemManager;
|
|
|
19445
19746
|
await item.renderManager.ReRender({
|
|
19446
19747
|
entityIds,
|
|
19447
19748
|
entities,
|
|
19448
|
-
force
|
|
19749
|
+
force,
|
|
19750
|
+
maintain
|
|
19449
19751
|
});
|
|
19450
19752
|
}
|
|
19451
19753
|
}
|
|
@@ -34979,7 +35281,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
34979
35281
|
}
|
|
34980
35282
|
}
|
|
34981
35283
|
|
|
34982
|
-
const VERSION = "6.4.
|
|
35284
|
+
const VERSION = "6.4.6";
|
|
34983
35285
|
/**
|
|
34984
35286
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
34985
35287
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|