bruce-cesium 6.7.5 → 6.7.6
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 +187 -44
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +174 -42
- 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/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-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;
|
|
@@ -32248,6 +32292,7 @@
|
|
|
32248
32292
|
if (!params.entityHistoric) {
|
|
32249
32293
|
params.entityHistoric = [];
|
|
32250
32294
|
}
|
|
32295
|
+
const styleTraceParts = [];
|
|
32251
32296
|
const style = params.style;
|
|
32252
32297
|
let type = style.Type;
|
|
32253
32298
|
if (type == null) {
|
|
@@ -32326,7 +32371,9 @@
|
|
|
32326
32371
|
row.type = BModels.Calculator.EValueType.Input;
|
|
32327
32372
|
}
|
|
32328
32373
|
});
|
|
32329
|
-
const
|
|
32374
|
+
const iconTrace = BModels.Calculator.TraceGetString(iconUrlRows, entity, params.tags);
|
|
32375
|
+
styleTraceParts.push({ key: "icon", effective: iconTrace.effective });
|
|
32376
|
+
const icon = iconTrace.value;
|
|
32330
32377
|
let iconUrl = null;
|
|
32331
32378
|
if (typeof icon == "string") {
|
|
32332
32379
|
iconUrl = icon;
|
|
@@ -32372,14 +32419,18 @@
|
|
|
32372
32419
|
imageKey = image ? iconUrl : null;
|
|
32373
32420
|
}
|
|
32374
32421
|
if (image) {
|
|
32375
|
-
|
|
32422
|
+
const iconScaleTrace = (style === null || style === void 0 ? void 0 : style.iconScale) ? BModels.Calculator.TraceGetNumber(style.iconScale, entity, params.tags) : { value: null, effective: null };
|
|
32423
|
+
let iconScale = (style === null || style === void 0 ? void 0 : style.iconScale) ? EnsureNumber(iconScaleTrace.value) : 1;
|
|
32424
|
+
styleTraceParts.push({ key: "iconScale", effective: iconScaleTrace.effective });
|
|
32376
32425
|
if (!iconScale && iconScale != 0) {
|
|
32377
32426
|
iconScale = 1;
|
|
32378
32427
|
}
|
|
32379
32428
|
const disableDepthTest = Boolean(style.renderOnTop);
|
|
32380
32429
|
if (iconScale > 0) {
|
|
32381
32430
|
updateShouldShowTrack();
|
|
32382
|
-
const
|
|
32431
|
+
const iconTintTrace = style.iconTintColor ? BModels.Calculator.TraceGetColor(style.iconTintColor, entity, params.tags) : { value: null, effective: null };
|
|
32432
|
+
styleTraceParts.push({ key: "iconTint", effective: iconTintTrace.effective });
|
|
32433
|
+
const bColor = iconTintTrace.value;
|
|
32383
32434
|
const cColor = bColor ? ColorToCColor(bColor) : Cesium.Color.WHITE.clone();
|
|
32384
32435
|
heightRef = getHeightRef(style);
|
|
32385
32436
|
if (!params.rendered || !params.rendered.billboard) {
|
|
@@ -32724,9 +32775,13 @@
|
|
|
32724
32775
|
}
|
|
32725
32776
|
}
|
|
32726
32777
|
if (!cEntity) {
|
|
32727
|
-
const
|
|
32778
|
+
const pointColorTrace = style.color ? BModels.Calculator.TraceGetColor(style.color, entity, params.tags) : { value: null, effective: null };
|
|
32779
|
+
styleTraceParts.push({ key: "color", effective: pointColorTrace.effective });
|
|
32780
|
+
const bColor = pointColorTrace.value;
|
|
32728
32781
|
const cColor = bColor ? ColorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(33, 150, 243, 0.8)");
|
|
32729
|
-
|
|
32782
|
+
const pointSizeTrace = style.size ? BModels.Calculator.TraceGetNumber(style.size, entity, params.tags) : { value: null, effective: null };
|
|
32783
|
+
styleTraceParts.push({ key: "size", effective: pointSizeTrace.effective });
|
|
32784
|
+
let size = pointSizeTrace.value;
|
|
32730
32785
|
if (size == null) {
|
|
32731
32786
|
size = 20;
|
|
32732
32787
|
}
|
|
@@ -32927,6 +32982,7 @@
|
|
|
32927
32982
|
trackEntity._parentEntity = cEntity;
|
|
32928
32983
|
}
|
|
32929
32984
|
cEntity._siblingGraphics = siblings;
|
|
32985
|
+
cEntity.styleEffective = exports.StyleEffective.Combine(styleTraceParts);
|
|
32930
32986
|
return cEntity;
|
|
32931
32987
|
}
|
|
32932
32988
|
EntityRenderEnginePoint.Render = Render;
|
|
@@ -33009,6 +33065,7 @@
|
|
|
33009
33065
|
const name = await getName(api, entity);
|
|
33010
33066
|
cEntity.name = name;
|
|
33011
33067
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
33068
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
33012
33069
|
}
|
|
33013
33070
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
33014
33071
|
}
|
|
@@ -33302,7 +33359,8 @@
|
|
|
33302
33359
|
scale = 1;
|
|
33303
33360
|
}
|
|
33304
33361
|
const style = params.style;
|
|
33305
|
-
|
|
33362
|
+
const scaleTrace = (style === null || style === void 0 ? void 0 : style.scale) ? BModels.Calculator.TraceGetNumber(style.scale, entity, params.tags) : { value: null, effective: null };
|
|
33363
|
+
let styleScale = scaleTrace.value;
|
|
33306
33364
|
styleScale = EnsureNumber(styleScale ? styleScale : 1);
|
|
33307
33365
|
if (styleScale <= 0) {
|
|
33308
33366
|
styleScale = 1;
|
|
@@ -33318,6 +33376,7 @@
|
|
|
33318
33376
|
let blendMode = null;
|
|
33319
33377
|
let blendAmount = null;
|
|
33320
33378
|
let color = null;
|
|
33379
|
+
let fillColorTrace = { value: null, effective: null };
|
|
33321
33380
|
if (style === null || style === void 0 ? void 0 : style.customize) {
|
|
33322
33381
|
blendMode = style.fillColorBlendMode;
|
|
33323
33382
|
if (!blendMode) {
|
|
@@ -33329,7 +33388,8 @@
|
|
|
33329
33388
|
blendAmount = 0.5;
|
|
33330
33389
|
}
|
|
33331
33390
|
}
|
|
33332
|
-
|
|
33391
|
+
fillColorTrace = style.fillColor ? BModels.Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
|
|
33392
|
+
const bColor = fillColorTrace.value;
|
|
33333
33393
|
if (bColor) {
|
|
33334
33394
|
color = ColorToCColor(bColor);
|
|
33335
33395
|
}
|
|
@@ -33818,7 +33878,7 @@
|
|
|
33818
33878
|
* @returns
|
|
33819
33879
|
*/
|
|
33820
33880
|
async function RenderGroup(params) {
|
|
33821
|
-
var _a, _b, _c, _d, _e, _f
|
|
33881
|
+
var _a, _b, _c, _d, _e, _f;
|
|
33822
33882
|
const api = params.apiGetter.getApi();
|
|
33823
33883
|
await api.Loading;
|
|
33824
33884
|
const cEntities = new Map();
|
|
@@ -33894,7 +33954,8 @@
|
|
|
33894
33954
|
for (let i = 0; i < params.entities.length; i++) {
|
|
33895
33955
|
const entity = params.entities[i];
|
|
33896
33956
|
const zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
33897
|
-
const
|
|
33957
|
+
const styleRecord = zoomItem.StyleID != -1 ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
|
|
33958
|
+
const style = zoomItem.StyleID != -1 ? styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.Settings : zoomItem.Style;
|
|
33898
33959
|
const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
|
|
33899
33960
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
33900
33961
|
continue;
|
|
@@ -33913,17 +33974,17 @@
|
|
|
33913
33974
|
let rego = null;
|
|
33914
33975
|
// Only used for historic tracks right now.
|
|
33915
33976
|
// So won't bother getting it if we don't have historic data.
|
|
33916
|
-
if ((
|
|
33977
|
+
if ((_c = params.entitiesHistoric) === null || _c === void 0 ? void 0 : _c[entity.Bruce.ID]) {
|
|
33917
33978
|
rego = params.visualRegister.GetRego({
|
|
33918
33979
|
entityId: entity.Bruce.ID,
|
|
33919
33980
|
menuItemId: params.menuItemId
|
|
33920
33981
|
});
|
|
33921
33982
|
}
|
|
33922
|
-
const mStyle = (
|
|
33983
|
+
const mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
|
|
33923
33984
|
const cEntity = Render({
|
|
33924
|
-
rendered: (
|
|
33985
|
+
rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
|
|
33925
33986
|
entity: entity,
|
|
33926
|
-
entityHistoric: (
|
|
33987
|
+
entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
|
|
33927
33988
|
style: mStyle,
|
|
33928
33989
|
tags: tags,
|
|
33929
33990
|
viewer: params.viewer,
|
|
@@ -33943,6 +34004,7 @@
|
|
|
33943
34004
|
const name = await getName$1(api, entity);
|
|
33944
34005
|
cEntity.name = name;
|
|
33945
34006
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34007
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.ID;
|
|
33946
34008
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
33947
34009
|
}
|
|
33948
34010
|
}
|
|
@@ -34155,12 +34217,14 @@
|
|
|
34155
34217
|
posses = smoothed;
|
|
34156
34218
|
}
|
|
34157
34219
|
}
|
|
34158
|
-
const
|
|
34220
|
+
const lineColorTrace = style.lineColor ? BModels.Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
|
|
34221
|
+
const bColor = lineColorTrace.value;
|
|
34159
34222
|
const cColor = bColor ? ColorToCColor(bColor) : Cesium.Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
34160
34223
|
if (cColor.alpha <= 0) {
|
|
34161
34224
|
return null;
|
|
34162
34225
|
}
|
|
34163
|
-
|
|
34226
|
+
const lineWidthTrace = style.lineWidth ? BModels.Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
|
|
34227
|
+
let width = lineWidthTrace.value;
|
|
34164
34228
|
if (width == null) {
|
|
34165
34229
|
width = 2;
|
|
34166
34230
|
}
|
|
@@ -34323,6 +34387,10 @@
|
|
|
34323
34387
|
cEntity.corridor._orgPosses = orgPosses;
|
|
34324
34388
|
cEntity.corridor._smoothen = style.smoothen;
|
|
34325
34389
|
}
|
|
34390
|
+
cEntity.styleEffective = exports.StyleEffective.Combine([
|
|
34391
|
+
{ key: "lineColor", effective: lineColorTrace.effective },
|
|
34392
|
+
{ key: "lineWidth", effective: lineWidthTrace.effective }
|
|
34393
|
+
]);
|
|
34326
34394
|
return cEntity;
|
|
34327
34395
|
}
|
|
34328
34396
|
EntityRenderEnginePolyline.Render = Render;
|
|
@@ -34390,6 +34458,7 @@
|
|
|
34390
34458
|
const name = await getName$2(api, entity);
|
|
34391
34459
|
cEntity.name = name;
|
|
34392
34460
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34461
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
34393
34462
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34394
34463
|
}
|
|
34395
34464
|
}
|
|
@@ -34530,11 +34599,14 @@
|
|
|
34530
34599
|
return null;
|
|
34531
34600
|
}
|
|
34532
34601
|
const style = params.style;
|
|
34533
|
-
const
|
|
34602
|
+
const fillColorTrace = style.fillColor ? BModels.Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
|
|
34603
|
+
const bFillColor = fillColorTrace.value;
|
|
34534
34604
|
const cFillColor = bFillColor ? ColorToCColor(bFillColor) : Cesium.Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
34535
|
-
const
|
|
34605
|
+
const lineColorTrace = style.lineColor ? BModels.Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
|
|
34606
|
+
const bLineColor = lineColorTrace.value;
|
|
34536
34607
|
const cLineColor = bLineColor ? ColorToCColor(bLineColor) : Cesium.Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
34537
|
-
|
|
34608
|
+
const lineWidthTrace = style.lineWidth ? BModels.Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
|
|
34609
|
+
let width = lineWidthTrace.value;
|
|
34538
34610
|
if (width == null) {
|
|
34539
34611
|
width = 1;
|
|
34540
34612
|
}
|
|
@@ -34822,6 +34894,11 @@
|
|
|
34822
34894
|
else {
|
|
34823
34895
|
cEntity._siblingGraphics = [];
|
|
34824
34896
|
}
|
|
34897
|
+
cEntity.styleEffective = exports.StyleEffective.Combine([
|
|
34898
|
+
{ key: "color", effective: fillColorTrace.effective },
|
|
34899
|
+
{ key: "lineColor", effective: lineColorTrace.effective },
|
|
34900
|
+
{ key: "lineWidth", effective: lineWidthTrace.effective }
|
|
34901
|
+
]);
|
|
34825
34902
|
return cEntity;
|
|
34826
34903
|
}
|
|
34827
34904
|
EntityRenderEnginePolygon.Render = Render;
|
|
@@ -34886,6 +34963,7 @@
|
|
|
34886
34963
|
const name = await getName$3(api, entity);
|
|
34887
34964
|
cEntity.name = name;
|
|
34888
34965
|
cEntity._renderGroup = exports.EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34966
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
34889
34967
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34890
34968
|
}
|
|
34891
34969
|
}
|
|
@@ -35245,6 +35323,60 @@
|
|
|
35245
35323
|
}
|
|
35246
35324
|
return false;
|
|
35247
35325
|
}
|
|
35326
|
+
(function (StyleEffective) {
|
|
35327
|
+
/**
|
|
35328
|
+
* Builds a styleEffective string from labelled trace results.
|
|
35329
|
+
* Segments whose effective is null/empty are omitted.
|
|
35330
|
+
*/
|
|
35331
|
+
function Combine(parts) {
|
|
35332
|
+
const segments = [];
|
|
35333
|
+
for (const part of parts) {
|
|
35334
|
+
if (part.effective) {
|
|
35335
|
+
segments.push(`${part.key}=${part.effective}`);
|
|
35336
|
+
}
|
|
35337
|
+
}
|
|
35338
|
+
return segments.length ? segments.join(",") : null;
|
|
35339
|
+
}
|
|
35340
|
+
StyleEffective.Combine = Combine;
|
|
35341
|
+
/**
|
|
35342
|
+
* Returns true if every segment in the filter string appears in the subject effective string.
|
|
35343
|
+
* A filter segment matches if the subject contains a segment starting with the same key,
|
|
35344
|
+
* and either no value filter is given or the value matches exactly.
|
|
35345
|
+
* Passing a partial effective value (e.g. just "f0:gradient") also matches.
|
|
35346
|
+
*/
|
|
35347
|
+
function MatchesFilter(effective, filter) {
|
|
35348
|
+
if (!filter) {
|
|
35349
|
+
return true;
|
|
35350
|
+
}
|
|
35351
|
+
if (!effective) {
|
|
35352
|
+
return false;
|
|
35353
|
+
}
|
|
35354
|
+
const subjectParts = parseSegments(effective);
|
|
35355
|
+
const filterParts = parseSegments(filter);
|
|
35356
|
+
for (const [fKey, fVal] of filterParts) {
|
|
35357
|
+
const sVal = subjectParts.get(fKey);
|
|
35358
|
+
if (sVal === undefined) {
|
|
35359
|
+
return false;
|
|
35360
|
+
}
|
|
35361
|
+
if (fVal && !sVal.startsWith(fVal)) {
|
|
35362
|
+
return false;
|
|
35363
|
+
}
|
|
35364
|
+
}
|
|
35365
|
+
return true;
|
|
35366
|
+
}
|
|
35367
|
+
StyleEffective.MatchesFilter = MatchesFilter;
|
|
35368
|
+
function parseSegments(str) {
|
|
35369
|
+
const map = new Map();
|
|
35370
|
+
for (const seg of str.split(",")) {
|
|
35371
|
+
const eq = seg.indexOf("=");
|
|
35372
|
+
if (eq < 0) {
|
|
35373
|
+
continue;
|
|
35374
|
+
}
|
|
35375
|
+
map.set(seg.slice(0, eq), seg.slice(eq + 1));
|
|
35376
|
+
}
|
|
35377
|
+
return map;
|
|
35378
|
+
}
|
|
35379
|
+
})(exports.StyleEffective || (exports.StyleEffective = {}));
|
|
35248
35380
|
(function (EntityRenderEngine) {
|
|
35249
35381
|
function GetRenderGroupId(zoomItem) {
|
|
35250
35382
|
if (!zoomItem) {
|
|
@@ -36222,7 +36354,7 @@
|
|
|
36222
36354
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
36223
36355
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
36224
36356
|
|
|
36225
|
-
const VERSION = "6.7.
|
|
36357
|
+
const VERSION = "6.7.6";
|
|
36226
36358
|
/**
|
|
36227
36359
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
36228
36360
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|