bruce-cesium 5.8.7 → 5.8.9
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 +299 -85
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +298 -84
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/menu-item-manager.js +64 -5
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +22 -11
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +29 -6
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js +25 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-google-photos-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js +26 -12
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +13 -1
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +22 -3
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/lib/widgets/widget-info-view.js +220 -45
- package/dist/lib/widgets/widget-info-view.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-ids-render-manager.d.ts +5 -1
- package/dist/types/rendering/render-managers/tilesets/tileset-google-photos-render-manager.d.ts +3 -1
- package/dist/types/rendering/render-managers/tilesets/tileset-osm-render-manager.d.ts +5 -2
- package/dist/types/widgets/widget-info-view.d.ts +0 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -3374,11 +3374,31 @@
|
|
|
3374
3374
|
if (!worldPosition) {
|
|
3375
3375
|
return null;
|
|
3376
3376
|
}
|
|
3377
|
-
let offset
|
|
3377
|
+
let offset;
|
|
3378
|
+
{
|
|
3379
|
+
// Check if we have rotation/scale components (non-identity 3x3 upper-left matrix).
|
|
3380
|
+
const hasRotationOrScale = Math.abs(+worldPosition[0][0] - 1) > 1e-6 || Math.abs(+worldPosition[0][1]) > 1e-6 || Math.abs(+worldPosition[0][2]) > 1e-6 ||
|
|
3381
|
+
Math.abs(+worldPosition[1][0]) > 1e-6 || Math.abs(+worldPosition[1][1] - 1) > 1e-6 || Math.abs(+worldPosition[1][2]) > 1e-6 ||
|
|
3382
|
+
Math.abs(+worldPosition[2][0]) > 1e-6 || Math.abs(+worldPosition[2][1]) > 1e-6 || Math.abs(+worldPosition[2][2] - 1) > 1e-6;
|
|
3383
|
+
if (hasRotationOrScale) {
|
|
3384
|
+
// Extract translation first.
|
|
3385
|
+
const translation = new Cesium.Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
3386
|
+
// Extract rotation matrix.
|
|
3387
|
+
const mawp = new Cesium.Matrix4(+worldPosition[0][0], +worldPosition[0][1], +worldPosition[0][2], +worldPosition[0][3], +worldPosition[1][0], +worldPosition[1][1], +worldPosition[1][2], +worldPosition[1][3], +worldPosition[2][0], +worldPosition[2][1], +worldPosition[2][2], +worldPosition[2][3], +worldPosition[3][0], +worldPosition[3][1], +worldPosition[3][2], +worldPosition[3][3]);
|
|
3388
|
+
let rotmat = new Cesium.Matrix3();
|
|
3389
|
+
rotmat = Cesium.Matrix4.getRotation(mawp, rotmat);
|
|
3390
|
+
const inverseRotmat = Cesium.Matrix3.transpose(rotmat, new Cesium.Matrix3());
|
|
3391
|
+
offset = Cesium.Matrix3.multiplyByVector(inverseRotmat, translation, new Cesium.Cartesian3());
|
|
3392
|
+
}
|
|
3393
|
+
// For translation-only matrices, extract translation directly.
|
|
3394
|
+
else {
|
|
3395
|
+
offset = new Cesium.Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3378
3398
|
let heading = 0;
|
|
3379
3399
|
let pitch = 0;
|
|
3380
3400
|
let roll = 0;
|
|
3381
|
-
{
|
|
3401
|
+
if (!modelSpace) {
|
|
3382
3402
|
const eTransform = entity.Bruce.Transform;
|
|
3383
3403
|
if (eTransform) {
|
|
3384
3404
|
if (eTransform.heading) {
|
|
@@ -14861,6 +14881,14 @@
|
|
|
14861
14881
|
get Disposed() {
|
|
14862
14882
|
return this.disposed;
|
|
14863
14883
|
}
|
|
14884
|
+
get EntityIds() {
|
|
14885
|
+
var _a, _b;
|
|
14886
|
+
return ((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.BruceEntity) === null || _b === void 0 ? void 0 : _b.EntityIds) || [];
|
|
14887
|
+
}
|
|
14888
|
+
get ZoomControl() {
|
|
14889
|
+
var _a;
|
|
14890
|
+
return ((_a = this.item) === null || _a === void 0 ? void 0 : _a.CameraZoomSettings) || [];
|
|
14891
|
+
}
|
|
14864
14892
|
constructor(params) {
|
|
14865
14893
|
var _a;
|
|
14866
14894
|
this.getter = null;
|
|
@@ -14886,11 +14914,14 @@
|
|
|
14886
14914
|
this.clustering = new PointClustering(visualsManager, this.item.id, (_a = this.item) === null || _a === void 0 ? void 0 : _a.clustering);
|
|
14887
14915
|
}
|
|
14888
14916
|
}
|
|
14889
|
-
Init() {
|
|
14917
|
+
Init(params) {
|
|
14890
14918
|
var _a, _b, _c;
|
|
14891
14919
|
if (this.disposed) {
|
|
14892
14920
|
throw (new Error("This item is disposed."));
|
|
14893
14921
|
}
|
|
14922
|
+
if (params === null || params === void 0 ? void 0 : params.item) {
|
|
14923
|
+
this.item = params.item;
|
|
14924
|
+
}
|
|
14894
14925
|
if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
14895
14926
|
this.item.CameraZoomSettings = [
|
|
14896
14927
|
{
|
|
@@ -14907,19 +14938,19 @@
|
|
|
14907
14938
|
if (this.renderPriority == null) {
|
|
14908
14939
|
this.renderPriority = 2;
|
|
14909
14940
|
}
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
this.
|
|
14915
|
-
|
|
14916
|
-
|
|
14941
|
+
if (!this.getter) {
|
|
14942
|
+
this.getter = new BatchedDataGetter.Getter(this.item.BruceEntity.EntityIds, this.monitor, BATCH_SIZE$2,
|
|
14943
|
+
// Don't emit the same Entity multiple times.
|
|
14944
|
+
true);
|
|
14945
|
+
this.getterSub = this.getter.OnUpdate.Subscribe((ids) => {
|
|
14946
|
+
this.onGetterUpdate(ids);
|
|
14947
|
+
});
|
|
14948
|
+
this.getter.Start();
|
|
14949
|
+
}
|
|
14950
|
+
this.viewerDateTimeDispose();
|
|
14917
14951
|
if (((_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.historic) || ((_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.historicAttrKey)) {
|
|
14918
14952
|
this.viewerDateTimeSub();
|
|
14919
14953
|
}
|
|
14920
|
-
else {
|
|
14921
|
-
this.viewerDateTimeDispose();
|
|
14922
|
-
}
|
|
14923
14954
|
}
|
|
14924
14955
|
Dispose() {
|
|
14925
14956
|
if (this.disposed) {
|
|
@@ -16515,9 +16546,21 @@
|
|
|
16515
16546
|
if (transform.scale <= 0) {
|
|
16516
16547
|
transform.scale = 0.000001;
|
|
16517
16548
|
}
|
|
16518
|
-
// If we're in model-space we'll just go at 0,0 lat/lon.
|
|
16549
|
+
// If we're in model-space we'll just go at 0,0 lat/lon and no h/p/r from the coords.
|
|
16519
16550
|
if (params.modelSpace) {
|
|
16520
16551
|
location = null;
|
|
16552
|
+
transform = {
|
|
16553
|
+
heading: 0,
|
|
16554
|
+
pitch: 0,
|
|
16555
|
+
roll: 0,
|
|
16556
|
+
scale: EnsureNumber(transform.scale, 1),
|
|
16557
|
+
x: 0,
|
|
16558
|
+
y: 0,
|
|
16559
|
+
z: 0
|
|
16560
|
+
};
|
|
16561
|
+
if (transform.scale <= 0) {
|
|
16562
|
+
transform.scale = 0.000001;
|
|
16563
|
+
}
|
|
16521
16564
|
}
|
|
16522
16565
|
/**
|
|
16523
16566
|
* Very cursed.
|
|
@@ -19200,8 +19243,7 @@
|
|
|
19200
19243
|
})(exports.DataLabRenderManager || (exports.DataLabRenderManager = {}));
|
|
19201
19244
|
|
|
19202
19245
|
const MAX_BATCHES = 2;
|
|
19203
|
-
const
|
|
19204
|
-
const BATCH_SIZE_NEW_API = 1000;
|
|
19246
|
+
const BATCH_SIZE$3 = 1000;
|
|
19205
19247
|
const BATCH_DELAY = 200;
|
|
19206
19248
|
const MAX_RANGE = 3000;
|
|
19207
19249
|
(function (TilesetOsmRenderManager) {
|
|
@@ -19215,6 +19257,12 @@
|
|
|
19215
19257
|
get count() {
|
|
19216
19258
|
return ++this.counter;
|
|
19217
19259
|
}
|
|
19260
|
+
get SourceId() {
|
|
19261
|
+
return this.sourceId;
|
|
19262
|
+
}
|
|
19263
|
+
get EntityTypeId() {
|
|
19264
|
+
return this.entityTypeId;
|
|
19265
|
+
}
|
|
19218
19266
|
constructor(params) {
|
|
19219
19267
|
this.disposed = false;
|
|
19220
19268
|
this.cTileset = null;
|
|
@@ -19227,7 +19275,6 @@
|
|
|
19227
19275
|
this.queueCheckInterval = null;
|
|
19228
19276
|
this.processingQueue = 0;
|
|
19229
19277
|
this._osmIdToBruceId = {};
|
|
19230
|
-
this.batchSize = BATCH_SIZE_OLD_API;
|
|
19231
19278
|
const { viewer, register: visualsManager, getters: apiGetter, monitor, item } = params;
|
|
19232
19279
|
this.viewer = viewer;
|
|
19233
19280
|
this.getters = apiGetter;
|
|
@@ -19259,12 +19306,22 @@
|
|
|
19259
19306
|
});
|
|
19260
19307
|
this.featureQueue = [];
|
|
19261
19308
|
}
|
|
19262
|
-
Init() {
|
|
19309
|
+
Init(params) {
|
|
19263
19310
|
var _a, _b;
|
|
19311
|
+
if (params === null || params === void 0 ? void 0 : params.item) {
|
|
19312
|
+
this.item = params.item;
|
|
19313
|
+
}
|
|
19264
19314
|
const menuItem = this.item;
|
|
19265
19315
|
this.sourceId = EnsureNumber((_a = menuItem.BruceEntity) === null || _a === void 0 ? void 0 : _a.SourceId, 0);
|
|
19266
19316
|
this.entityTypeId = (_b = menuItem.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"];
|
|
19267
19317
|
(async () => {
|
|
19318
|
+
if (this.disposed) {
|
|
19319
|
+
return;
|
|
19320
|
+
}
|
|
19321
|
+
else if (this.cTileset) {
|
|
19322
|
+
// Already exists, no need to re-initialize.
|
|
19323
|
+
return;
|
|
19324
|
+
}
|
|
19268
19325
|
const validToken = await exports.ViewerUtils.AssertIonToken(Cesium.Ion.defaultAccessToken);
|
|
19269
19326
|
if (!validToken) {
|
|
19270
19327
|
console.warn("'tileset-osm-render-manager.ts' could not locate a valid Cesium Ion token.");
|
|
@@ -19284,12 +19341,13 @@
|
|
|
19284
19341
|
console.warn("'tileset-osm-render-manager.ts' could not locate a create function for OSM buildings.");
|
|
19285
19342
|
return;
|
|
19286
19343
|
}
|
|
19287
|
-
//
|
|
19288
|
-
|
|
19289
|
-
|
|
19290
|
-
|
|
19291
|
-
|
|
19344
|
+
// See if we already have a cTileset set.
|
|
19345
|
+
// Happens if we re-initialized in quick succession.
|
|
19346
|
+
if (this.cTileset) {
|
|
19347
|
+
cTileset.destroy();
|
|
19348
|
+
return;
|
|
19292
19349
|
}
|
|
19350
|
+
this.cTileset = cTileset;
|
|
19293
19351
|
if (this.disposed) {
|
|
19294
19352
|
if (this.cTileset && !this.cTileset.isDestroyed()) {
|
|
19295
19353
|
this.cTileset.destroy();
|
|
@@ -19297,7 +19355,6 @@
|
|
|
19297
19355
|
}
|
|
19298
19356
|
return;
|
|
19299
19357
|
}
|
|
19300
|
-
this.cTileset = cTileset;
|
|
19301
19358
|
if (this.sourceId) {
|
|
19302
19359
|
if (menuItem.ghostLoading == true) {
|
|
19303
19360
|
this.cTileset.style = new Cesium.Cesium3DTileStyle({
|
|
@@ -19401,7 +19458,7 @@
|
|
|
19401
19458
|
const isClose = this.getIsVisualWithinRange(feature, MAX_RANGE);
|
|
19402
19459
|
if (isClose) {
|
|
19403
19460
|
batch.push(feature);
|
|
19404
|
-
if (batch.length >=
|
|
19461
|
+
if (batch.length >= BATCH_SIZE$3) {
|
|
19405
19462
|
return batch;
|
|
19406
19463
|
}
|
|
19407
19464
|
}
|
|
@@ -19551,7 +19608,7 @@
|
|
|
19551
19608
|
delete this._loadedCesiumEntities[key];
|
|
19552
19609
|
this.totalLoaded -= 1;
|
|
19553
19610
|
removed += 1;
|
|
19554
|
-
if (removed >=
|
|
19611
|
+
if (removed >= BATCH_SIZE$3) {
|
|
19555
19612
|
return true;
|
|
19556
19613
|
}
|
|
19557
19614
|
}
|
|
@@ -20823,9 +20880,33 @@
|
|
|
20823
20880
|
this.cTileset = null;
|
|
20824
20881
|
}
|
|
20825
20882
|
}
|
|
20826
|
-
Init() {
|
|
20883
|
+
Init(params) {
|
|
20884
|
+
if (this.disposed) {
|
|
20885
|
+
return;
|
|
20886
|
+
}
|
|
20887
|
+
if (params === null || params === void 0 ? void 0 : params.item) {
|
|
20888
|
+
this.item = params.item;
|
|
20889
|
+
}
|
|
20827
20890
|
(async () => {
|
|
20828
20891
|
var _a;
|
|
20892
|
+
// If the tileset already exists then we just need to update the style.
|
|
20893
|
+
if (this.cTileset) {
|
|
20894
|
+
const colorCss = this.item.colorMask;
|
|
20895
|
+
if (colorCss) {
|
|
20896
|
+
this.cTileset.style = new Cesium.Cesium3DTileStyle({
|
|
20897
|
+
color: {
|
|
20898
|
+
conditions: [
|
|
20899
|
+
["true", `color("${colorCss}")`]
|
|
20900
|
+
]
|
|
20901
|
+
}
|
|
20902
|
+
});
|
|
20903
|
+
}
|
|
20904
|
+
else {
|
|
20905
|
+
this.cTileset.style = undefined;
|
|
20906
|
+
}
|
|
20907
|
+
this.viewer.scene.requestRender();
|
|
20908
|
+
return;
|
|
20909
|
+
}
|
|
20829
20910
|
const CESIUM = Cesium;
|
|
20830
20911
|
if (!CESIUM.createGooglePhotorealistic3DTileset) {
|
|
20831
20912
|
console.warn("Cesium version does not support 'createGooglePhotorealistic3DTileset' so Google Photos tileset will not be rendered.");
|
|
@@ -22330,7 +22411,7 @@
|
|
|
22330
22411
|
continue;
|
|
22331
22412
|
}
|
|
22332
22413
|
const pos3d = calcEntityLocation$1(entity, this.modelSpace);
|
|
22333
|
-
const orient = calcEntityOrientation(entity, pos3d);
|
|
22414
|
+
const orient = calcEntityOrientation(entity, pos3d, this.modelSpace);
|
|
22334
22415
|
if (!pos3d || !orient) {
|
|
22335
22416
|
continue;
|
|
22336
22417
|
}
|
|
@@ -22348,9 +22429,15 @@
|
|
|
22348
22429
|
position: pos3d,
|
|
22349
22430
|
orientation: new Cesium.ConstantProperty(orient)
|
|
22350
22431
|
});
|
|
22432
|
+
const geometryRadius = BModels.Entity.GetValue({
|
|
22433
|
+
entity: entity,
|
|
22434
|
+
path: ["Bruce", "GeometryRadius"]
|
|
22435
|
+
});
|
|
22436
|
+
cEntity.model["_radius"] = geometryRadius;
|
|
22437
|
+
cEntity.model["_radiusLoaded"] = true;
|
|
22351
22438
|
this.visualsManager.AddRego({
|
|
22352
22439
|
rego: {
|
|
22353
|
-
canEdit:
|
|
22440
|
+
canEdit: true,
|
|
22354
22441
|
entityId: entity.Bruce.ID,
|
|
22355
22442
|
menuItemId: this.item.id,
|
|
22356
22443
|
menuItemType: this.item.Type,
|
|
@@ -22611,7 +22698,7 @@
|
|
|
22611
22698
|
let heading = 0;
|
|
22612
22699
|
let pitch = 0;
|
|
22613
22700
|
let roll = 0;
|
|
22614
|
-
{
|
|
22701
|
+
if (!modelSpace) {
|
|
22615
22702
|
const eTransform = entity.Bruce.Transform;
|
|
22616
22703
|
if (eTransform) {
|
|
22617
22704
|
if (eTransform.heading) {
|
|
@@ -22633,12 +22720,29 @@
|
|
|
22633
22720
|
pos3d = Cesium.Matrix4.multiplyByPoint(m1, transformedOffset, new Cesium.Cartesian3());
|
|
22634
22721
|
return pos3d;
|
|
22635
22722
|
}
|
|
22636
|
-
function calcEntityOrientation(entity, pos3d) {
|
|
22637
|
-
var _a, _b, _c;
|
|
22723
|
+
function calcEntityOrientation(entity, pos3d, modelSpace) {
|
|
22638
22724
|
if (!entity.Bruce || !pos3d) {
|
|
22639
22725
|
return null;
|
|
22640
22726
|
}
|
|
22641
|
-
|
|
22727
|
+
// 0 or 90 for these?
|
|
22728
|
+
let heading = 90;
|
|
22729
|
+
let pitch = 0;
|
|
22730
|
+
let roll = 0;
|
|
22731
|
+
if (!modelSpace) {
|
|
22732
|
+
const eTransform = entity.Bruce.Transform;
|
|
22733
|
+
if (eTransform) {
|
|
22734
|
+
if (eTransform.heading) {
|
|
22735
|
+
heading = eTransform.heading;
|
|
22736
|
+
}
|
|
22737
|
+
if (eTransform.pitch) {
|
|
22738
|
+
pitch = eTransform.pitch;
|
|
22739
|
+
}
|
|
22740
|
+
if (eTransform.roll) {
|
|
22741
|
+
roll = eTransform.roll;
|
|
22742
|
+
}
|
|
22743
|
+
}
|
|
22744
|
+
}
|
|
22745
|
+
let hpr = Cesium.HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll));
|
|
22642
22746
|
let orientation = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
22643
22747
|
if (entity.Bruce.AssemblyWorldPosition) {
|
|
22644
22748
|
// extract rot, scale
|
|
@@ -22727,7 +22831,7 @@
|
|
|
22727
22831
|
* @returns
|
|
22728
22832
|
*/
|
|
22729
22833
|
RenderItem(params) {
|
|
22730
|
-
var _a, _b, _c, _d, _e;
|
|
22834
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
22731
22835
|
if (this.viewer.isDestroyed()) {
|
|
22732
22836
|
return null;
|
|
22733
22837
|
}
|
|
@@ -22749,6 +22853,7 @@
|
|
|
22749
22853
|
}
|
|
22750
22854
|
let rItem = this.items.find(x => x.id == params.item.id);
|
|
22751
22855
|
let create = true;
|
|
22856
|
+
// Item already exists so we'll check if we should re-create it.
|
|
22752
22857
|
if (rItem) {
|
|
22753
22858
|
// This means we're updating a tag menu item.
|
|
22754
22859
|
// Tag menu items have alternative states based on bookmark settings.
|
|
@@ -22797,18 +22902,76 @@
|
|
|
22797
22902
|
create = false;
|
|
22798
22903
|
}
|
|
22799
22904
|
}
|
|
22905
|
+
else if (rItem.type == BModels.MenuItem.EType.PointCloud && params.item.Type == BModels.MenuItem.EType.PointCloud) {
|
|
22906
|
+
if (rItem.renderManager) {
|
|
22907
|
+
create = false;
|
|
22908
|
+
}
|
|
22909
|
+
}
|
|
22910
|
+
else if (rItem.type == BModels.MenuItem.EType.ArbTileset && params.item.Type == BModels.MenuItem.EType.ArbTileset) {
|
|
22911
|
+
if (rItem.renderManager) {
|
|
22912
|
+
create = false;
|
|
22913
|
+
}
|
|
22914
|
+
}
|
|
22915
|
+
else if (rItem.type == BModels.MenuItem.EType.I3sTileset && params.item.Type == BModels.MenuItem.EType.I3sTileset) {
|
|
22916
|
+
if (rItem.renderManager) {
|
|
22917
|
+
create = false;
|
|
22918
|
+
}
|
|
22919
|
+
}
|
|
22800
22920
|
// Re-init in case model-space changed to geo-spatial or vice-versa.
|
|
22801
22921
|
else if (rItem.type == BModels.MenuItem.EType.Assembly && params.item.Type == BModels.MenuItem.EType.Assembly) {
|
|
22802
22922
|
if (rItem.renderManager && rItem.renderManager.ModelSpace == params.modelSpace) {
|
|
22803
22923
|
create = false;
|
|
22804
22924
|
}
|
|
22805
22925
|
}
|
|
22926
|
+
// Updating an existing Google photos tileset.
|
|
22927
|
+
// Eg: different color mask (opacity).
|
|
22928
|
+
else if (rItem.type == BModels.MenuItem.EType.GooglePhotoTileset && params.item.Type == BModels.MenuItem.EType.GooglePhotoTileset) {
|
|
22929
|
+
if (rItem.renderManager) {
|
|
22930
|
+
rItem.renderManager.Init({
|
|
22931
|
+
item: params.item
|
|
22932
|
+
});
|
|
22933
|
+
rItem.item = params.item;
|
|
22934
|
+
create = false;
|
|
22935
|
+
}
|
|
22936
|
+
}
|
|
22937
|
+
else if (rItem.type == BModels.MenuItem.EType.Osm && params.item.Type == BModels.MenuItem.EType.Osm) {
|
|
22938
|
+
// If the source is the same then we can re-use the render manager.
|
|
22939
|
+
const oRenderManager = rItem.renderManager;
|
|
22940
|
+
const oItem = params.item;
|
|
22941
|
+
if (oRenderManager && oItem) {
|
|
22942
|
+
if (+oRenderManager.SourceId == +((_b = oItem.BruceEntity) === null || _b === void 0 ? void 0 : _b.SourceId) && oRenderManager.EntityTypeId == ((_c = oItem.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"])) {
|
|
22943
|
+
oRenderManager.Init({
|
|
22944
|
+
item: oItem
|
|
22945
|
+
});
|
|
22946
|
+
rItem.item = params.item;
|
|
22947
|
+
create = false;
|
|
22948
|
+
}
|
|
22949
|
+
}
|
|
22950
|
+
}
|
|
22951
|
+
else if (rItem.type == BModels.MenuItem.EType.EntitiesIds && params.item.Type == BModels.MenuItem.EType.EntitiesIds) {
|
|
22952
|
+
// Checking for Entity IDs.
|
|
22953
|
+
const eIdsRenderManager = rItem.renderManager;
|
|
22954
|
+
const eIdsItem = params.item;
|
|
22955
|
+
if (eIdsRenderManager && eIdsItem) {
|
|
22956
|
+
const eEntityIds = eIdsRenderManager.EntityIds;
|
|
22957
|
+
const mEntityIds = (_d = eIdsItem.BruceEntity) === null || _d === void 0 ? void 0 : _d.EntityIds;
|
|
22958
|
+
const eEntityIdsStr = eEntityIds ? eEntityIds.join(",") : "";
|
|
22959
|
+
const mEntityIdsStr = mEntityIds ? mEntityIds.join(",") : "";
|
|
22960
|
+
if (eEntityIdsStr == mEntityIdsStr) {
|
|
22961
|
+
eIdsRenderManager.Init({
|
|
22962
|
+
item: eIdsItem
|
|
22963
|
+
});
|
|
22964
|
+
rItem.item = params.item;
|
|
22965
|
+
create = false;
|
|
22966
|
+
}
|
|
22967
|
+
}
|
|
22968
|
+
}
|
|
22806
22969
|
else if (rItem.type != params.item.Type) {
|
|
22807
22970
|
create = true;
|
|
22808
22971
|
}
|
|
22809
22972
|
if (create) {
|
|
22810
22973
|
try {
|
|
22811
|
-
(
|
|
22974
|
+
(_e = rItem.renderManager) === null || _e === void 0 ? void 0 : _e.Dispose();
|
|
22812
22975
|
}
|
|
22813
22976
|
catch (e) {
|
|
22814
22977
|
console.error(e);
|
|
@@ -22819,7 +22982,7 @@
|
|
|
22819
22982
|
if (create) {
|
|
22820
22983
|
if (!rItem) {
|
|
22821
22984
|
rItem = {
|
|
22822
|
-
id: (
|
|
22985
|
+
id: (_f = params.item.id) !== null && _f !== void 0 ? _f : BModels.ObjectUtils.UId(),
|
|
22823
22986
|
childIds: [],
|
|
22824
22987
|
item: params.item,
|
|
22825
22988
|
renderManager: null,
|
|
@@ -23018,8 +23181,8 @@
|
|
|
23018
23181
|
rItem.childIds.push(childId);
|
|
23019
23182
|
}
|
|
23020
23183
|
}
|
|
23021
|
-
if (rItem.renderManager && !((
|
|
23022
|
-
(
|
|
23184
|
+
if (rItem.renderManager && !((_g = rItem.renderManager) === null || _g === void 0 ? void 0 : _g.Disposed)) {
|
|
23185
|
+
(_h = this.onUpdate) === null || _h === void 0 ? void 0 : _h.Trigger({ isEnabling: true, itemId: rItem.id });
|
|
23023
23186
|
}
|
|
23024
23187
|
return rItem.id;
|
|
23025
23188
|
}
|
|
@@ -30849,6 +31012,7 @@
|
|
|
30849
31012
|
EMode["ShowAvailable"] = "AV";
|
|
30850
31013
|
EMode["ShowImportantAndAvailable"] = "IMP_AV";
|
|
30851
31014
|
})(EMode || (EMode = {}));
|
|
31015
|
+
const DISPLAY_ASSEMBLY_INFO = false;
|
|
30852
31016
|
const OPEN_STORAGE_KEY = "EntityViewSummary_open_";
|
|
30853
31017
|
const EXCLUDED_PROPERTIES = ["Bruce", "geometry", "position", "boundaries"];
|
|
30854
31018
|
function isAttributeImportant(mode, entity, path, field) {
|
|
@@ -31085,7 +31249,7 @@
|
|
|
31085
31249
|
flex-shrink: 1;
|
|
31086
31250
|
margin-top: 12px;
|
|
31087
31251
|
overflow: auto;
|
|
31088
|
-
padding:
|
|
31252
|
+
padding: 20px;
|
|
31089
31253
|
width: 100%;
|
|
31090
31254
|
}
|
|
31091
31255
|
|
|
@@ -31096,32 +31260,42 @@
|
|
|
31096
31260
|
width: 100%;
|
|
31097
31261
|
}
|
|
31098
31262
|
|
|
31263
|
+
.NextspaceInfoViewLabel {
|
|
31264
|
+
align-items: center;
|
|
31265
|
+
column-gap: 8px;
|
|
31266
|
+
display: flex;
|
|
31267
|
+
flex-wrap: wrap;
|
|
31268
|
+
margin-top: 12px;
|
|
31269
|
+
max-width: 100%;
|
|
31270
|
+
row-gap: 5px;
|
|
31271
|
+
text-align: left;
|
|
31272
|
+
white-space: nowrap;
|
|
31273
|
+
}
|
|
31274
|
+
|
|
31099
31275
|
.NextspaceInfoViewName {
|
|
31100
31276
|
font-family: Arial;
|
|
31101
31277
|
font-style: normal;
|
|
31102
31278
|
font-weight: 400;
|
|
31103
|
-
|
|
31104
|
-
|
|
31279
|
+
font-size: 12px;
|
|
31280
|
+
letter-spacing: .05em;
|
|
31105
31281
|
color: #40c4ff;
|
|
31106
|
-
|
|
31107
|
-
|
|
31108
|
-
|
|
31109
|
-
|
|
31282
|
+
overflow: hidden;
|
|
31283
|
+
text-overflow: ellipsis;
|
|
31284
|
+
transition: .3s ease;
|
|
31285
|
+
max-width: 100%;
|
|
31286
|
+
width: 100%;
|
|
31287
|
+
width: -webkit-max-content !important;
|
|
31288
|
+
width: max-content !important;
|
|
31110
31289
|
}
|
|
31111
31290
|
|
|
31112
31291
|
.NextspaceInfoViewType {
|
|
31113
31292
|
font-family: Arial;
|
|
31114
31293
|
font-style: normal;
|
|
31115
31294
|
font-weight: 400;
|
|
31116
|
-
|
|
31117
|
-
width: 100%;
|
|
31118
|
-
color: #c1c7cd;
|
|
31119
|
-
font-size: 10px;
|
|
31295
|
+
font-size: 12px;
|
|
31120
31296
|
letter-spacing: .05em;
|
|
31121
|
-
|
|
31122
|
-
|
|
31123
|
-
-webkit-user-select: none;
|
|
31124
|
-
user-select: none;
|
|
31297
|
+
color: #fff;
|
|
31298
|
+
opacity: .7;
|
|
31125
31299
|
}
|
|
31126
31300
|
|
|
31127
31301
|
.NextspaceInfoViewTitle {
|
|
@@ -31135,7 +31309,7 @@
|
|
|
31135
31309
|
-webkit-touch-callout: none;
|
|
31136
31310
|
-webkit-user-select: none;
|
|
31137
31311
|
user-select: none;
|
|
31138
|
-
margin-top:
|
|
31312
|
+
margin-top: 10px;
|
|
31139
31313
|
margin-bottom: 10px;
|
|
31140
31314
|
}
|
|
31141
31315
|
|
|
@@ -31157,8 +31331,8 @@
|
|
|
31157
31331
|
|
|
31158
31332
|
.NextspaceAttributesGroupToggle {
|
|
31159
31333
|
align-items: center;
|
|
31160
|
-
background-color: #
|
|
31161
|
-
border: 1px solid #
|
|
31334
|
+
background-color: #293034;
|
|
31335
|
+
border: 1px solid #494949;
|
|
31162
31336
|
border-radius: 5px;
|
|
31163
31337
|
cursor: pointer;
|
|
31164
31338
|
display: flex;
|
|
@@ -31177,13 +31351,11 @@
|
|
|
31177
31351
|
.NextspaceAttributesGroupToggleIcon {
|
|
31178
31352
|
align-items: center;
|
|
31179
31353
|
display: flex;
|
|
31180
|
-
height:
|
|
31354
|
+
height: 15px;
|
|
31181
31355
|
justify-content: center;
|
|
31182
|
-
margin-left: auto;
|
|
31183
31356
|
margin-right: 8px;
|
|
31184
|
-
|
|
31185
|
-
|
|
31186
|
-
white-space: nowrap;
|
|
31357
|
+
position: relative;
|
|
31358
|
+
width: 15px;
|
|
31187
31359
|
}
|
|
31188
31360
|
|
|
31189
31361
|
.NextspaceAttributesGroup[is-opened="false"] .NextspaceAttributesGroupToggleIconOpened {
|
|
@@ -31279,6 +31451,40 @@
|
|
|
31279
31451
|
width: 100%;
|
|
31280
31452
|
user-select: none;
|
|
31281
31453
|
}
|
|
31454
|
+
|
|
31455
|
+
.NextspaceInputRow {
|
|
31456
|
+
display: flex;
|
|
31457
|
+
flex-direction: row;
|
|
31458
|
+
align-items: center;
|
|
31459
|
+
margin-bottom: 4px;
|
|
31460
|
+
}
|
|
31461
|
+
|
|
31462
|
+
.NextspaceInputRow > label {
|
|
31463
|
+
flex-grow: 0;
|
|
31464
|
+
flex-shrink: 0;
|
|
31465
|
+
width: 120px;
|
|
31466
|
+
margin-right: 5px;
|
|
31467
|
+
color: #f2f4f8;
|
|
31468
|
+
font-family: Arial;
|
|
31469
|
+
font-size: 14px;
|
|
31470
|
+
font-style: normal;
|
|
31471
|
+
font-weight: 500;
|
|
31472
|
+
line-height: 20px;
|
|
31473
|
+
}
|
|
31474
|
+
|
|
31475
|
+
.NextspaceInputRow > input {
|
|
31476
|
+
width: 100px;
|
|
31477
|
+
flex-grow: 1;
|
|
31478
|
+
flex-shrink: 1;
|
|
31479
|
+
background-color: #121619;
|
|
31480
|
+
border: 1px solid #434343;
|
|
31481
|
+
border-radius: 5px;
|
|
31482
|
+
display: flex;
|
|
31483
|
+
height: 35px;
|
|
31484
|
+
color: #fff;
|
|
31485
|
+
font-size: 12px;
|
|
31486
|
+
outline: none;
|
|
31487
|
+
}
|
|
31282
31488
|
`;
|
|
31283
31489
|
document.head.appendChild(style);
|
|
31284
31490
|
}
|
|
@@ -31317,13 +31523,16 @@
|
|
|
31317
31523
|
const scrollBox = document.createElement("div");
|
|
31318
31524
|
scrollBox.className = "NextspaceInfoViewScrollBox";
|
|
31319
31525
|
content.appendChild(scrollBox);
|
|
31526
|
+
const label = document.createElement("div");
|
|
31527
|
+
label.className = "NextspaceInfoViewLabel";
|
|
31528
|
+
scrollBox.appendChild(label);
|
|
31320
31529
|
const name = document.createElement("div");
|
|
31321
31530
|
name.className = "NextspaceInfoViewName";
|
|
31322
|
-
|
|
31531
|
+
label.appendChild(name);
|
|
31323
31532
|
this._name = name;
|
|
31324
31533
|
const type = document.createElement("div");
|
|
31325
31534
|
type.className = "NextspaceInfoViewType";
|
|
31326
|
-
|
|
31535
|
+
label.appendChild(type);
|
|
31327
31536
|
this._type = type;
|
|
31328
31537
|
const imageContainer = document.createElement("div");
|
|
31329
31538
|
imageContainer.className = "NextspaceDefaultImageContainer";
|
|
@@ -31333,11 +31542,6 @@
|
|
|
31333
31542
|
scrollBox.appendChild(imageContainer);
|
|
31334
31543
|
this._imageContainer = imageContainer;
|
|
31335
31544
|
this._image = image;
|
|
31336
|
-
const title = document.createElement("div");
|
|
31337
|
-
title.className = "NextspaceInfoViewTitle";
|
|
31338
|
-
title.innerText = "Details";
|
|
31339
|
-
scrollBox.appendChild(title);
|
|
31340
|
-
this._title = title;
|
|
31341
31545
|
const summary = document.createElement("div");
|
|
31342
31546
|
summary.className = "NextspaceInfoViewSummary";
|
|
31343
31547
|
scrollBox.appendChild(summary);
|
|
@@ -31361,7 +31565,7 @@
|
|
|
31361
31565
|
}
|
|
31362
31566
|
}
|
|
31363
31567
|
async _updateInfoView() {
|
|
31364
|
-
var
|
|
31568
|
+
var _b, _c, _d;
|
|
31365
31569
|
const selectedIds = this._manager.VisualsRegister.GetSelected();
|
|
31366
31570
|
if (selectedIds.length <= 0) {
|
|
31367
31571
|
this._element.style.display = "none";
|
|
@@ -31377,9 +31581,8 @@
|
|
|
31377
31581
|
}
|
|
31378
31582
|
this._lastSelectedId = firstId;
|
|
31379
31583
|
try {
|
|
31380
|
-
this._title.style.display = "none";
|
|
31381
31584
|
this._flyTo.style.display = "none";
|
|
31382
|
-
this._name.innerText = "Loading
|
|
31585
|
+
this._name.innerText = "Loading..";
|
|
31383
31586
|
this._type.innerText = "";
|
|
31384
31587
|
this._summary.innerHTML = "";
|
|
31385
31588
|
this._imageContainer.style.display = "none";
|
|
@@ -31387,13 +31590,14 @@
|
|
|
31387
31590
|
const { entity } = await BModels.Entity.Get({
|
|
31388
31591
|
entityId: firstId,
|
|
31389
31592
|
api: api,
|
|
31390
|
-
migrated: true
|
|
31593
|
+
migrated: true,
|
|
31594
|
+
expandLocation: DISPLAY_ASSEMBLY_INFO
|
|
31391
31595
|
});
|
|
31392
31596
|
if (!entity) {
|
|
31393
31597
|
throw (new Error("Could not get entity."));
|
|
31394
31598
|
}
|
|
31395
31599
|
const { entityType } = await BModels.EntityType.Get({
|
|
31396
|
-
entityTypeId: (
|
|
31600
|
+
entityTypeId: (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b["EntityType.ID"],
|
|
31397
31601
|
api: api
|
|
31398
31602
|
});
|
|
31399
31603
|
let name = BModels.Entity.CalculateName({
|
|
@@ -31404,7 +31608,6 @@
|
|
|
31404
31608
|
if (!name) {
|
|
31405
31609
|
name = "Unnamed Entity";
|
|
31406
31610
|
}
|
|
31407
|
-
this._title.style.display = "block";
|
|
31408
31611
|
this._flyTo.style.display = "flex";
|
|
31409
31612
|
this._name.innerText = name;
|
|
31410
31613
|
this._type.innerText = (entityType === null || entityType === void 0 ? void 0 : entityType.Name) ? entityType.Name : "Unknown type";
|
|
@@ -31424,9 +31627,13 @@
|
|
|
31424
31627
|
});
|
|
31425
31628
|
this._image.style.backgroundImage = `url(${url})`;
|
|
31426
31629
|
}
|
|
31630
|
+
const detailsTitle = document.createElement("div");
|
|
31631
|
+
detailsTitle.className = "NextspaceInfoViewTitle";
|
|
31632
|
+
detailsTitle.innerText = "Details";
|
|
31633
|
+
this._summary.appendChild(detailsTitle);
|
|
31427
31634
|
// TODO: Selection for what mode instead of always doing "all".
|
|
31428
31635
|
const attributes = gatherAttributes(EMode.ShowAll, entity, entityType);
|
|
31429
|
-
const groups = groupAttributes(attributes, (
|
|
31636
|
+
const groups = groupAttributes(attributes, (_d = (_c = entityType.DataSchema) === null || _c === void 0 ? void 0 : _c.Structure) !== null && _d !== void 0 ? _d : []);
|
|
31430
31637
|
for (const group of groups) {
|
|
31431
31638
|
this._generateAttrGroup(entityType, entity, group);
|
|
31432
31639
|
}
|
|
@@ -31434,7 +31641,7 @@
|
|
|
31434
31641
|
catch (e) {
|
|
31435
31642
|
console.error(e);
|
|
31436
31643
|
this._name.innerText = "";
|
|
31437
|
-
this._summary.innerHTML = "<p>Could not read
|
|
31644
|
+
this._summary.innerHTML = "<p>Could not read Entity information</p>";
|
|
31438
31645
|
}
|
|
31439
31646
|
}
|
|
31440
31647
|
_generateAttrGroup(type, entity, group) {
|
|
@@ -31445,11 +31652,11 @@
|
|
|
31445
31652
|
const toggle = document.createElement("div");
|
|
31446
31653
|
toggle.className = "NextspaceAttributesGroupToggle";
|
|
31447
31654
|
toggle.innerHTML = `
|
|
31448
|
-
${group.group.Key}
|
|
31449
31655
|
<div class="NextspaceAttributesGroupToggleIcon">
|
|
31450
31656
|
<svg class="NextspaceAttributesGroupToggleIconOpened" width="16" height="9" viewBox="0 0 16 9" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 1L8 8L1 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
|
|
31451
|
-
<svg class="NextspaceAttributesGroupToggleIconClosed" width="10" height="17" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="
|
|
31657
|
+
<svg class="NextspaceAttributesGroupToggleIconClosed" width="10" height="17" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 1.5L8.5 8.5L1.5 15.5" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>
|
|
31452
31658
|
</div>
|
|
31659
|
+
${group.group.Name ? group.group.Name : group.group.Key}
|
|
31453
31660
|
`;
|
|
31454
31661
|
toggle.addEventListener("click", () => {
|
|
31455
31662
|
const isOpened = groupDiv.getAttribute("is-opened") == "true";
|
|
@@ -31459,17 +31666,24 @@
|
|
|
31459
31666
|
groupDiv.appendChild(toggle);
|
|
31460
31667
|
}
|
|
31461
31668
|
for (const attr of group.attributes) {
|
|
31462
|
-
|
|
31463
|
-
if (group.group.Key != "ROOT") {
|
|
31464
|
-
attrDiv.style.marginLeft = "12px";
|
|
31465
|
-
}
|
|
31669
|
+
this._generateAttr(groupDiv, type, entity, attr, group.group.Key != "ROOT");
|
|
31466
31670
|
}
|
|
31467
31671
|
this._summary.appendChild(groupDiv);
|
|
31468
31672
|
}
|
|
31469
|
-
_generateAttr(container, type, entity, path) {
|
|
31673
|
+
_generateAttr(container, type, entity, path, nested) {
|
|
31470
31674
|
var _a, _b, _c;
|
|
31471
31675
|
const attrDiv = document.createElement("div");
|
|
31472
31676
|
attrDiv.className = "NextspaceAttribute";
|
|
31677
|
+
if (nested) {
|
|
31678
|
+
const nestedIconStr = `
|
|
31679
|
+
<svg width="11" height="13" viewBox="0 0 11 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1V10C1 11.1046 1.89543 12 3 12H10" stroke="#4D5358" stroke-linecap="round" stroke-linejoin="round"></path></svg>
|
|
31680
|
+
`;
|
|
31681
|
+
const nestedIcon = document.createElement("div");
|
|
31682
|
+
nestedIcon.style.marginLeft = "12px";
|
|
31683
|
+
nestedIcon.style.marginRight = "5px";
|
|
31684
|
+
nestedIcon.innerHTML = nestedIconStr;
|
|
31685
|
+
attrDiv.appendChild(nestedIcon);
|
|
31686
|
+
}
|
|
31473
31687
|
const typeItem = digTypeItem(path, (_b = (_a = type.DataSchema) === null || _a === void 0 ? void 0 : _a.Structure) !== null && _b !== void 0 ? _b : []);
|
|
31474
31688
|
const attrType = (_c = typeItem === null || typeItem === void 0 ? void 0 : typeItem.Type) !== null && _c !== void 0 ? _c : BModels.EntityAttribute.EType.String;
|
|
31475
31689
|
const input = document.createElement("div");
|
|
@@ -32774,7 +32988,7 @@
|
|
|
32774
32988
|
}
|
|
32775
32989
|
}
|
|
32776
32990
|
|
|
32777
|
-
const VERSION = "5.8.
|
|
32991
|
+
const VERSION = "5.8.9";
|
|
32778
32992
|
|
|
32779
32993
|
exports.VERSION = VERSION;
|
|
32780
32994
|
exports.isOutlineChanged = isOutlineChanged;
|