bruce-cesium 7.8.8 → 7.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.
@@ -9664,7 +9664,7 @@
9664
9664
  const places = clickEntityIds.filter(id => { var _a, _b; return (_b = (_a = this.visualRegister.GetLabelGroupFor(id)) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.placeId; });
9665
9665
  if (places.length) {
9666
9666
  const keys = event;
9667
- this.visualRegister.ClickLabelPlaces(places, Boolean(keys.ctrlKey || keys.metaKey || keys.shiftKey));
9667
+ this.visualRegister.ClickLabelPlaces(places, Boolean(keys.ctrlKey || keys.metaKey || keys.shiftKey), clickEntityIds.length > 1);
9668
9668
  }
9669
9669
  const entityIds = clickEntityIds.filter(id => !places.includes(id));
9670
9670
  if (!entityIds.length) {
@@ -11240,7 +11240,8 @@
11240
11240
  latitude: place.latitude,
11241
11241
  altitude: place.altitude,
11242
11242
  look: place.look,
11243
- selected: place.selected || undefined
11243
+ selected: place.selected || undefined,
11244
+ interactive: place.interactive || undefined
11244
11245
  }));
11245
11246
  }
11246
11247
  EntityLabelGroup.FromPlaces = FromPlaces;
@@ -11793,7 +11794,7 @@
11793
11794
  }
11794
11795
  if (item.placeId) {
11795
11796
  // Clickable only when the app asks, and reported then, as there is no Entity to select.
11796
- options.selectOnClick = this.placesInteractive;
11797
+ options.selectOnClick = this.placesInteractive || Boolean(item.interactive);
11797
11798
  options.highlightColor = item.selected ? PLACE_SELECTED_COLOR : undefined;
11798
11799
  const look = item.look;
11799
11800
  if ((look === null || look === void 0 ? void 0 : look.iconUrl) || (look === null || look === void 0 ? void 0 : look.iconClass)) {
@@ -16805,13 +16806,13 @@
16805
16806
  this.labelGroups.SetPlacesInteractive(on);
16806
16807
  }
16807
16808
  /*
16808
- * Called by a label clicked while places are interactive, with the place keys it stands for.
16809
+ * Called by a clicked label that stands for places, with their keys and whether it was a cluster.
16809
16810
  */
16810
- ClickLabelPlaces(keys, additive) {
16811
+ ClickLabelPlaces(keys, additive, cluster = keys.length > 1) {
16811
16812
  const places = keys.map(key => { var _a, _b, _c; return ({ groupId: (_a = this.GetLabelGroupFor(key)) === null || _a === void 0 ? void 0 : _a.groupId, placeId: (_c = (_b = this.GetLabelGroupFor(key)) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.placeId }); })
16812
16813
  .filter(place => place.groupId && place.placeId);
16813
16814
  if (places.length) {
16814
- this.labelPlaceClicked.Trigger({ places, additive });
16815
+ this.labelPlaceClicked.Trigger({ places, additive, cluster });
16815
16816
  }
16816
16817
  }
16817
16818
  /*
@@ -18621,11 +18622,25 @@
18621
18622
  cTilesetExt._bruceModelSpace = Boolean(params.modelSpace);
18622
18623
  }
18623
18624
  TilesetRenderEngine.ApplyPosition = ApplyPosition;
18625
+ // Eye dome lighting strength that keeps depth readable as soft grey edges, tuned on a coloured scan in November 2026.
18626
+ TilesetRenderEngine.POINT_OUTLINE_STRENGTH = 0.02;
18627
+ /*
18628
+ * Returns a positive maximum point size, since a stored 0 or null shrinks every point to nothing.
18629
+ */
18630
+ function GetMaximumAttenuation(value, fallback) {
18631
+ const size = value == null ? NaN : Number(value);
18632
+ return size > 0 ? size : fallback;
18633
+ }
18634
+ TilesetRenderEngine.GetMaximumAttenuation = GetMaximumAttenuation;
18624
18635
  function ApplySettings(params) {
18625
18636
  const { cTileset, settings } = params;
18626
18637
  cTileset.maximumScreenSpaceError = EnsureNumber(settings.maxScreenSpaceError, 5);
18627
18638
  cTileset.pointCloudShading.attenuation = Boolean(settings.attenuation);
18628
- cTileset.pointCloudShading.maximumAttenuation = EnsureNumber(settings.maximumAttenuation, 4);
18639
+ const maximumAttenuation = GetMaximumAttenuation(settings.maximumAttenuation, 4);
18640
+ cTileset.pointCloudShading.maximumAttenuation = maximumAttenuation;
18641
+ // Cesium's eye dome lighting is the point outline, at its default strength of 1 they render black.
18642
+ cTileset.pointCloudShading.eyeDomeLighting = settings.pointOutlines !== false;
18643
+ cTileset.pointCloudShading.eyeDomeLightingStrength = TilesetRenderEngine.POINT_OUTLINE_STRENGTH;
18629
18644
  if (settings.colorMask) {
18630
18645
  cTileset.style = new Cesium.Cesium3DTileStyle({
18631
18646
  color: settings.colorMask
@@ -18633,7 +18648,8 @@
18633
18648
  }
18634
18649
  const cTilesetExt = cTileset;
18635
18650
  cTilesetExt._bruceSettings = {
18636
- ...settings
18651
+ ...settings,
18652
+ maximumAttenuation
18637
18653
  };
18638
18654
  }
18639
18655
  TilesetRenderEngine.ApplySettings = ApplySettings;
@@ -18755,6 +18771,7 @@
18755
18771
  settings: {
18756
18772
  attenuation: settings.attenuation,
18757
18773
  maximumAttenuation: settings.attenuationMax,
18774
+ pointOutlines: settings.pointOutlines,
18758
18775
  maxScreenSpaceError: settings.maximumScreenSpaceError
18759
18776
  }
18760
18777
  });
@@ -18871,6 +18888,7 @@
18871
18888
  attenuation: visual.attenuation != false,
18872
18889
  colorMask: visual.colorMask,
18873
18890
  maximumAttenuation: visual.attenuationMax,
18891
+ pointOutlines: visual.pointOutlines,
18874
18892
  maxScreenSpaceError: visual.maximumScreenSpaceError
18875
18893
  }
18876
18894
  });
@@ -29448,16 +29466,14 @@
29448
29466
  if (!attenuation && attenuation != false) {
29449
29467
  attenuation = true;
29450
29468
  }
29451
- let attenuationMax = this.item.attenuationMax;
29452
- if (isNaN(attenuationMax)) {
29453
- attenuationMax = 20;
29454
- }
29469
+ const attenuationMax = exports.TilesetRenderEngine.GetMaximumAttenuation(this.item.attenuationMax, 20);
29455
29470
  exports.TilesetRenderEngine.OnTilesetReady(this.cTileset).then(() => {
29456
29471
  exports.TilesetRenderEngine.ApplySettings({
29457
29472
  cTileset: this.cTileset,
29458
29473
  settings: {
29459
29474
  attenuation: attenuation,
29460
- maximumAttenuation: attenuationMax
29475
+ maximumAttenuation: attenuationMax,
29476
+ pointOutlines: this.item.pointOutlines
29461
29477
  }
29462
29478
  });
29463
29479
  });
@@ -29820,15 +29836,13 @@
29820
29836
  if (!attenuation && attenuation != false) {
29821
29837
  attenuation = true;
29822
29838
  }
29823
- let attenuationMax = this.item.attenuationMax;
29824
- if (isNaN(attenuationMax)) {
29825
- attenuationMax = 20;
29826
- }
29839
+ const attenuationMax = exports.TilesetRenderEngine.GetMaximumAttenuation(this.item.attenuationMax, 20);
29827
29840
  exports.TilesetRenderEngine.ApplySettings({
29828
29841
  cTileset: this.cTileset,
29829
29842
  settings: {
29830
29843
  attenuation: attenuation,
29831
- maximumAttenuation: attenuationMax
29844
+ maximumAttenuation: attenuationMax,
29845
+ pointOutlines: this.item.pointOutlines
29832
29846
  }
29833
29847
  });
29834
29848
  this.viewer.scene.requestRender();
@@ -36028,7 +36042,8 @@
36028
36042
  Type: item.Type,
36029
36043
  BruceEntity: { SelectedExpandLayers: (_a = eItem.BruceEntity) === null || _a === void 0 ? void 0 : _a.SelectedExpandLayers },
36030
36044
  attenuation: tItem.attenuation,
36031
- attenuationMax: tItem.attenuationMax
36045
+ attenuationMax: tItem.attenuationMax,
36046
+ pointOutlines: tItem.pointOutlines
36032
36047
  }));
36033
36048
  this.authoredAlternations.set(item, authored);
36034
36049
  }
@@ -39481,10 +39496,11 @@
39481
39496
  const tItem = item;
39482
39497
  const authored = manager.GetAuthoredAlternation(item);
39483
39498
  const tItemAlt = alternations[item.id];
39484
- const hasAttenuation = (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.attenuation) !== undefined || (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.attenuationMax) !== undefined;
39499
+ const hasAttenuation = (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.attenuation) !== undefined || (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.attenuationMax) !== undefined || (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.pointOutlines) !== undefined;
39485
39500
  const source = hasAttenuation ? tItemAlt : authored;
39486
39501
  tItem.attenuation = source.attenuation;
39487
39502
  tItem.attenuationMax = source.attenuationMax;
39503
+ tItem.pointOutlines = source.pointOutlines;
39488
39504
  }
39489
39505
  (_d = item.Children) === null || _d === void 0 ? void 0 : _d.forEach(alternateItems);
39490
39506
  };
@@ -61089,7 +61105,7 @@ void main() {
61089
61105
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
61090
61106
  })(exports.StyleUtils || (exports.StyleUtils = {}));
61091
61107
 
61092
- const VERSION = "7.8.8";
61108
+ const VERSION = "7.9.0";
61093
61109
  /**
61094
61110
  * Updates the environment instance used by bruce-cesium to one specified.
61095
61111
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.