bruce-cesium 3.4.2 → 3.4.4
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 +178 -40
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +177 -39
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +14 -9
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +14 -9
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +14 -9
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +6 -0
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/rendering/visual-register-culler.js +53 -2
- package/dist/lib/rendering/visual-register-culler.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +29 -9
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +46 -0
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/visual-register-culler.d.ts +1 -1
- package/dist/types/rendering/visuals-register.d.ts +2 -0
- package/dist/types/utils/cesium-entity-styler.d.ts +5 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, ENVIRONMENT, BruceEvent, EntityCoords, Api, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, SceneMode, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, GeoJsonDataSource, ColorMaterialProperty, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, EasingFunction, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, ScreenSpaceEventHandler, ScreenSpaceEventType, CesiumInspector, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -742,6 +742,52 @@ var CesiumEntityStyler;
|
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
CesiumEntityStyler.UpdateColorSetting = UpdateColorSetting;
|
|
745
|
+
function Refresh(params) {
|
|
746
|
+
var viewer = params.viewer, entity = params.entity, requestRender = params.requestRender;
|
|
747
|
+
if (!entity) {
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
var parts = EntityUtils.GatherEntity({
|
|
751
|
+
entity: entity
|
|
752
|
+
});
|
|
753
|
+
for (var i = 0; i < parts.length; i++) {
|
|
754
|
+
var part = parts[i];
|
|
755
|
+
if (!isAlive(viewer, part)) {
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
if (part instanceof Cesium3DTileFeature) {
|
|
759
|
+
var opacity = getAppliedOpacity(part);
|
|
760
|
+
refreshColor(viewer, part, opacity);
|
|
761
|
+
}
|
|
762
|
+
else if (part instanceof Entity) {
|
|
763
|
+
if (part.billboard) {
|
|
764
|
+
refreshColor(viewer, part.billboard, getAppliedOpacity(part.billboard));
|
|
765
|
+
}
|
|
766
|
+
if (part.model) {
|
|
767
|
+
refreshColor(viewer, part.model, getAppliedOpacity(part.model));
|
|
768
|
+
}
|
|
769
|
+
if (part.polyline) {
|
|
770
|
+
refreshColor(viewer, part.polyline, getAppliedOpacity(part.polyline));
|
|
771
|
+
}
|
|
772
|
+
if (part.polygon) {
|
|
773
|
+
refreshColor(viewer, part.polygon, getAppliedOpacity(part.polygon));
|
|
774
|
+
}
|
|
775
|
+
if (part.corridor) {
|
|
776
|
+
refreshColor(viewer, part.corridor, getAppliedOpacity(part.corridor));
|
|
777
|
+
}
|
|
778
|
+
if (part.point) {
|
|
779
|
+
refreshColor(viewer, part.point, getAppliedOpacity(part.point));
|
|
780
|
+
}
|
|
781
|
+
if (part.ellipse) {
|
|
782
|
+
refreshColor(viewer, part.ellipse, getAppliedOpacity(part.ellipse));
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
if (requestRender != false) {
|
|
787
|
+
viewer.scene.requestRender();
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
CesiumEntityStyler.Refresh = Refresh;
|
|
745
791
|
/**
|
|
746
792
|
* Updates the default colour of a graphic.
|
|
747
793
|
* This will not change the graphic's state to use it if the entity is selected/highlighted.
|
|
@@ -3086,6 +3132,54 @@ function shouldRecheck(viewer) {
|
|
|
3086
3132
|
}
|
|
3087
3133
|
return recheck;
|
|
3088
3134
|
}
|
|
3135
|
+
/**
|
|
3136
|
+
* Returns true if the given rego should be ignored from culling.
|
|
3137
|
+
* @param rego
|
|
3138
|
+
* @returns
|
|
3139
|
+
*/
|
|
3140
|
+
function isCullingIgnored(viewer, rego) {
|
|
3141
|
+
if (
|
|
3142
|
+
// No rego or visual.
|
|
3143
|
+
// This is a safety check to avoid crashes.
|
|
3144
|
+
!rego ||
|
|
3145
|
+
!rego.visual ||
|
|
3146
|
+
// We will only touch entities. Not tileset stuff.
|
|
3147
|
+
!(rego.visual instanceof Entity) ||
|
|
3148
|
+
// We won't touch relationship lines because they dynamically change shape.
|
|
3149
|
+
rego.relation != null ||
|
|
3150
|
+
// Explicitly being either shown or hidden.
|
|
3151
|
+
rego.overrideShow != null ||
|
|
3152
|
+
// Part of an independent collection.
|
|
3153
|
+
// Won't touch in case there is special logic.
|
|
3154
|
+
rego.collection) {
|
|
3155
|
+
return true;
|
|
3156
|
+
}
|
|
3157
|
+
var visual = rego.visual;
|
|
3158
|
+
// We will only cull clamped stuff since it seems that's where we get benefits from.
|
|
3159
|
+
var heightRef;
|
|
3160
|
+
if (visual.polygon) {
|
|
3161
|
+
heightRef = getValue(viewer, visual.polygon.heightReference);
|
|
3162
|
+
}
|
|
3163
|
+
else if (visual.polyline) {
|
|
3164
|
+
heightRef = getValue(viewer, visual.polyline.clampToGround) == false ? HeightReference.NONE : HeightReference.CLAMP_TO_GROUND;
|
|
3165
|
+
}
|
|
3166
|
+
else if (visual.corridor) {
|
|
3167
|
+
heightRef = getValue(viewer, visual.corridor.heightReference);
|
|
3168
|
+
}
|
|
3169
|
+
else if (visual.ellipse) {
|
|
3170
|
+
heightRef = getValue(viewer, visual.ellipse.heightReference);
|
|
3171
|
+
}
|
|
3172
|
+
else if (visual.model) {
|
|
3173
|
+
heightRef = getValue(viewer, visual.model.heightReference);
|
|
3174
|
+
}
|
|
3175
|
+
else if (visual.point) {
|
|
3176
|
+
heightRef = getValue(viewer, visual.point.heightReference);
|
|
3177
|
+
}
|
|
3178
|
+
else if (visual.billboard) {
|
|
3179
|
+
heightRef = getValue(viewer, visual.billboard.heightReference);
|
|
3180
|
+
}
|
|
3181
|
+
return heightRef != HeightReference.CLAMP_TO_GROUND;
|
|
3182
|
+
}
|
|
3089
3183
|
/**
|
|
3090
3184
|
* Runs through all entities in the register and culls them if they are out of the viewport.
|
|
3091
3185
|
* This will work in batches.
|
|
@@ -3112,7 +3206,7 @@ function runCullChecker(register) {
|
|
|
3112
3206
|
var rego = register.GetRego({
|
|
3113
3207
|
entityId: entityId
|
|
3114
3208
|
});
|
|
3115
|
-
if (
|
|
3209
|
+
if (isCullingIgnored(viewer, rego)) {
|
|
3116
3210
|
continue;
|
|
3117
3211
|
}
|
|
3118
3212
|
var parts = EntityUtils.GatherEntity({
|
|
@@ -3223,7 +3317,10 @@ var VisualRegisterCuller;
|
|
|
3223
3317
|
};
|
|
3224
3318
|
}
|
|
3225
3319
|
VisualRegisterCuller.Monitor = Monitor;
|
|
3226
|
-
function IsCulled(viewer, visual) {
|
|
3320
|
+
function IsCulled(viewer, rego, visual) {
|
|
3321
|
+
if (isCullingIgnored(viewer, rego)) {
|
|
3322
|
+
return false;
|
|
3323
|
+
}
|
|
3227
3324
|
if (!visual) {
|
|
3228
3325
|
return false;
|
|
3229
3326
|
}
|
|
@@ -6248,13 +6345,9 @@ function updateCEntityShow(viewer, visual, rego, show, ignoreParent, depth) {
|
|
|
6248
6345
|
console.warn("updateCEntityShow(): Max show depth reached. EntityId = " + rego.entityId);
|
|
6249
6346
|
return;
|
|
6250
6347
|
}
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
// A sub-object can be culled while the siblings are not.
|
|
6255
|
-
var isCulled = show ? VisualRegisterCuller.IsCulled(viewer, visual) : true;
|
|
6256
|
-
show = !isCulled;
|
|
6257
|
-
}
|
|
6348
|
+
// A sub-object can be culled while the siblings are not.
|
|
6349
|
+
// We only cull things that give us some benefit. For example clamped to ground graphics are expensive to keep rendered.
|
|
6350
|
+
show = show ? !VisualRegisterCuller.IsCulled(viewer, rego, visual) : true;
|
|
6258
6351
|
if (visual._parentEntity && !ignoreParent) {
|
|
6259
6352
|
updateCEntityShow(viewer, visual._parentEntity, rego, show, false, depth + 1);
|
|
6260
6353
|
}
|
|
@@ -6479,16 +6572,40 @@ var VisualsRegister;
|
|
|
6479
6572
|
};
|
|
6480
6573
|
Register.prototype.ForceUpdate = function (params) {
|
|
6481
6574
|
var _a;
|
|
6482
|
-
var entityIds = params.entityIds;
|
|
6575
|
+
var entityIds = params.entityIds, requestRender = params.requestRender, refreshColors = params.refreshColors;
|
|
6576
|
+
var selectedIds = this.selectedIds;
|
|
6577
|
+
var highlightedIds = this.highlightedIds;
|
|
6483
6578
|
for (var i = 0; i < entityIds.length; i++) {
|
|
6484
6579
|
var entityId = entityIds[i];
|
|
6485
6580
|
updateEntity(this.viewer, entityId, this);
|
|
6581
|
+
if (refreshColors) {
|
|
6582
|
+
if (selectedIds.includes(entityId)) {
|
|
6583
|
+
CesiumEntityStyler.Select({
|
|
6584
|
+
entity: this.GetRego({
|
|
6585
|
+
entityId: entityId
|
|
6586
|
+
}).visual,
|
|
6587
|
+
viewer: this.viewer,
|
|
6588
|
+
requestRender: false
|
|
6589
|
+
});
|
|
6590
|
+
}
|
|
6591
|
+
else if (highlightedIds.includes(entityId)) {
|
|
6592
|
+
CesiumEntityStyler.Highlight({
|
|
6593
|
+
entity: this.GetRego({
|
|
6594
|
+
entityId: entityId
|
|
6595
|
+
}).visual,
|
|
6596
|
+
viewer: this.viewer,
|
|
6597
|
+
requestRender: false
|
|
6598
|
+
});
|
|
6599
|
+
}
|
|
6600
|
+
}
|
|
6486
6601
|
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger({
|
|
6487
6602
|
type: EVisualUpdateType.Update,
|
|
6488
6603
|
entityId: entityId
|
|
6489
6604
|
});
|
|
6490
6605
|
}
|
|
6491
|
-
|
|
6606
|
+
if (requestRender != false) {
|
|
6607
|
+
this.viewer.scene.requestRender();
|
|
6608
|
+
}
|
|
6492
6609
|
};
|
|
6493
6610
|
/**
|
|
6494
6611
|
* Marks given entityIds as either labelled or not labelled.
|
|
@@ -8498,7 +8615,7 @@ var EntitiesRenderManager;
|
|
|
8498
8615
|
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
8499
8616
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
8500
8617
|
return __awaiter(this, void 0, void 0, function () {
|
|
8501
|
-
var zoomItem, lods, withLods_1, individuals, style, e_4, entityTypeId, entityType, e_5, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
8618
|
+
var zoomItem, lods, withLods_1, individuals, style, e_4, entityTypeId, entityType, e_5, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, toForceUpdate, register, sEntities, i, cEntity;
|
|
8502
8619
|
var _this = this;
|
|
8503
8620
|
return __generator(this, function (_o) {
|
|
8504
8621
|
switch (_o.label) {
|
|
@@ -8707,6 +8824,7 @@ var EntitiesRenderManager;
|
|
|
8707
8824
|
thing.polyline.width = width;
|
|
8708
8825
|
}
|
|
8709
8826
|
};
|
|
8827
|
+
toForceUpdate = [];
|
|
8710
8828
|
register = function (thing) {
|
|
8711
8829
|
var _a, _b, _c, _d;
|
|
8712
8830
|
// See if the cesium entity already exists in a group.
|
|
@@ -8719,7 +8837,6 @@ var EntitiesRenderManager;
|
|
|
8719
8837
|
if (!entityId) {
|
|
8720
8838
|
return;
|
|
8721
8839
|
}
|
|
8722
|
-
var needsUpdate = false;
|
|
8723
8840
|
// Find group for the nextspace entity ID.
|
|
8724
8841
|
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
8725
8842
|
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
@@ -8734,6 +8851,7 @@ var EntitiesRenderManager;
|
|
|
8734
8851
|
rego: null
|
|
8735
8852
|
};
|
|
8736
8853
|
groups.push(group);
|
|
8854
|
+
applyStyle(thing, entityId, group.data);
|
|
8737
8855
|
var rego = {
|
|
8738
8856
|
entityId: entityId,
|
|
8739
8857
|
menuItemId: _this.item.id,
|
|
@@ -8758,6 +8876,7 @@ var EntitiesRenderManager;
|
|
|
8758
8876
|
}
|
|
8759
8877
|
// Found a group. We flag this as a sibling entity of the primary.
|
|
8760
8878
|
else {
|
|
8879
|
+
applyStyle(thing, entityId, group.data);
|
|
8761
8880
|
group.siblings.push(thing);
|
|
8762
8881
|
group.visual._siblingGraphics = group.siblings;
|
|
8763
8882
|
thing._parentEntity = group.visual;
|
|
@@ -8765,21 +8884,24 @@ var EntitiesRenderManager;
|
|
|
8765
8884
|
_this.visualsManager.RefreshMark({
|
|
8766
8885
|
rego: group.rego
|
|
8767
8886
|
});
|
|
8768
|
-
|
|
8887
|
+
if (!toForceUpdate.includes(entityId)) {
|
|
8888
|
+
toForceUpdate.push(entityId);
|
|
8889
|
+
}
|
|
8769
8890
|
}
|
|
8770
8891
|
}
|
|
8771
|
-
applyStyle(thing, entityId, group.data);
|
|
8772
|
-
if (needsUpdate) {
|
|
8773
|
-
_this.visualsManager.ForceUpdate({
|
|
8774
|
-
entityIds: [entityId],
|
|
8775
|
-
});
|
|
8776
|
-
}
|
|
8777
8892
|
};
|
|
8778
8893
|
sEntities = source.entities.values;
|
|
8779
8894
|
for (i = 0; i < sEntities.length; i++) {
|
|
8780
8895
|
cEntity = sEntities[i];
|
|
8781
8896
|
register(cEntity);
|
|
8782
8897
|
}
|
|
8898
|
+
if (toForceUpdate.length) {
|
|
8899
|
+
this.visualsManager.ForceUpdate({
|
|
8900
|
+
entityIds: toForceUpdate,
|
|
8901
|
+
refreshColors: true,
|
|
8902
|
+
requestRender: false
|
|
8903
|
+
});
|
|
8904
|
+
}
|
|
8783
8905
|
this.viewer.scene.requestRender();
|
|
8784
8906
|
return [2 /*return*/];
|
|
8785
8907
|
}
|
|
@@ -9306,7 +9428,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9306
9428
|
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
9307
9429
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9308
9430
|
return __awaiter(this, void 0, void 0, function () {
|
|
9309
|
-
var zoomItem, lods, withLods_1, individuals, style, e_3, entityTypeId, entityType, e_4, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
9431
|
+
var zoomItem, lods, withLods_1, individuals, style, e_3, entityTypeId, entityType, e_4, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, toForceUpdate, register, sEntities, i, cEntity;
|
|
9310
9432
|
var _this = this;
|
|
9311
9433
|
return __generator(this, function (_o) {
|
|
9312
9434
|
switch (_o.label) {
|
|
@@ -9515,6 +9637,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9515
9637
|
thing.polyline.width = width;
|
|
9516
9638
|
}
|
|
9517
9639
|
};
|
|
9640
|
+
toForceUpdate = [];
|
|
9518
9641
|
register = function (thing) {
|
|
9519
9642
|
var _a, _b, _c, _d;
|
|
9520
9643
|
// See if the cesium entity already exists in a group.
|
|
@@ -9527,7 +9650,6 @@ var EntitiesLoadedRenderManager;
|
|
|
9527
9650
|
if (!entityId) {
|
|
9528
9651
|
return;
|
|
9529
9652
|
}
|
|
9530
|
-
var needsUpdate = false;
|
|
9531
9653
|
// Find group for the nextspace entity ID.
|
|
9532
9654
|
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
9533
9655
|
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
@@ -9542,6 +9664,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9542
9664
|
rego: null
|
|
9543
9665
|
};
|
|
9544
9666
|
groups.push(group);
|
|
9667
|
+
applyStyle(thing, entityId, group.data);
|
|
9545
9668
|
var rego = {
|
|
9546
9669
|
entityId: entityId,
|
|
9547
9670
|
menuItemId: _this.item.id,
|
|
@@ -9566,6 +9689,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9566
9689
|
}
|
|
9567
9690
|
// Found a group. We flag this as a sibling entity of the primary.
|
|
9568
9691
|
else {
|
|
9692
|
+
applyStyle(thing, entityId, group.data);
|
|
9569
9693
|
group.siblings.push(thing);
|
|
9570
9694
|
group.visual._siblingGraphics = group.siblings;
|
|
9571
9695
|
thing._parentEntity = group.visual;
|
|
@@ -9573,21 +9697,24 @@ var EntitiesLoadedRenderManager;
|
|
|
9573
9697
|
_this.visualsManager.RefreshMark({
|
|
9574
9698
|
rego: group.rego
|
|
9575
9699
|
});
|
|
9576
|
-
|
|
9700
|
+
if (!toForceUpdate.includes(entityId)) {
|
|
9701
|
+
toForceUpdate.push(entityId);
|
|
9702
|
+
}
|
|
9577
9703
|
}
|
|
9578
9704
|
}
|
|
9579
|
-
applyStyle(thing, entityId, group.data);
|
|
9580
|
-
if (needsUpdate) {
|
|
9581
|
-
_this.visualsManager.ForceUpdate({
|
|
9582
|
-
entityIds: [entityId],
|
|
9583
|
-
});
|
|
9584
|
-
}
|
|
9585
9705
|
};
|
|
9586
9706
|
sEntities = source.entities.values;
|
|
9587
9707
|
for (i = 0; i < sEntities.length; i++) {
|
|
9588
9708
|
cEntity = sEntities[i];
|
|
9589
9709
|
register(cEntity);
|
|
9590
9710
|
}
|
|
9711
|
+
if (toForceUpdate.length) {
|
|
9712
|
+
this.visualsManager.ForceUpdate({
|
|
9713
|
+
entityIds: toForceUpdate,
|
|
9714
|
+
refreshColors: true,
|
|
9715
|
+
requestRender: false
|
|
9716
|
+
});
|
|
9717
|
+
}
|
|
9591
9718
|
this.viewer.scene.requestRender();
|
|
9592
9719
|
return [2 /*return*/];
|
|
9593
9720
|
}
|
|
@@ -9906,7 +10033,7 @@ var EntitiesIdsRenderManager;
|
|
|
9906
10033
|
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
9907
10034
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
9908
10035
|
return __awaiter(this, void 0, void 0, function () {
|
|
9909
|
-
var zoomItem, lods, withLods_1, individuals, style, e_3, entityTypeId, entityType, e_4, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, register, sEntities, i, cEntity;
|
|
10036
|
+
var zoomItem, lods, withLods_1, individuals, style, e_3, entityTypeId, entityType, e_4, pStyle, lStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, notRendered, source, groups, applyStyle, toForceUpdate, register, sEntities, i, cEntity;
|
|
9910
10037
|
var _this = this;
|
|
9911
10038
|
return __generator(this, function (_o) {
|
|
9912
10039
|
switch (_o.label) {
|
|
@@ -10115,6 +10242,7 @@ var EntitiesIdsRenderManager;
|
|
|
10115
10242
|
thing.polyline.width = width;
|
|
10116
10243
|
}
|
|
10117
10244
|
};
|
|
10245
|
+
toForceUpdate = [];
|
|
10118
10246
|
register = function (thing) {
|
|
10119
10247
|
var _a, _b, _c, _d;
|
|
10120
10248
|
// See if the cesium entity already exists in a group.
|
|
@@ -10127,7 +10255,6 @@ var EntitiesIdsRenderManager;
|
|
|
10127
10255
|
if (!entityId) {
|
|
10128
10256
|
return;
|
|
10129
10257
|
}
|
|
10130
|
-
var needsUpdate = false;
|
|
10131
10258
|
// Find group for the nextspace entity ID.
|
|
10132
10259
|
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
10133
10260
|
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
@@ -10142,6 +10269,7 @@ var EntitiesIdsRenderManager;
|
|
|
10142
10269
|
rego: null
|
|
10143
10270
|
};
|
|
10144
10271
|
groups.push(group);
|
|
10272
|
+
applyStyle(thing, entityId, group.data);
|
|
10145
10273
|
var rego = {
|
|
10146
10274
|
entityId: entityId,
|
|
10147
10275
|
menuItemId: _this.item.id,
|
|
@@ -10166,6 +10294,7 @@ var EntitiesIdsRenderManager;
|
|
|
10166
10294
|
}
|
|
10167
10295
|
// Found a group. We flag this as a sibling entity of the primary.
|
|
10168
10296
|
else {
|
|
10297
|
+
applyStyle(thing, entityId, group.data);
|
|
10169
10298
|
group.siblings.push(thing);
|
|
10170
10299
|
group.visual._siblingGraphics = group.siblings;
|
|
10171
10300
|
thing._parentEntity = group.visual;
|
|
@@ -10173,21 +10302,24 @@ var EntitiesIdsRenderManager;
|
|
|
10173
10302
|
_this.visualsManager.RefreshMark({
|
|
10174
10303
|
rego: group.rego
|
|
10175
10304
|
});
|
|
10176
|
-
|
|
10305
|
+
if (!toForceUpdate.includes(entityId)) {
|
|
10306
|
+
toForceUpdate.push(entityId);
|
|
10307
|
+
}
|
|
10177
10308
|
}
|
|
10178
10309
|
}
|
|
10179
|
-
applyStyle(thing, entityId, group.data);
|
|
10180
|
-
if (needsUpdate) {
|
|
10181
|
-
_this.visualsManager.ForceUpdate({
|
|
10182
|
-
entityIds: [entityId],
|
|
10183
|
-
});
|
|
10184
|
-
}
|
|
10185
10310
|
};
|
|
10186
10311
|
sEntities = source.entities.values;
|
|
10187
10312
|
for (i = 0; i < sEntities.length; i++) {
|
|
10188
10313
|
cEntity = sEntities[i];
|
|
10189
10314
|
register(cEntity);
|
|
10190
10315
|
}
|
|
10316
|
+
if (toForceUpdate.length) {
|
|
10317
|
+
this.visualsManager.ForceUpdate({
|
|
10318
|
+
entityIds: toForceUpdate,
|
|
10319
|
+
refreshColors: true,
|
|
10320
|
+
requestRender: false
|
|
10321
|
+
});
|
|
10322
|
+
}
|
|
10191
10323
|
this.viewer.scene.requestRender();
|
|
10192
10324
|
return [2 /*return*/];
|
|
10193
10325
|
}
|
|
@@ -10946,6 +11078,10 @@ var TilesetRenderEngine;
|
|
|
10946
11078
|
this.cTileset = cTileset;
|
|
10947
11079
|
this.fallbackStyleId = fallbackStyleId;
|
|
10948
11080
|
this.styleMapping = styleMapping;
|
|
11081
|
+
if (styleMapping) {
|
|
11082
|
+
// Dereference.
|
|
11083
|
+
styleMapping = JSON.parse(JSON.stringify(styleMapping));
|
|
11084
|
+
}
|
|
10949
11085
|
// ND-1641. BOOKMARKS - (DEMO) View does not match bookmark.
|
|
10950
11086
|
// We have some evil hard-coded style mappings that need to be fixed.
|
|
10951
11087
|
// These exist within legacy project views.
|
|
@@ -10976,6 +11112,8 @@ var TilesetRenderEngine;
|
|
|
10976
11112
|
Styler.prototype.UpdateStyleMapping = function (params) {
|
|
10977
11113
|
var _a;
|
|
10978
11114
|
if (params.styleMapping) {
|
|
11115
|
+
// Dereference.
|
|
11116
|
+
params.styleMapping = JSON.parse(JSON.stringify(params.styleMapping));
|
|
10979
11117
|
this.styleMapping = params.styleMapping;
|
|
10980
11118
|
// ND-1641. BOOKMARKS - (DEMO) View does not match bookmark.
|
|
10981
11119
|
// We have some evil hard-coded style mappings that need to be fixed.
|
|
@@ -21360,7 +21498,7 @@ var CesiumViewMonitor;
|
|
|
21360
21498
|
CesiumViewMonitor$$1.Monitor = Monitor;
|
|
21361
21499
|
})(CesiumViewMonitor || (CesiumViewMonitor = {}));
|
|
21362
21500
|
|
|
21363
|
-
var VERSION$1 = "3.4.
|
|
21501
|
+
var VERSION$1 = "3.4.4";
|
|
21364
21502
|
|
|
21365
21503
|
export { VERSION$1 as VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
|
|
21366
21504
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|