bruce-cesium 6.9.8 → 6.9.9

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.
@@ -37001,7 +37001,9 @@
37001
37001
  textureTraceEffective = resolved.effective;
37002
37002
  frameArchive = resolved.frameArchive || null;
37003
37003
  }
37004
- const hasFill = fillType === BModels.Style.EPolygonFillType.Texture ? Boolean(textureDataUri || frameArchive) : cFillColor.alpha > 0;
37004
+ const hasFill = fillType === BModels.Style.EPolygonFillType.Texture
37005
+ ? Boolean(textureDataUri || frameArchive || cFillColor.alpha > 0)
37006
+ : cFillColor.alpha > 0;
37005
37007
  const fillMaterial = textureDataUri
37006
37008
  ? new Cesium.ImageMaterialProperty({ image: textureDataUri, transparent: true })
37007
37009
  : frameArchive
@@ -37596,7 +37598,11 @@
37596
37598
  */
37597
37599
  async function resolveTexturedFill(params) {
37598
37600
  const { api, style, entity, tags } = params;
37599
- let textureRows = style.texture == null ? [] : style.texture;
37601
+ const textureValue = style.texture;
37602
+ if (textureValue && !Array.isArray(textureValue)) {
37603
+ return resolveTextureCondition({ api, condition: textureValue });
37604
+ }
37605
+ let textureRows = Array.isArray(textureValue) ? textureValue : [];
37600
37606
  textureRows.forEach((row) => {
37601
37607
  if (row.type == BModels.Calculator.EValueType.Color) {
37602
37608
  row.type = BModels.Calculator.EValueType.Input;
@@ -37633,6 +37639,31 @@
37633
37639
  }
37634
37640
  return { dataUri: await prom, effective: textureTrace.effective };
37635
37641
  }
37642
+ async function resolveTextureCondition(params) {
37643
+ const { api, condition } = params;
37644
+ const entityTypeSourceId = condition === null || condition === void 0 ? void 0 : condition["EntityType.Source.ID"];
37645
+ const attribute = condition === null || condition === void 0 ? void 0 : condition.Attribute;
37646
+ if (!api || !entityTypeSourceId || !attribute) {
37647
+ return { dataUri: null, effective: null };
37648
+ }
37649
+ await api.Loading;
37650
+ const clientFile = await BModels.ClientFile.FindGeneratedTexture({ api, entityTypeSourceId, attribute });
37651
+ if (!clientFile) {
37652
+ return { dataUri: null, effective: null };
37653
+ }
37654
+ const url = clientFile.URL;
37655
+ const clientFileData = clientFile.Data;
37656
+ if (TextureFrameSeriesAnimator.IsFrameArchiveMetadata(clientFileData)) {
37657
+ return { dataUri: null, effective: null, frameArchive: { url, metadata: clientFileData.generation } };
37658
+ }
37659
+ const cacheKey = "texture-" + url + "-none";
37660
+ let prom = _textureCache.Get(cacheKey);
37661
+ if (!prom) {
37662
+ prom = buildTintedTextureDataUri(url).catch(() => null);
37663
+ _textureCache.Set(cacheKey, prom);
37664
+ }
37665
+ return { dataUri: await prom, effective: null };
37666
+ }
37636
37667
  /**
37637
37668
  * Fetches an image and, if a color mask is provided, remaps its (assumed grayscale) pixel values
37638
37669
  * into a gradient between the mask's minColor/maxColor, preserving source alpha.
@@ -38959,7 +38990,7 @@
38959
38990
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
38960
38991
  })(exports.StyleUtils || (exports.StyleUtils = {}));
38961
38992
 
38962
- const VERSION = "6.9.8";
38993
+ const VERSION = "6.9.9";
38963
38994
  /**
38964
38995
  * Updates the environment instance used by bruce-cesium to one specified.
38965
38996
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.