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.
- package/dist/bruce-cesium.es5.js +225 -54
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +210 -49
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine-model3d.js +13 -8
- package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine-point.js +18 -5
- package/dist/lib/rendering/entity-render-engine-point.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine-polygon.js +12 -3
- package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine-polyline.js +9 -2
- package/dist/lib/rendering/entity-render-engine-polyline.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +66 -1
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +9 -5
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js +36 -7
- package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +2 -1
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/rendering/tileset-styler.js +27 -11
- package/dist/lib/rendering/tileset-styler.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +33 -7
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/entity-render-engine.d.ts +29 -0
- package/dist/types/rendering/tileset-render-engine.d.ts +10 -0
- package/dist/types/rendering/tileset-styler.d.ts +1 -0
- package/dist/types/rendering/visuals-register.d.ts +4 -0
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -7760,29 +7760,54 @@
|
|
|
7760
7760
|
GetRegos(params) {
|
|
7761
7761
|
// TODO: refactor.
|
|
7762
7762
|
// Currently this was made by merging two functions.
|
|
7763
|
-
const { entityId, menuItemId } = params;
|
|
7763
|
+
const { entityId, menuItemId, styleId, styleEffectiveFilter } = params;
|
|
7764
|
+
const matchesStyleFilters = (rego) => {
|
|
7765
|
+
if (styleId != null && rego.styleId !== styleId) {
|
|
7766
|
+
return false;
|
|
7767
|
+
}
|
|
7768
|
+
if (styleEffectiveFilter && !exports.StyleEffective.MatchesFilter(rego.styleEffective, styleEffectiveFilter)) {
|
|
7769
|
+
return false;
|
|
7770
|
+
}
|
|
7771
|
+
return true;
|
|
7772
|
+
};
|
|
7764
7773
|
if (entityId) {
|
|
7765
|
-
const entityId = params.entityId;
|
|
7766
7774
|
const entityRegos = this.rego[entityId];
|
|
7767
7775
|
if (!entityRegos) {
|
|
7768
7776
|
return [];
|
|
7769
7777
|
}
|
|
7770
|
-
|
|
7778
|
+
let results = menuItemId ? entityRegos.filter(x => x.menuItemId == menuItemId) : entityRegos;
|
|
7779
|
+
if (styleId != null || styleEffectiveFilter) {
|
|
7780
|
+
results = results.filter(matchesStyleFilters);
|
|
7781
|
+
}
|
|
7782
|
+
return results;
|
|
7771
7783
|
}
|
|
7772
7784
|
else if (menuItemId) {
|
|
7773
|
-
const menuItemId = params.menuItemId;
|
|
7774
7785
|
const visuals = [];
|
|
7775
|
-
for (const
|
|
7776
|
-
const entityRegos = this.rego[
|
|
7786
|
+
for (const eId in this.rego) {
|
|
7787
|
+
const entityRegos = this.rego[eId];
|
|
7777
7788
|
if (entityRegos) {
|
|
7778
7789
|
const rego = entityRegos.find(r => r.menuItemId === menuItemId);
|
|
7779
|
-
if (rego) {
|
|
7790
|
+
if (rego && matchesStyleFilters(rego)) {
|
|
7780
7791
|
visuals.push(rego);
|
|
7781
7792
|
}
|
|
7782
7793
|
}
|
|
7783
7794
|
}
|
|
7784
7795
|
return visuals;
|
|
7785
7796
|
}
|
|
7797
|
+
else if (styleId != null || styleEffectiveFilter) {
|
|
7798
|
+
const visuals = [];
|
|
7799
|
+
for (const eId in this.rego) {
|
|
7800
|
+
const entityRegos = this.rego[eId];
|
|
7801
|
+
if (entityRegos) {
|
|
7802
|
+
for (const rego of entityRegos) {
|
|
7803
|
+
if (matchesStyleFilters(rego)) {
|
|
7804
|
+
visuals.push(rego);
|
|
7805
|
+
}
|
|
7806
|
+
}
|
|
7807
|
+
}
|
|
7808
|
+
}
|
|
7809
|
+
return visuals;
|
|
7810
|
+
}
|
|
7786
7811
|
return [];
|
|
7787
7812
|
}
|
|
7788
7813
|
/**
|
|
@@ -10111,7 +10136,7 @@
|
|
|
10111
10136
|
* @returns
|
|
10112
10137
|
*/
|
|
10113
10138
|
async renderAsIndividuals(entities, force = false) {
|
|
10114
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
10139
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
10115
10140
|
// When live we just want to show the latest pos.
|
|
10116
10141
|
// When not live, the user might scroll the timeline and want to see it a fluid animation between points in time.
|
|
10117
10142
|
const isLive = exports.ViewUtils.GetTimeDetails({
|
|
@@ -10204,6 +10229,8 @@
|
|
|
10204
10229
|
cdn: this.item.cdnEnabled,
|
|
10205
10230
|
outline: entity.Bruce.Outline,
|
|
10206
10231
|
internalId: (_f = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.InternalID) !== null && _f !== void 0 ? _f : undefined,
|
|
10232
|
+
styleId: (_g = cEntity.styleId) !== null && _g !== void 0 ? _g : undefined,
|
|
10233
|
+
styleEffective: (_h = cEntity.styleEffective) !== null && _h !== void 0 ? _h : undefined,
|
|
10207
10234
|
};
|
|
10208
10235
|
this.visualsManager.AddRego({
|
|
10209
10236
|
rego,
|
|
@@ -10215,11 +10242,13 @@
|
|
|
10215
10242
|
rego.visual = cEntity;
|
|
10216
10243
|
rego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
10217
10244
|
rego.tagIds = entity.Bruce["Layer.ID"] ? [].concat(entity.Bruce["Layer.ID"]) : [];
|
|
10218
|
-
rego.outline = (
|
|
10245
|
+
rego.outline = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.Outline;
|
|
10219
10246
|
rego.cdn = this.item.cdnEnabled;
|
|
10220
|
-
rego.schema = (
|
|
10247
|
+
rego.schema = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Schema;
|
|
10221
10248
|
rego.canEdit = canEdit;
|
|
10222
|
-
rego.internalId = (
|
|
10249
|
+
rego.internalId = (_m = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.InternalID) !== null && _m !== void 0 ? _m : rego.internalId;
|
|
10250
|
+
rego.styleId = (_o = cEntity.styleId) !== null && _o !== void 0 ? _o : rego.styleId;
|
|
10251
|
+
rego.styleEffective = (_p = cEntity.styleEffective) !== null && _p !== void 0 ? _p : rego.styleEffective;
|
|
10223
10252
|
// Marked as stale meaning some change was performed that requires a refresh.
|
|
10224
10253
|
// This usually means a new sibling was added that we need to update.
|
|
10225
10254
|
if (rego.stale) {
|
|
@@ -10249,7 +10278,7 @@
|
|
|
10249
10278
|
menuItemId: this.item.id,
|
|
10250
10279
|
requestRender: false
|
|
10251
10280
|
});
|
|
10252
|
-
(
|
|
10281
|
+
(_q = this.clustering) === null || _q === void 0 ? void 0 : _q.RemoveEntity(id, false);
|
|
10253
10282
|
}
|
|
10254
10283
|
}
|
|
10255
10284
|
this.viewer.scene.requestRender();
|
|
@@ -12809,13 +12838,14 @@
|
|
|
12809
12838
|
this.styleTilesetFeatureFullData(rego, null, []);
|
|
12810
12839
|
}
|
|
12811
12840
|
styleTilesetFeatureFullData(rego, data, tags) {
|
|
12812
|
-
var _a, _b, _c;
|
|
12841
|
+
var _a, _b, _c, _d;
|
|
12813
12842
|
const visual = rego.visual;
|
|
12814
12843
|
if (!visual || !(visual instanceof Cesium.Cesium3DTileFeature)) {
|
|
12815
12844
|
return;
|
|
12816
12845
|
}
|
|
12817
|
-
const style = this.
|
|
12818
|
-
const
|
|
12846
|
+
const { settings: style, styleId: resolvedStyleId } = this.getTilesetFeatureStyleWithId(rego.entityTypeId);
|
|
12847
|
+
const fillColorTrace = (style && ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor)) ? BModels.Calculator.TraceGetColor(style.modelStyle.fillColor, data, tags) : { value: null, effective: null };
|
|
12848
|
+
const bColor = fillColorTrace.value;
|
|
12819
12849
|
let cColor = null;
|
|
12820
12850
|
if (bColor == null) {
|
|
12821
12851
|
cColor = Cesium.Color.WHITE;
|
|
@@ -12835,6 +12865,12 @@
|
|
|
12835
12865
|
rego.internalId = data.Bruce.InternalID;
|
|
12836
12866
|
this.styledByInternalId.set(data.Bruce.InternalID, rego.entityId);
|
|
12837
12867
|
}
|
|
12868
|
+
if (resolvedStyleId != null) {
|
|
12869
|
+
rego.styleId = resolvedStyleId;
|
|
12870
|
+
}
|
|
12871
|
+
rego.styleEffective = (_c = exports.StyleEffective.Combine([
|
|
12872
|
+
{ key: "color", effective: fillColorTrace.effective }
|
|
12873
|
+
])) !== null && _c !== void 0 ? _c : rego.styleEffective;
|
|
12838
12874
|
this.styledEntityIds.set(rego.entityId, true);
|
|
12839
12875
|
this._styleProgressQueue.Call();
|
|
12840
12876
|
// Since we only need to update it for scenarios right now.
|
|
@@ -12843,7 +12879,7 @@
|
|
|
12843
12879
|
// Update the Entity's rego state.
|
|
12844
12880
|
let changed = false;
|
|
12845
12881
|
if (isOutlineChanged(rego, data)) {
|
|
12846
|
-
rego.outline = (
|
|
12882
|
+
rego.outline = (_d = data === null || data === void 0 ? void 0 : data.Bruce) === null || _d === void 0 ? void 0 : _d.Outline;
|
|
12847
12883
|
changed = true;
|
|
12848
12884
|
}
|
|
12849
12885
|
// Something changed, trigger a rego update.
|
|
@@ -12858,19 +12894,27 @@
|
|
|
12858
12894
|
}
|
|
12859
12895
|
}
|
|
12860
12896
|
getTilesetFeatureStyle(entityTypeId) {
|
|
12861
|
-
|
|
12862
|
-
|
|
12897
|
+
return this.getTilesetFeatureStyleWithId(entityTypeId).settings;
|
|
12898
|
+
}
|
|
12899
|
+
getTilesetFeatureStyleWithId(entityTypeId) {
|
|
12900
|
+
var _a, _b, _c;
|
|
12863
12901
|
let style = null;
|
|
12902
|
+
let styleId = null;
|
|
12864
12903
|
if (entityTypeId) {
|
|
12865
|
-
|
|
12904
|
+
const mapping = this.styleMapping.find(x => x.EntityTypeID == entityTypeId);
|
|
12905
|
+
if (mapping) {
|
|
12906
|
+
style = (_a = mapping.style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
12907
|
+
styleId = mapping.StyleID != null ? Number(mapping.StyleID) : null;
|
|
12908
|
+
}
|
|
12866
12909
|
}
|
|
12867
12910
|
if (!style) {
|
|
12868
|
-
style = (
|
|
12911
|
+
style = (_b = this.fallbackStyle) === null || _b === void 0 ? void 0 : _b.Settings;
|
|
12912
|
+
styleId = this.fallbackStyleId != null ? Number(this.fallbackStyleId) : null;
|
|
12869
12913
|
}
|
|
12870
|
-
if (!style || !((
|
|
12871
|
-
return null;
|
|
12914
|
+
if (!style || !((_c = style === null || style === void 0 ? void 0 : style.modelStyle) === null || _c === void 0 ? void 0 : _c.customize)) {
|
|
12915
|
+
return { settings: null, styleId: null };
|
|
12872
12916
|
}
|
|
12873
|
-
return style;
|
|
12917
|
+
return { settings: style, styleId };
|
|
12874
12918
|
}
|
|
12875
12919
|
getTilesetFeatureNeedsFullData(entityTypeId) {
|
|
12876
12920
|
var _a;
|
|
@@ -19071,7 +19115,7 @@
|
|
|
19071
19115
|
this.item = params.item;
|
|
19072
19116
|
}
|
|
19073
19117
|
(async () => {
|
|
19074
|
-
var _a;
|
|
19118
|
+
var _a, _b, _c;
|
|
19075
19119
|
// If the tileset already exists then we just need to update the style.
|
|
19076
19120
|
if (this.cTileset) {
|
|
19077
19121
|
const colorCss = this.item.colorMask;
|
|
@@ -19098,16 +19142,44 @@
|
|
|
19098
19142
|
console.warn("Cesium version does not support 'createGooglePhotorealistic3DTileset' so Google Photos tileset will not be rendered.");
|
|
19099
19143
|
return;
|
|
19100
19144
|
}
|
|
19145
|
+
// Proxy path: key injected server-side.
|
|
19101
19146
|
if (api.IsVersionAtLeast(BModels.BruceApi.VERSION_WITH_PROXIES)) {
|
|
19102
|
-
//
|
|
19103
|
-
|
|
19147
|
+
// If we have a Google token we'll proxy through that.
|
|
19148
|
+
// Otherwise use Cesium Ion to load as a resource.
|
|
19149
|
+
const { programKeys } = await BModels.ProgramKey.GetList({
|
|
19150
|
+
api: this.getters.GetBruceApi()
|
|
19151
|
+
});
|
|
19152
|
+
const hasGoogleToken = Boolean((_a = programKeys.find(x => x.ProgramId === BModels.ProgramKey.EProgramId.GooglePhotogrammetry)) === null || _a === void 0 ? void 0 : _a.Available);
|
|
19153
|
+
// Must have own iot token, this ensures we don't use our template one for loading customer photogrammetry.
|
|
19154
|
+
const hasIonToken = Boolean((_b = programKeys.find(x => x.ProgramId === BModels.ProgramKey.EProgramId.CesiumIon)) === null || _b === void 0 ? void 0 : _b.Available);
|
|
19104
19155
|
if (this.disposed) {
|
|
19105
19156
|
this.doDispose();
|
|
19106
19157
|
return;
|
|
19107
19158
|
}
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
|
|
19159
|
+
// WARNING: we are routing through ion first right now as it is faster.
|
|
19160
|
+
// Should be a user-decision and we should improve our google proxying.
|
|
19161
|
+
if (hasIonToken && Cesium.Ion.defaultServer) {
|
|
19162
|
+
const loadUrl = await Cesium.IonResource.fromAssetId(2275207, undefined);
|
|
19163
|
+
if (this.disposed) {
|
|
19164
|
+
this.doDispose();
|
|
19165
|
+
return;
|
|
19166
|
+
}
|
|
19167
|
+
this.cTileset = await createTileset(loadUrl, {}, true);
|
|
19168
|
+
}
|
|
19169
|
+
else if (hasGoogleToken) {
|
|
19170
|
+
const proxyRootUrl = api.GetBaseUrl() + "proxy/google-tiles/v1/3dtiles/root.json";
|
|
19171
|
+
if (this.disposed) {
|
|
19172
|
+
this.doDispose();
|
|
19173
|
+
return;
|
|
19174
|
+
}
|
|
19175
|
+
this.cTileset = await CESIUM.Cesium3DTileset.fromUrl(proxyRootUrl, {
|
|
19176
|
+
showCreditsOnScreen: true
|
|
19177
|
+
});
|
|
19178
|
+
}
|
|
19179
|
+
else {
|
|
19180
|
+
console.warn("No Google or Cesium Ion token available, so Google Photos tileset will not be rendered.");
|
|
19181
|
+
return;
|
|
19182
|
+
}
|
|
19111
19183
|
}
|
|
19112
19184
|
// Legacy path: fetch real Google key and use createGooglePhotorealistic3DTileset().
|
|
19113
19185
|
// Kill of whenever all API instances are migrated.
|
|
@@ -19135,7 +19207,7 @@
|
|
|
19135
19207
|
this.doDispose();
|
|
19136
19208
|
return;
|
|
19137
19209
|
}
|
|
19138
|
-
this.cTileset = await ((
|
|
19210
|
+
this.cTileset = await ((_c = CESIUM.createGooglePhotorealistic3DTileset) === null || _c === void 0 ? void 0 : _c.call(CESIUM));
|
|
19139
19211
|
}
|
|
19140
19212
|
if (this.disposed) {
|
|
19141
19213
|
this.doDispose();
|
|
@@ -32248,6 +32320,7 @@
|
|
|
32248
32320
|
if (!params.entityHistoric) {
|
|
32249
32321
|
params.entityHistoric = [];
|
|
32250
32322
|
}
|
|
32323
|
+
const styleTraceParts = [];
|
|
32251
32324
|
const style = params.style;
|
|
32252
32325
|
let type = style.Type;
|
|
32253
32326
|
if (type == null) {
|
|
@@ -32326,7 +32399,9 @@
|
|
|
32326
32399
|
row.type = BModels.Calculator.EValueType.Input;
|
|
32327
32400
|
}
|
|
32328
32401
|
});
|
|
32329
|
-
const
|
|
32402
|
+
const iconTrace = BModels.Calculator.TraceGetString(iconUrlRows, entity, params.tags);
|
|
32403
|
+
styleTraceParts.push({ key: "icon", effective: iconTrace.effective });
|
|
32404
|
+
const icon = iconTrace.value;
|
|
32330
32405
|
let iconUrl = null;
|
|
32331
32406
|
if (typeof icon == "string") {
|
|
32332
32407
|
iconUrl = icon;
|
|
@@ -32372,14 +32447,18 @@
|
|
|
32372
32447
|
imageKey = image ? iconUrl : null;
|
|
32373
32448
|
}
|
|
32374
32449
|
if (image) {
|
|
32375
|
-
|
|
32450
|
+
const iconScaleTrace = (style === null || style === void 0 ? void 0 : style.iconScale) ? BModels.Calculator.TraceGetNumber(style.iconScale, entity, params.tags) : { value: null, effective: null };
|
|
32451
|
+
let iconScale = (style === null || style === void 0 ? void 0 : style.iconScale) ? EnsureNumber(iconScaleTrace.value) : 1;
|
|
32452
|
+
styleTraceParts.push({ key: "iconScale", effective: iconScaleTrace.effective });
|
|
32376
32453
|
if (!iconScale && iconScale != 0) {
|
|
32377
32454
|
iconScale = 1;
|
|
32378
32455
|
}
|
|
32379
32456
|
const disableDepthTest = Boolean(style.renderOnTop);
|
|
32380
32457
|
if (iconScale > 0) {
|
|
32381
32458
|
updateShouldShowTrack();
|
|
32382
|
-
const
|
|
32459
|
+
const iconTintTrace = style.iconTintColor ? BModels.Calculator.TraceGetColor(style.iconTintColor, entity, params.tags) : { value: null, effective: null };
|
|
32460
|
+
styleTraceParts.push({ key: "iconTint", effective: iconTintTrace.effective });
|
|
32461
|
+
const bColor = iconTintTrace.value;
|
|
32383
32462
|
const cColor = bColor ? ColorToCColor(bColor) : Cesium.Color.WHITE.clone();
|
|
32384
32463
|
heightRef = getHeightRef(style);
|
|
32385
32464
|
if (!params.rendered || !params.rendered.billboard) {
|
|
@@ -32724,9 +32803,13 @@
|
|
|
32724
32803
|
}
|
|
32725
32804
|
}
|
|
32726
32805
|
if (!cEntity) {
|
|
32727
|
-
const
|
|
32806
|
+
const pointColorTrace = style.color ? BModels.Calculator.TraceGetColor(style.color, entity, params.tags) : { value: null, effective: null };
|
|
32807
|
+
styleTraceParts.push({ key: "color", effective: pointColorTrace.effective });
|
|
32808
|
+
const bColor = pointColorTrace.value;
|
|
32728
32809
|
const cColor = bColor ? ColorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(33, 150, 243, 0.8)");
|
|
32729
|
-
|
|
32810
|
+
const pointSizeTrace = style.size ? BModels.Calculator.TraceGetNumber(style.size, entity, params.tags) : { value: null, effective: null };
|
|
32811
|
+
styleTraceParts.push({ key: "size", effective: pointSizeTrace.effective });
|
|
32812
|
+
let size = pointSizeTrace.value;
|
|
32730
32813
|
if (size == null) {
|
|
32731
32814
|
size = 20;
|
|
32732
32815
|
}
|
|
@@ -32927,6 +33010,7 @@
|
|
|
32927
33010
|
trackEntity._parentEntity = cEntity;
|
|
32928
33011
|
}
|
|
32929
33012
|
cEntity._siblingGraphics = siblings;
|
|
33013
|
+
cEntity.styleEffective = exports.StyleEffective.Combine(styleTraceParts);
|
|
32930
33014
|
return cEntity;
|
|
32931
33015
|
}
|
|
32932
33016
|
EntityRenderEnginePoint.Render = Render;
|
|
@@ -33009,6 +33093,7 @@
|
|
|
33009
33093
|
const name = await getName(api, entity);
|
|
33010
33094
|
cEntity.name = name;
|
|
33011
33095
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
33096
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
33012
33097
|
}
|
|
33013
33098
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
33014
33099
|
}
|
|
@@ -33302,7 +33387,8 @@
|
|
|
33302
33387
|
scale = 1;
|
|
33303
33388
|
}
|
|
33304
33389
|
const style = params.style;
|
|
33305
|
-
|
|
33390
|
+
const scaleTrace = (style === null || style === void 0 ? void 0 : style.scale) ? BModels.Calculator.TraceGetNumber(style.scale, entity, params.tags) : { value: null, effective: null };
|
|
33391
|
+
let styleScale = scaleTrace.value;
|
|
33306
33392
|
styleScale = EnsureNumber(styleScale ? styleScale : 1);
|
|
33307
33393
|
if (styleScale <= 0) {
|
|
33308
33394
|
styleScale = 1;
|
|
@@ -33318,6 +33404,7 @@
|
|
|
33318
33404
|
let blendMode = null;
|
|
33319
33405
|
let blendAmount = null;
|
|
33320
33406
|
let color = null;
|
|
33407
|
+
let fillColorTrace = { value: null, effective: null };
|
|
33321
33408
|
if (style === null || style === void 0 ? void 0 : style.customize) {
|
|
33322
33409
|
blendMode = style.fillColorBlendMode;
|
|
33323
33410
|
if (!blendMode) {
|
|
@@ -33329,7 +33416,8 @@
|
|
|
33329
33416
|
blendAmount = 0.5;
|
|
33330
33417
|
}
|
|
33331
33418
|
}
|
|
33332
|
-
|
|
33419
|
+
fillColorTrace = style.fillColor ? BModels.Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
|
|
33420
|
+
const bColor = fillColorTrace.value;
|
|
33333
33421
|
if (bColor) {
|
|
33334
33422
|
color = ColorToCColor(bColor);
|
|
33335
33423
|
}
|
|
@@ -33818,7 +33906,7 @@
|
|
|
33818
33906
|
* @returns
|
|
33819
33907
|
*/
|
|
33820
33908
|
async function RenderGroup(params) {
|
|
33821
|
-
var _a, _b, _c, _d, _e, _f
|
|
33909
|
+
var _a, _b, _c, _d, _e, _f;
|
|
33822
33910
|
const api = params.apiGetter.getApi();
|
|
33823
33911
|
await api.Loading;
|
|
33824
33912
|
const cEntities = new Map();
|
|
@@ -33894,7 +33982,8 @@
|
|
|
33894
33982
|
for (let i = 0; i < params.entities.length; i++) {
|
|
33895
33983
|
const entity = params.entities[i];
|
|
33896
33984
|
const zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
33897
|
-
const
|
|
33985
|
+
const styleRecord = zoomItem.StyleID != -1 ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
|
|
33986
|
+
const style = zoomItem.StyleID != -1 ? styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.Settings : zoomItem.Style;
|
|
33898
33987
|
const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
|
|
33899
33988
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
33900
33989
|
continue;
|
|
@@ -33913,17 +34002,17 @@
|
|
|
33913
34002
|
let rego = null;
|
|
33914
34003
|
// Only used for historic tracks right now.
|
|
33915
34004
|
// So won't bother getting it if we don't have historic data.
|
|
33916
|
-
if ((
|
|
34005
|
+
if ((_c = params.entitiesHistoric) === null || _c === void 0 ? void 0 : _c[entity.Bruce.ID]) {
|
|
33917
34006
|
rego = params.visualRegister.GetRego({
|
|
33918
34007
|
entityId: entity.Bruce.ID,
|
|
33919
34008
|
menuItemId: params.menuItemId
|
|
33920
34009
|
});
|
|
33921
34010
|
}
|
|
33922
|
-
const mStyle = (
|
|
34011
|
+
const mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
|
|
33923
34012
|
const cEntity = Render({
|
|
33924
|
-
rendered: (
|
|
34013
|
+
rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
|
|
33925
34014
|
entity: entity,
|
|
33926
|
-
entityHistoric: (
|
|
34015
|
+
entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
|
|
33927
34016
|
style: mStyle,
|
|
33928
34017
|
tags: tags,
|
|
33929
34018
|
viewer: params.viewer,
|
|
@@ -33943,6 +34032,7 @@
|
|
|
33943
34032
|
const name = await getName$1(api, entity);
|
|
33944
34033
|
cEntity.name = name;
|
|
33945
34034
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34035
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.ID;
|
|
33946
34036
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
33947
34037
|
}
|
|
33948
34038
|
}
|
|
@@ -34155,12 +34245,14 @@
|
|
|
34155
34245
|
posses = smoothed;
|
|
34156
34246
|
}
|
|
34157
34247
|
}
|
|
34158
|
-
const
|
|
34248
|
+
const lineColorTrace = style.lineColor ? BModels.Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
|
|
34249
|
+
const bColor = lineColorTrace.value;
|
|
34159
34250
|
const cColor = bColor ? ColorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
34160
34251
|
if (cColor.alpha <= 0) {
|
|
34161
34252
|
return null;
|
|
34162
34253
|
}
|
|
34163
|
-
|
|
34254
|
+
const lineWidthTrace = style.lineWidth ? BModels.Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
|
|
34255
|
+
let width = lineWidthTrace.value;
|
|
34164
34256
|
if (width == null) {
|
|
34165
34257
|
width = 2;
|
|
34166
34258
|
}
|
|
@@ -34323,6 +34415,10 @@
|
|
|
34323
34415
|
cEntity.corridor._orgPosses = orgPosses;
|
|
34324
34416
|
cEntity.corridor._smoothen = style.smoothen;
|
|
34325
34417
|
}
|
|
34418
|
+
cEntity.styleEffective = exports.StyleEffective.Combine([
|
|
34419
|
+
{ key: "lineColor", effective: lineColorTrace.effective },
|
|
34420
|
+
{ key: "lineWidth", effective: lineWidthTrace.effective }
|
|
34421
|
+
]);
|
|
34326
34422
|
return cEntity;
|
|
34327
34423
|
}
|
|
34328
34424
|
EntityRenderEnginePolyline.Render = Render;
|
|
@@ -34390,6 +34486,7 @@
|
|
|
34390
34486
|
const name = await getName$2(api, entity);
|
|
34391
34487
|
cEntity.name = name;
|
|
34392
34488
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34489
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
34393
34490
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34394
34491
|
}
|
|
34395
34492
|
}
|
|
@@ -34530,11 +34627,14 @@
|
|
|
34530
34627
|
return null;
|
|
34531
34628
|
}
|
|
34532
34629
|
const style = params.style;
|
|
34533
|
-
const
|
|
34630
|
+
const fillColorTrace = style.fillColor ? BModels.Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
|
|
34631
|
+
const bFillColor = fillColorTrace.value;
|
|
34534
34632
|
const cFillColor = bFillColor ? ColorToCColor(bFillColor) : Cesium.Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
34535
|
-
const
|
|
34633
|
+
const lineColorTrace = style.lineColor ? BModels.Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
|
|
34634
|
+
const bLineColor = lineColorTrace.value;
|
|
34536
34635
|
const cLineColor = bLineColor ? ColorToCColor(bLineColor) : Cesium.Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
34537
|
-
|
|
34636
|
+
const lineWidthTrace = style.lineWidth ? BModels.Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
|
|
34637
|
+
let width = lineWidthTrace.value;
|
|
34538
34638
|
if (width == null) {
|
|
34539
34639
|
width = 1;
|
|
34540
34640
|
}
|
|
@@ -34822,6 +34922,11 @@
|
|
|
34822
34922
|
else {
|
|
34823
34923
|
cEntity._siblingGraphics = [];
|
|
34824
34924
|
}
|
|
34925
|
+
cEntity.styleEffective = exports.StyleEffective.Combine([
|
|
34926
|
+
{ key: "color", effective: fillColorTrace.effective },
|
|
34927
|
+
{ key: "lineColor", effective: lineColorTrace.effective },
|
|
34928
|
+
{ key: "lineWidth", effective: lineWidthTrace.effective }
|
|
34929
|
+
]);
|
|
34825
34930
|
return cEntity;
|
|
34826
34931
|
}
|
|
34827
34932
|
EntityRenderEnginePolygon.Render = Render;
|
|
@@ -34886,6 +34991,7 @@
|
|
|
34886
34991
|
const name = await getName$3(api, entity);
|
|
34887
34992
|
cEntity.name = name;
|
|
34888
34993
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34994
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
34889
34995
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34890
34996
|
}
|
|
34891
34997
|
}
|
|
@@ -35245,6 +35351,60 @@
|
|
|
35245
35351
|
}
|
|
35246
35352
|
return false;
|
|
35247
35353
|
}
|
|
35354
|
+
(function (StyleEffective) {
|
|
35355
|
+
/**
|
|
35356
|
+
* Builds a styleEffective string from labelled trace results.
|
|
35357
|
+
* Segments whose effective is null/empty are omitted.
|
|
35358
|
+
*/
|
|
35359
|
+
function Combine(parts) {
|
|
35360
|
+
const segments = [];
|
|
35361
|
+
for (const part of parts) {
|
|
35362
|
+
if (part.effective) {
|
|
35363
|
+
segments.push(`${part.key}=${part.effective}`);
|
|
35364
|
+
}
|
|
35365
|
+
}
|
|
35366
|
+
return segments.length ? segments.join(",") : null;
|
|
35367
|
+
}
|
|
35368
|
+
StyleEffective.Combine = Combine;
|
|
35369
|
+
/**
|
|
35370
|
+
* Returns true if every segment in the filter string appears in the subject effective string.
|
|
35371
|
+
* A filter segment matches if the subject contains a segment starting with the same key,
|
|
35372
|
+
* and either no value filter is given or the value matches exactly.
|
|
35373
|
+
* Passing a partial effective value (e.g. just "f0:gradient") also matches.
|
|
35374
|
+
*/
|
|
35375
|
+
function MatchesFilter(effective, filter) {
|
|
35376
|
+
if (!filter) {
|
|
35377
|
+
return true;
|
|
35378
|
+
}
|
|
35379
|
+
if (!effective) {
|
|
35380
|
+
return false;
|
|
35381
|
+
}
|
|
35382
|
+
const subjectParts = parseSegments(effective);
|
|
35383
|
+
const filterParts = parseSegments(filter);
|
|
35384
|
+
for (const [fKey, fVal] of filterParts) {
|
|
35385
|
+
const sVal = subjectParts.get(fKey);
|
|
35386
|
+
if (sVal === undefined) {
|
|
35387
|
+
return false;
|
|
35388
|
+
}
|
|
35389
|
+
if (fVal && !sVal.startsWith(fVal)) {
|
|
35390
|
+
return false;
|
|
35391
|
+
}
|
|
35392
|
+
}
|
|
35393
|
+
return true;
|
|
35394
|
+
}
|
|
35395
|
+
StyleEffective.MatchesFilter = MatchesFilter;
|
|
35396
|
+
function parseSegments(str) {
|
|
35397
|
+
const map = new Map();
|
|
35398
|
+
for (const seg of str.split(",")) {
|
|
35399
|
+
const eq = seg.indexOf("=");
|
|
35400
|
+
if (eq < 0) {
|
|
35401
|
+
continue;
|
|
35402
|
+
}
|
|
35403
|
+
map.set(seg.slice(0, eq), seg.slice(eq + 1));
|
|
35404
|
+
}
|
|
35405
|
+
return map;
|
|
35406
|
+
}
|
|
35407
|
+
})(exports.StyleEffective || (exports.StyleEffective = {}));
|
|
35248
35408
|
(function (EntityRenderEngine) {
|
|
35249
35409
|
function GetRenderGroupId(zoomItem) {
|
|
35250
35410
|
if (!zoomItem) {
|
|
@@ -36222,7 +36382,7 @@
|
|
|
36222
36382
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
36223
36383
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
36224
36384
|
|
|
36225
|
-
const VERSION = "6.7.
|
|
36385
|
+
const VERSION = "6.7.7";
|
|
36226
36386
|
/**
|
|
36227
36387
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
36228
36388
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|
|
@@ -36244,6 +36404,7 @@
|
|
|
36244
36404
|
exports.getENVIRONMENT = getENVIRONMENT;
|
|
36245
36405
|
exports.isOutlineChanged = isOutlineChanged$1;
|
|
36246
36406
|
exports.CesiumParabola = CesiumParabola;
|
|
36407
|
+
exports.createTileset = createTileset;
|
|
36247
36408
|
exports.CESIUM_INSPECTOR_KEY = CESIUM_INSPECTOR_KEY;
|
|
36248
36409
|
exports.CESIUM_TIMELINE_KEY = CESIUM_TIMELINE_KEY;
|
|
36249
36410
|
exports.CESIUM_TIMELINE_LIVE_KEY = CESIUM_TIMELINE_LIVE_KEY;
|