bruce-cesium 5.3.8 → 5.4.0

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
- 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';
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, ProjectViewLegacyTile, Camera, 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, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, Quaternion, 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, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, HorizontalOrigin, VerticalOrigin, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, CesiumInspector, OrthographicFrustum, defined, ClockRange, EasingFunction, NearFarScalar, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, Matrix4, Matrix3, IonResource, BoundingSphere, GeometryInstance, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -2738,13 +2738,38 @@ var EntityUtils;
2738
2738
  * Returns an array of positions from the entity's currently rendered graphics.
2739
2739
  */
2740
2740
  const evaluateRendered = async () => {
2741
+ var _a, _b;
2741
2742
  const rego = visualRegister ? visualRegister.GetRego({
2742
2743
  entityId: sample.entityId,
2743
2744
  menuItemId: sample.menuItemId
2744
2745
  }) : null;
2746
+ if (!rego) {
2747
+ return [];
2748
+ }
2749
+ // If this is a historic Entity but associated with a Tileset, we'll hack the movement in.
2750
+ // Our API doesn't account for this at the moment.
2751
+ if (rego.visual instanceof Cesium3DTileFeature && ((_a = rego.historicLayers) === null || _a === void 0 ? void 0 : _a.length)) {
2752
+ // Get the Tileset.
2753
+ const tileset = rego.visual.tileset;
2754
+ if (tileset === null || tileset === void 0 ? void 0 : tileset._bruceCoords) {
2755
+ // The render logic currently swaps out the UCS location when the assembly is moving.
2756
+ const location = (_b = tileset._bruceCoords.ucs) === null || _b === void 0 ? void 0 : _b.location;
2757
+ if (location) {
2758
+ const latitude = EnsureNumber(location.latitude);
2759
+ const longitude = EnsureNumber(location.longitude);
2760
+ // Disallowing exact 0.
2761
+ if (latitude || longitude) {
2762
+ const pos3d = Cartesian3.fromDegrees(longitude, latitude, EnsureNumber(location.altitude));
2763
+ const toAdjust = [pos3d];
2764
+ await ensureHeightRefs(toAdjust, sample);
2765
+ return toAdjust;
2766
+ }
2767
+ }
2768
+ }
2769
+ }
2745
2770
  let posses = [];
2746
2771
  const parts = GatherEntity({
2747
- entity: rego === null || rego === void 0 ? void 0 : rego.visual,
2772
+ entity: rego.visual,
2748
2773
  });
2749
2774
  for (let i = 0; i < parts.length; i++) {
2750
2775
  const part = parts[i];
@@ -16404,43 +16429,48 @@ var TilesetRenderEngine;
16404
16429
  }
16405
16430
  }
16406
16431
  }
16407
- // Quick access dictionary of Entity ID -> Entities.
16408
- const entityMap = {};
16409
- // Gather all Tag IDs from found Entities.
16410
- let tagIds = [];
16411
- for (let i = 0; i < entities.length; i++) {
16412
- const entity = entities[i];
16413
- entityMap[entity.Bruce.ID] = entity;
16414
- if ((_b = (_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a["Layer.ID"]) === null || _b === void 0 ? void 0 : _b.length) {
16415
- const eTagIds = entity.Bruce["Layer.ID"];
16416
- for (let j = 0; j < eTagIds.length; j++) {
16417
- tagIds.push(eTagIds[j]);
16432
+ if (rerun) {
16433
+ this.recordLoadQueue = this.recordLoadQueue.concat(batch);
16434
+ }
16435
+ else {
16436
+ // Quick access dictionary of Entity ID -> Entities.
16437
+ const entityMap = {};
16438
+ // Gather all Tag IDs from found Entities.
16439
+ let tagIds = [];
16440
+ for (let i = 0; i < entities.length; i++) {
16441
+ const entity = entities[i];
16442
+ entityMap[entity.Bruce.ID] = entity;
16443
+ if ((_b = (_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a["Layer.ID"]) === null || _b === void 0 ? void 0 : _b.length) {
16444
+ const eTagIds = entity.Bruce["Layer.ID"];
16445
+ for (let j = 0; j < eTagIds.length; j++) {
16446
+ tagIds.push(eTagIds[j]);
16447
+ }
16418
16448
  }
16419
16449
  }
16420
- }
16421
- // Turn into unique list.
16422
- if (tagIds.length) {
16423
- tagIds = tagIds.filter((v, i, a) => a.indexOf(v) === i);
16424
- }
16425
- // Gather records.
16426
- let tags = [];
16427
- if (tagIds.length) {
16428
- tags = (await EntityTag.GetListByIds({
16429
- tagIds: tagIds,
16430
- api: this.api
16431
- })).tags;
16432
- }
16433
- for (let i = 0; i < batch.length; i++) {
16434
- const entityId = batch[i];
16435
- const record = entityMap[entityId];
16436
- const feature = this.getEntityRego(entityId);
16437
- if (feature) {
16438
- const eTags = tags.filter(t => { var _a, _b, _c, _d; return ((_b = (_a = record === null || record === void 0 ? void 0 : record.Bruce) === null || _a === void 0 ? void 0 : _a["Layer.ID"]) === null || _b === void 0 ? void 0 : _b.length) && ((_d = (_c = record === null || record === void 0 ? void 0 : record.Bruce) === null || _c === void 0 ? void 0 : _c["Layer.ID"]) === null || _d === void 0 ? void 0 : _d.includes(t.ID)); });
16439
- this.styleTilesetFeatureFullData(feature, record, eTags);
16450
+ // Turn into unique list.
16451
+ if (tagIds.length) {
16452
+ tagIds = tagIds.filter((v, i, a) => a.indexOf(v) === i);
16440
16453
  }
16454
+ // Gather records.
16455
+ let tags = [];
16456
+ if (tagIds.length) {
16457
+ tags = (await EntityTag.GetListByIds({
16458
+ tagIds: tagIds,
16459
+ api: this.api
16460
+ })).tags;
16461
+ }
16462
+ for (let i = 0; i < batch.length; i++) {
16463
+ const entityId = batch[i];
16464
+ const record = entityMap[entityId];
16465
+ const feature = this.getEntityRego(entityId);
16466
+ if (feature) {
16467
+ const eTags = tags.filter(t => { var _a, _b, _c, _d; return ((_b = (_a = record === null || record === void 0 ? void 0 : record.Bruce) === null || _a === void 0 ? void 0 : _a["Layer.ID"]) === null || _b === void 0 ? void 0 : _b.length) && ((_d = (_c = record === null || record === void 0 ? void 0 : record.Bruce) === null || _c === void 0 ? void 0 : _c["Layer.ID"]) === null || _d === void 0 ? void 0 : _d.includes(t.ID)); });
16468
+ this.styleTilesetFeatureFullData(feature, record, eTags);
16469
+ }
16470
+ }
16471
+ rerun = rerun || batch.length > 0;
16472
+ this.viewer.scene.requestRender();
16441
16473
  }
16442
- rerun = rerun || batch.length > 0;
16443
- this.viewer.scene.requestRender();
16444
16474
  }
16445
16475
  }
16446
16476
  finally {
@@ -30471,7 +30501,7 @@ class WidgetViewBar extends Widget.AWidget {
30471
30501
  }
30472
30502
  }
30473
30503
 
30474
- const VERSION = "5.3.8";
30504
+ const VERSION = "5.4.0";
30475
30505
 
30476
30506
  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, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, 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 };
30477
30507
  //# sourceMappingURL=bruce-cesium.es5.js.map