bruce-cesium 3.3.7 → 3.3.8
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 +286 -40
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +285 -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-render-manager.js +251 -24
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/visual-register-culler.js +1 -1
- package/dist/lib/rendering/visual-register-culler.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +32 -11
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +17 -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 { 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, Primitive, Cesium3DTileFeature, SceneMode,
|
|
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, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, CesiumInspector, PolygonPipeline, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ColorMaterialProperty } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3052,7 +3052,7 @@ function runCullChecker(register) {
|
|
|
3052
3052
|
var rego = register.GetRego({
|
|
3053
3053
|
entityId: entityId
|
|
3054
3054
|
});
|
|
3055
|
-
if (!rego || !rego.visual || !(rego.visual instanceof Entity) || rego.relation != null || rego.overrideShow != null) {
|
|
3055
|
+
if (!rego || !rego.visual || !(rego.visual instanceof Entity) || rego.relation != null || rego.overrideShow != null || rego.collection) {
|
|
3056
3056
|
continue;
|
|
3057
3057
|
}
|
|
3058
3058
|
var parts = EntityUtils.GatherEntity({
|
|
@@ -6181,8 +6181,14 @@ function removeEntity(viewer, visual) {
|
|
|
6181
6181
|
}
|
|
6182
6182
|
}
|
|
6183
6183
|
}
|
|
6184
|
-
|
|
6185
|
-
|
|
6184
|
+
var MAX_SHOW_DEPTH = 10;
|
|
6185
|
+
function updateCEntityShow(viewer, visual, rego, show, ignoreParent, depth) {
|
|
6186
|
+
if (depth === void 0) { depth = 0; }
|
|
6187
|
+
if (depth > MAX_SHOW_DEPTH) {
|
|
6188
|
+
console.warn("updateCEntityShow(): Max show depth reached. EntityId = " + rego.entityId);
|
|
6189
|
+
return;
|
|
6190
|
+
}
|
|
6191
|
+
if (show && !rego.relation && !rego.overrideShow && !rego.collection) {
|
|
6186
6192
|
// Culling is controlled by "visual-register-culler.ts".
|
|
6187
6193
|
// When an object is unculled then the 'updateEntityShow' function is re-called to reveal it and related objects.
|
|
6188
6194
|
// A sub-object can be culled while the siblings are not.
|
|
@@ -6190,31 +6196,42 @@ function updateCEntityShow(viewer, isRelationship, visual, isShowOverriden, show
|
|
|
6190
6196
|
show = !isCulled;
|
|
6191
6197
|
}
|
|
6192
6198
|
if (visual._parentEntity && !ignoreParent) {
|
|
6193
|
-
updateCEntityShow(viewer,
|
|
6199
|
+
updateCEntityShow(viewer, visual._parentEntity, rego, show, false, depth + 1);
|
|
6194
6200
|
}
|
|
6195
6201
|
if (visual._siblingGraphics) {
|
|
6196
6202
|
for (var i = 0; i < visual._siblingGraphics.length; i++) {
|
|
6197
6203
|
var sibling = visual._siblingGraphics[i];
|
|
6198
|
-
updateCEntityShow(viewer,
|
|
6204
|
+
updateCEntityShow(viewer, sibling, rego, show, true, depth + 1);
|
|
6199
6205
|
}
|
|
6200
6206
|
}
|
|
6201
6207
|
/**
|
|
6202
6208
|
* Do NOT use ".show" as it causes crashes in Cesium polylines that are clamped to ground.
|
|
6203
6209
|
* We could target them specifically here but we may be getting overall performance gain by just removing stuff from the scene.
|
|
6204
6210
|
*/
|
|
6205
|
-
if (
|
|
6206
|
-
|
|
6211
|
+
if (rego.collection) {
|
|
6212
|
+
if (!show && rego.collection.contains(visual)) {
|
|
6213
|
+
rego.collection.remove(visual);
|
|
6214
|
+
}
|
|
6215
|
+
else if (show && !rego.collection.contains(visual)) {
|
|
6216
|
+
rego.collection.add(visual);
|
|
6217
|
+
}
|
|
6207
6218
|
}
|
|
6208
|
-
else
|
|
6209
|
-
viewer.entities.
|
|
6219
|
+
else {
|
|
6220
|
+
if (!show && viewer.entities.contains(visual)) {
|
|
6221
|
+
viewer.entities.remove(visual);
|
|
6222
|
+
}
|
|
6223
|
+
else if (show && !viewer.entities.contains(visual)) {
|
|
6224
|
+
viewer.entities.add(visual);
|
|
6225
|
+
}
|
|
6210
6226
|
}
|
|
6211
6227
|
}
|
|
6212
|
-
function updateEntityShow(viewer,
|
|
6228
|
+
function updateEntityShow(viewer, rego, show) {
|
|
6229
|
+
var visual = rego.visual;
|
|
6213
6230
|
if (visual instanceof Entity) {
|
|
6214
6231
|
if (!(viewer === null || viewer === void 0 ? void 0 : viewer.scene) || viewer.isDestroyed()) {
|
|
6215
6232
|
return;
|
|
6216
6233
|
}
|
|
6217
|
-
updateCEntityShow(viewer,
|
|
6234
|
+
updateCEntityShow(viewer, rego.visual, rego, show, false, 0);
|
|
6218
6235
|
return;
|
|
6219
6236
|
}
|
|
6220
6237
|
if (!isAlive$1(viewer, visual)) {
|
|
@@ -6267,7 +6284,7 @@ function updateEntity(viewer, entityId, register) {
|
|
|
6267
6284
|
if (visible == null) {
|
|
6268
6285
|
visible = getShowState(rego);
|
|
6269
6286
|
}
|
|
6270
|
-
updateEntityShow(viewer, rego
|
|
6287
|
+
updateEntityShow(viewer, rego, visible);
|
|
6271
6288
|
if (rego.best) {
|
|
6272
6289
|
var isLabelled = register.GetIsLabelled({
|
|
6273
6290
|
entityId: entityId
|
|
@@ -6389,6 +6406,10 @@ var VisualsRegister;
|
|
|
6389
6406
|
enumerable: false,
|
|
6390
6407
|
configurable: true
|
|
6391
6408
|
});
|
|
6409
|
+
Register.prototype.RefreshMark = function (params) {
|
|
6410
|
+
var rego = params.rego;
|
|
6411
|
+
markEntity(this, rego, rego.visual, false);
|
|
6412
|
+
};
|
|
6392
6413
|
Register.prototype.Dispose = function () {
|
|
6393
6414
|
var _a;
|
|
6394
6415
|
(_a = this.cameraCullerDispose) === null || _a === void 0 ? void 0 : _a.call(this, {
|
|
@@ -8011,6 +8032,15 @@ var PointClustering = /** @class */ (function () {
|
|
|
8011
8032
|
|
|
8012
8033
|
var BATCH_SIZE = 500;
|
|
8013
8034
|
var CHECK_BATCH_SIZE = 250;
|
|
8035
|
+
function getValue$3(viewer, obj) {
|
|
8036
|
+
if (obj === null || obj === void 0 ? void 0 : obj.getValue) {
|
|
8037
|
+
return obj.getValue(viewer.scene.lastRenderTime);
|
|
8038
|
+
}
|
|
8039
|
+
return obj;
|
|
8040
|
+
}
|
|
8041
|
+
function colorToCColor$2(color) {
|
|
8042
|
+
return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
8043
|
+
}
|
|
8014
8044
|
/**
|
|
8015
8045
|
* Manager for rendering Bruce entities.
|
|
8016
8046
|
* This will request entities based on setup menu item filter.
|
|
@@ -8030,6 +8060,10 @@ var EntitiesRenderManager;
|
|
|
8030
8060
|
this.viewMonitorRemoval = null;
|
|
8031
8061
|
this.renderQueue = [];
|
|
8032
8062
|
this.renderQueueInterval = null;
|
|
8063
|
+
this.sources = [];
|
|
8064
|
+
// Highly experimental flag to try improve rendering large sets of polygons and polylines.
|
|
8065
|
+
// Many things are not supported when this is enabled.
|
|
8066
|
+
this.useGeojson = false;
|
|
8033
8067
|
var viewer = params.viewer, apiGetter = params.apiGetter, monitor = params.monitor, item = params.item, visualsManager = params.register, sharedGetters = params.sharedGetters;
|
|
8034
8068
|
this.viewer = viewer;
|
|
8035
8069
|
this.sharedGetters = sharedGetters;
|
|
@@ -8037,6 +8071,7 @@ var EntitiesRenderManager;
|
|
|
8037
8071
|
this.apiGetter = apiGetter;
|
|
8038
8072
|
this.item = item;
|
|
8039
8073
|
this.visualsManager = visualsManager;
|
|
8074
|
+
this.useGeojson = item.renderAsGeojson == true;
|
|
8040
8075
|
if (item.enableClustering) {
|
|
8041
8076
|
this.clustering = new PointClustering(this.visualsManager, this.item.id);
|
|
8042
8077
|
}
|
|
@@ -8186,6 +8221,12 @@ var EntitiesRenderManager;
|
|
|
8186
8221
|
clearInterval(this.renderQueueInterval);
|
|
8187
8222
|
this.renderQueue = [];
|
|
8188
8223
|
(_c = this.clustering) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
8224
|
+
this.clustering = null;
|
|
8225
|
+
for (var i = 0; i < this.sources.length; i++) {
|
|
8226
|
+
var source = this.sources[i];
|
|
8227
|
+
this.viewer.dataSources.remove(source);
|
|
8228
|
+
}
|
|
8229
|
+
this.sources = [];
|
|
8189
8230
|
};
|
|
8190
8231
|
Manager.prototype.ReRender = function (params) {
|
|
8191
8232
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -8337,14 +8378,14 @@ var EntitiesRenderManager;
|
|
|
8337
8378
|
}
|
|
8338
8379
|
};
|
|
8339
8380
|
Manager.prototype.renderEntities = function (entities, force) {
|
|
8340
|
-
var _a
|
|
8381
|
+
var _a;
|
|
8341
8382
|
if (force === void 0) { force = false; }
|
|
8342
8383
|
return __awaiter(this, void 0, void 0, function () {
|
|
8343
|
-
var typeId_1,
|
|
8344
|
-
return __generator(this, function (
|
|
8345
|
-
switch (
|
|
8384
|
+
var typeId_1, e_3;
|
|
8385
|
+
return __generator(this, function (_b) {
|
|
8386
|
+
switch (_b.label) {
|
|
8346
8387
|
case 0:
|
|
8347
|
-
|
|
8388
|
+
_b.trys.push([0, 5, , 6]);
|
|
8348
8389
|
if (this.disposed || this.viewer.isDestroyed()) {
|
|
8349
8390
|
return [2 /*return*/];
|
|
8350
8391
|
}
|
|
@@ -8352,17 +8393,227 @@ var EntitiesRenderManager;
|
|
|
8352
8393
|
if (typeId_1) {
|
|
8353
8394
|
entities = entities.filter(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]) == typeId_1; });
|
|
8354
8395
|
}
|
|
8355
|
-
return [
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8396
|
+
if (!this.useGeojson) return [3 /*break*/, 2];
|
|
8397
|
+
return [4 /*yield*/, this.renderAsGeojson(entities, force)];
|
|
8398
|
+
case 1:
|
|
8399
|
+
_b.sent();
|
|
8400
|
+
return [3 /*break*/, 4];
|
|
8401
|
+
case 2: return [4 /*yield*/, this.renderAsIndividuals(entities, force)];
|
|
8402
|
+
case 3:
|
|
8403
|
+
_b.sent();
|
|
8404
|
+
_b.label = 4;
|
|
8405
|
+
case 4: return [3 /*break*/, 6];
|
|
8406
|
+
case 5:
|
|
8407
|
+
e_3 = _b.sent();
|
|
8408
|
+
console.error(e_3);
|
|
8409
|
+
return [3 /*break*/, 6];
|
|
8410
|
+
case 6: return [2 /*return*/];
|
|
8411
|
+
}
|
|
8412
|
+
});
|
|
8413
|
+
});
|
|
8414
|
+
};
|
|
8415
|
+
/**
|
|
8416
|
+
* Our optimized and more stable path.
|
|
8417
|
+
* We construct a geojson that we draw in one go.
|
|
8418
|
+
* @param entities
|
|
8419
|
+
* @param force TODO: This should re-render entities that are already rendered.
|
|
8420
|
+
*/
|
|
8421
|
+
Manager.prototype.renderAsGeojson = function (entities, force) {
|
|
8422
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8423
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8424
|
+
var zoomItem, style, e_4, entityType, e_5, pStyle, polygonsClamped, bFillColor, cFillColor, bLineColor, cLineColor, lineWidthPx, geojson, source, groups, register, sEntities, i, cEntity;
|
|
8425
|
+
var _this = this;
|
|
8426
|
+
return __generator(this, function (_j) {
|
|
8427
|
+
switch (_j.label) {
|
|
8428
|
+
case 0:
|
|
8429
|
+
entities = entities.filter(function (entity) {
|
|
8430
|
+
var _a;
|
|
8431
|
+
return !_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID];
|
|
8432
|
+
});
|
|
8433
|
+
// Mark these as rendered.
|
|
8434
|
+
entities.forEach(function (entity) {
|
|
8435
|
+
var _a;
|
|
8436
|
+
_this.renderedEntities[(_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.ID] = true;
|
|
8437
|
+
});
|
|
8438
|
+
zoomItem = this.item.CameraZoomSettings[0];
|
|
8439
|
+
style = null;
|
|
8440
|
+
if (!(zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID)) return [3 /*break*/, 4];
|
|
8441
|
+
_j.label = 1;
|
|
8442
|
+
case 1:
|
|
8443
|
+
_j.trys.push([1, 3, , 4]);
|
|
8444
|
+
return [4 /*yield*/, Style.Get({
|
|
8445
|
+
api: this.apiGetter.getApi(),
|
|
8446
|
+
styleId: zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID
|
|
8363
8447
|
})];
|
|
8448
|
+
case 2:
|
|
8449
|
+
style = (_a = (_j.sent()).style) === null || _a === void 0 ? void 0 : _a.Settings;
|
|
8450
|
+
return [3 /*break*/, 4];
|
|
8451
|
+
case 3:
|
|
8452
|
+
e_4 = _j.sent();
|
|
8453
|
+
console.error(e_4);
|
|
8454
|
+
return [3 /*break*/, 4];
|
|
8455
|
+
case 4:
|
|
8456
|
+
_j.trys.push([4, 8, , 9]);
|
|
8457
|
+
return [4 /*yield*/, EntityType.Get({
|
|
8458
|
+
entityTypeId: this.item.BruceEntity["EntityType.ID"],
|
|
8459
|
+
api: this.apiGetter.getApi()
|
|
8460
|
+
})];
|
|
8461
|
+
case 5:
|
|
8462
|
+
entityType = (_b = (_j.sent())) === null || _b === void 0 ? void 0 : _b.entityType;
|
|
8463
|
+
if (!(!style && ((_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"]))) return [3 /*break*/, 7];
|
|
8464
|
+
if (!entityType["DisplaySetting.ID"]) return [3 /*break*/, 7];
|
|
8465
|
+
return [4 /*yield*/, Style.Get({
|
|
8466
|
+
api: this.apiGetter.getApi(),
|
|
8467
|
+
styleId: entityType["DisplaySetting.ID"]
|
|
8468
|
+
})];
|
|
8469
|
+
case 6:
|
|
8470
|
+
style = (_d = (_j.sent()).style) === null || _d === void 0 ? void 0 : _d.Settings;
|
|
8471
|
+
_j.label = 7;
|
|
8472
|
+
case 7: return [3 /*break*/, 9];
|
|
8473
|
+
case 8:
|
|
8474
|
+
e_5 = _j.sent();
|
|
8475
|
+
console.error(e_5);
|
|
8476
|
+
return [3 /*break*/, 9];
|
|
8477
|
+
case 9:
|
|
8478
|
+
pStyle = (_e = style === null || style === void 0 ? void 0 : style.polygonStyle) !== null && _e !== void 0 ? _e : {};
|
|
8479
|
+
polygonsClamped = ((_f = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _f === void 0 ? void 0 : _f.id) == null ? true : ((_g = pStyle === null || pStyle === void 0 ? void 0 : pStyle.altitudeOption) === null || _g === void 0 ? void 0 : _g.id) == 0;
|
|
8480
|
+
bFillColor = Calculator.GetColor(pStyle.fillColor, {}, []);
|
|
8481
|
+
cFillColor = bFillColor ? colorToCColor$2(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
|
|
8482
|
+
bLineColor = Calculator.GetColor(pStyle.lineColor, {}, []);
|
|
8483
|
+
cLineColor = bLineColor ? colorToCColor$2(bLineColor) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
|
|
8484
|
+
lineWidthPx = pStyle.lineWidth ? Calculator.GetNumber(pStyle.lineWidth, {}, []) : null;
|
|
8485
|
+
if (lineWidthPx == null) {
|
|
8486
|
+
lineWidthPx = 1;
|
|
8487
|
+
}
|
|
8488
|
+
lineWidthPx = EnsureNumber(lineWidthPx);
|
|
8489
|
+
if (lineWidthPx < 0.01) {
|
|
8490
|
+
lineWidthPx = 0;
|
|
8491
|
+
}
|
|
8492
|
+
lineWidthPx = Math.round(lineWidthPx);
|
|
8493
|
+
geojson = Entity$1.ToGeoJson({
|
|
8494
|
+
entities: entities,
|
|
8495
|
+
includeUserData: false,
|
|
8496
|
+
excludeAltitude: polygonsClamped && lineWidthPx <= 0,
|
|
8497
|
+
altitude: lineWidthPx > 0 && polygonsClamped ? 1 : null,
|
|
8498
|
+
// No points.
|
|
8499
|
+
allowedDisplayTypes: [ZoomControl.EDisplayType.Geometry]
|
|
8500
|
+
});
|
|
8501
|
+
if (!((_h = geojson === null || geojson === void 0 ? void 0 : geojson.features) === null || _h === void 0 ? void 0 : _h.length)) {
|
|
8502
|
+
return [2 /*return*/];
|
|
8503
|
+
}
|
|
8504
|
+
return [4 /*yield*/, GeoJsonDataSource.load(geojson, {
|
|
8505
|
+
stroke: cLineColor,
|
|
8506
|
+
fill: cFillColor,
|
|
8507
|
+
strokeWidth: lineWidthPx,
|
|
8508
|
+
clampToGround: lineWidthPx <= 0 && polygonsClamped
|
|
8509
|
+
})];
|
|
8510
|
+
case 10:
|
|
8511
|
+
source = _j.sent();
|
|
8512
|
+
this.viewer.dataSources.add(source);
|
|
8513
|
+
this.sources.push(source);
|
|
8514
|
+
if (this.disposed) {
|
|
8515
|
+
this.doDispose();
|
|
8516
|
+
return [2 /*return*/];
|
|
8517
|
+
}
|
|
8518
|
+
groups = [];
|
|
8519
|
+
register = function (thing) {
|
|
8520
|
+
var _a, _b, _c, _d;
|
|
8521
|
+
// See if the cesium entity already exists in a group.
|
|
8522
|
+
var group = groups.find(function (x) { var _a; return ((_a = x.visual) === null || _a === void 0 ? void 0 : _a.id) == thing.id || x.siblings.find(function (x) { return (x === null || x === void 0 ? void 0 : x.id) == thing.id; }); });
|
|
8523
|
+
if (group) {
|
|
8524
|
+
return;
|
|
8525
|
+
}
|
|
8526
|
+
var metadata = getValue$3(_this.viewer, thing === null || thing === void 0 ? void 0 : thing.properties);
|
|
8527
|
+
var entityId = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
|
|
8528
|
+
if (!entityId) {
|
|
8529
|
+
return;
|
|
8530
|
+
}
|
|
8531
|
+
// Find group for the nextspace entity ID.
|
|
8532
|
+
group = groups.find(function (x) { return x.entityId == entityId; });
|
|
8533
|
+
// No group yet. We can designate this as the primary entity and create a new group for it.
|
|
8534
|
+
if (!group) {
|
|
8535
|
+
group = {
|
|
8536
|
+
entityId: entityId,
|
|
8537
|
+
visual: thing,
|
|
8538
|
+
tagIds: (_b = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _b === void 0 ? void 0 : _b["Layer.ID"],
|
|
8539
|
+
entityTypeId: (_c = metadata === null || metadata === void 0 ? void 0 : metadata.Bruce) === null || _c === void 0 ? void 0 : _c["EntityType.ID"],
|
|
8540
|
+
siblings: [],
|
|
8541
|
+
data: entities.find(function (x) { var _a; return ((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID) == entityId; }),
|
|
8542
|
+
rego: null
|
|
8543
|
+
};
|
|
8544
|
+
groups.push(group);
|
|
8545
|
+
var rego = {
|
|
8546
|
+
entityId: entityId,
|
|
8547
|
+
menuItemId: _this.item.id,
|
|
8548
|
+
visual: thing,
|
|
8549
|
+
priority: 0,
|
|
8550
|
+
entityTypeId: group.entityTypeId,
|
|
8551
|
+
accountId: _this.apiGetter.accountId,
|
|
8552
|
+
tagIds: group.tagIds ? [].concat(group.tagIds) : [],
|
|
8553
|
+
name: (_d = Entity$1.CalculateName({
|
|
8554
|
+
entity: group.data,
|
|
8555
|
+
type: entityType,
|
|
8556
|
+
defaultToId: false
|
|
8557
|
+
})) !== null && _d !== void 0 ? _d : "Unnamed Entity",
|
|
8558
|
+
cdn: _this.item.cdnEnabled,
|
|
8559
|
+
collection: source.entities
|
|
8560
|
+
};
|
|
8561
|
+
group.rego = rego;
|
|
8562
|
+
_this.visualsManager.AddRego({
|
|
8563
|
+
rego: rego,
|
|
8564
|
+
requestRender: false
|
|
8565
|
+
});
|
|
8566
|
+
}
|
|
8567
|
+
// Found a group. We flag this as a sibling entity of the primary.
|
|
8568
|
+
else {
|
|
8569
|
+
group.siblings.push(thing);
|
|
8570
|
+
group.visual._siblingGraphics = group.siblings;
|
|
8571
|
+
thing._parentEntity = group.visual;
|
|
8572
|
+
if (group.rego) {
|
|
8573
|
+
_this.visualsManager.RefreshMark({
|
|
8574
|
+
rego: group.rego
|
|
8575
|
+
});
|
|
8576
|
+
}
|
|
8577
|
+
}
|
|
8578
|
+
// Won't do individual styles for now. More stability that way.
|
|
8579
|
+
// applyStyle(thing, entityId, group.data);
|
|
8580
|
+
};
|
|
8581
|
+
sEntities = source.entities.values;
|
|
8582
|
+
for (i = 0; i < sEntities.length; i++) {
|
|
8583
|
+
cEntity = sEntities[i];
|
|
8584
|
+
register(cEntity);
|
|
8585
|
+
}
|
|
8586
|
+
this.viewer.scene.requestRender();
|
|
8587
|
+
return [2 /*return*/];
|
|
8588
|
+
}
|
|
8589
|
+
});
|
|
8590
|
+
});
|
|
8591
|
+
};
|
|
8592
|
+
/**
|
|
8593
|
+
* Our default path.
|
|
8594
|
+
* We render each entity individually.
|
|
8595
|
+
* @param entities
|
|
8596
|
+
* @param force
|
|
8597
|
+
* @returns
|
|
8598
|
+
*/
|
|
8599
|
+
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
8600
|
+
var _a, _b, _c;
|
|
8601
|
+
if (force === void 0) { force = false; }
|
|
8602
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8603
|
+
var cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds, rego;
|
|
8604
|
+
return __generator(this, function (_d) {
|
|
8605
|
+
switch (_d.label) {
|
|
8606
|
+
case 0: return [4 /*yield*/, EntityRenderEngine.Render({
|
|
8607
|
+
viewer: this.viewer,
|
|
8608
|
+
apiGetter: this.apiGetter,
|
|
8609
|
+
entities: entities,
|
|
8610
|
+
menuItemId: this.item.id,
|
|
8611
|
+
visualRegister: this.visualsManager,
|
|
8612
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
8613
|
+
force: force
|
|
8614
|
+
})];
|
|
8364
8615
|
case 1:
|
|
8365
|
-
cEntities =
|
|
8616
|
+
cEntities = _d.sent();
|
|
8366
8617
|
if (this.disposed) {
|
|
8367
8618
|
this.doDispose();
|
|
8368
8619
|
return [2 /*return*/];
|
|
@@ -8373,13 +8624,13 @@ var EntitiesRenderManager;
|
|
|
8373
8624
|
cEntity = cEntities[id];
|
|
8374
8625
|
this.renderedEntities[id] = !!cEntity;
|
|
8375
8626
|
if (cEntity) {
|
|
8376
|
-
visual = (
|
|
8627
|
+
visual = (_a = this.visualsManager.GetRego({
|
|
8377
8628
|
entityId: id,
|
|
8378
8629
|
menuItemId: this.item.id
|
|
8379
|
-
})) === null ||
|
|
8630
|
+
})) === null || _a === void 0 ? void 0 : _a.visual;
|
|
8380
8631
|
if (!visual || visual != cEntity) {
|
|
8381
8632
|
wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
8382
|
-
tagIds = (
|
|
8633
|
+
tagIds = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b["Layer.ID"];
|
|
8383
8634
|
rego = {
|
|
8384
8635
|
entityId: id,
|
|
8385
8636
|
menuItemId: this.item.id,
|
|
@@ -8404,19 +8655,14 @@ var EntitiesRenderManager;
|
|
|
8404
8655
|
menuItemId: this.item.id,
|
|
8405
8656
|
requestRender: false
|
|
8406
8657
|
});
|
|
8407
|
-
(
|
|
8658
|
+
(_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(id, false);
|
|
8408
8659
|
}
|
|
8409
8660
|
}
|
|
8410
8661
|
this.viewer.scene.requestRender();
|
|
8411
8662
|
if (this.clustering && entities.length) {
|
|
8412
8663
|
this.clustering.Update();
|
|
8413
8664
|
}
|
|
8414
|
-
return [
|
|
8415
|
-
case 2:
|
|
8416
|
-
e_3 = _e.sent();
|
|
8417
|
-
console.error(e_3);
|
|
8418
|
-
return [3 /*break*/, 3];
|
|
8419
|
-
case 3: return [2 /*return*/];
|
|
8665
|
+
return [2 /*return*/];
|
|
8420
8666
|
}
|
|
8421
8667
|
});
|
|
8422
8668
|
});
|
|
@@ -9300,7 +9546,7 @@ var EntityRenderManager;
|
|
|
9300
9546
|
EntityRenderManager.Manager = Manager;
|
|
9301
9547
|
})(EntityRenderManager || (EntityRenderManager = {}));
|
|
9302
9548
|
|
|
9303
|
-
function colorToCColor$
|
|
9549
|
+
function colorToCColor$3(color) {
|
|
9304
9550
|
return new Color(color.red ? color.red / 255 : 0, color.green ? color.green / 255 : 0, color.blue ? color.blue / 255 : 0, color.alpha);
|
|
9305
9551
|
}
|
|
9306
9552
|
/**
|
|
@@ -10116,7 +10362,7 @@ var TilesetRenderEngine;
|
|
|
10116
10362
|
}
|
|
10117
10363
|
var bColor = ((_a = style.modelStyle) === null || _a === void 0 ? void 0 : _a.fillColor) ? Calculator.GetColor(style.modelStyle.fillColor, data, []) : null;
|
|
10118
10364
|
if (bColor != null) {
|
|
10119
|
-
var cColor = colorToCColor$
|
|
10365
|
+
var cColor = colorToCColor$3(bColor);
|
|
10120
10366
|
var visual = entity.visual;
|
|
10121
10367
|
if (visual && visual instanceof Cesium3DTileFeature) {
|
|
10122
10368
|
visual.color = cColor;
|
|
@@ -20108,7 +20354,7 @@ var CesiumViewMonitor;
|
|
|
20108
20354
|
CesiumViewMonitor$$1.Monitor = Monitor;
|
|
20109
20355
|
})(CesiumViewMonitor || (CesiumViewMonitor = {}));
|
|
20110
20356
|
|
|
20111
|
-
var VERSION$1 = "3.3.
|
|
20357
|
+
var VERSION$1 = "3.3.8";
|
|
20112
20358
|
|
|
20113
20359
|
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 };
|
|
20114
20360
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|