bruce-cesium 6.7.5 → 6.7.7

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.
Files changed (31) hide show
  1. package/dist/bruce-cesium.es5.js +225 -54
  2. package/dist/bruce-cesium.es5.js.map +1 -1
  3. package/dist/bruce-cesium.umd.js +210 -49
  4. package/dist/bruce-cesium.umd.js.map +1 -1
  5. package/dist/lib/bruce-cesium.js +1 -1
  6. package/dist/lib/rendering/entity-render-engine-model3d.js +13 -8
  7. package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
  8. package/dist/lib/rendering/entity-render-engine-point.js +18 -5
  9. package/dist/lib/rendering/entity-render-engine-point.js.map +1 -1
  10. package/dist/lib/rendering/entity-render-engine-polygon.js +12 -3
  11. package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
  12. package/dist/lib/rendering/entity-render-engine-polyline.js +9 -2
  13. package/dist/lib/rendering/entity-render-engine-polyline.js.map +1 -1
  14. package/dist/lib/rendering/entity-render-engine.js +66 -1
  15. package/dist/lib/rendering/entity-render-engine.js.map +1 -1
  16. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +9 -5
  17. package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
  18. package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js +36 -7
  19. package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js.map +1 -1
  20. package/dist/lib/rendering/tileset-render-engine.js +2 -1
  21. package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
  22. package/dist/lib/rendering/tileset-styler.js +27 -11
  23. package/dist/lib/rendering/tileset-styler.js.map +1 -1
  24. package/dist/lib/rendering/visuals-register.js +33 -7
  25. package/dist/lib/rendering/visuals-register.js.map +1 -1
  26. package/dist/types/bruce-cesium.d.ts +1 -1
  27. package/dist/types/rendering/entity-render-engine.d.ts +29 -0
  28. package/dist/types/rendering/tileset-render-engine.d.ts +10 -0
  29. package/dist/types/rendering/tileset-styler.d.ts +1 -0
  30. package/dist/types/rendering/visuals-register.d.ts +4 -0
  31. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import * as Cesium from 'cesium';
2
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, DistanceDisplayCondition, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
- import { Cartes, Entity as Entity$1, ENVIRONMENT, Calculator, ClientFile, EntityLod, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Api, Bounds, Geometry, Carto, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, DataLab, DelayQueue, EntityHistoricData, AccountConcept, RecordChangeFeed, BruceApi, EntityRelation, ProgramKey, EntitySource, ProjectViewLegacyTile, ProjectViewTile, Camera, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType } from 'bruce-models';
2
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, DistanceDisplayCondition, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, IonResource, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileset, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
+ import { Cartes, Entity as Entity$1, ENVIRONMENT, Calculator, ClientFile, EntityLod, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Api, Bounds, Geometry, Carto, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, DataLab, DelayQueue, EntityHistoricData, AccountConcept, RecordChangeFeed, BruceApi, EntityRelation, ProgramKey, EntitySource, ProjectViewLegacyTile, ProjectViewTile, Camera, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session, EntityRelationType } from 'bruce-models';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -7780,29 +7780,54 @@ var VisualsRegister;
7780
7780
  GetRegos(params) {
7781
7781
  // TODO: refactor.
7782
7782
  // Currently this was made by merging two functions.
7783
- const { entityId, menuItemId } = params;
7783
+ const { entityId, menuItemId, styleId, styleEffectiveFilter } = params;
7784
+ const matchesStyleFilters = (rego) => {
7785
+ if (styleId != null && rego.styleId !== styleId) {
7786
+ return false;
7787
+ }
7788
+ if (styleEffectiveFilter && !StyleEffective.MatchesFilter(rego.styleEffective, styleEffectiveFilter)) {
7789
+ return false;
7790
+ }
7791
+ return true;
7792
+ };
7784
7793
  if (entityId) {
7785
- const entityId = params.entityId;
7786
7794
  const entityRegos = this.rego[entityId];
7787
7795
  if (!entityRegos) {
7788
7796
  return [];
7789
7797
  }
7790
- return menuItemId ? entityRegos.filter(x => x.menuItemId == menuItemId) : entityRegos;
7798
+ let results = menuItemId ? entityRegos.filter(x => x.menuItemId == menuItemId) : entityRegos;
7799
+ if (styleId != null || styleEffectiveFilter) {
7800
+ results = results.filter(matchesStyleFilters);
7801
+ }
7802
+ return results;
7791
7803
  }
7792
7804
  else if (menuItemId) {
7793
- const menuItemId = params.menuItemId;
7794
7805
  const visuals = [];
7795
- for (const entityId in this.rego) {
7796
- const entityRegos = this.rego[entityId];
7806
+ for (const eId in this.rego) {
7807
+ const entityRegos = this.rego[eId];
7797
7808
  if (entityRegos) {
7798
7809
  const rego = entityRegos.find(r => r.menuItemId === menuItemId);
7799
- if (rego) {
7810
+ if (rego && matchesStyleFilters(rego)) {
7800
7811
  visuals.push(rego);
7801
7812
  }
7802
7813
  }
7803
7814
  }
7804
7815
  return visuals;
7805
7816
  }
7817
+ else if (styleId != null || styleEffectiveFilter) {
7818
+ const visuals = [];
7819
+ for (const eId in this.rego) {
7820
+ const entityRegos = this.rego[eId];
7821
+ if (entityRegos) {
7822
+ for (const rego of entityRegos) {
7823
+ if (matchesStyleFilters(rego)) {
7824
+ visuals.push(rego);
7825
+ }
7826
+ }
7827
+ }
7828
+ }
7829
+ return visuals;
7830
+ }
7806
7831
  return [];
7807
7832
  }
7808
7833
  /**
@@ -10136,7 +10161,7 @@ var EntitiesRenderManager;
10136
10161
  * @returns
10137
10162
  */
10138
10163
  async renderAsIndividuals(entities, force = false) {
10139
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10164
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
10140
10165
  // When live we just want to show the latest pos.
10141
10166
  // When not live, the user might scroll the timeline and want to see it a fluid animation between points in time.
10142
10167
  const isLive = ViewUtils.GetTimeDetails({
@@ -10229,6 +10254,8 @@ var EntitiesRenderManager;
10229
10254
  cdn: this.item.cdnEnabled,
10230
10255
  outline: entity.Bruce.Outline,
10231
10256
  internalId: (_f = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.InternalID) !== null && _f !== void 0 ? _f : undefined,
10257
+ styleId: (_g = cEntity.styleId) !== null && _g !== void 0 ? _g : undefined,
10258
+ styleEffective: (_h = cEntity.styleEffective) !== null && _h !== void 0 ? _h : undefined,
10232
10259
  };
10233
10260
  this.visualsManager.AddRego({
10234
10261
  rego,
@@ -10240,11 +10267,13 @@ var EntitiesRenderManager;
10240
10267
  rego.visual = cEntity;
10241
10268
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
10242
10269
  rego.tagIds = entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [];
10243
- rego.outline = (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.Outline;
10270
+ rego.outline = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.Outline;
10244
10271
  rego.cdn = this.item.cdnEnabled;
10245
- rego.schema = (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Schema;
10272
+ rego.schema = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Schema;
10246
10273
  rego.canEdit = canEdit;
10247
- rego.internalId = (_k = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.InternalID) !== null && _k !== void 0 ? _k : rego.internalId;
10274
+ rego.internalId = (_m = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.InternalID) !== null && _m !== void 0 ? _m : rego.internalId;
10275
+ rego.styleId = (_o = cEntity.styleId) !== null && _o !== void 0 ? _o : rego.styleId;
10276
+ rego.styleEffective = (_p = cEntity.styleEffective) !== null && _p !== void 0 ? _p : rego.styleEffective;
10248
10277
  // Marked as stale meaning some change was performed that requires a refresh.
10249
10278
  // This usually means a new sibling was added that we need to update.
10250
10279
  if (rego.stale) {
@@ -10274,7 +10303,7 @@ var EntitiesRenderManager;
10274
10303
  menuItemId: this.item.id,
10275
10304
  requestRender: false
10276
10305
  });
10277
- (_l = this.clustering) === null || _l === void 0 ? void 0 : _l.RemoveEntity(id, false);
10306
+ (_q = this.clustering) === null || _q === void 0 ? void 0 : _q.RemoveEntity(id, false);
10278
10307
  }
10279
10308
  }
10280
10309
  this.viewer.scene.requestRender();
@@ -12849,13 +12878,14 @@ class TilesetStyler {
12849
12878
  this.styleTilesetFeatureFullData(rego, null, []);
12850
12879
  }
12851
12880
  styleTilesetFeatureFullData(rego, data, tags) {
12852
- var _a, _b, _c;
12881
+ var _a, _b, _c, _d;
12853
12882
  const visual = rego.visual;
12854
12883
  if (!visual || !(visual instanceof Cesium3DTileFeature)) {
12855
12884
  return;
12856
12885
  }
12857
- const style = this.getTilesetFeatureStyle(rego.entityTypeId);
12858
- const bColor = style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? Calculator.GetColor(style.modelStyle.fillColor, data, tags) : null;
12886
+ const { settings: style, styleId: resolvedStyleId } = this.getTilesetFeatureStyleWithId(rego.entityTypeId);
12887
+ const fillColorTrace = (style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor)) ? Calculator.TraceGetColor(style.modelStyle.fillColor, data, tags) : { value: null, effective: null };
12888
+ const bColor = fillColorTrace.value;
12859
12889
  let cColor = null;
12860
12890
  if (bColor == null) {
12861
12891
  cColor = Color.WHITE;
@@ -12875,6 +12905,12 @@ class TilesetStyler {
12875
12905
  rego.internalId = data.Bruce.InternalID;
12876
12906
  this.styledByInternalId.set(data.Bruce.InternalID, rego.entityId);
12877
12907
  }
12908
+ if (resolvedStyleId != null) {
12909
+ rego.styleId = resolvedStyleId;
12910
+ }
12911
+ rego.styleEffective = (_c = StyleEffective.Combine([
12912
+ { key: "color", effective: fillColorTrace.effective }
12913
+ ])) !== null && _c !== void 0 ? _c : rego.styleEffective;
12878
12914
  this.styledEntityIds.set(rego.entityId, true);
12879
12915
  this._styleProgressQueue.Call();
12880
12916
  // Since we only need to update it for scenarios right now.
@@ -12883,7 +12919,7 @@ class TilesetStyler {
12883
12919
  // Update the Entity's rego state.
12884
12920
  let changed = false;
12885
12921
  if (isOutlineChanged(rego, data)) {
12886
- rego.outline = (_c = data === null || data === void 0 ? void 0 : data.Bruce) === null || _c === void 0 ? void 0 : _c.Outline;
12922
+ rego.outline = (_d = data === null || data === void 0 ? void 0 : data.Bruce) === null || _d === void 0 ? void 0 : _d.Outline;
12887
12923
  changed = true;
12888
12924
  }
12889
12925
  // Something changed, trigger a rego update.
@@ -12898,19 +12934,27 @@ class TilesetStyler {
12898
12934
  }
12899
12935
  }
12900
12936
  getTilesetFeatureStyle(entityTypeId) {
12901
- var _a, _b, _c, _d;
12902
- // Locate what style is applicable to the feature.
12937
+ return this.getTilesetFeatureStyleWithId(entityTypeId).settings;
12938
+ }
12939
+ getTilesetFeatureStyleWithId(entityTypeId) {
12940
+ var _a, _b, _c;
12903
12941
  let style = null;
12942
+ let styleId = null;
12904
12943
  if (entityTypeId) {
12905
- style = ((_b = (_a = this.styleMapping.find(x => x.EntityTypeID == entityTypeId)) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.Settings);
12944
+ const mapping = this.styleMapping.find(x => x.EntityTypeID == entityTypeId);
12945
+ if (mapping) {
12946
+ style = (_a = mapping.style) === null || _a === void 0 ? void 0 : _a.Settings;
12947
+ styleId = mapping.StyleID != null ? Number(mapping.StyleID) : null;
12948
+ }
12906
12949
  }
12907
12950
  if (!style) {
12908
- style = ((_c = this.fallbackStyle) === null || _c === void 0 ? void 0 : _c.Settings);
12951
+ style = (_b = this.fallbackStyle) === null || _b === void 0 ? void 0 : _b.Settings;
12952
+ styleId = this.fallbackStyleId != null ? Number(this.fallbackStyleId) : null;
12909
12953
  }
12910
- if (!style || !((_d = style === null || style === void 0 ? void 0 : style.modelStyle) === null || _d === void 0 ? void 0 : _d.customize)) {
12911
- return null;
12954
+ if (!style || !((_c = style === null || style === void 0 ? void 0 : style.modelStyle) === null || _c === void 0 ? void 0 : _c.customize)) {
12955
+ return { settings: null, styleId: null };
12912
12956
  }
12913
- return style;
12957
+ return { settings: style, styleId };
12914
12958
  }
12915
12959
  getTilesetFeatureNeedsFullData(entityTypeId) {
12916
12960
  var _a;
@@ -19090,7 +19134,7 @@ var RelationsRenderManager;
19090
19134
  })(RelationsRenderManager || (RelationsRenderManager = {}));
19091
19135
 
19092
19136
  var TilesetGooglePhotosRenderManager;
19093
- (function (TilesetGooglePhotosRenderManager) {
19137
+ (function (TilesetGooglePhotosRenderManager$$1) {
19094
19138
  class Manager {
19095
19139
  get Disposed() {
19096
19140
  return this.disposed;
@@ -19132,7 +19176,7 @@ var TilesetGooglePhotosRenderManager;
19132
19176
  this.item = params.item;
19133
19177
  }
19134
19178
  (async () => {
19135
- var _a;
19179
+ var _a, _b, _c;
19136
19180
  // If the tileset already exists then we just need to update the style.
19137
19181
  if (this.cTileset) {
19138
19182
  const colorCss = this.item.colorMask;
@@ -19159,16 +19203,44 @@ var TilesetGooglePhotosRenderManager;
19159
19203
  console.warn("Cesium version does not support 'createGooglePhotorealistic3DTileset' so Google Photos tileset will not be rendered.");
19160
19204
  return;
19161
19205
  }
19206
+ // Proxy path: key injected server-side.
19162
19207
  if (api.IsVersionAtLeast(BruceApi.VERSION_WITH_PROXIES)) {
19163
- // Proxy path: key injected server-side.
19164
- const proxyRootUrl = api.GetBaseUrl() + "proxy/google-tiles/v1/3dtiles/root.json";
19208
+ // If we have a Google token we'll proxy through that.
19209
+ // Otherwise use Cesium Ion to load as a resource.
19210
+ const { programKeys } = await ProgramKey.GetList({
19211
+ api: this.getters.GetBruceApi()
19212
+ });
19213
+ const hasGoogleToken = Boolean((_a = programKeys.find(x => x.ProgramId === ProgramKey.EProgramId.GooglePhotogrammetry)) === null || _a === void 0 ? void 0 : _a.Available);
19214
+ // Must have own iot token, this ensures we don't use our template one for loading customer photogrammetry.
19215
+ const hasIonToken = Boolean((_b = programKeys.find(x => x.ProgramId === ProgramKey.EProgramId.CesiumIon)) === null || _b === void 0 ? void 0 : _b.Available);
19165
19216
  if (this.disposed) {
19166
19217
  this.doDispose();
19167
19218
  return;
19168
19219
  }
19169
- this.cTileset = await CESIUM.Cesium3DTileset.fromUrl(proxyRootUrl, {
19170
- showCreditsOnScreen: true
19171
- });
19220
+ // WARNING: we are routing through ion first right now as it is faster.
19221
+ // Should be a user-decision and we should improve our google proxying.
19222
+ if (hasIonToken && Ion.defaultServer) {
19223
+ const loadUrl = await IonResource.fromAssetId(2275207, undefined);
19224
+ if (this.disposed) {
19225
+ this.doDispose();
19226
+ return;
19227
+ }
19228
+ this.cTileset = await createTileset(loadUrl, {}, true);
19229
+ }
19230
+ else if (hasGoogleToken) {
19231
+ const proxyRootUrl = api.GetBaseUrl() + "proxy/google-tiles/v1/3dtiles/root.json";
19232
+ if (this.disposed) {
19233
+ this.doDispose();
19234
+ return;
19235
+ }
19236
+ this.cTileset = await CESIUM.Cesium3DTileset.fromUrl(proxyRootUrl, {
19237
+ showCreditsOnScreen: true
19238
+ });
19239
+ }
19240
+ else {
19241
+ console.warn("No Google or Cesium Ion token available, so Google Photos tileset will not be rendered.");
19242
+ return;
19243
+ }
19172
19244
  }
19173
19245
  // Legacy path: fetch real Google key and use createGooglePhotorealistic3DTileset().
19174
19246
  // Kill of whenever all API instances are migrated.
@@ -19196,7 +19268,7 @@ var TilesetGooglePhotosRenderManager;
19196
19268
  this.doDispose();
19197
19269
  return;
19198
19270
  }
19199
- this.cTileset = await ((_a = CESIUM.createGooglePhotorealistic3DTileset) === null || _a === void 0 ? void 0 : _a.call(CESIUM));
19271
+ this.cTileset = await ((_c = CESIUM.createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(CESIUM));
19200
19272
  }
19201
19273
  if (this.disposed) {
19202
19274
  this.doDispose();
@@ -19224,7 +19296,7 @@ var TilesetGooglePhotosRenderManager;
19224
19296
  async ReRender(params) {
19225
19297
  }
19226
19298
  }
19227
- TilesetGooglePhotosRenderManager.Manager = Manager;
19299
+ TilesetGooglePhotosRenderManager$$1.Manager = Manager;
19228
19300
  })(TilesetGooglePhotosRenderManager || (TilesetGooglePhotosRenderManager = {}));
19229
19301
 
19230
19302
  /**
@@ -32346,6 +32418,7 @@ var EntityRenderEnginePoint;
32346
32418
  if (!params.entityHistoric) {
32347
32419
  params.entityHistoric = [];
32348
32420
  }
32421
+ const styleTraceParts = [];
32349
32422
  const style = params.style;
32350
32423
  let type = style.Type;
32351
32424
  if (type == null) {
@@ -32424,7 +32497,9 @@ var EntityRenderEnginePoint;
32424
32497
  row.type = Calculator.EValueType.Input;
32425
32498
  }
32426
32499
  });
32427
- const icon = Calculator.GetString(iconUrlRows, entity, params.tags);
32500
+ const iconTrace = Calculator.TraceGetString(iconUrlRows, entity, params.tags);
32501
+ styleTraceParts.push({ key: "icon", effective: iconTrace.effective });
32502
+ const icon = iconTrace.value;
32428
32503
  let iconUrl = null;
32429
32504
  if (typeof icon == "string") {
32430
32505
  iconUrl = icon;
@@ -32470,14 +32545,18 @@ var EntityRenderEnginePoint;
32470
32545
  imageKey = image ? iconUrl : null;
32471
32546
  }
32472
32547
  if (image) {
32473
- let iconScale = (style === null || style === void 0 ? void 0 : style.iconScale) ? EnsureNumber(Calculator.GetNumber(style.iconScale, entity, params.tags)) : 1;
32548
+ const iconScaleTrace = (style === null || style === void 0 ? void 0 : style.iconScale) ? Calculator.TraceGetNumber(style.iconScale, entity, params.tags) : { value: null, effective: null };
32549
+ let iconScale = (style === null || style === void 0 ? void 0 : style.iconScale) ? EnsureNumber(iconScaleTrace.value) : 1;
32550
+ styleTraceParts.push({ key: "iconScale", effective: iconScaleTrace.effective });
32474
32551
  if (!iconScale && iconScale != 0) {
32475
32552
  iconScale = 1;
32476
32553
  }
32477
32554
  const disableDepthTest = Boolean(style.renderOnTop);
32478
32555
  if (iconScale > 0) {
32479
32556
  updateShouldShowTrack();
32480
- const bColor = style.iconTintColor ? Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
32557
+ const iconTintTrace = style.iconTintColor ? Calculator.TraceGetColor(style.iconTintColor, entity, params.tags) : { value: null, effective: null };
32558
+ styleTraceParts.push({ key: "iconTint", effective: iconTintTrace.effective });
32559
+ const bColor = iconTintTrace.value;
32481
32560
  const cColor = bColor ? ColorToCColor(bColor) : Color.WHITE.clone();
32482
32561
  heightRef = getHeightRef(style);
32483
32562
  if (!params.rendered || !params.rendered.billboard) {
@@ -32822,9 +32901,13 @@ var EntityRenderEnginePoint;
32822
32901
  }
32823
32902
  }
32824
32903
  if (!cEntity) {
32825
- const bColor = style.color ? Calculator.GetColor(style.color, entity, params.tags) : null;
32904
+ const pointColorTrace = style.color ? Calculator.TraceGetColor(style.color, entity, params.tags) : { value: null, effective: null };
32905
+ styleTraceParts.push({ key: "color", effective: pointColorTrace.effective });
32906
+ const bColor = pointColorTrace.value;
32826
32907
  const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(33, 150, 243, 0.8)");
32827
- let size = style.size ? Calculator.GetNumber(style.size, entity, params.tags) : null;
32908
+ const pointSizeTrace = style.size ? Calculator.TraceGetNumber(style.size, entity, params.tags) : { value: null, effective: null };
32909
+ styleTraceParts.push({ key: "size", effective: pointSizeTrace.effective });
32910
+ let size = pointSizeTrace.value;
32828
32911
  if (size == null) {
32829
32912
  size = 20;
32830
32913
  }
@@ -33025,6 +33108,7 @@ var EntityRenderEnginePoint;
33025
33108
  trackEntity._parentEntity = cEntity;
33026
33109
  }
33027
33110
  cEntity._siblingGraphics = siblings;
33111
+ cEntity.styleEffective = StyleEffective.Combine(styleTraceParts);
33028
33112
  return cEntity;
33029
33113
  }
33030
33114
  EntityRenderEnginePoint.Render = Render;
@@ -33107,6 +33191,7 @@ var EntityRenderEnginePoint;
33107
33191
  const name = await getName(api, entity);
33108
33192
  cEntity.name = name;
33109
33193
  cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
33194
+ cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
33110
33195
  }
33111
33196
  cEntities.set(entity.Bruce.ID, cEntity);
33112
33197
  }
@@ -33404,7 +33489,8 @@ var EntityRenderEngineModel3d;
33404
33489
  scale = 1;
33405
33490
  }
33406
33491
  const style = params.style;
33407
- let styleScale = (style === null || style === void 0 ? void 0 : style.scale) ? Calculator.GetNumber(style === null || style === void 0 ? void 0 : style.scale, entity, params.tags) : null;
33492
+ const scaleTrace = (style === null || style === void 0 ? void 0 : style.scale) ? Calculator.TraceGetNumber(style.scale, entity, params.tags) : { value: null, effective: null };
33493
+ let styleScale = scaleTrace.value;
33408
33494
  styleScale = EnsureNumber(styleScale ? styleScale : 1);
33409
33495
  if (styleScale <= 0) {
33410
33496
  styleScale = 1;
@@ -33420,6 +33506,7 @@ var EntityRenderEngineModel3d;
33420
33506
  let blendMode = null;
33421
33507
  let blendAmount = null;
33422
33508
  let color = null;
33509
+ let fillColorTrace = { value: null, effective: null };
33423
33510
  if (style === null || style === void 0 ? void 0 : style.customize) {
33424
33511
  blendMode = style.fillColorBlendMode;
33425
33512
  if (!blendMode) {
@@ -33431,7 +33518,8 @@ var EntityRenderEngineModel3d;
33431
33518
  blendAmount = 0.5;
33432
33519
  }
33433
33520
  }
33434
- const bColor = Calculator.GetColor(style.fillColor, entity, params.tags);
33521
+ fillColorTrace = style.fillColor ? Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
33522
+ const bColor = fillColorTrace.value;
33435
33523
  if (bColor) {
33436
33524
  color = ColorToCColor(bColor);
33437
33525
  }
@@ -33920,7 +34008,7 @@ var EntityRenderEngineModel3d;
33920
34008
  * @returns
33921
34009
  */
33922
34010
  async function RenderGroup(params) {
33923
- var _a, _b, _c, _d, _e, _f, _g;
34011
+ var _a, _b, _c, _d, _e, _f;
33924
34012
  const api = params.apiGetter.getApi();
33925
34013
  await api.Loading;
33926
34014
  const cEntities = new Map();
@@ -33996,7 +34084,8 @@ var EntityRenderEngineModel3d;
33996
34084
  for (let i = 0; i < params.entities.length; i++) {
33997
34085
  const entity = params.entities[i];
33998
34086
  const zoomItem = params.zoomItems[entity.Bruce.ID];
33999
- const style = zoomItem.StyleID != -1 ? (_c = (await getStyle$2(api, entity, zoomItem.StyleID))) === null || _c === void 0 ? void 0 : _c.Settings : zoomItem.Style;
34087
+ const styleRecord = zoomItem.StyleID != -1 ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
34088
+ const style = zoomItem.StyleID != -1 ? styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.Settings : zoomItem.Style;
34000
34089
  const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
34001
34090
  if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
34002
34091
  continue;
@@ -34015,17 +34104,17 @@ var EntityRenderEngineModel3d;
34015
34104
  let rego = null;
34016
34105
  // Only used for historic tracks right now.
34017
34106
  // So won't bother getting it if we don't have historic data.
34018
- if ((_d = params.entitiesHistoric) === null || _d === void 0 ? void 0 : _d[entity.Bruce.ID]) {
34107
+ if ((_c = params.entitiesHistoric) === null || _c === void 0 ? void 0 : _c[entity.Bruce.ID]) {
34019
34108
  rego = params.visualRegister.GetRego({
34020
34109
  entityId: entity.Bruce.ID,
34021
34110
  menuItemId: params.menuItemId
34022
34111
  });
34023
34112
  }
34024
- const mStyle = (_e = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _e !== void 0 ? _e : {};
34113
+ const mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
34025
34114
  const cEntity = Render({
34026
- rendered: (_f = params.rendered) === null || _f === void 0 ? void 0 : _f.get(entity.Bruce.ID),
34115
+ rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
34027
34116
  entity: entity,
34028
- entityHistoric: (_g = params.entitiesHistoric) === null || _g === void 0 ? void 0 : _g[entity.Bruce.ID],
34117
+ entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
34029
34118
  style: mStyle,
34030
34119
  tags: tags,
34031
34120
  viewer: params.viewer,
@@ -34045,6 +34134,7 @@ var EntityRenderEngineModel3d;
34045
34134
  const name = await getName$1(api, entity);
34046
34135
  cEntity.name = name;
34047
34136
  cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
34137
+ cEntity.styleId = zoomItem.StyleID == -1 ? -1 : styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.ID;
34048
34138
  cEntities.set(entity.Bruce.ID, cEntity);
34049
34139
  }
34050
34140
  }
@@ -34261,12 +34351,14 @@ var EntityRenderEnginePolyline;
34261
34351
  posses = smoothed;
34262
34352
  }
34263
34353
  }
34264
- const bColor = style.lineColor ? Calculator.GetColor(style.lineColor, entity, params.tags) : null;
34354
+ const lineColorTrace = style.lineColor ? Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
34355
+ const bColor = lineColorTrace.value;
34265
34356
  const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
34266
34357
  if (cColor.alpha <= 0) {
34267
34358
  return null;
34268
34359
  }
34269
- let width = style.lineWidth ? Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
34360
+ const lineWidthTrace = style.lineWidth ? Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
34361
+ let width = lineWidthTrace.value;
34270
34362
  if (width == null) {
34271
34363
  width = 2;
34272
34364
  }
@@ -34429,6 +34521,10 @@ var EntityRenderEnginePolyline;
34429
34521
  cEntity.corridor._orgPosses = orgPosses;
34430
34522
  cEntity.corridor._smoothen = style.smoothen;
34431
34523
  }
34524
+ cEntity.styleEffective = StyleEffective.Combine([
34525
+ { key: "lineColor", effective: lineColorTrace.effective },
34526
+ { key: "lineWidth", effective: lineWidthTrace.effective }
34527
+ ]);
34432
34528
  return cEntity;
34433
34529
  }
34434
34530
  EntityRenderEnginePolyline.Render = Render;
@@ -34496,6 +34592,7 @@ var EntityRenderEnginePolyline;
34496
34592
  const name = await getName$2(api, entity);
34497
34593
  cEntity.name = name;
34498
34594
  cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
34595
+ cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
34499
34596
  cEntities.set(entity.Bruce.ID, cEntity);
34500
34597
  }
34501
34598
  }
@@ -34637,11 +34734,14 @@ var EntityRenderEnginePolygon;
34637
34734
  return null;
34638
34735
  }
34639
34736
  const style = params.style;
34640
- const bFillColor = Calculator.GetColor(style.fillColor, entity, params.tags);
34737
+ const fillColorTrace = style.fillColor ? Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
34738
+ const bFillColor = fillColorTrace.value;
34641
34739
  const cFillColor = bFillColor ? ColorToCColor(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
34642
- const bLineColor = Calculator.GetColor(style.lineColor, entity, params.tags);
34740
+ const lineColorTrace = style.lineColor ? Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
34741
+ const bLineColor = lineColorTrace.value;
34643
34742
  const cLineColor = bLineColor ? ColorToCColor(bLineColor) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
34644
- let width = style.lineWidth ? Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
34743
+ const lineWidthTrace = style.lineWidth ? Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
34744
+ let width = lineWidthTrace.value;
34645
34745
  if (width == null) {
34646
34746
  width = 1;
34647
34747
  }
@@ -34929,6 +35029,11 @@ var EntityRenderEnginePolygon;
34929
35029
  else {
34930
35030
  cEntity._siblingGraphics = [];
34931
35031
  }
35032
+ cEntity.styleEffective = StyleEffective.Combine([
35033
+ { key: "color", effective: fillColorTrace.effective },
35034
+ { key: "lineColor", effective: lineColorTrace.effective },
35035
+ { key: "lineWidth", effective: lineWidthTrace.effective }
35036
+ ]);
34932
35037
  return cEntity;
34933
35038
  }
34934
35039
  EntityRenderEnginePolygon.Render = Render;
@@ -34993,6 +35098,7 @@ var EntityRenderEnginePolygon;
34993
35098
  const name = await getName$3(api, entity);
34994
35099
  cEntity.name = name;
34995
35100
  cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
35101
+ cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
34996
35102
  cEntities.set(entity.Bruce.ID, cEntity);
34997
35103
  }
34998
35104
  }
@@ -35352,6 +35458,71 @@ function isOutlineChanged$1(rego, entity) {
35352
35458
  }
35353
35459
  return false;
35354
35460
  }
35461
+ /**
35462
+ * Utilities for building and querying styleEffective strings.
35463
+ *
35464
+ * Format: comma-separated segments of the form "{key}={traceEffective}".
35465
+ * Keys name the style property (e.g. "color", "scale", "icon").
35466
+ * Values are effective strings produced by Calculator.TraceGet* calls.
35467
+ * Keys must not contain "=" or ",". Effective values must not contain ",".
35468
+ *
35469
+ * Example: "color=f0:gradient:abc:123,scale=f1:input:def:456"
35470
+ */
35471
+ var StyleEffective;
35472
+ (function (StyleEffective) {
35473
+ /**
35474
+ * Builds a styleEffective string from labelled trace results.
35475
+ * Segments whose effective is null/empty are omitted.
35476
+ */
35477
+ function Combine(parts) {
35478
+ const segments = [];
35479
+ for (const part of parts) {
35480
+ if (part.effective) {
35481
+ segments.push(`${part.key}=${part.effective}`);
35482
+ }
35483
+ }
35484
+ return segments.length ? segments.join(",") : null;
35485
+ }
35486
+ StyleEffective.Combine = Combine;
35487
+ /**
35488
+ * Returns true if every segment in the filter string appears in the subject effective string.
35489
+ * A filter segment matches if the subject contains a segment starting with the same key,
35490
+ * and either no value filter is given or the value matches exactly.
35491
+ * Passing a partial effective value (e.g. just "f0:gradient") also matches.
35492
+ */
35493
+ function MatchesFilter(effective, filter) {
35494
+ if (!filter) {
35495
+ return true;
35496
+ }
35497
+ if (!effective) {
35498
+ return false;
35499
+ }
35500
+ const subjectParts = parseSegments(effective);
35501
+ const filterParts = parseSegments(filter);
35502
+ for (const [fKey, fVal] of filterParts) {
35503
+ const sVal = subjectParts.get(fKey);
35504
+ if (sVal === undefined) {
35505
+ return false;
35506
+ }
35507
+ if (fVal && !sVal.startsWith(fVal)) {
35508
+ return false;
35509
+ }
35510
+ }
35511
+ return true;
35512
+ }
35513
+ StyleEffective.MatchesFilter = MatchesFilter;
35514
+ function parseSegments(str) {
35515
+ const map = new Map();
35516
+ for (const seg of str.split(",")) {
35517
+ const eq = seg.indexOf("=");
35518
+ if (eq < 0) {
35519
+ continue;
35520
+ }
35521
+ map.set(seg.slice(0, eq), seg.slice(eq + 1));
35522
+ }
35523
+ return map;
35524
+ }
35525
+ })(StyleEffective || (StyleEffective = {}));
35355
35526
  var EntityRenderEngine;
35356
35527
  (function (EntityRenderEngine) {
35357
35528
  function GetRenderGroupId(zoomItem) {
@@ -36333,7 +36504,7 @@ var StyleUtils;
36333
36504
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
36334
36505
  })(StyleUtils || (StyleUtils = {}));
36335
36506
 
36336
- const VERSION = "6.7.5";
36507
+ const VERSION = "6.7.7";
36337
36508
  /**
36338
36509
  * Updates the environment instance used by bruce-cesium to one specified.
36339
36510
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
@@ -36350,5 +36521,5 @@ const getENVIRONMENT = () => {
36350
36521
  return ENVIRONMENT;
36351
36522
  };
36352
36523
 
36353
- export { VERSION, setENVIRONMENT, getENVIRONMENT, CesiumAnimatedInOut, CesiumAnimatedProperty, isOutlineChanged$1 as isOutlineChanged, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, EntityRenderEnginePolygon, EntityRenderEnginePolyline, MenuItemCreator, MenuItemManager, CesiumParabola, EntityLabel, LiveCursor, SharedGetters, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, TilesetRenderEngine, ViewRenderEngine, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
36524
+ export { VERSION, setENVIRONMENT, getENVIRONMENT, CesiumAnimatedInOut, CesiumAnimatedProperty, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, EntityRenderEnginePolygon, EntityRenderEnginePolyline, MenuItemCreator, MenuItemManager, CesiumParabola, EntityLabel, LiveCursor, SharedGetters, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
36354
36525
  //# sourceMappingURL=bruce-cesium.es5.js.map