bruce-cesium 5.6.2 → 5.6.4

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.
Files changed (26) hide show
  1. package/dist/bruce-cesium.es5.js +141 -81
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +140 -80
  4. package/dist/bruce-cesium.umd.js.map +1 -1
  5. package/dist/lib/bruce-cesium.js +1 -1
  6. package/dist/lib/rendering/entity-render-engine.js +27 -16
  7. package/dist/lib/rendering/entity-render-engine.js.map +1 -1
  8. package/dist/lib/rendering/getters/entity-filter-getter.js +20 -5
  9. package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
  10. package/dist/lib/rendering/render-managers/common/entity-label.js +1 -1
  11. package/dist/lib/rendering/render-managers/common/entity-label.js.map +1 -1
  12. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +74 -39
  13. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  14. package/dist/lib/rendering/tileset-styler.js +14 -14
  15. package/dist/lib/rendering/tileset-styler.js.map +1 -1
  16. package/dist/lib/rendering/visual-register-culler.js +1 -2
  17. package/dist/lib/rendering/visual-register-culler.js.map +1 -1
  18. package/dist/lib/rendering/visuals-register.js.map +1 -1
  19. package/dist/lib/utils/entity-utils.js +3 -3
  20. package/dist/lib/utils/entity-utils.js.map +1 -1
  21. package/dist/types/bruce-cesium.d.ts +1 -1
  22. package/dist/types/rendering/entity-render-engine.d.ts +1 -1
  23. package/dist/types/rendering/getters/entity-filter-getter.d.ts +7 -2
  24. package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +8 -0
  25. package/dist/types/rendering/visuals-register.d.ts +3 -6
  26. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, Cesium3DTileset, IonResource, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -3032,7 +3032,7 @@ var EntityUtils;
3032
3032
  * Returns an array of positions from the entity's currently rendered graphics.
3033
3033
  */
3034
3034
  const evaluateRendered = async () => {
3035
- var _a, _b;
3035
+ var _a;
3036
3036
  const rego = visualRegister ? visualRegister.GetRego({
3037
3037
  entityId: sample.entityId,
3038
3038
  menuItemId: sample.menuItemId
@@ -3042,12 +3042,12 @@ var EntityUtils;
3042
3042
  }
3043
3043
  // If this is a historic Entity but associated with a Tileset, we'll hack the movement in.
3044
3044
  // Our API doesn't account for this at the moment.
3045
- if (rego.visual instanceof Cesium3DTileFeature && ((_a = rego.historicLayers) === null || _a === void 0 ? void 0 : _a.length)) {
3045
+ if (rego.visual instanceof Cesium3DTileFeature && rego.outline && rego.outline.some(x => !!x.DateTime)) {
3046
3046
  // Get the Tileset.
3047
3047
  const tileset = rego.visual.tileset;
3048
3048
  if (tileset === null || tileset === void 0 ? void 0 : tileset._bruceCoords) {
3049
3049
  // The render logic currently swaps out the UCS location when the assembly is moving.
3050
- const location = (_b = tileset._bruceCoords.ucs) === null || _b === void 0 ? void 0 : _b.location;
3050
+ const location = (_a = tileset._bruceCoords.ucs) === null || _a === void 0 ? void 0 : _a.location;
3051
3051
  if (location) {
3052
3052
  const latitude = EnsureNumber(location.latitude);
3053
3053
  const longitude = EnsureNumber(location.longitude);
@@ -6290,7 +6290,6 @@ function shouldRecheck(viewer) {
6290
6290
  * @returns
6291
6291
  */
6292
6292
  function isCullingIgnored(viewer, rego) {
6293
- var _a;
6294
6293
  if (
6295
6294
  // No rego or visual.
6296
6295
  // This is a safety check to avoid crashes.
@@ -6306,7 +6305,7 @@ function isCullingIgnored(viewer, rego) {
6306
6305
  // Won't touch in case there is special logic.
6307
6306
  rego.collection ||
6308
6307
  // We won't cull historic records as they may be interpolating their locations.
6309
- Boolean((_a = rego.historicLayers) === null || _a === void 0 ? void 0 : _a.length)) {
6308
+ Boolean(rego.outline && rego.outline.some(x => !!x.DateTime))) {
6310
6309
  return true;
6311
6310
  }
6312
6311
  const visual = rego.visual;
@@ -8306,26 +8305,37 @@ function getHeightRef$3(style, defaultStyle) {
8306
8305
  * @param rego
8307
8306
  * @param entity
8308
8307
  */
8309
- function isHistoricMetadataChanged(rego, entity) {
8310
- var _a, _b, _c, _d, _e, _f, _g;
8311
- // Different overlay amount.
8312
- if (((_a = rego.historicLayers) === null || _a === void 0 ? void 0 : _a.length) != ((_c = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.HistoricLayers) === null || _c === void 0 ? void 0 : _c.length)) {
8308
+ function isOutlineChanged(rego, entity) {
8309
+ var _a, _b, _c, _d, _e, _f;
8310
+ if (((_a = rego.outline) === null || _a === void 0 ? void 0 : _a.length) != ((_c = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Outline) === null || _c === void 0 ? void 0 : _c.length)) {
8313
8311
  return true;
8314
8312
  }
8315
- // Both missing. Nothing to compare.
8316
- else if (!rego.historicLayers && !((_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricLayers)) {
8313
+ else if (!rego.outline && !((_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.Outline)) {
8317
8314
  return false;
8318
8315
  }
8319
- // One missing. Definitely different.
8320
- else if (!rego.historicLayers || !((_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.HistoricLayers)) {
8316
+ else if (!rego.outline || !((_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.Outline)) {
8321
8317
  return true;
8322
8318
  }
8323
- // Compare each layer.
8324
- for (let i = 0; i < rego.historicLayers.length; i++) {
8325
- if (rego.historicLayers[i].attrKey != ((_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.HistoricLayers[i].attrKey)) {
8319
+ // Compare each item.
8320
+ for (let i = 0; i < rego.outline.length; i++) {
8321
+ const rOutline = rego.outline[i];
8322
+ const eOutline = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.Outline[i];
8323
+ if (rOutline.Kind !== eOutline.Kind) {
8324
+ return true;
8325
+ }
8326
+ else if (rOutline.DateTime !== eOutline.DateTime) {
8327
+ return true;
8328
+ }
8329
+ else if (rOutline.Scenario !== eOutline.Scenario) {
8326
8330
  return true;
8327
8331
  }
8328
- if (rego.historicLayers[i].dateTime != ((_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.HistoricLayers[i].dateTime)) {
8332
+ else if (rOutline.Baseline !== eOutline.Baseline) {
8333
+ return true;
8334
+ }
8335
+ else if (rOutline["Source.ID"] !== eOutline["Source.ID"]) {
8336
+ return true;
8337
+ }
8338
+ else if (rOutline["EntityType.Source.ID"] !== eOutline["EntityType.Source.ID"]) {
8329
8339
  return true;
8330
8340
  }
8331
8341
  }
@@ -8424,7 +8434,7 @@ var EntityRenderEngine;
8424
8434
  if (!params.force &&
8425
8435
  newRenderId == oldRenderId &&
8426
8436
  !(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
8427
- !isHistoricMetadataChanged(existingRego, entity) &&
8437
+ !isOutlineChanged(existingRego, entity) &&
8428
8438
  ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.scenario) == ((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Scenario))) {
8429
8439
  // No sorting category needed. Already rendered the way we want.
8430
8440
  cEntities.set(id, existingRego.visual);
@@ -8436,7 +8446,7 @@ var EntityRenderEngine;
8436
8446
  // Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
8437
8447
  existingRego.stale = false;
8438
8448
  // Update metadata for the same reason.
8439
- existingRego.historicLayers = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.HistoricLayers;
8449
+ existingRego.outline = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.Outline;
8440
8450
  existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
8441
8451
  existingRego.scenario = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.Scenario;
8442
8452
  updated.set(id, true);
@@ -9663,7 +9673,7 @@ var EntityLabel;
9663
9673
  entityId: this.rego.entityId,
9664
9674
  entityTypeId: this.rego.entityTypeId,
9665
9675
  scenario: this.rego.scenario,
9666
- schemaId: this.rego.schemaId,
9676
+ schemaId: this.rego.schema,
9667
9677
  migrated: true
9668
9678
  });
9669
9679
  for (let i = 0; i < attributes.length; i++) {
@@ -12723,8 +12733,7 @@ var EntitiesRenderManager;
12723
12733
  // Scenario for retrieving Entities.
12724
12734
  this.scenario = null;
12725
12735
  // Type IDs that we'll allow to be rendered when receiving Entities.
12726
- // This is a band-aid for that fact that locally sourced Entities across Types are trickier to filter out.
12727
- // So we request source info and use that to figure the situation out.
12736
+ // This might be exactly the Menu Item Type ID because of local data sources.
12728
12737
  this.allowedTypeIDs = [];
12729
12738
  const { viewer, apiGetter, monitor, item, register: visualsManager, sharedGetters } = params;
12730
12739
  this.viewer = viewer;
@@ -12746,37 +12755,23 @@ var EntitiesRenderManager;
12746
12755
  this.item = params.item;
12747
12756
  }
12748
12757
  (async () => {
12749
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
12758
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
12750
12759
  if (this.disposed) {
12751
12760
  return;
12752
12761
  }
12753
12762
  try {
12754
- // Get type sources to look for locally sourced entity types.
12755
- if ((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]) {
12763
+ // Reset allowed list if there's change.
12764
+ if (((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]) && !this.allowedTypeIDs.includes((_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"])) {
12756
12765
  this.allowedTypeIDs = [];
12757
- this.allowedTypeIDs.push((_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"]);
12758
- try {
12759
- const api = this.apiGetter.getApi();
12760
- const typeId = (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"];
12761
- const { Items: items } = await api.GET(`entitytype/${typeId}/sources`);
12762
- for (const item of items) {
12763
- if (item.Type == 0 && item["Source.EntityType.ID"] && (item.Kind == "ENTITY" || item.Kind == "UNSET")) {
12764
- const typeId = item["Source.EntityType.ID"];
12765
- if (typeId && !this.allowedTypeIDs.includes(typeId)) {
12766
- this.allowedTypeIDs.push(typeId);
12767
- }
12768
- }
12769
- }
12770
- }
12771
- catch (e) {
12772
- console.error(e);
12766
+ if ((_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"]) {
12767
+ this.allowedTypeIDs.push((_d = this.item.BruceEntity) === null || _d === void 0 ? void 0 : _d["EntityType.ID"]);
12773
12768
  }
12774
12769
  }
12775
12770
  if (this.disposed) {
12776
12771
  return;
12777
12772
  }
12778
12773
  this.zoomControl = this.item.CameraZoomSettings;
12779
- if (!((_d = this.zoomControl) === null || _d === void 0 ? void 0 : _d.length)) {
12774
+ if (!((_e = this.zoomControl) === null || _e === void 0 ? void 0 : _e.length)) {
12780
12775
  this.zoomControl = [
12781
12776
  {
12782
12777
  MinZoom: 0,
@@ -12796,7 +12791,7 @@ var EntitiesRenderManager;
12796
12791
  console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
12797
12792
  this.zoomControl = [this.zoomControl[0]];
12798
12793
  }
12799
- this.scenario = (_e = this.item.BruceEntity) === null || _e === void 0 ? void 0 : _e.Scenario;
12794
+ this.scenario = (_f = this.item.BruceEntity) === null || _f === void 0 ? void 0 : _f.Scenario;
12800
12795
  const isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
12801
12796
  let tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
12802
12797
  if (!tagsToRender) {
@@ -12805,9 +12800,9 @@ var EntitiesRenderManager;
12805
12800
  tagsToRender = [].concat(tagsToRender);
12806
12801
  const shouldRender = !isTagItem || tagsToRender.length > 0;
12807
12802
  this.unsetGetter();
12808
- (_f = this.viewMonitorRemoval) === null || _f === void 0 ? void 0 : _f.call(this);
12803
+ (_g = this.viewMonitorRemoval) === null || _g === void 0 ? void 0 : _g.call(this);
12809
12804
  this.viewMonitorRemoval = null;
12810
- (_g = this.entityCheckQueue) === null || _g === void 0 ? void 0 : _g.Dispose();
12805
+ (_h = this.entityCheckQueue) === null || _h === void 0 ? void 0 : _h.Dispose();
12811
12806
  this.entityCheckQueue = null;
12812
12807
  clearInterval(this.renderQueueInterval);
12813
12808
  this.renderQueueInterval = null;
@@ -12819,17 +12814,17 @@ var EntitiesRenderManager;
12819
12814
  menuItemId: this.item.id,
12820
12815
  retainTagIds: tagsToRender
12821
12816
  });
12822
- (_h = this.clustering) === null || _h === void 0 ? void 0 : _h.Dispose();
12817
+ (_j = this.clustering) === null || _j === void 0 ? void 0 : _j.Dispose();
12823
12818
  }
12824
12819
  else {
12825
12820
  this.visualsManager.RemoveRegos({
12826
12821
  menuItemId: this.item.id
12827
12822
  });
12828
- (_j = this.clustering) === null || _j === void 0 ? void 0 : _j.Dispose();
12823
+ (_k = this.clustering) === null || _k === void 0 ? void 0 : _k.Dispose();
12829
12824
  return;
12830
12825
  }
12831
12826
  if (this.item.enableClustering) {
12832
- this.clustering = new PointClustering(this.visualsManager, this.item.id, (_k = this.item) === null || _k === void 0 ? void 0 : _k.clustering);
12827
+ this.clustering = new PointClustering(this.visualsManager, this.item.id, (_l = this.item) === null || _l === void 0 ? void 0 : _l.clustering);
12833
12828
  }
12834
12829
  this.setGetter();
12835
12830
  this.viewMonitorRemoval = this.monitor.Updated().Subscribe(() => {
@@ -12849,6 +12844,50 @@ var EntitiesRenderManager;
12849
12844
  }
12850
12845
  })();
12851
12846
  }
12847
+ /**
12848
+ * Updates allowedTypeIDs values based in incoming data.
12849
+ * We might request 'x' Entity Type, but get 'y' Entities due to local Data Sources.
12850
+ * So we'll dynamically construct allowed type IDs to help filter out unwanted Entities from further ReRender calls.
12851
+ * @param typeSources
12852
+ * @param entities
12853
+ */
12854
+ updateAllowedTypeIDs(typeSources, entities) {
12855
+ var _a, _b;
12856
+ const sourceLookup = new Map();
12857
+ if (typeSources) {
12858
+ for (const source of typeSources) {
12859
+ sourceLookup.set(source.ID, source);
12860
+ }
12861
+ }
12862
+ for (let i = 0; i < entities.length; i++) {
12863
+ const entity = entities[i];
12864
+ const typeId = (_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"];
12865
+ if (!typeId || this.allowedTypeIDs.includes(typeId)) {
12866
+ continue;
12867
+ }
12868
+ // If an Entity is not from the allowed Entity Type, but has a source matching it, then it's allowed.
12869
+ // Therefor we will add it to the allowedTypeIDs list.
12870
+ if (!((_b = entity.Bruce["Sources"]) === null || _b === void 0 ? void 0 : _b.length)) {
12871
+ continue;
12872
+ }
12873
+ const sources = entity.Bruce["Sources"];
12874
+ for (const source of sources) {
12875
+ if (!source["EntityType.Source.ID"]) {
12876
+ continue;
12877
+ }
12878
+ const sRecord = sourceLookup.get(source["EntityType.Source.ID"]);
12879
+ if (!sRecord) {
12880
+ continue;
12881
+ }
12882
+ if (sRecord["EntityType.ID"] && this.allowedTypeIDs.includes(sRecord["EntityType.ID"])) {
12883
+ const toAddTypeId = sRecord["Source.EntityType.ID"];
12884
+ if (toAddTypeId && !this.allowedTypeIDs.includes(toAddTypeId)) {
12885
+ this.allowedTypeIDs.push(toAddTypeId);
12886
+ }
12887
+ }
12888
+ }
12889
+ }
12890
+ }
12852
12891
  setGetter() {
12853
12892
  var _a, _b, _c;
12854
12893
  this.unsetGetter();
@@ -12880,9 +12919,14 @@ var EntitiesRenderManager;
12880
12919
  zoomControl: this.zoomControl
12881
12920
  });
12882
12921
  this.getter.IncludeMenuItem(this.item.id, this.item.BruceEntity["EntityType.ID"], (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [], minMax[0], minMax[1]);
12883
- this.getterSub = this.getter.OnUpdate.Subscribe((entities) => {
12922
+ this.getterSub = this.getter.OnUpdate.Subscribe((data) => {
12923
+ var _a;
12924
+ if (!((_a = data === null || data === void 0 ? void 0 : data.entities) === null || _a === void 0 ? void 0 : _a.length)) {
12925
+ return;
12926
+ }
12927
+ this.updateAllowedTypeIDs(data.entityTypeSources, data.entities);
12884
12928
  if (isTagItem) {
12885
- this.distributeForRender(entities.filter((entity) => {
12929
+ this.distributeForRender(data.entities.filter((entity) => {
12886
12930
  let entityTags = entity.Bruce["Layer.ID"];
12887
12931
  if (!entityTags) {
12888
12932
  entityTags = [];
@@ -12893,7 +12937,7 @@ var EntitiesRenderManager;
12893
12937
  }));
12894
12938
  }
12895
12939
  else {
12896
- this.distributeForRender(entities);
12940
+ this.distributeForRender(data.entities);
12897
12941
  }
12898
12942
  });
12899
12943
  }
@@ -13368,7 +13412,7 @@ var EntitiesRenderManager;
13368
13412
  * @returns
13369
13413
  */
13370
13414
  const register = (thing) => {
13371
- var _a, _b, _c, _d, _e, _f;
13415
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13372
13416
  // See if the cesium entity already exists in a group.
13373
13417
  let group = groups.find((x) => { var _a; return ((_a = x.visual) === null || _a === void 0 ? void 0 : _a.id) == thing.id || x.siblings.find(x => (x === null || x === void 0 ? void 0 : x.id) == thing.id); });
13374
13418
  if (group) {
@@ -13411,7 +13455,8 @@ var EntitiesRenderManager;
13411
13455
  })) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
13412
13456
  cdn: this.item.cdnEnabled,
13413
13457
  collection: source.entities,
13414
- scenario: (_f = (_e = group.data) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f.Scenario
13458
+ scenario: (_f = (_e = group.data) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f.Scenario,
13459
+ outline: (_h = (_g = group.data) === null || _g === void 0 ? void 0 : _g.Bruce) === null || _h === void 0 ? void 0 : _h.Outline,
13415
13460
  };
13416
13461
  group.rego = rego;
13417
13462
  this.visualsManager.AddRego({
@@ -13480,7 +13525,7 @@ var EntitiesRenderManager;
13480
13525
  });
13481
13526
  entitiesHistoric = historicData.recordsByIds;
13482
13527
  // Remove ones with no historicAttrKey and no historic data.
13483
- const toRemoveIds = entities.filter(x => { var _a, _b; return !((_b = (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricLayers) === null || _b === void 0 ? void 0 : _b.length) && !entitiesHistoric[x.Bruce.ID]; }).map(x => x.Bruce.ID);
13528
+ const toRemoveIds = entities.filter(x => { var _a, _b; return !((_b = (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.Outline) === null || _b === void 0 ? void 0 : _b.length) && !entitiesHistoric[x.Bruce.ID]; }).map(x => x.Bruce.ID);
13484
13529
  for (let i = 0; i < toRemoveIds.length; i++) {
13485
13530
  const removeId = toRemoveIds[i];
13486
13531
  this.visualsManager.RemoveRegos({
@@ -13495,7 +13540,7 @@ var EntitiesRenderManager;
13495
13540
  // Not interpolating.
13496
13541
  // So we'll see if the Entities have a historic key or not.
13497
13542
  else {
13498
- const toRemoveIds = entities.filter(x => { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricLayers); }).map(x => x.Bruce.ID);
13543
+ const toRemoveIds = entities.filter(x => { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.Outline); }).map(x => x.Bruce.ID);
13499
13544
  for (let i = 0; i < toRemoveIds.length; i++) {
13500
13545
  const removeId = toRemoveIds[i];
13501
13546
  this.visualsManager.RemoveRegos({
@@ -13547,7 +13592,7 @@ var EntitiesRenderManager;
13547
13592
  const rego = {
13548
13593
  canEdit: true,
13549
13594
  entityId: id,
13550
- schemaId: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
13595
+ schema: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
13551
13596
  menuItemId: this.item.id,
13552
13597
  menuItemType: this.item.Type,
13553
13598
  visual: cEntity,
@@ -13558,7 +13603,7 @@ var EntitiesRenderManager;
13558
13603
  overrideShow: wasClustered ? false : null,
13559
13604
  name: cEntity.name,
13560
13605
  cdn: this.item.cdnEnabled,
13561
- historicLayers: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.HistoricLayers,
13606
+ outline: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.Outline,
13562
13607
  scenario: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Scenario
13563
13608
  };
13564
13609
  this.visualsManager.AddRego({
@@ -13571,9 +13616,9 @@ var EntitiesRenderManager;
13571
13616
  rego.visual = cEntity;
13572
13617
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
13573
13618
  rego.tagIds = ((_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
13574
- rego.historicLayers = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.HistoricLayers;
13619
+ rego.outline = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Outline;
13575
13620
  rego.cdn = this.item.cdnEnabled;
13576
- rego.schemaId = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.SchemaID;
13621
+ rego.schema = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.SchemaID;
13577
13622
  rego.scenario = (_m = entity.Bruce) === null || _m === void 0 ? void 0 : _m.Scenario;
13578
13623
  // Marked as stale meaning some change was performed that requires a refresh.
13579
13624
  // This usually means a new sibling was added that we need to update.
@@ -15842,16 +15887,16 @@ class TilesetStyler {
15842
15887
  this.entityGatherer.Queue(needsDataIds, highPriority);
15843
15888
  }
15844
15889
  }
15845
- styleTilesetFeature(entity) {
15846
- this.styleTilesetFeatureFullData(entity, null, []);
15890
+ styleTilesetFeature(rego) {
15891
+ this.styleTilesetFeatureFullData(rego, null, []);
15847
15892
  }
15848
- styleTilesetFeatureFullData(entity, data, tags) {
15893
+ styleTilesetFeatureFullData(rego, data, tags) {
15849
15894
  var _a, _b, _c, _d, _e, _f, _g, _h;
15850
- const visual = entity.visual;
15895
+ const visual = rego.visual;
15851
15896
  if (!visual || !(visual instanceof Cesium3DTileFeature)) {
15852
15897
  return;
15853
15898
  }
15854
- const style = this.getTilesetFeatureStyle(entity.entityTypeId);
15899
+ const style = this.getTilesetFeatureStyle(rego.entityTypeId);
15855
15900
  const bColor = style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? Calculator.GetColor(style.modelStyle.fillColor, data, tags) : null;
15856
15901
  let cColor = null;
15857
15902
  if (bColor == null) {
@@ -15860,15 +15905,15 @@ class TilesetStyler {
15860
15905
  else {
15861
15906
  cColor = colorToCColor$3(bColor);
15862
15907
  }
15863
- const override = this.overrideFeatureColor.get(entity.entityId) == true;
15908
+ const override = this.overrideFeatureColor.get(rego.entityId) == true;
15864
15909
  CesiumEntityStyler.SetDefaultColor({
15865
15910
  color: cColor,
15866
15911
  entity: visual,
15867
15912
  viewer: this.viewer,
15868
15913
  override: override
15869
15914
  });
15870
- this.overrideFeatureColor.set(entity.entityId, true);
15871
- this.styledEntityIds.set(entity.entityId, true);
15915
+ this.overrideFeatureColor.set(rego.entityId, true);
15916
+ this.styledEntityIds.set(rego.entityId, true);
15872
15917
  this._styleProgressQueue.Call();
15873
15918
  // Since we only need to update it for scenarios right now.
15874
15919
  // We'll avoid doing it if not needed, eg: first render and no scenario (same state as default).
@@ -15876,13 +15921,13 @@ class TilesetStyler {
15876
15921
  // Update the Entity's rego state.
15877
15922
  let changed = false;
15878
15923
  // Changed scenario.
15879
- if (entity.scenario != ((_c = data === null || data === void 0 ? void 0 : data.Bruce) === null || _c === void 0 ? void 0 : _c.Scenario)) {
15880
- entity.scenario = (_d = data === null || data === void 0 ? void 0 : data.Bruce) === null || _d === void 0 ? void 0 : _d.Scenario;
15924
+ if (rego.scenario != ((_c = data === null || data === void 0 ? void 0 : data.Bruce) === null || _c === void 0 ? void 0 : _c.Scenario)) {
15925
+ rego.scenario = (_d = data === null || data === void 0 ? void 0 : data.Bruce) === null || _d === void 0 ? void 0 : _d.Scenario;
15881
15926
  changed = true;
15882
15927
  }
15883
15928
  // Changed historic.
15884
- if ((data && isHistoricMetadataChanged(entity, data)) || (!data && ((_e = entity.historicLayers) === null || _e === void 0 ? void 0 : _e.length) && !((_g = (_f = data.Bruce) === null || _f === void 0 ? void 0 : _f.HistoricLayers) === null || _g === void 0 ? void 0 : _g.length))) {
15885
- entity.historicLayers = (_h = data === null || data === void 0 ? void 0 : data.Bruce) === null || _h === void 0 ? void 0 : _h.HistoricLayers;
15929
+ if ((data && isOutlineChanged(rego, data)) || (!data && ((_e = rego.outline) === null || _e === void 0 ? void 0 : _e.length) && !((_g = (_f = data.Bruce) === null || _f === void 0 ? void 0 : _f.Outline) === null || _g === void 0 ? void 0 : _g.length))) {
15930
+ rego.outline = (_h = data === null || data === void 0 ? void 0 : data.Bruce) === null || _h === void 0 ? void 0 : _h.Outline;
15886
15931
  changed = true;
15887
15932
  }
15888
15933
  // Something changed, trigger a rego update.
@@ -15890,8 +15935,8 @@ class TilesetStyler {
15890
15935
  if (changed) {
15891
15936
  this.register.OnUpdate.Trigger({
15892
15937
  type: VisualsRegister.EVisualUpdateType.Update,
15893
- entityId: entity.entityId,
15894
- rego: entity
15938
+ entityId: rego.entityId,
15939
+ rego: rego
15895
15940
  });
15896
15941
  }
15897
15942
  }
@@ -17059,7 +17104,9 @@ var EntityFilterGetter;
17059
17104
  response = {
17060
17105
  entities: tmpResponse.Items ? tmpResponse.Items : [],
17061
17106
  nextPage: tmpResponse.NextPage,
17062
- nextPageUrl: tmpResponse.NextPageURL
17107
+ nextPageUrl: tmpResponse.NextPageURL,
17108
+ sources: tmpResponse.Source,
17109
+ entityTypeSources: tmpResponse["EntityType.Source"]
17063
17110
  };
17064
17111
  }
17065
17112
  else {
@@ -17098,7 +17145,11 @@ var EntityFilterGetter;
17098
17145
  const entities = response.entities;
17099
17146
  const integrity = this.getIntegrityId();
17100
17147
  if (loopIntegrity == integrity && entities) {
17101
- (_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger(entities);
17148
+ (_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger({
17149
+ entities: entities,
17150
+ sources: response.sources,
17151
+ entityTypeSources: response.entityTypeSources
17152
+ });
17102
17153
  }
17103
17154
  if (this.gatheredIntegrity != integrity) {
17104
17155
  this.gatheredIntegrity = integrity;
@@ -17221,12 +17272,14 @@ var EntityFilterGetter;
17221
17272
  // Controller we can use to abort the request when a new loop starts.
17222
17273
  const controller = this.historicRefreshAbortController = new AbortController();
17223
17274
  let entities = [];
17275
+ let sources = [];
17276
+ let entityTypeSources = [];
17224
17277
  await SharedGetters.Queue.Run("Refreshing historic data in Menu Item that loads Entity Type: " + this.typeIds, async () => {
17225
17278
  var _a;
17226
17279
  if (controller.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
17227
17280
  return;
17228
17281
  }
17229
- entities = (await Entity$1.GetList({
17282
+ const data = await Entity$1.GetList({
17230
17283
  api: this.api,
17231
17284
  scenario: this.scenario,
17232
17285
  historicKey: this.historicAttrKey,
@@ -17257,7 +17310,10 @@ var EntityFilterGetter;
17257
17310
  noCache: true,
17258
17311
  abortSignal: controller.signal
17259
17312
  }
17260
- })).entities;
17313
+ });
17314
+ entities = data.entities;
17315
+ sources = data.sources;
17316
+ entityTypeSources = data.entityTypeSources;
17261
17317
  });
17262
17318
  // Date changed.
17263
17319
  if (this.historicAttrDateTime != historicAttrDateTime) {
@@ -17271,7 +17327,11 @@ var EntityFilterGetter;
17271
17327
  if (!this.GetMenuItems().length) {
17272
17328
  break;
17273
17329
  }
17274
- (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(entities);
17330
+ (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger({
17331
+ entities: entities,
17332
+ sources: sources,
17333
+ entityTypeSources: entityTypeSources
17334
+ });
17275
17335
  }
17276
17336
  }
17277
17337
  catch (e) {
@@ -31661,7 +31721,7 @@ class WidgetViewBar extends Widget.AWidget {
31661
31721
  }
31662
31722
  }
31663
31723
 
31664
- const VERSION = "5.6.2";
31724
+ const VERSION = "5.6.4";
31665
31725
 
31666
- export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
31726
+ export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isOutlineChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
31667
31727
  //# sourceMappingURL=bruce-cesium.es5.js.map