bruce-cesium 5.6.3 → 5.6.5

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.
@@ -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++) {
@@ -13402,7 +13412,7 @@ var EntitiesRenderManager;
13402
13412
  * @returns
13403
13413
  */
13404
13414
  const register = (thing) => {
13405
- var _a, _b, _c, _d, _e, _f;
13415
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13406
13416
  // See if the cesium entity already exists in a group.
13407
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); });
13408
13418
  if (group) {
@@ -13445,7 +13455,8 @@ var EntitiesRenderManager;
13445
13455
  })) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
13446
13456
  cdn: this.item.cdnEnabled,
13447
13457
  collection: source.entities,
13448
- 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,
13449
13460
  };
13450
13461
  group.rego = rego;
13451
13462
  this.visualsManager.AddRego({
@@ -13514,7 +13525,7 @@ var EntitiesRenderManager;
13514
13525
  });
13515
13526
  entitiesHistoric = historicData.recordsByIds;
13516
13527
  // Remove ones with no historicAttrKey and no historic data.
13517
- 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);
13518
13529
  for (let i = 0; i < toRemoveIds.length; i++) {
13519
13530
  const removeId = toRemoveIds[i];
13520
13531
  this.visualsManager.RemoveRegos({
@@ -13529,7 +13540,7 @@ var EntitiesRenderManager;
13529
13540
  // Not interpolating.
13530
13541
  // So we'll see if the Entities have a historic key or not.
13531
13542
  else {
13532
- 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);
13533
13544
  for (let i = 0; i < toRemoveIds.length; i++) {
13534
13545
  const removeId = toRemoveIds[i];
13535
13546
  this.visualsManager.RemoveRegos({
@@ -13581,7 +13592,7 @@ var EntitiesRenderManager;
13581
13592
  const rego = {
13582
13593
  canEdit: true,
13583
13594
  entityId: id,
13584
- schemaId: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
13595
+ schema: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.Schema,
13585
13596
  menuItemId: this.item.id,
13586
13597
  menuItemType: this.item.Type,
13587
13598
  visual: cEntity,
@@ -13592,7 +13603,7 @@ var EntitiesRenderManager;
13592
13603
  overrideShow: wasClustered ? false : null,
13593
13604
  name: cEntity.name,
13594
13605
  cdn: this.item.cdnEnabled,
13595
- 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,
13596
13607
  scenario: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Scenario
13597
13608
  };
13598
13609
  this.visualsManager.AddRego({
@@ -13605,9 +13616,9 @@ var EntitiesRenderManager;
13605
13616
  rego.visual = cEntity;
13606
13617
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
13607
13618
  rego.tagIds = ((_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
13608
- 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;
13609
13620
  rego.cdn = this.item.cdnEnabled;
13610
- 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.Schema;
13611
13622
  rego.scenario = (_m = entity.Bruce) === null || _m === void 0 ? void 0 : _m.Scenario;
13612
13623
  // Marked as stale meaning some change was performed that requires a refresh.
13613
13624
  // This usually means a new sibling was added that we need to update.
@@ -15876,16 +15887,16 @@ class TilesetStyler {
15876
15887
  this.entityGatherer.Queue(needsDataIds, highPriority);
15877
15888
  }
15878
15889
  }
15879
- styleTilesetFeature(entity) {
15880
- this.styleTilesetFeatureFullData(entity, null, []);
15890
+ styleTilesetFeature(rego) {
15891
+ this.styleTilesetFeatureFullData(rego, null, []);
15881
15892
  }
15882
- styleTilesetFeatureFullData(entity, data, tags) {
15893
+ styleTilesetFeatureFullData(rego, data, tags) {
15883
15894
  var _a, _b, _c, _d, _e, _f, _g, _h;
15884
- const visual = entity.visual;
15895
+ const visual = rego.visual;
15885
15896
  if (!visual || !(visual instanceof Cesium3DTileFeature)) {
15886
15897
  return;
15887
15898
  }
15888
- const style = this.getTilesetFeatureStyle(entity.entityTypeId);
15899
+ const style = this.getTilesetFeatureStyle(rego.entityTypeId);
15889
15900
  const bColor = style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? Calculator.GetColor(style.modelStyle.fillColor, data, tags) : null;
15890
15901
  let cColor = null;
15891
15902
  if (bColor == null) {
@@ -15894,15 +15905,15 @@ class TilesetStyler {
15894
15905
  else {
15895
15906
  cColor = colorToCColor$3(bColor);
15896
15907
  }
15897
- const override = this.overrideFeatureColor.get(entity.entityId) == true;
15908
+ const override = this.overrideFeatureColor.get(rego.entityId) == true;
15898
15909
  CesiumEntityStyler.SetDefaultColor({
15899
15910
  color: cColor,
15900
15911
  entity: visual,
15901
15912
  viewer: this.viewer,
15902
15913
  override: override
15903
15914
  });
15904
- this.overrideFeatureColor.set(entity.entityId, true);
15905
- this.styledEntityIds.set(entity.entityId, true);
15915
+ this.overrideFeatureColor.set(rego.entityId, true);
15916
+ this.styledEntityIds.set(rego.entityId, true);
15906
15917
  this._styleProgressQueue.Call();
15907
15918
  // Since we only need to update it for scenarios right now.
15908
15919
  // We'll avoid doing it if not needed, eg: first render and no scenario (same state as default).
@@ -15910,13 +15921,13 @@ class TilesetStyler {
15910
15921
  // Update the Entity's rego state.
15911
15922
  let changed = false;
15912
15923
  // Changed scenario.
15913
- if (entity.scenario != ((_c = data === null || data === void 0 ? void 0 : data.Bruce) === null || _c === void 0 ? void 0 : _c.Scenario)) {
15914
- 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;
15915
15926
  changed = true;
15916
15927
  }
15917
15928
  // Changed historic.
15918
- 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))) {
15919
- 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;
15920
15931
  changed = true;
15921
15932
  }
15922
15933
  // Something changed, trigger a rego update.
@@ -15924,8 +15935,8 @@ class TilesetStyler {
15924
15935
  if (changed) {
15925
15936
  this.register.OnUpdate.Trigger({
15926
15937
  type: VisualsRegister.EVisualUpdateType.Update,
15927
- entityId: entity.entityId,
15928
- rego: entity
15938
+ entityId: rego.entityId,
15939
+ rego: rego
15929
15940
  });
15930
15941
  }
15931
15942
  }
@@ -31710,7 +31721,7 @@ class WidgetViewBar extends Widget.AWidget {
31710
31721
  }
31711
31722
  }
31712
31723
 
31713
- const VERSION = "5.6.3";
31724
+ const VERSION = "5.6.5";
31714
31725
 
31715
- 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 };
31716
31727
  //# sourceMappingURL=bruce-cesium.es5.js.map