bruce-cesium 5.6.4 → 5.6.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.
@@ -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, 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';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, Primitive, Cesium3DTileFeature, SceneMode, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, Cesium3DTileColorBlendMode, KmlDataSource, Quaternion, Matrix3, Matrix4, OrthographicFrustum, EasingFunction, NearFarScalar, SceneTransforms, Cesium3DTileset, IonResource, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, 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;
@@ -8301,7 +8301,7 @@ function getHeightRef$3(style, defaultStyle) {
8301
8301
  }
8302
8302
 
8303
8303
  /**
8304
- * Returns if the historic metadata is different.
8304
+ * Returns if the outline metadata is different.
8305
8305
  * @param rego
8306
8306
  * @param entity
8307
8307
  */
@@ -8351,7 +8351,7 @@ var EntityRenderEngine;
8351
8351
  }
8352
8352
  EntityRenderEngine.GetRenderGroupId = GetRenderGroupId;
8353
8353
  async function Render(params) {
8354
- var _a, _b, _c, _d, _e, _f;
8354
+ var _a, _b, _c, _d;
8355
8355
  const groupRenderParams = {
8356
8356
  apiGetter: params.apiGetter,
8357
8357
  viewer: params.viewer,
@@ -8434,8 +8434,7 @@ var EntityRenderEngine;
8434
8434
  if (!params.force &&
8435
8435
  newRenderId == oldRenderId &&
8436
8436
  !(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
8437
- !isOutlineChanged(existingRego, entity) &&
8438
- ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.scenario) == ((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Scenario))) {
8437
+ !isOutlineChanged(existingRego, entity)) {
8439
8438
  // No sorting category needed. Already rendered the way we want.
8440
8439
  cEntities.set(id, existingRego.visual);
8441
8440
  }
@@ -8446,9 +8445,8 @@ var EntityRenderEngine;
8446
8445
  // Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
8447
8446
  existingRego.stale = false;
8448
8447
  // Update metadata for the same reason.
8449
- existingRego.outline = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.Outline;
8448
+ existingRego.outline = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Outline;
8450
8449
  existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
8451
- existingRego.scenario = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.Scenario;
8452
8450
  updated.set(id, true);
8453
8451
  }
8454
8452
  if (displayType == ZoomControl.EDisplayType.Model3D) {
@@ -8461,7 +8459,7 @@ var EntityRenderEngine;
8461
8459
  entity: entity,
8462
8460
  path: ["Bruce", "VectorGeometry"]
8463
8461
  });
8464
- if ((_e = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _e === void 0 ? void 0 : _e.length) {
8462
+ if ((_c = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _c === void 0 ? void 0 : _c.length) {
8465
8463
  multiGeometry.push(entity);
8466
8464
  }
8467
8465
  else {
@@ -8504,7 +8502,7 @@ var EntityRenderEngine;
8504
8502
  entity: entity,
8505
8503
  path: ["Bruce", "VectorGeometry"]
8506
8504
  });
8507
- if (!((_f = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _f === void 0 ? void 0 : _f.length)) {
8505
+ if (!((_d = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _d === void 0 ? void 0 : _d.length)) {
8508
8506
  polygons.push(entity);
8509
8507
  continue;
8510
8508
  }
@@ -9638,7 +9636,7 @@ var EntityLabel;
9638
9636
  }
9639
9637
  clearTimeout(this.loadTimeout);
9640
9638
  this.loadTimeout = setTimeout(async () => {
9641
- var _a, _b;
9639
+ var _a, _b, _c, _d;
9642
9640
  if (this.disposed || this.counter != counter) {
9643
9641
  return;
9644
9642
  }
@@ -9672,7 +9670,7 @@ var EntityLabel;
9672
9670
  api: this.api,
9673
9671
  entityId: this.rego.entityId,
9674
9672
  entityTypeId: this.rego.entityTypeId,
9675
- scenario: this.rego.scenario,
9673
+ scenario: ((_c = this.rego.outline) === null || _c === void 0 ? void 0 : _c.length) ? (_d = this.rego.outline.find(x => !!x.Scenario)) === null || _d === void 0 ? void 0 : _d.Scenario : null,
9676
9674
  schemaId: this.rego.schema,
9677
9675
  migrated: true
9678
9676
  });
@@ -13412,7 +13410,7 @@ var EntitiesRenderManager;
13412
13410
  * @returns
13413
13411
  */
13414
13412
  const register = (thing) => {
13415
- var _a, _b, _c, _d, _e, _f, _g, _h;
13413
+ var _a, _b, _c, _d, _e, _f;
13416
13414
  // See if the cesium entity already exists in a group.
13417
13415
  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); });
13418
13416
  if (group) {
@@ -13455,8 +13453,7 @@ var EntitiesRenderManager;
13455
13453
  })) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
13456
13454
  cdn: this.item.cdnEnabled,
13457
13455
  collection: source.entities,
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,
13456
+ outline: (_f = (_e = group.data) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f.Outline,
13460
13457
  };
13461
13458
  group.rego = rego;
13462
13459
  this.visualsManager.AddRego({
@@ -13502,7 +13499,7 @@ var EntitiesRenderManager;
13502
13499
  * @returns
13503
13500
  */
13504
13501
  async renderAsIndividuals(entities, force = false) {
13505
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
13502
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
13506
13503
  // Entity ID -> historic records array.
13507
13504
  // We load this as extra information when rendering historic records.
13508
13505
  // This way we know what to animate towards as time changes.
@@ -13592,7 +13589,7 @@ var EntitiesRenderManager;
13592
13589
  const rego = {
13593
13590
  canEdit: true,
13594
13591
  entityId: id,
13595
- schema: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
13592
+ schema: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.Schema,
13596
13593
  menuItemId: this.item.id,
13597
13594
  menuItemType: this.item.Type,
13598
13595
  visual: cEntity,
@@ -13603,8 +13600,7 @@ var EntitiesRenderManager;
13603
13600
  overrideShow: wasClustered ? false : null,
13604
13601
  name: cEntity.name,
13605
13602
  cdn: this.item.cdnEnabled,
13606
- outline: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.Outline,
13607
- scenario: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Scenario
13603
+ outline: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.Outline
13608
13604
  };
13609
13605
  this.visualsManager.AddRego({
13610
13606
  rego,
@@ -13615,11 +13611,10 @@ var EntitiesRenderManager;
13615
13611
  rego.name = cEntity.name;
13616
13612
  rego.visual = cEntity;
13617
13613
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
13618
- rego.tagIds = ((_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
13619
- rego.outline = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Outline;
13614
+ rego.tagIds = ((_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
13615
+ rego.outline = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.Outline;
13620
13616
  rego.cdn = this.item.cdnEnabled;
13621
- rego.schema = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.SchemaID;
13622
- rego.scenario = (_m = entity.Bruce) === null || _m === void 0 ? void 0 : _m.Scenario;
13617
+ rego.schema = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Schema;
13623
13618
  // Marked as stale meaning some change was performed that requires a refresh.
13624
13619
  // This usually means a new sibling was added that we need to update.
13625
13620
  if (rego.stale) {
@@ -13649,7 +13644,7 @@ var EntitiesRenderManager;
13649
13644
  menuItemId: this.item.id,
13650
13645
  requestRender: false
13651
13646
  });
13652
- (_o = this.clustering) === null || _o === void 0 ? void 0 : _o.RemoveEntity(id, false);
13647
+ (_l = this.clustering) === null || _l === void 0 ? void 0 : _l.RemoveEntity(id, false);
13653
13648
  }
13654
13649
  }
13655
13650
  this.viewer.scene.requestRender();
@@ -15449,6 +15444,47 @@ function correctStyle(style) {
15449
15444
  function colorToCColor$3(color) {
15450
15445
  return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
15451
15446
  }
15447
+ /**
15448
+ * Returns if the outline metadata is different.
15449
+ * @param rego
15450
+ * @param entity
15451
+ */
15452
+ function isOutlineChanged$1(rego, entity) {
15453
+ var _a, _b, _c, _d, _e, _f;
15454
+ if (((_a = rego === null || rego === void 0 ? void 0 : rego.outline) === null || _a === void 0 ? void 0 : _a.length) != ((_c = (_b = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _b === void 0 ? void 0 : _b.Outline) === null || _c === void 0 ? void 0 : _c.length)) {
15455
+ return true;
15456
+ }
15457
+ else if (!(rego === null || rego === void 0 ? void 0 : rego.outline) && !((_d = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _d === void 0 ? void 0 : _d.Outline)) {
15458
+ return false;
15459
+ }
15460
+ else if (!(rego === null || rego === void 0 ? void 0 : rego.outline) || !((_e = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _e === void 0 ? void 0 : _e.Outline)) {
15461
+ return true;
15462
+ }
15463
+ // Compare each item.
15464
+ for (let i = 0; i < rego.outline.length; i++) {
15465
+ const rOutline = rego.outline[i];
15466
+ const eOutline = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.Outline[i];
15467
+ if (rOutline.Kind !== eOutline.Kind) {
15468
+ return true;
15469
+ }
15470
+ else if (rOutline.DateTime !== eOutline.DateTime) {
15471
+ return true;
15472
+ }
15473
+ else if (rOutline.Scenario !== eOutline.Scenario) {
15474
+ return true;
15475
+ }
15476
+ else if (rOutline.Baseline !== eOutline.Baseline) {
15477
+ return true;
15478
+ }
15479
+ else if (rOutline["Source.ID"] !== eOutline["Source.ID"]) {
15480
+ return true;
15481
+ }
15482
+ else if (rOutline["EntityType.Source.ID"] !== eOutline["EntityType.Source.ID"]) {
15483
+ return true;
15484
+ }
15485
+ }
15486
+ return false;
15487
+ }
15452
15488
  class TilesetStyler {
15453
15489
  constructor() {
15454
15490
  this.disposed = false;
@@ -15891,7 +15927,7 @@ class TilesetStyler {
15891
15927
  this.styleTilesetFeatureFullData(rego, null, []);
15892
15928
  }
15893
15929
  styleTilesetFeatureFullData(rego, data, tags) {
15894
- var _a, _b, _c, _d, _e, _f, _g, _h;
15930
+ var _a, _b;
15895
15931
  const visual = rego.visual;
15896
15932
  if (!visual || !(visual instanceof Cesium3DTileFeature)) {
15897
15933
  return;
@@ -15917,17 +15953,11 @@ class TilesetStyler {
15917
15953
  this._styleProgressQueue.Call();
15918
15954
  // Since we only need to update it for scenarios right now.
15919
15955
  // We'll avoid doing it if not needed, eg: first render and no scenario (same state as default).
15920
- if (this.shouldUpdateRegoStates && (override || ((_b = data === null || data === void 0 ? void 0 : data.Bruce) === null || _b === void 0 ? void 0 : _b.Scenario) || this.historic)) {
15956
+ if (this.shouldUpdateRegoStates && (override || this.historic)) {
15921
15957
  // Update the Entity's rego state.
15922
15958
  let changed = false;
15923
- // Changed 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;
15926
- changed = true;
15927
- }
15928
- // Changed historic.
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;
15959
+ if (isOutlineChanged$1(rego, data)) {
15960
+ rego.outline = (_b = data === null || data === void 0 ? void 0 : data.Bruce) === null || _b === void 0 ? void 0 : _b.Outline;
15931
15961
  changed = true;
15932
15962
  }
15933
15963
  // Something changed, trigger a rego update.
@@ -17799,8 +17829,7 @@ var TilesetCadRenderManager;
17799
17829
  accountId: accountId,
17800
17830
  tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
17801
17831
  tilesetType: Tileset.EType.Cad,
17802
- rootId: this.rootId,
17803
- scenario: null
17832
+ rootId: this.rootId
17804
17833
  };
17805
17834
  const featureAny = feature;
17806
17835
  const propertyNames = featureAny.getPropertyNames ? featureAny.getPropertyNames() : (_d = featureAny.getPropertyIds) === null || _d === void 0 ? void 0 : _d.call(featureAny);
@@ -31721,7 +31750,7 @@ class WidgetViewBar extends Widget.AWidget {
31721
31750
  }
31722
31751
  }
31723
31752
 
31724
- const VERSION = "5.6.4";
31753
+ const VERSION = "5.6.6";
31725
31754
 
31726
31755
  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 };
31727
31756
  //# sourceMappingURL=bruce-cesium.es5.js.map