bruce-cesium 4.7.8 → 4.7.9

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, EntityAttribute, EntityAttachment, EntityAttachmentType, 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, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, OrthographicFrustum, EasingFunction, NearFarScalar, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, Matrix4, Matrix3, IonResource, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, 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, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8122,11 +8122,11 @@ var EntityRenderEngine;
8122
8122
  }
8123
8123
  EntityRenderEngine.GetRenderGroupId = GetRenderGroupId;
8124
8124
  function Render(params) {
8125
- var _a, _b, _c, _d, _e, _f;
8125
+ var _a, _b, _c, _d, _e, _f, _g, _h;
8126
8126
  return __awaiter(this, void 0, void 0, function () {
8127
8127
  var groupRenderParams, updated, cEntities, models, multiGeometry, polygons, polylines, points, prepareGeometry, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, geometry, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
8128
- return __generator(this, function (_g) {
8129
- switch (_g.label) {
8128
+ return __generator(this, function (_j) {
8129
+ switch (_j.label) {
8130
8130
  case 0:
8131
8131
  groupRenderParams = {
8132
8132
  apiGetter: params.apiGetter,
@@ -8208,8 +8208,9 @@ var EntityRenderEngine;
8208
8208
  if (!params.force &&
8209
8209
  newRenderId == oldRenderId &&
8210
8210
  !(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
8211
- // If historic metadata is different then it's also stale.
8212
- ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.HistoricDateTime))) {
8211
+ // If historic/scenario metadata is different then it's also stale.
8212
+ ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.HistoricDateTime)) &&
8213
+ ((existingRego === null || existingRego === void 0 ? void 0 : existingRego.scenario) == ((_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c["Scenario.ID"]))) {
8213
8214
  // No sorting category needed. Already rendered the way we want.
8214
8215
  cEntities.set(id, existingRego.visual);
8215
8216
  }
@@ -8220,9 +8221,10 @@ var EntityRenderEngine;
8220
8221
  // Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
8221
8222
  existingRego.stale = false;
8222
8223
  // Update metadata for the same reason.
8223
- existingRego.historicDateTime = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c.HistoricDateTime;
8224
- existingRego.historicAttrKey = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricAttrKey;
8224
+ existingRego.historicDateTime = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricDateTime;
8225
+ existingRego.historicAttrKey = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.HistoricAttrKey;
8225
8226
  existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
8227
+ existingRego.scenario = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f["Scenario.ID"];
8226
8228
  updated.set(id, true);
8227
8229
  }
8228
8230
  if (displayType == ZoomControl.EDisplayType.Model3D) {
@@ -8235,7 +8237,7 @@ var EntityRenderEngine;
8235
8237
  entity: entity,
8236
8238
  path: ["Bruce", "VectorGeometry"]
8237
8239
  });
8238
- if ((_e = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _e === void 0 ? void 0 : _e.length) {
8240
+ if ((_g = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _g === void 0 ? void 0 : _g.length) {
8239
8241
  multiGeometry.push(entity);
8240
8242
  }
8241
8243
  else {
@@ -8253,7 +8255,7 @@ var EntityRenderEngine;
8253
8255
  mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models, entitiesHistoric: params.entitiesHistoric, entityHistoricDrawTrack: params.entityHistoricDrawTrack });
8254
8256
  return [4 /*yield*/, Model3d.RenderGroup(mParams)];
8255
8257
  case 1:
8256
- mEntities = _g.sent();
8258
+ mEntities = _j.sent();
8257
8259
  for (i = 0; i < mParams.entities.length; i++) {
8258
8260
  entity = mParams.entities[i];
8259
8261
  id = entity.Bruce.ID;
@@ -8265,20 +8267,20 @@ var EntityRenderEngine;
8265
8267
  multiGeometry.push(entity);
8266
8268
  }
8267
8269
  }
8268
- _g.label = 2;
8270
+ _j.label = 2;
8269
8271
  case 2:
8270
8272
  if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
8271
8273
  _loop_1 = function (i) {
8272
8274
  var entity, geometry, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
8273
- return __generator(this, function (_h) {
8274
- switch (_h.label) {
8275
+ return __generator(this, function (_k) {
8276
+ switch (_k.label) {
8275
8277
  case 0:
8276
8278
  entity = multiGeometry[i];
8277
8279
  geometry = Entity$1.GetValue({
8278
8280
  entity: entity,
8279
8281
  path: ["Bruce", "VectorGeometry"]
8280
8282
  });
8281
- if (!((_f = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _f === void 0 ? void 0 : _f.length)) {
8283
+ if (!((_h = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _h === void 0 ? void 0 : _h.length)) {
8282
8284
  polygons.push(entity);
8283
8285
  return [2 /*return*/, "continue"];
8284
8286
  }
@@ -8292,7 +8294,7 @@ var EntityRenderEngine;
8292
8294
  }
8293
8295
  return [4 /*yield*/, Polygon.RenderGroup(pParams)];
8294
8296
  case 1:
8295
- cPoly = _h.sent();
8297
+ cPoly = _k.sent();
8296
8298
  Array.from(cPoly.keys()).forEach(function (key) {
8297
8299
  if (cPoly.get(key)) {
8298
8300
  pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
@@ -8301,7 +8303,7 @@ var EntityRenderEngine;
8301
8303
  rendered = Array.from(cPoly.values());
8302
8304
  return [4 /*yield*/, Polyline.RenderGroup(pParams)];
8303
8305
  case 2:
8304
- cLines = _h.sent();
8306
+ cLines = _k.sent();
8305
8307
  Array.from(cLines.keys()).forEach(function (key) {
8306
8308
  if (cLines.get(key)) {
8307
8309
  pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
@@ -8311,9 +8313,9 @@ var EntityRenderEngine;
8311
8313
  if (!!rendered.length) return [3 /*break*/, 4];
8312
8314
  return [4 /*yield*/, Point.RenderGroup(pParams)];
8313
8315
  case 3:
8314
- cPoints = _h.sent();
8316
+ cPoints = _k.sent();
8315
8317
  rendered = rendered.concat(Array.from(cPoints.values()));
8316
- _h.label = 4;
8318
+ _k.label = 4;
8317
8319
  case 4:
8318
8320
  rendered = rendered.filter(function (x) { return x != null; });
8319
8321
  if (rendered.length) {
@@ -8340,13 +8342,13 @@ var EntityRenderEngine;
8340
8342
  });
8341
8343
  };
8342
8344
  i = 0;
8343
- _g.label = 3;
8345
+ _j.label = 3;
8344
8346
  case 3:
8345
8347
  if (!(i < multiGeometry.length)) return [3 /*break*/, 6];
8346
8348
  return [5 /*yield**/, _loop_1(i)];
8347
8349
  case 4:
8348
- _g.sent();
8349
- _g.label = 5;
8350
+ _j.sent();
8351
+ _j.label = 5;
8350
8352
  case 5:
8351
8353
  i++;
8352
8354
  return [3 /*break*/, 3];
@@ -8355,7 +8357,7 @@ var EntityRenderEngine;
8355
8357
  pParams = __assign(__assign({}, groupRenderParams), { entities: polygons, rendered: cEntities });
8356
8358
  return [4 /*yield*/, Polygon.RenderGroup(pParams)];
8357
8359
  case 7:
8358
- pEntities = _g.sent();
8360
+ pEntities = _j.sent();
8359
8361
  for (i = 0; i < pParams.entities.length; i++) {
8360
8362
  entity = pParams.entities[i];
8361
8363
  cEntity = pEntities.get(entity.Bruce.ID);
@@ -8366,13 +8368,13 @@ var EntityRenderEngine;
8366
8368
  polylines.push(entity);
8367
8369
  }
8368
8370
  }
8369
- _g.label = 8;
8371
+ _j.label = 8;
8370
8372
  case 8:
8371
8373
  if (!(polylines.length > 0)) return [3 /*break*/, 10];
8372
8374
  pParams = __assign(__assign({}, groupRenderParams), { entities: polylines, rendered: cEntities });
8373
8375
  return [4 /*yield*/, Polyline.RenderGroup(pParams)];
8374
8376
  case 9:
8375
- pEntities = _g.sent();
8377
+ pEntities = _j.sent();
8376
8378
  for (i = 0; i < pParams.entities.length; i++) {
8377
8379
  entity = pParams.entities[i];
8378
8380
  cEntity = pEntities.get(entity.Bruce.ID);
@@ -8383,13 +8385,13 @@ var EntityRenderEngine;
8383
8385
  points.push(entity);
8384
8386
  }
8385
8387
  }
8386
- _g.label = 10;
8388
+ _j.label = 10;
8387
8389
  case 10:
8388
8390
  if (!(points.length > 0)) return [3 /*break*/, 12];
8389
8391
  pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities, entitiesHistoric: params.entitiesHistoric, entityHistoricDrawTrack: params.entityHistoricDrawTrack });
8390
8392
  return [4 /*yield*/, Point.RenderGroup(pParams)];
8391
8393
  case 11:
8392
- pEntities = _g.sent();
8394
+ pEntities = _j.sent();
8393
8395
  for (i = 0; i < pParams.entities.length; i++) {
8394
8396
  entity = pParams.entities[i];
8395
8397
  cEntity = pEntities.get(entity.Bruce.ID);
@@ -8397,7 +8399,7 @@ var EntityRenderEngine;
8397
8399
  cEntities.set(entity.Bruce.ID, cEntity);
8398
8400
  }
8399
8401
  }
8400
- _g.label = 12;
8402
+ _j.label = 12;
8401
8403
  case 12: return [2 /*return*/, {
8402
8404
  entities: cEntities,
8403
8405
  updated: updated
@@ -12630,7 +12632,7 @@ var EntitiesRenderManager;
12630
12632
  };
12631
12633
  toForceUpdate = [];
12632
12634
  register = function (thing) {
12633
- var _a, _b, _c, _d;
12635
+ var _a, _b, _c, _d, _e, _f;
12634
12636
  // See if the cesium entity already exists in a group.
12635
12637
  var group = groups.find(function (x) { var _a; return ((_a = x.visual) === null || _a === void 0 ? void 0 : _a.id) == thing.id || x.siblings.find(function (x) { return (x === null || x === void 0 ? void 0 : x.id) == thing.id; }); });
12636
12638
  if (group) {
@@ -12671,7 +12673,8 @@ var EntitiesRenderManager;
12671
12673
  defaultToId: false
12672
12674
  })) !== null && _d !== void 0 ? _d : "Unnamed Entity" : "Unnamed Entity",
12673
12675
  cdn: _this.item.cdnEnabled,
12674
- collection: source.entities
12676
+ collection: source.entities,
12677
+ scenario: (_f = (_e = group.data) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f["Scenario.ID"]
12675
12678
  };
12676
12679
  group.rego = rego;
12677
12680
  _this.visualsManager.AddRego({
@@ -17079,6 +17082,9 @@ var EntityFilterGetter;
17079
17082
  */
17080
17083
  Getter.prototype.emitHistoricData = function () {
17081
17084
  var _this = this;
17085
+ if (!this.GetMenuItems().length) {
17086
+ return;
17087
+ }
17082
17088
  var integrity = this.getIntegrityId();
17083
17089
  // Gathered ID does't match current one.
17084
17090
  if (this.gatheredIntegrity != integrity) {
@@ -28632,7 +28638,7 @@ var WidgetViewBar = /** @class */ (function (_super) {
28632
28638
  return WidgetViewBar;
28633
28639
  }(Widget.AWidget));
28634
28640
 
28635
- var VERSION = "4.7.8";
28641
+ var VERSION = "4.7.9";
28636
28642
 
28637
28643
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, 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 };
28638
28644
  //# sourceMappingURL=bruce-cesium.es5.js.map