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.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cesium from 'cesium';
|
|
2
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,
|
|
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
|
-
|
|
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
|
|
7796
|
-
const entityRegos = this.rego[
|
|
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 = (
|
|
10270
|
+
rego.outline = (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.Outline;
|
|
10244
10271
|
rego.cdn = this.item.cdnEnabled;
|
|
10245
|
-
rego.schema = (
|
|
10272
|
+
rego.schema = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Schema;
|
|
10246
10273
|
rego.canEdit = canEdit;
|
|
10247
|
-
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
|
-
(
|
|
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.
|
|
12858
|
-
const
|
|
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 = (
|
|
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
|
-
|
|
12902
|
-
|
|
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
|
-
|
|
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 = (
|
|
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 || !((
|
|
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;
|
|
@@ -32346,6 +32390,7 @@ var EntityRenderEnginePoint;
|
|
|
32346
32390
|
if (!params.entityHistoric) {
|
|
32347
32391
|
params.entityHistoric = [];
|
|
32348
32392
|
}
|
|
32393
|
+
const styleTraceParts = [];
|
|
32349
32394
|
const style = params.style;
|
|
32350
32395
|
let type = style.Type;
|
|
32351
32396
|
if (type == null) {
|
|
@@ -32424,7 +32469,9 @@ var EntityRenderEnginePoint;
|
|
|
32424
32469
|
row.type = Calculator.EValueType.Input;
|
|
32425
32470
|
}
|
|
32426
32471
|
});
|
|
32427
|
-
const
|
|
32472
|
+
const iconTrace = Calculator.TraceGetString(iconUrlRows, entity, params.tags);
|
|
32473
|
+
styleTraceParts.push({ key: "icon", effective: iconTrace.effective });
|
|
32474
|
+
const icon = iconTrace.value;
|
|
32428
32475
|
let iconUrl = null;
|
|
32429
32476
|
if (typeof icon == "string") {
|
|
32430
32477
|
iconUrl = icon;
|
|
@@ -32470,14 +32517,18 @@ var EntityRenderEnginePoint;
|
|
|
32470
32517
|
imageKey = image ? iconUrl : null;
|
|
32471
32518
|
}
|
|
32472
32519
|
if (image) {
|
|
32473
|
-
|
|
32520
|
+
const iconScaleTrace = (style === null || style === void 0 ? void 0 : style.iconScale) ? Calculator.TraceGetNumber(style.iconScale, entity, params.tags) : { value: null, effective: null };
|
|
32521
|
+
let iconScale = (style === null || style === void 0 ? void 0 : style.iconScale) ? EnsureNumber(iconScaleTrace.value) : 1;
|
|
32522
|
+
styleTraceParts.push({ key: "iconScale", effective: iconScaleTrace.effective });
|
|
32474
32523
|
if (!iconScale && iconScale != 0) {
|
|
32475
32524
|
iconScale = 1;
|
|
32476
32525
|
}
|
|
32477
32526
|
const disableDepthTest = Boolean(style.renderOnTop);
|
|
32478
32527
|
if (iconScale > 0) {
|
|
32479
32528
|
updateShouldShowTrack();
|
|
32480
|
-
const
|
|
32529
|
+
const iconTintTrace = style.iconTintColor ? Calculator.TraceGetColor(style.iconTintColor, entity, params.tags) : { value: null, effective: null };
|
|
32530
|
+
styleTraceParts.push({ key: "iconTint", effective: iconTintTrace.effective });
|
|
32531
|
+
const bColor = iconTintTrace.value;
|
|
32481
32532
|
const cColor = bColor ? ColorToCColor(bColor) : Color.WHITE.clone();
|
|
32482
32533
|
heightRef = getHeightRef(style);
|
|
32483
32534
|
if (!params.rendered || !params.rendered.billboard) {
|
|
@@ -32822,9 +32873,13 @@ var EntityRenderEnginePoint;
|
|
|
32822
32873
|
}
|
|
32823
32874
|
}
|
|
32824
32875
|
if (!cEntity) {
|
|
32825
|
-
const
|
|
32876
|
+
const pointColorTrace = style.color ? Calculator.TraceGetColor(style.color, entity, params.tags) : { value: null, effective: null };
|
|
32877
|
+
styleTraceParts.push({ key: "color", effective: pointColorTrace.effective });
|
|
32878
|
+
const bColor = pointColorTrace.value;
|
|
32826
32879
|
const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(33, 150, 243, 0.8)");
|
|
32827
|
-
|
|
32880
|
+
const pointSizeTrace = style.size ? Calculator.TraceGetNumber(style.size, entity, params.tags) : { value: null, effective: null };
|
|
32881
|
+
styleTraceParts.push({ key: "size", effective: pointSizeTrace.effective });
|
|
32882
|
+
let size = pointSizeTrace.value;
|
|
32828
32883
|
if (size == null) {
|
|
32829
32884
|
size = 20;
|
|
32830
32885
|
}
|
|
@@ -33025,6 +33080,7 @@ var EntityRenderEnginePoint;
|
|
|
33025
33080
|
trackEntity._parentEntity = cEntity;
|
|
33026
33081
|
}
|
|
33027
33082
|
cEntity._siblingGraphics = siblings;
|
|
33083
|
+
cEntity.styleEffective = StyleEffective.Combine(styleTraceParts);
|
|
33028
33084
|
return cEntity;
|
|
33029
33085
|
}
|
|
33030
33086
|
EntityRenderEnginePoint.Render = Render;
|
|
@@ -33107,6 +33163,7 @@ var EntityRenderEnginePoint;
|
|
|
33107
33163
|
const name = await getName(api, entity);
|
|
33108
33164
|
cEntity.name = name;
|
|
33109
33165
|
cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
33166
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
33110
33167
|
}
|
|
33111
33168
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
33112
33169
|
}
|
|
@@ -33404,7 +33461,8 @@ var EntityRenderEngineModel3d;
|
|
|
33404
33461
|
scale = 1;
|
|
33405
33462
|
}
|
|
33406
33463
|
const style = params.style;
|
|
33407
|
-
|
|
33464
|
+
const scaleTrace = (style === null || style === void 0 ? void 0 : style.scale) ? Calculator.TraceGetNumber(style.scale, entity, params.tags) : { value: null, effective: null };
|
|
33465
|
+
let styleScale = scaleTrace.value;
|
|
33408
33466
|
styleScale = EnsureNumber(styleScale ? styleScale : 1);
|
|
33409
33467
|
if (styleScale <= 0) {
|
|
33410
33468
|
styleScale = 1;
|
|
@@ -33420,6 +33478,7 @@ var EntityRenderEngineModel3d;
|
|
|
33420
33478
|
let blendMode = null;
|
|
33421
33479
|
let blendAmount = null;
|
|
33422
33480
|
let color = null;
|
|
33481
|
+
let fillColorTrace = { value: null, effective: null };
|
|
33423
33482
|
if (style === null || style === void 0 ? void 0 : style.customize) {
|
|
33424
33483
|
blendMode = style.fillColorBlendMode;
|
|
33425
33484
|
if (!blendMode) {
|
|
@@ -33431,7 +33490,8 @@ var EntityRenderEngineModel3d;
|
|
|
33431
33490
|
blendAmount = 0.5;
|
|
33432
33491
|
}
|
|
33433
33492
|
}
|
|
33434
|
-
|
|
33493
|
+
fillColorTrace = style.fillColor ? Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
|
|
33494
|
+
const bColor = fillColorTrace.value;
|
|
33435
33495
|
if (bColor) {
|
|
33436
33496
|
color = ColorToCColor(bColor);
|
|
33437
33497
|
}
|
|
@@ -33920,7 +33980,7 @@ var EntityRenderEngineModel3d;
|
|
|
33920
33980
|
* @returns
|
|
33921
33981
|
*/
|
|
33922
33982
|
async function RenderGroup(params) {
|
|
33923
|
-
var _a, _b, _c, _d, _e, _f
|
|
33983
|
+
var _a, _b, _c, _d, _e, _f;
|
|
33924
33984
|
const api = params.apiGetter.getApi();
|
|
33925
33985
|
await api.Loading;
|
|
33926
33986
|
const cEntities = new Map();
|
|
@@ -33996,7 +34056,8 @@ var EntityRenderEngineModel3d;
|
|
|
33996
34056
|
for (let i = 0; i < params.entities.length; i++) {
|
|
33997
34057
|
const entity = params.entities[i];
|
|
33998
34058
|
const zoomItem = params.zoomItems[entity.Bruce.ID];
|
|
33999
|
-
const
|
|
34059
|
+
const styleRecord = zoomItem.StyleID != -1 ? (await getStyle$2(api, entity, zoomItem.StyleID)) : null;
|
|
34060
|
+
const style = zoomItem.StyleID != -1 ? styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.Settings : zoomItem.Style;
|
|
34000
34061
|
const lod = lodData.find(x => x.entityId == entity.Bruce.ID);
|
|
34001
34062
|
if (!(lod === null || lod === void 0 ? void 0 : lod.clientFileId)) {
|
|
34002
34063
|
continue;
|
|
@@ -34015,17 +34076,17 @@ var EntityRenderEngineModel3d;
|
|
|
34015
34076
|
let rego = null;
|
|
34016
34077
|
// Only used for historic tracks right now.
|
|
34017
34078
|
// So won't bother getting it if we don't have historic data.
|
|
34018
|
-
if ((
|
|
34079
|
+
if ((_c = params.entitiesHistoric) === null || _c === void 0 ? void 0 : _c[entity.Bruce.ID]) {
|
|
34019
34080
|
rego = params.visualRegister.GetRego({
|
|
34020
34081
|
entityId: entity.Bruce.ID,
|
|
34021
34082
|
menuItemId: params.menuItemId
|
|
34022
34083
|
});
|
|
34023
34084
|
}
|
|
34024
|
-
const mStyle = (
|
|
34085
|
+
const mStyle = (_d = style === null || style === void 0 ? void 0 : style.modelStyle) !== null && _d !== void 0 ? _d : {};
|
|
34025
34086
|
const cEntity = Render({
|
|
34026
|
-
rendered: (
|
|
34087
|
+
rendered: (_e = params.rendered) === null || _e === void 0 ? void 0 : _e.get(entity.Bruce.ID),
|
|
34027
34088
|
entity: entity,
|
|
34028
|
-
entityHistoric: (
|
|
34089
|
+
entityHistoric: (_f = params.entitiesHistoric) === null || _f === void 0 ? void 0 : _f[entity.Bruce.ID],
|
|
34029
34090
|
style: mStyle,
|
|
34030
34091
|
tags: tags,
|
|
34031
34092
|
viewer: params.viewer,
|
|
@@ -34045,6 +34106,7 @@ var EntityRenderEngineModel3d;
|
|
|
34045
34106
|
const name = await getName$1(api, entity);
|
|
34046
34107
|
cEntity.name = name;
|
|
34047
34108
|
cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34109
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : styleRecord === null || styleRecord === void 0 ? void 0 : styleRecord.ID;
|
|
34048
34110
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34049
34111
|
}
|
|
34050
34112
|
}
|
|
@@ -34261,12 +34323,14 @@ var EntityRenderEnginePolyline;
|
|
|
34261
34323
|
posses = smoothed;
|
|
34262
34324
|
}
|
|
34263
34325
|
}
|
|
34264
|
-
const
|
|
34326
|
+
const lineColorTrace = style.lineColor ? Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
|
|
34327
|
+
const bColor = lineColorTrace.value;
|
|
34265
34328
|
const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
34266
34329
|
if (cColor.alpha <= 0) {
|
|
34267
34330
|
return null;
|
|
34268
34331
|
}
|
|
34269
|
-
|
|
34332
|
+
const lineWidthTrace = style.lineWidth ? Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
|
|
34333
|
+
let width = lineWidthTrace.value;
|
|
34270
34334
|
if (width == null) {
|
|
34271
34335
|
width = 2;
|
|
34272
34336
|
}
|
|
@@ -34429,6 +34493,10 @@ var EntityRenderEnginePolyline;
|
|
|
34429
34493
|
cEntity.corridor._orgPosses = orgPosses;
|
|
34430
34494
|
cEntity.corridor._smoothen = style.smoothen;
|
|
34431
34495
|
}
|
|
34496
|
+
cEntity.styleEffective = StyleEffective.Combine([
|
|
34497
|
+
{ key: "lineColor", effective: lineColorTrace.effective },
|
|
34498
|
+
{ key: "lineWidth", effective: lineWidthTrace.effective }
|
|
34499
|
+
]);
|
|
34432
34500
|
return cEntity;
|
|
34433
34501
|
}
|
|
34434
34502
|
EntityRenderEnginePolyline.Render = Render;
|
|
@@ -34496,6 +34564,7 @@ var EntityRenderEnginePolyline;
|
|
|
34496
34564
|
const name = await getName$2(api, entity);
|
|
34497
34565
|
cEntity.name = name;
|
|
34498
34566
|
cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
34567
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
34499
34568
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34500
34569
|
}
|
|
34501
34570
|
}
|
|
@@ -34637,11 +34706,14 @@ var EntityRenderEnginePolygon;
|
|
|
34637
34706
|
return null;
|
|
34638
34707
|
}
|
|
34639
34708
|
const style = params.style;
|
|
34640
|
-
const
|
|
34709
|
+
const fillColorTrace = style.fillColor ? Calculator.TraceGetColor(style.fillColor, entity, params.tags) : { value: null, effective: null };
|
|
34710
|
+
const bFillColor = fillColorTrace.value;
|
|
34641
34711
|
const cFillColor = bFillColor ? ColorToCColor(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
34642
|
-
const
|
|
34712
|
+
const lineColorTrace = style.lineColor ? Calculator.TraceGetColor(style.lineColor, entity, params.tags) : { value: null, effective: null };
|
|
34713
|
+
const bLineColor = lineColorTrace.value;
|
|
34643
34714
|
const cLineColor = bLineColor ? ColorToCColor(bLineColor) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
34644
|
-
|
|
34715
|
+
const lineWidthTrace = style.lineWidth ? Calculator.TraceGetNumber(style.lineWidth, entity, params.tags) : { value: null, effective: null };
|
|
34716
|
+
let width = lineWidthTrace.value;
|
|
34645
34717
|
if (width == null) {
|
|
34646
34718
|
width = 1;
|
|
34647
34719
|
}
|
|
@@ -34929,6 +35001,11 @@ var EntityRenderEnginePolygon;
|
|
|
34929
35001
|
else {
|
|
34930
35002
|
cEntity._siblingGraphics = [];
|
|
34931
35003
|
}
|
|
35004
|
+
cEntity.styleEffective = StyleEffective.Combine([
|
|
35005
|
+
{ key: "color", effective: fillColorTrace.effective },
|
|
35006
|
+
{ key: "lineColor", effective: lineColorTrace.effective },
|
|
35007
|
+
{ key: "lineWidth", effective: lineWidthTrace.effective }
|
|
35008
|
+
]);
|
|
34932
35009
|
return cEntity;
|
|
34933
35010
|
}
|
|
34934
35011
|
EntityRenderEnginePolygon.Render = Render;
|
|
@@ -34993,6 +35070,7 @@ var EntityRenderEnginePolygon;
|
|
|
34993
35070
|
const name = await getName$3(api, entity);
|
|
34994
35071
|
cEntity.name = name;
|
|
34995
35072
|
cEntity._renderGroup = EntityRenderEngine.GetRenderGroupId(zoomItem);
|
|
35073
|
+
cEntity.styleId = zoomItem.StyleID == -1 ? -1 : (+zoomItem.StyleID || null);
|
|
34996
35074
|
cEntities.set(entity.Bruce.ID, cEntity);
|
|
34997
35075
|
}
|
|
34998
35076
|
}
|
|
@@ -35352,6 +35430,71 @@ function isOutlineChanged$1(rego, entity) {
|
|
|
35352
35430
|
}
|
|
35353
35431
|
return false;
|
|
35354
35432
|
}
|
|
35433
|
+
/**
|
|
35434
|
+
* Utilities for building and querying styleEffective strings.
|
|
35435
|
+
*
|
|
35436
|
+
* Format: comma-separated segments of the form "{key}={traceEffective}".
|
|
35437
|
+
* Keys name the style property (e.g. "color", "scale", "icon").
|
|
35438
|
+
* Values are effective strings produced by Calculator.TraceGet* calls.
|
|
35439
|
+
* Keys must not contain "=" or ",". Effective values must not contain ",".
|
|
35440
|
+
*
|
|
35441
|
+
* Example: "color=f0:gradient:abc:123,scale=f1:input:def:456"
|
|
35442
|
+
*/
|
|
35443
|
+
var StyleEffective;
|
|
35444
|
+
(function (StyleEffective) {
|
|
35445
|
+
/**
|
|
35446
|
+
* Builds a styleEffective string from labelled trace results.
|
|
35447
|
+
* Segments whose effective is null/empty are omitted.
|
|
35448
|
+
*/
|
|
35449
|
+
function Combine(parts) {
|
|
35450
|
+
const segments = [];
|
|
35451
|
+
for (const part of parts) {
|
|
35452
|
+
if (part.effective) {
|
|
35453
|
+
segments.push(`${part.key}=${part.effective}`);
|
|
35454
|
+
}
|
|
35455
|
+
}
|
|
35456
|
+
return segments.length ? segments.join(",") : null;
|
|
35457
|
+
}
|
|
35458
|
+
StyleEffective.Combine = Combine;
|
|
35459
|
+
/**
|
|
35460
|
+
* Returns true if every segment in the filter string appears in the subject effective string.
|
|
35461
|
+
* A filter segment matches if the subject contains a segment starting with the same key,
|
|
35462
|
+
* and either no value filter is given or the value matches exactly.
|
|
35463
|
+
* Passing a partial effective value (e.g. just "f0:gradient") also matches.
|
|
35464
|
+
*/
|
|
35465
|
+
function MatchesFilter(effective, filter) {
|
|
35466
|
+
if (!filter) {
|
|
35467
|
+
return true;
|
|
35468
|
+
}
|
|
35469
|
+
if (!effective) {
|
|
35470
|
+
return false;
|
|
35471
|
+
}
|
|
35472
|
+
const subjectParts = parseSegments(effective);
|
|
35473
|
+
const filterParts = parseSegments(filter);
|
|
35474
|
+
for (const [fKey, fVal] of filterParts) {
|
|
35475
|
+
const sVal = subjectParts.get(fKey);
|
|
35476
|
+
if (sVal === undefined) {
|
|
35477
|
+
return false;
|
|
35478
|
+
}
|
|
35479
|
+
if (fVal && !sVal.startsWith(fVal)) {
|
|
35480
|
+
return false;
|
|
35481
|
+
}
|
|
35482
|
+
}
|
|
35483
|
+
return true;
|
|
35484
|
+
}
|
|
35485
|
+
StyleEffective.MatchesFilter = MatchesFilter;
|
|
35486
|
+
function parseSegments(str) {
|
|
35487
|
+
const map = new Map();
|
|
35488
|
+
for (const seg of str.split(",")) {
|
|
35489
|
+
const eq = seg.indexOf("=");
|
|
35490
|
+
if (eq < 0) {
|
|
35491
|
+
continue;
|
|
35492
|
+
}
|
|
35493
|
+
map.set(seg.slice(0, eq), seg.slice(eq + 1));
|
|
35494
|
+
}
|
|
35495
|
+
return map;
|
|
35496
|
+
}
|
|
35497
|
+
})(StyleEffective || (StyleEffective = {}));
|
|
35355
35498
|
var EntityRenderEngine;
|
|
35356
35499
|
(function (EntityRenderEngine) {
|
|
35357
35500
|
function GetRenderGroupId(zoomItem) {
|
|
@@ -36333,7 +36476,7 @@ var StyleUtils;
|
|
|
36333
36476
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
36334
36477
|
})(StyleUtils || (StyleUtils = {}));
|
|
36335
36478
|
|
|
36336
|
-
const VERSION = "6.7.
|
|
36479
|
+
const VERSION = "6.7.6";
|
|
36337
36480
|
/**
|
|
36338
36481
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
36339
36482
|
* 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 +36493,5 @@ const getENVIRONMENT = () => {
|
|
|
36350
36493
|
return ENVIRONMENT;
|
|
36351
36494
|
};
|
|
36352
36495
|
|
|
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 };
|
|
36496
|
+
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, 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
36497
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|