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.
@@ -1,6 +1,6 @@
1
1
  import * as Cesium from 'cesium';
2
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ShaderSource, Cartesian3, Math as Math$1, Ellipsoid, Transforms, Matrix4, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, PixelDatatype, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, JulianDate, Quaternion, HeadingPitchRoll, HeightReference, ConstantPositionProperty, DistanceDisplayCondition, ColorBlendMode, Model, ClassificationType, HorizontalOrigin, VerticalOrigin, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Rectangle, SceneMode, IntersectionTests, Ray, SceneTransforms, FeatureDetection, Matrix3, NearFarScalar, KmlDataSource, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, IonResource, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileset, OrthographicFrustum, EasingFunction, Intersect, ShadowMode, CustomDataSource, WebGLConstants, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, GeometryInstance, PrimitiveCollection, PolylineCollection, LabelCollection, LabelStyle, Material, Event, CameraEventType, Plane, OrientedBoundingBox, ScreenSpaceEventHandler, ScreenSpaceEventType, Fullscreen, PolygonPipeline, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, CzmlDataSource } from 'cesium';
3
- import { Cartes, LRUCache, Carto, ProjectViewTile, EntityHistoricData, BruceEvent, DelayQueue, Entity as Entity$1, EntityTag, PathUtils, ClientFile, ENVIRONMENT, EntityAttachmentType, EntityRelationType, EntityType, Tileset, Calculator, DataLab, Style, ObjectUtils, MenuItem, AccountConcept, RecordChangeFeed, EntityLod, UrlUtils, Api, Bounds, ClientFileValueMap, Color as Color$1, Geometry as Geometry$1, ProjectView, ProjectViewBookmark, ZoomControl, Assembly, EntityCoords, BruceApi, EntityRelation, EntitySource, ProgramKey, ProjectViewLegacyTile, Camera, Account, AccountLimits, Session, EntityAttachment, EntityAttribute, MathUtils, ProjectViewBookmarkGroup } from 'bruce-models';
2
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ConstantPositionProperty, HeightReference, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, Cartesian3, ClassificationType, ShaderSource, Math as Math$1, Ellipsoid, Transforms, Matrix4, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, PixelDatatype, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, ArcType, CornerType, JulianDate, Quaternion, HeadingPitchRoll, ColorBlendMode, Model, SceneMode, IntersectionTests, Ray, SceneTransforms, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, FeatureDetection, Cesium3DTileColorBlendMode, Cesium3DTileset, Intersect, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, WebGLConstants, OrthographicFrustum, EasingFunction, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, CesiumInspector, ClockRange, ShadowMode, DynamicEnvironmentMapManager, GeometryInstance, CustomDataSource, Event, PrimitiveCollection, PolylineCollection, LabelCollection, LabelStyle, Material, ScreenSpaceEventHandler, ScreenSpaceEventType, CameraEventType, Plane, OrientedBoundingBox, Fullscreen, CzmlDataSource } from 'cesium';
3
+ import { Cartes, LRUCache, Carto, ProjectViewTile, EntityHistoricData, BruceEvent, DelayQueue, Entity as Entity$1, EntityTag, PathUtils, ClientFile, ENVIRONMENT, EntityAttachmentType, EntityRelationType, EntityType, Tileset, Calculator, DataLab, Style, ObjectUtils, MenuItem, AccountConcept, RecordChangeFeed, Api, Geometry as Geometry$1, EntityLod, UrlUtils, ProjectView, ProjectViewBookmark, ZoomControl, Assembly, EntityCoords, Bounds, ClientFileValueMap, Color as Color$1, EntityRelation, BruceApi, EntitySource, ProgramKey, ProjectViewLegacyTile, Camera, Account, AccountLimits, Session, EntityAttachment, EntityAttribute, MathUtils, ProjectViewBookmarkGroup } from 'bruce-models';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -9683,7 +9683,7 @@ var EntityLabel;
9683
9683
  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; });
9684
9684
  if (places.length) {
9685
9685
  const keys = event;
9686
- this.visualRegister.ClickLabelPlaces(places, Boolean(keys.ctrlKey || keys.metaKey || keys.shiftKey));
9686
+ this.visualRegister.ClickLabelPlaces(places, Boolean(keys.ctrlKey || keys.metaKey || keys.shiftKey), clickEntityIds.length > 1);
9687
9687
  }
9688
9688
  const entityIds = clickEntityIds.filter(id => !places.includes(id));
9689
9689
  if (!entityIds.length) {
@@ -11260,7 +11260,8 @@ var EntityLabelGroup;
11260
11260
  latitude: place.latitude,
11261
11261
  altitude: place.altitude,
11262
11262
  look: place.look,
11263
- selected: place.selected || undefined
11263
+ selected: place.selected || undefined,
11264
+ interactive: place.interactive || undefined
11264
11265
  }));
11265
11266
  }
11266
11267
  EntityLabelGroup.FromPlaces = FromPlaces;
@@ -11813,7 +11814,7 @@ var EntityLabelGroup;
11813
11814
  }
11814
11815
  if (item.placeId) {
11815
11816
  // Clickable only when the app asks, and reported then, as there is no Entity to select.
11816
- options.selectOnClick = this.placesInteractive;
11817
+ options.selectOnClick = this.placesInteractive || Boolean(item.interactive);
11817
11818
  options.highlightColor = item.selected ? PLACE_SELECTED_COLOR : undefined;
11818
11819
  const look = item.look;
11819
11820
  if ((look === null || look === void 0 ? void 0 : look.iconUrl) || (look === null || look === void 0 ? void 0 : look.iconClass)) {
@@ -16830,13 +16831,13 @@ var VisualsRegister;
16830
16831
  this.labelGroups.SetPlacesInteractive(on);
16831
16832
  }
16832
16833
  /*
16833
- * Called by a label clicked while places are interactive, with the place keys it stands for.
16834
+ * Called by a clicked label that stands for places, with their keys and whether it was a cluster.
16834
16835
  */
16835
- ClickLabelPlaces(keys, additive) {
16836
+ ClickLabelPlaces(keys, additive, cluster = keys.length > 1) {
16836
16837
  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 }); })
16837
16838
  .filter(place => place.groupId && place.placeId);
16838
16839
  if (places.length) {
16839
- this.labelPlaceClicked.Trigger({ places, additive });
16840
+ this.labelPlaceClicked.Trigger({ places, additive, cluster });
16840
16841
  }
16841
16842
  }
16842
16843
  /*
@@ -18655,11 +18656,25 @@ var TilesetRenderEngine;
18655
18656
  cTilesetExt._bruceModelSpace = Boolean(params.modelSpace);
18656
18657
  }
18657
18658
  TilesetRenderEngine.ApplyPosition = ApplyPosition;
18659
+ // Eye dome lighting strength that keeps depth readable as soft grey edges, tuned on a coloured scan in November 2026.
18660
+ TilesetRenderEngine.POINT_OUTLINE_STRENGTH = 0.02;
18661
+ /*
18662
+ * Returns a positive maximum point size, since a stored 0 or null shrinks every point to nothing.
18663
+ */
18664
+ function GetMaximumAttenuation(value, fallback) {
18665
+ const size = value == null ? NaN : Number(value);
18666
+ return size > 0 ? size : fallback;
18667
+ }
18668
+ TilesetRenderEngine.GetMaximumAttenuation = GetMaximumAttenuation;
18658
18669
  function ApplySettings(params) {
18659
18670
  const { cTileset, settings } = params;
18660
18671
  cTileset.maximumScreenSpaceError = EnsureNumber(settings.maxScreenSpaceError, 5);
18661
18672
  cTileset.pointCloudShading.attenuation = Boolean(settings.attenuation);
18662
- cTileset.pointCloudShading.maximumAttenuation = EnsureNumber(settings.maximumAttenuation, 4);
18673
+ const maximumAttenuation = GetMaximumAttenuation(settings.maximumAttenuation, 4);
18674
+ cTileset.pointCloudShading.maximumAttenuation = maximumAttenuation;
18675
+ // Cesium's eye dome lighting is the point outline, at its default strength of 1 they render black.
18676
+ cTileset.pointCloudShading.eyeDomeLighting = settings.pointOutlines !== false;
18677
+ cTileset.pointCloudShading.eyeDomeLightingStrength = TilesetRenderEngine.POINT_OUTLINE_STRENGTH;
18663
18678
  if (settings.colorMask) {
18664
18679
  cTileset.style = new Cesium3DTileStyle({
18665
18680
  color: settings.colorMask
@@ -18667,7 +18682,8 @@ var TilesetRenderEngine;
18667
18682
  }
18668
18683
  const cTilesetExt = cTileset;
18669
18684
  cTilesetExt._bruceSettings = {
18670
- ...settings
18685
+ ...settings,
18686
+ maximumAttenuation
18671
18687
  };
18672
18688
  }
18673
18689
  TilesetRenderEngine.ApplySettings = ApplySettings;
@@ -18789,6 +18805,7 @@ var TilesetRenderEngine;
18789
18805
  settings: {
18790
18806
  attenuation: settings.attenuation,
18791
18807
  maximumAttenuation: settings.attenuationMax,
18808
+ pointOutlines: settings.pointOutlines,
18792
18809
  maxScreenSpaceError: settings.maximumScreenSpaceError
18793
18810
  }
18794
18811
  });
@@ -18905,6 +18922,7 @@ var TilesetRenderEngine;
18905
18922
  attenuation: visual.attenuation != false,
18906
18923
  colorMask: visual.colorMask,
18907
18924
  maximumAttenuation: visual.attenuationMax,
18925
+ pointOutlines: visual.pointOutlines,
18908
18926
  maxScreenSpaceError: visual.maximumScreenSpaceError
18909
18927
  }
18910
18928
  });
@@ -29518,16 +29536,14 @@ var TilesetEntitiesRenderManager;
29518
29536
  if (!attenuation && attenuation != false) {
29519
29537
  attenuation = true;
29520
29538
  }
29521
- let attenuationMax = this.item.attenuationMax;
29522
- if (isNaN(attenuationMax)) {
29523
- attenuationMax = 20;
29524
- }
29539
+ const attenuationMax = TilesetRenderEngine.GetMaximumAttenuation(this.item.attenuationMax, 20);
29525
29540
  TilesetRenderEngine.OnTilesetReady(this.cTileset).then(() => {
29526
29541
  TilesetRenderEngine.ApplySettings({
29527
29542
  cTileset: this.cTileset,
29528
29543
  settings: {
29529
29544
  attenuation: attenuation,
29530
- maximumAttenuation: attenuationMax
29545
+ maximumAttenuation: attenuationMax,
29546
+ pointOutlines: this.item.pointOutlines
29531
29547
  }
29532
29548
  });
29533
29549
  });
@@ -29890,15 +29906,13 @@ var TilesetEntitiesRenderManager;
29890
29906
  if (!attenuation && attenuation != false) {
29891
29907
  attenuation = true;
29892
29908
  }
29893
- let attenuationMax = this.item.attenuationMax;
29894
- if (isNaN(attenuationMax)) {
29895
- attenuationMax = 20;
29896
- }
29909
+ const attenuationMax = TilesetRenderEngine.GetMaximumAttenuation(this.item.attenuationMax, 20);
29897
29910
  TilesetRenderEngine.ApplySettings({
29898
29911
  cTileset: this.cTileset,
29899
29912
  settings: {
29900
29913
  attenuation: attenuation,
29901
- maximumAttenuation: attenuationMax
29914
+ maximumAttenuation: attenuationMax,
29915
+ pointOutlines: this.item.pointOutlines
29902
29916
  }
29903
29917
  });
29904
29918
  this.viewer.scene.requestRender();
@@ -36123,7 +36137,8 @@ var MenuItemManager;
36123
36137
  Type: item.Type,
36124
36138
  BruceEntity: { SelectedExpandLayers: (_a = eItem.BruceEntity) === null || _a === void 0 ? void 0 : _a.SelectedExpandLayers },
36125
36139
  attenuation: tItem.attenuation,
36126
- attenuationMax: tItem.attenuationMax
36140
+ attenuationMax: tItem.attenuationMax,
36141
+ pointOutlines: tItem.pointOutlines
36127
36142
  }));
36128
36143
  this.authoredAlternations.set(item, authored);
36129
36144
  }
@@ -39591,10 +39606,11 @@ var MenuItemCreator;
39591
39606
  const tItem = item;
39592
39607
  const authored = manager.GetAuthoredAlternation(item);
39593
39608
  const tItemAlt = alternations[item.id];
39594
- const hasAttenuation = (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.attenuation) !== undefined || (tItemAlt === null || tItemAlt === void 0 ? void 0 : tItemAlt.attenuationMax) !== undefined;
39609
+ 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;
39595
39610
  const source = hasAttenuation ? tItemAlt : authored;
39596
39611
  tItem.attenuation = source.attenuation;
39597
39612
  tItem.attenuationMax = source.attenuationMax;
39613
+ tItem.pointOutlines = source.pointOutlines;
39598
39614
  }
39599
39615
  (_d = item.Children) === null || _d === void 0 ? void 0 : _d.forEach(alternateItems);
39600
39616
  };
@@ -61259,7 +61275,7 @@ var StyleUtils;
61259
61275
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
61260
61276
  })(StyleUtils || (StyleUtils = {}));
61261
61277
 
61262
- const VERSION = "7.8.8";
61278
+ const VERSION = "7.9.0";
61263
61279
  /**
61264
61280
  * Updates the environment instance used by bruce-cesium to one specified.
61265
61281
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.