bruce-cesium 5.8.8 → 5.9.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
1
  import { BruceEvent, Cartes, Entity as Entity$1, ProjectViewTile, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, 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, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, Primitive, Cesium3DTileFeature, SceneMode, HorizontalOrigin, VerticalOrigin, GeoJsonDataSource, HeadingPitchRange, Ion, Cesium3DTileStyle, Cesium3DTileColorBlendMode, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, 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;
@@ -3382,11 +3382,31 @@ function calcEntityLocation(entity, modelSpace) {
3382
3382
  if (!worldPosition) {
3383
3383
  return null;
3384
3384
  }
3385
- let offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
3385
+ let offset;
3386
+ {
3387
+ // Check if we have rotation/scale components (non-identity 3x3 upper-left matrix).
3388
+ const hasRotationOrScale = Math.abs(+worldPosition[0][0] - 1) > 1e-6 || Math.abs(+worldPosition[0][1]) > 1e-6 || Math.abs(+worldPosition[0][2]) > 1e-6 ||
3389
+ Math.abs(+worldPosition[1][0]) > 1e-6 || Math.abs(+worldPosition[1][1] - 1) > 1e-6 || Math.abs(+worldPosition[1][2]) > 1e-6 ||
3390
+ Math.abs(+worldPosition[2][0]) > 1e-6 || Math.abs(+worldPosition[2][1]) > 1e-6 || Math.abs(+worldPosition[2][2] - 1) > 1e-6;
3391
+ if (hasRotationOrScale) {
3392
+ // Extract translation first.
3393
+ const translation = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
3394
+ // Extract rotation matrix.
3395
+ const mawp = new Matrix4(+worldPosition[0][0], +worldPosition[0][1], +worldPosition[0][2], +worldPosition[0][3], +worldPosition[1][0], +worldPosition[1][1], +worldPosition[1][2], +worldPosition[1][3], +worldPosition[2][0], +worldPosition[2][1], +worldPosition[2][2], +worldPosition[2][3], +worldPosition[3][0], +worldPosition[3][1], +worldPosition[3][2], +worldPosition[3][3]);
3396
+ let rotmat = new Matrix3();
3397
+ rotmat = Matrix4.getRotation(mawp, rotmat);
3398
+ const inverseRotmat = Matrix3.transpose(rotmat, new Matrix3());
3399
+ offset = Matrix3.multiplyByVector(inverseRotmat, translation, new Cartesian3());
3400
+ }
3401
+ // For translation-only matrices, extract translation directly.
3402
+ else {
3403
+ offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
3404
+ }
3405
+ }
3386
3406
  let heading = 0;
3387
3407
  let pitch = 0;
3388
3408
  let roll = 0;
3389
- {
3409
+ if (!modelSpace) {
3390
3410
  const eTransform = entity.Bruce.Transform;
3391
3411
  if (eTransform) {
3392
3412
  if (eTransform.heading) {
@@ -16580,9 +16600,21 @@ var TilesetRenderEngine;
16580
16600
  if (transform.scale <= 0) {
16581
16601
  transform.scale = 0.000001;
16582
16602
  }
16583
- // If we're in model-space we'll just go at 0,0 lat/lon.
16603
+ // If we're in model-space we'll just go at 0,0 lat/lon and no h/p/r from the coords.
16584
16604
  if (params.modelSpace) {
16585
16605
  location = null;
16606
+ transform = {
16607
+ heading: 0,
16608
+ pitch: 0,
16609
+ roll: 0,
16610
+ scale: EnsureNumber(transform.scale, 1),
16611
+ x: 0,
16612
+ y: 0,
16613
+ z: 0
16614
+ };
16615
+ if (transform.scale <= 0) {
16616
+ transform.scale = 0.000001;
16617
+ }
16586
16618
  }
16587
16619
  /**
16588
16620
  * Very cursed.
@@ -22384,6 +22416,7 @@ var AssemblyRenderManager;
22384
22416
  // Quick look-up of the hierarchy nodes by entity ID.
22385
22417
  this.hierarchyNodeByEntityId = null;
22386
22418
  this.modelSpace = false;
22419
+ this.rootId = null;
22387
22420
  const { viewer, register: visualsManager, getters, item } = params;
22388
22421
  this.viewer = viewer;
22389
22422
  this.getters = getters;
@@ -22397,7 +22430,6 @@ var AssemblyRenderManager;
22397
22430
  this.renderPriority = 1;
22398
22431
  }
22399
22432
  (async () => {
22400
- var _a, _b, _c;
22401
22433
  if (this.disposed) {
22402
22434
  return;
22403
22435
  }
@@ -22429,75 +22461,100 @@ var AssemblyRenderManager;
22429
22461
  rootId = hierarchy.Root.ID;
22430
22462
  }
22431
22463
  }
22464
+ this.rootId = rootId;
22432
22465
  if (this.disposed) {
22433
22466
  return;
22434
22467
  }
22435
- const BATCH_SIZE = 200;
22436
- let batches = Math.ceil(flatEntityIds.length / BATCH_SIZE);
22437
- for (let i = 0; i < batches; i++) {
22438
- const batch = flatEntityIds.slice(i * BATCH_SIZE, (i + 1) * BATCH_SIZE);
22439
- if (!batch.length) {
22440
- continue;
22441
- }
22442
- const { entities } = await Entity$1.GetListByIds({
22443
- entityIds: batch,
22444
- api: this.getters.GetBruceApi(),
22445
- expandLODs: true,
22446
- expandLocation: true
22447
- });
22448
- if (this.disposed) {
22449
- return;
22450
- }
22451
- for (const entity of entities) {
22452
- const lod = entity.Bruce.LOD ? entity.Bruce.LOD[0] : null;
22453
- if (!lod || !((_a = lod["ClientFile"]) === null || _a === void 0 ? void 0 : _a.URL)) {
22454
- // Won't bother with vector data for this experiment.
22455
- continue;
22456
- }
22457
- const pos3d = calcEntityLocation$1(entity, this.modelSpace);
22458
- const orient = calcEntityOrientation(entity, pos3d);
22459
- if (!pos3d || !orient) {
22460
- continue;
22461
- }
22462
- const cEntity = this.viewer.entities.add({
22463
- model: {
22464
- uri: lod["ClientFile"].URL,
22465
- heightReference: HeightReference.NONE
22466
- },
22467
- // point: {
22468
- // pixelSize: 50,
22469
- // disableDepthTestDistance: Number.POSITIVE_INFINITY,
22470
- // color: Cesium.Color.fromCssColorString("#FF0000"),
22471
- // heightReference: Cesium.HeightReference.NONE
22472
- // },
22473
- position: pos3d,
22474
- orientation: new ConstantProperty(orient)
22475
- });
22476
- this.visualsManager.AddRego({
22477
- rego: {
22478
- canEdit: false,
22479
- entityId: entity.Bruce.ID,
22480
- menuItemId: this.item.id,
22481
- menuItemType: this.item.Type,
22482
- priority: this.renderPriority,
22483
- visual: cEntity,
22484
- accountId: this.getters.GetAccountId(),
22485
- entityTypeId: entity.Bruce["EntityType.ID"],
22486
- name: entity.Bruce.Name,
22487
- rootId: rootId,
22488
- parentId: (_c = (_b = this.hierarchyNodeByEntityId) === null || _b === void 0 ? void 0 : _b[entity.Bruce.ID]) === null || _c === void 0 ? void 0 : _c.parentId
22489
- },
22490
- requestRender: false
22491
- });
22492
- }
22493
- this.viewer.scene.requestRender();
22468
+ else if (flatEntityIds.length === 0) {
22469
+ return;
22494
22470
  }
22471
+ this.processEntityIds(flatEntityIds);
22495
22472
  }
22496
22473
  catch (e) {
22497
22474
  console.error("AssemblyRenderManager.Manager.Init()", e);
22498
22475
  }
22499
22476
  })();
22500
22477
  }
22478
+ /**
22479
+ * Processes given entity IDs and renders them in the viewer.
22480
+ * @param entityIds
22481
+ * @returns
22482
+ */
22483
+ async processEntityIds(entityIds) {
22484
+ var _a, _b, _c;
22485
+ if (!entityIds || !entityIds.length) {
22486
+ return;
22487
+ }
22488
+ else if (this.disposed) {
22489
+ return;
22490
+ }
22491
+ const BATCH_SIZE = 200;
22492
+ let batches = Math.ceil(entityIds.length / BATCH_SIZE);
22493
+ for (let i = 0; i < batches; i++) {
22494
+ const batch = entityIds.slice(i * BATCH_SIZE, (i + 1) * BATCH_SIZE);
22495
+ if (!batch.length) {
22496
+ continue;
22497
+ }
22498
+ const { entities: fetched } = await Entity$1.GetListByIds({
22499
+ entityIds: batch,
22500
+ api: this.getters.GetBruceApi(),
22501
+ expandLODs: true,
22502
+ expandLocation: true
22503
+ });
22504
+ if (this.disposed) {
22505
+ return;
22506
+ }
22507
+ for (const entity of fetched) {
22508
+ const lod = entity.Bruce.LOD ? entity.Bruce.LOD[0] : null;
22509
+ if (!lod || !((_a = lod["ClientFile"]) === null || _a === void 0 ? void 0 : _a.URL)) {
22510
+ // Won't bother with vector data for this experiment.
22511
+ continue;
22512
+ }
22513
+ const pos3d = calcEntityLocation$1(entity, this.modelSpace);
22514
+ const orient = calcEntityOrientation(entity, pos3d, this.modelSpace);
22515
+ if (!pos3d || !orient) {
22516
+ continue;
22517
+ }
22518
+ const cEntity = this.viewer.entities.add({
22519
+ model: {
22520
+ uri: lod["ClientFile"].URL,
22521
+ heightReference: HeightReference.NONE
22522
+ },
22523
+ // point: {
22524
+ // pixelSize: 50,
22525
+ // disableDepthTestDistance: Number.POSITIVE_INFINITY,
22526
+ // color: Cesium.Color.fromCssColorString("#FF0000"),
22527
+ // heightReference: Cesium.HeightReference.NONE
22528
+ // },
22529
+ position: pos3d,
22530
+ orientation: new ConstantProperty(orient)
22531
+ });
22532
+ const geometryRadius = Entity$1.GetValue({
22533
+ entity: entity,
22534
+ path: ["Bruce", "GeometryRadius"]
22535
+ });
22536
+ cEntity.model["_radius"] = geometryRadius;
22537
+ cEntity.model["_radiusLoaded"] = true;
22538
+ this.visualsManager.AddRego({
22539
+ rego: {
22540
+ canEdit: true,
22541
+ entityId: entity.Bruce.ID,
22542
+ menuItemId: this.item.id,
22543
+ menuItemType: this.item.Type,
22544
+ priority: this.renderPriority,
22545
+ visual: cEntity,
22546
+ accountId: this.getters.GetAccountId(),
22547
+ entityTypeId: entity.Bruce["EntityType.ID"],
22548
+ name: entity.Bruce.Name,
22549
+ rootId: this.rootId,
22550
+ parentId: (_c = (_b = this.hierarchyNodeByEntityId) === null || _b === void 0 ? void 0 : _b[entity.Bruce.ID]) === null || _c === void 0 ? void 0 : _c.parentId
22551
+ },
22552
+ requestRender: false
22553
+ });
22554
+ }
22555
+ this.viewer.scene.requestRender();
22556
+ }
22557
+ }
22501
22558
  Dispose() {
22502
22559
  if (this.disposed) {
22503
22560
  return;
@@ -22512,6 +22569,10 @@ var AssemblyRenderManager;
22512
22569
  if (entities && !entityIds) {
22513
22570
  entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
22514
22571
  }
22572
+ if (!entityIds && entities) {
22573
+ entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
22574
+ }
22575
+ this.processEntityIds(entityIds);
22515
22576
  }
22516
22577
  /**
22517
22578
  * Builds quick look-up of the hierarchy nodes by entity ID.
@@ -22736,7 +22797,7 @@ function calcEntityLocation$1(entity, modelSpace) {
22736
22797
  let heading = 0;
22737
22798
  let pitch = 0;
22738
22799
  let roll = 0;
22739
- {
22800
+ if (!modelSpace) {
22740
22801
  const eTransform = entity.Bruce.Transform;
22741
22802
  if (eTransform) {
22742
22803
  if (eTransform.heading) {
@@ -22758,12 +22819,29 @@ function calcEntityLocation$1(entity, modelSpace) {
22758
22819
  pos3d = Matrix4.multiplyByPoint(m1, transformedOffset, new Cartesian3());
22759
22820
  return pos3d;
22760
22821
  }
22761
- function calcEntityOrientation(entity, pos3d) {
22762
- var _a, _b, _c;
22822
+ function calcEntityOrientation(entity, pos3d, modelSpace) {
22763
22823
  if (!entity.Bruce || !pos3d) {
22764
22824
  return null;
22765
22825
  }
22766
- let hpr = HeadingPitchRoll.fromDegrees(((_a = entity.Bruce.Transform) === null || _a === void 0 ? void 0 : _a.heading) || 90, ((_b = entity.Bruce.Transform) === null || _b === void 0 ? void 0 : _b.pitch) || 0, ((_c = entity.Bruce.Transform) === null || _c === void 0 ? void 0 : _c.roll) || 0);
22826
+ // 0 or 90 for these?
22827
+ let heading = 90;
22828
+ let pitch = 0;
22829
+ let roll = 0;
22830
+ if (!modelSpace) {
22831
+ const eTransform = entity.Bruce.Transform;
22832
+ if (eTransform) {
22833
+ if (eTransform.heading) {
22834
+ heading = eTransform.heading;
22835
+ }
22836
+ if (eTransform.pitch) {
22837
+ pitch = eTransform.pitch;
22838
+ }
22839
+ if (eTransform.roll) {
22840
+ roll = eTransform.roll;
22841
+ }
22842
+ }
22843
+ }
22844
+ let hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll));
22767
22845
  let orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
22768
22846
  if (entity.Bruce.AssemblyWorldPosition) {
22769
22847
  // extract rot, scale
@@ -31059,6 +31137,7 @@ var EMode;
31059
31137
  EMode["ShowAvailable"] = "AV";
31060
31138
  EMode["ShowImportantAndAvailable"] = "IMP_AV";
31061
31139
  })(EMode || (EMode = {}));
31140
+ const DISPLAY_ASSEMBLY_INFO = false;
31062
31141
  const OPEN_STORAGE_KEY = "EntityViewSummary_open_";
31063
31142
  const EXCLUDED_PROPERTIES = ["Bruce", "geometry", "position", "boundaries"];
31064
31143
  function isAttributeImportant(mode, entity, path, field) {
@@ -31295,7 +31374,7 @@ class WidgetInfoView extends Widget.AWidget {
31295
31374
  flex-shrink: 1;
31296
31375
  margin-top: 12px;
31297
31376
  overflow: auto;
31298
- padding: 25px;
31377
+ padding: 20px;
31299
31378
  width: 100%;
31300
31379
  }
31301
31380
 
@@ -31306,32 +31385,42 @@ class WidgetInfoView extends Widget.AWidget {
31306
31385
  width: 100%;
31307
31386
  }
31308
31387
 
31388
+ .NextspaceInfoViewLabel {
31389
+ align-items: center;
31390
+ column-gap: 8px;
31391
+ display: flex;
31392
+ flex-wrap: wrap;
31393
+ margin-top: 12px;
31394
+ max-width: 100%;
31395
+ row-gap: 5px;
31396
+ text-align: left;
31397
+ white-space: nowrap;
31398
+ }
31399
+
31309
31400
  .NextspaceInfoViewName {
31310
31401
  font-family: Arial;
31311
31402
  font-style: normal;
31312
31403
  font-weight: 400;
31313
- text-align: center;
31314
- width: 100%;
31404
+ font-size: 12px;
31405
+ letter-spacing: .05em;
31315
31406
  color: #40c4ff;
31316
- font-size: 13px;
31317
- letter-spacing: .01em;
31318
- line-height: 16px;
31319
- margin-bottom: 5px;
31407
+ overflow: hidden;
31408
+ text-overflow: ellipsis;
31409
+ transition: .3s ease;
31410
+ max-width: 100%;
31411
+ width: 100%;
31412
+ width: -webkit-max-content !important;
31413
+ width: max-content !important;
31320
31414
  }
31321
31415
 
31322
31416
  .NextspaceInfoViewType {
31323
31417
  font-family: Arial;
31324
31418
  font-style: normal;
31325
31419
  font-weight: 400;
31326
- text-align: center;
31327
- width: 100%;
31328
- color: #c1c7cd;
31329
- font-size: 10px;
31420
+ font-size: 12px;
31330
31421
  letter-spacing: .05em;
31331
- line-height: 10px;
31332
- margin-bottom: 12px;
31333
- -webkit-user-select: none;
31334
- user-select: none;
31422
+ color: #fff;
31423
+ opacity: .7;
31335
31424
  }
31336
31425
 
31337
31426
  .NextspaceInfoViewTitle {
@@ -31345,7 +31434,7 @@ class WidgetInfoView extends Widget.AWidget {
31345
31434
  -webkit-touch-callout: none;
31346
31435
  -webkit-user-select: none;
31347
31436
  user-select: none;
31348
- margin-top: 20px;
31437
+ margin-top: 10px;
31349
31438
  margin-bottom: 10px;
31350
31439
  }
31351
31440
 
@@ -31367,8 +31456,8 @@ class WidgetInfoView extends Widget.AWidget {
31367
31456
 
31368
31457
  .NextspaceAttributesGroupToggle {
31369
31458
  align-items: center;
31370
- background-color: #343a3f;
31371
- border: 1px solid #343a3f;
31459
+ background-color: #293034;
31460
+ border: 1px solid #494949;
31372
31461
  border-radius: 5px;
31373
31462
  cursor: pointer;
31374
31463
  display: flex;
@@ -31387,13 +31476,11 @@ class WidgetInfoView extends Widget.AWidget {
31387
31476
  .NextspaceAttributesGroupToggleIcon {
31388
31477
  align-items: center;
31389
31478
  display: flex;
31390
- height: 20px;
31479
+ height: 15px;
31391
31480
  justify-content: center;
31392
- margin-left: auto;
31393
31481
  margin-right: 8px;
31394
- width: 20px;
31395
- cursor: pointer;
31396
- white-space: nowrap;
31482
+ position: relative;
31483
+ width: 15px;
31397
31484
  }
31398
31485
 
31399
31486
  .NextspaceAttributesGroup[is-opened="false"] .NextspaceAttributesGroupToggleIconOpened {
@@ -31489,6 +31576,40 @@ class WidgetInfoView extends Widget.AWidget {
31489
31576
  width: 100%;
31490
31577
  user-select: none;
31491
31578
  }
31579
+
31580
+ .NextspaceInputRow {
31581
+ display: flex;
31582
+ flex-direction: row;
31583
+ align-items: center;
31584
+ margin-bottom: 4px;
31585
+ }
31586
+
31587
+ .NextspaceInputRow > label {
31588
+ flex-grow: 0;
31589
+ flex-shrink: 0;
31590
+ width: 120px;
31591
+ margin-right: 5px;
31592
+ color: #f2f4f8;
31593
+ font-family: Arial;
31594
+ font-size: 14px;
31595
+ font-style: normal;
31596
+ font-weight: 500;
31597
+ line-height: 20px;
31598
+ }
31599
+
31600
+ .NextspaceInputRow > input {
31601
+ width: 100px;
31602
+ flex-grow: 1;
31603
+ flex-shrink: 1;
31604
+ background-color: #121619;
31605
+ border: 1px solid #434343;
31606
+ border-radius: 5px;
31607
+ display: flex;
31608
+ height: 35px;
31609
+ color: #fff;
31610
+ font-size: 12px;
31611
+ outline: none;
31612
+ }
31492
31613
  `;
31493
31614
  document.head.appendChild(style);
31494
31615
  }
@@ -31527,13 +31648,16 @@ class WidgetInfoView extends Widget.AWidget {
31527
31648
  const scrollBox = document.createElement("div");
31528
31649
  scrollBox.className = "NextspaceInfoViewScrollBox";
31529
31650
  content.appendChild(scrollBox);
31651
+ const label = document.createElement("div");
31652
+ label.className = "NextspaceInfoViewLabel";
31653
+ scrollBox.appendChild(label);
31530
31654
  const name = document.createElement("div");
31531
31655
  name.className = "NextspaceInfoViewName";
31532
- scrollBox.appendChild(name);
31656
+ label.appendChild(name);
31533
31657
  this._name = name;
31534
31658
  const type = document.createElement("div");
31535
31659
  type.className = "NextspaceInfoViewType";
31536
- scrollBox.appendChild(type);
31660
+ label.appendChild(type);
31537
31661
  this._type = type;
31538
31662
  const imageContainer = document.createElement("div");
31539
31663
  imageContainer.className = "NextspaceDefaultImageContainer";
@@ -31543,11 +31667,6 @@ class WidgetInfoView extends Widget.AWidget {
31543
31667
  scrollBox.appendChild(imageContainer);
31544
31668
  this._imageContainer = imageContainer;
31545
31669
  this._image = image;
31546
- const title = document.createElement("div");
31547
- title.className = "NextspaceInfoViewTitle";
31548
- title.innerText = "Details";
31549
- scrollBox.appendChild(title);
31550
- this._title = title;
31551
31670
  const summary = document.createElement("div");
31552
31671
  summary.className = "NextspaceInfoViewSummary";
31553
31672
  scrollBox.appendChild(summary);
@@ -31571,7 +31690,7 @@ class WidgetInfoView extends Widget.AWidget {
31571
31690
  }
31572
31691
  }
31573
31692
  async _updateInfoView() {
31574
- var _a, _b, _c;
31693
+ var _b, _c, _d;
31575
31694
  const selectedIds = this._manager.VisualsRegister.GetSelected();
31576
31695
  if (selectedIds.length <= 0) {
31577
31696
  this._element.style.display = "none";
@@ -31587,9 +31706,8 @@ class WidgetInfoView extends Widget.AWidget {
31587
31706
  }
31588
31707
  this._lastSelectedId = firstId;
31589
31708
  try {
31590
- this._title.style.display = "none";
31591
31709
  this._flyTo.style.display = "none";
31592
- this._name.innerText = "Loading...";
31710
+ this._name.innerText = "Loading..";
31593
31711
  this._type.innerText = "";
31594
31712
  this._summary.innerHTML = "";
31595
31713
  this._imageContainer.style.display = "none";
@@ -31597,13 +31715,14 @@ class WidgetInfoView extends Widget.AWidget {
31597
31715
  const { entity } = await Entity$1.Get({
31598
31716
  entityId: firstId,
31599
31717
  api: api,
31600
- migrated: true
31718
+ migrated: true,
31719
+ expandLocation: DISPLAY_ASSEMBLY_INFO
31601
31720
  });
31602
31721
  if (!entity) {
31603
31722
  throw (new Error("Could not get entity."));
31604
31723
  }
31605
31724
  const { entityType } = await EntityType.Get({
31606
- entityTypeId: (_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"],
31725
+ entityTypeId: (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b["EntityType.ID"],
31607
31726
  api: api
31608
31727
  });
31609
31728
  let name = Entity$1.CalculateName({
@@ -31614,7 +31733,6 @@ class WidgetInfoView extends Widget.AWidget {
31614
31733
  if (!name) {
31615
31734
  name = "Unnamed Entity";
31616
31735
  }
31617
- this._title.style.display = "block";
31618
31736
  this._flyTo.style.display = "flex";
31619
31737
  this._name.innerText = name;
31620
31738
  this._type.innerText = (entityType === null || entityType === void 0 ? void 0 : entityType.Name) ? entityType.Name : "Unknown type";
@@ -31634,9 +31752,13 @@ class WidgetInfoView extends Widget.AWidget {
31634
31752
  });
31635
31753
  this._image.style.backgroundImage = `url(${url})`;
31636
31754
  }
31755
+ const detailsTitle = document.createElement("div");
31756
+ detailsTitle.className = "NextspaceInfoViewTitle";
31757
+ detailsTitle.innerText = "Details";
31758
+ this._summary.appendChild(detailsTitle);
31637
31759
  // TODO: Selection for what mode instead of always doing "all".
31638
31760
  const attributes = gatherAttributes(EMode.ShowAll, entity, entityType);
31639
- const groups = groupAttributes(attributes, (_c = (_b = entityType.DataSchema) === null || _b === void 0 ? void 0 : _b.Structure) !== null && _c !== void 0 ? _c : []);
31761
+ const groups = groupAttributes(attributes, (_d = (_c = entityType.DataSchema) === null || _c === void 0 ? void 0 : _c.Structure) !== null && _d !== void 0 ? _d : []);
31640
31762
  for (const group of groups) {
31641
31763
  this._generateAttrGroup(entityType, entity, group);
31642
31764
  }
@@ -31644,7 +31766,7 @@ class WidgetInfoView extends Widget.AWidget {
31644
31766
  catch (e) {
31645
31767
  console.error(e);
31646
31768
  this._name.innerText = "";
31647
- this._summary.innerHTML = "<p>Could not read entity information</p>";
31769
+ this._summary.innerHTML = "<p>Could not read Entity information</p>";
31648
31770
  }
31649
31771
  }
31650
31772
  _generateAttrGroup(type, entity, group) {
@@ -31655,11 +31777,11 @@ class WidgetInfoView extends Widget.AWidget {
31655
31777
  const toggle = document.createElement("div");
31656
31778
  toggle.className = "NextspaceAttributesGroupToggle";
31657
31779
  toggle.innerHTML = `
31658
- ${group.group.Key}
31659
31780
  <div class="NextspaceAttributesGroupToggleIcon">
31660
31781
  <svg class="NextspaceAttributesGroupToggleIconOpened" width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 1L8 8L1 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
31661
- <svg class="NextspaceAttributesGroupToggleIconClosed" width="10" height="17" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 15.5L1.5 8.5L8.5 1.5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
31782
+ <svg class="NextspaceAttributesGroupToggleIconClosed" width="10" height="17" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 1.5L8.5 8.5L1.5 15.5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
31662
31783
  </div>
31784
+ ${group.group.Name ? group.group.Name : group.group.Key}
31663
31785
  `;
31664
31786
  toggle.addEventListener("click", () => {
31665
31787
  const isOpened = groupDiv.getAttribute("is-opened") == "true";
@@ -31669,17 +31791,24 @@ class WidgetInfoView extends Widget.AWidget {
31669
31791
  groupDiv.appendChild(toggle);
31670
31792
  }
31671
31793
  for (const attr of group.attributes) {
31672
- const attrDiv = this._generateAttr(groupDiv, type, entity, attr);
31673
- if (group.group.Key != "ROOT") {
31674
- attrDiv.style.marginLeft = "12px";
31675
- }
31794
+ this._generateAttr(groupDiv, type, entity, attr, group.group.Key != "ROOT");
31676
31795
  }
31677
31796
  this._summary.appendChild(groupDiv);
31678
31797
  }
31679
- _generateAttr(container, type, entity, path) {
31798
+ _generateAttr(container, type, entity, path, nested) {
31680
31799
  var _a, _b, _c;
31681
31800
  const attrDiv = document.createElement("div");
31682
31801
  attrDiv.className = "NextspaceAttribute";
31802
+ if (nested) {
31803
+ const nestedIconStr = `
31804
+ <svg width="11" height="13" viewBox="0 0 11 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1V10C1 11.1046 1.89543 12 3 12H10" stroke="#4D5358" stroke-linecap="round" stroke-linejoin="round"></path></svg>
31805
+ `;
31806
+ const nestedIcon = document.createElement("div");
31807
+ nestedIcon.style.marginLeft = "12px";
31808
+ nestedIcon.style.marginRight = "5px";
31809
+ nestedIcon.innerHTML = nestedIconStr;
31810
+ attrDiv.appendChild(nestedIcon);
31811
+ }
31683
31812
  const typeItem = digTypeItem(path, (_b = (_a = type.DataSchema) === null || _a === void 0 ? void 0 : _a.Structure) !== null && _b !== void 0 ? _b : []);
31684
31813
  const attrType = (_c = typeItem === null || typeItem === void 0 ? void 0 : typeItem.Type) !== null && _c !== void 0 ? _c : EntityAttribute.EType.String;
31685
31814
  const input = document.createElement("div");
@@ -32986,7 +33115,7 @@ class WidgetViewBar extends Widget.AWidget {
32986
33115
  }
32987
33116
  }
32988
33117
 
32989
- const VERSION = "5.8.8";
33118
+ const VERSION = "5.9.0";
32990
33119
 
32991
33120
  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 };
32992
33121
  //# sourceMappingURL=bruce-cesium.es5.js.map