bruce-cesium 5.5.5 → 5.5.7
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 +253 -21
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +244 -19
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +2 -1
- package/dist/lib/bruce-cesium.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +9 -0
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js +2 -0
- package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/entities/entities-datalab-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +1 -0
- 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 +2 -0
- 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 +2 -0
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +216 -0
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -0
- package/dist/lib/rendering/render-managers/other/google-search-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/other/google-search-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/other/legacy-relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js +4 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-arb-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +4 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js +5 -2
- package/dist/lib/rendering/render-managers/tilesets/tileset-entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js +1 -0
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +12 -14
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +2 -1
- package/dist/types/rendering/render-managers/other/assembly-render-manager.d.ts +35 -0
- package/dist/types/rendering/visuals-register.d.ts +1 -0
- package/package.json +2 -2
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -13249,6 +13249,7 @@
|
|
|
13249
13249
|
groups.push(group);
|
|
13250
13250
|
applyStyle(thing, entityId, group.data);
|
|
13251
13251
|
const rego = {
|
|
13252
|
+
canEdit: true,
|
|
13252
13253
|
entityId: entityId,
|
|
13253
13254
|
menuItemId: this.item.id,
|
|
13254
13255
|
menuItemType: this.item.Type,
|
|
@@ -13398,6 +13399,7 @@
|
|
|
13398
13399
|
const wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
13399
13400
|
const tagIds = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e["Layer.ID"];
|
|
13400
13401
|
const rego = {
|
|
13402
|
+
canEdit: true,
|
|
13401
13403
|
entityId: id,
|
|
13402
13404
|
schemaId: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
|
|
13403
13405
|
menuItemId: this.item.id,
|
|
@@ -14116,6 +14118,7 @@
|
|
|
14116
14118
|
groups.push(group);
|
|
14117
14119
|
applyStyle(thing, entityId, group.data);
|
|
14118
14120
|
const rego = {
|
|
14121
|
+
canEdit: true,
|
|
14119
14122
|
entityId: entityId,
|
|
14120
14123
|
menuItemId: this.item.id,
|
|
14121
14124
|
menuItemType: this.item.Type,
|
|
@@ -14214,6 +14217,7 @@
|
|
|
14214
14217
|
if (!visual || visual != cEntity) {
|
|
14215
14218
|
this.visualsManager.AddRego({
|
|
14216
14219
|
rego: {
|
|
14220
|
+
canEdit: true,
|
|
14217
14221
|
entityId: id,
|
|
14218
14222
|
menuItemId: this.item.id,
|
|
14219
14223
|
menuItemType: this.item.Type,
|
|
@@ -14536,6 +14540,7 @@
|
|
|
14536
14540
|
const clustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
14537
14541
|
this.visualsManager.AddRego({
|
|
14538
14542
|
rego: {
|
|
14543
|
+
canEdit: true,
|
|
14539
14544
|
entityId: id,
|
|
14540
14545
|
menuItemId: this.item.id,
|
|
14541
14546
|
menuItemType: this.item.Type,
|
|
@@ -14855,6 +14860,7 @@
|
|
|
14855
14860
|
if (!visual || visual != cEntity) {
|
|
14856
14861
|
this.visualsManager.AddRego({
|
|
14857
14862
|
rego: {
|
|
14863
|
+
canEdit: true,
|
|
14858
14864
|
entityId: entity.Bruce.ID,
|
|
14859
14865
|
menuItemId: this.item.id,
|
|
14860
14866
|
menuItemType: this.item.Type,
|
|
@@ -15959,20 +15965,18 @@
|
|
|
15959
15965
|
}
|
|
15960
15966
|
}
|
|
15961
15967
|
else {
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
|
|
15974
|
-
root.updateTransform();
|
|
15975
|
-
}
|
|
15968
|
+
const translationMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(EnsureNumber(transform.x), EnsureNumber(transform.y), EnsureNumber(transform.z)), new Cesium.Matrix4());
|
|
15969
|
+
const pos3d = Cesium.Cartesian3.fromDegrees(EnsureNumber(location === null || location === void 0 ? void 0 : location.longitude), EnsureNumber(location === null || location === void 0 ? void 0 : location.latitude), EnsureNumber(location === null || location === void 0 ? void 0 : location.altitude));
|
|
15970
|
+
const m1 = Cesium.Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
15971
|
+
const hpr = Cesium.HeadingPitchRoll.fromDegrees(EnsureNumber(transform.heading), EnsureNumber(transform.pitch), EnsureNumber(transform.roll), new Cesium.HeadingPitchRoll());
|
|
15972
|
+
const hprRotation = Cesium.Matrix3.fromHeadingPitchRoll(hpr);
|
|
15973
|
+
const scaleMatrix = Cesium.Matrix4.fromUniformScale(EnsureNumber(transform.scale), new Cesium.Matrix4());
|
|
15974
|
+
let combinedMatrix = Cesium.Matrix4.multiply(m1, translationMatrix, new Cesium.Matrix4());
|
|
15975
|
+
combinedMatrix = Cesium.Matrix4.multiply(combinedMatrix, Cesium.Matrix4.fromRotation(hprRotation), new Cesium.Matrix4());
|
|
15976
|
+
combinedMatrix = Cesium.Matrix4.multiply(combinedMatrix, scaleMatrix, new Cesium.Matrix4());
|
|
15977
|
+
root.transform = combinedMatrix;
|
|
15978
|
+
// Force matrix to update
|
|
15979
|
+
root.updateTransform();
|
|
15976
15980
|
}
|
|
15977
15981
|
// Store data in the tileset as we can't interpret it using the cesium primitive later.
|
|
15978
15982
|
const cTilesetExt = cTileset;
|
|
@@ -17543,14 +17547,17 @@
|
|
|
17543
17547
|
*/
|
|
17544
17548
|
mapTilesetFeature(feature, add) {
|
|
17545
17549
|
var _a, _b, _c, _d, _e;
|
|
17550
|
+
const accountId = (_b = ((_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID)) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
17551
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
17546
17552
|
let rego = {
|
|
17553
|
+
canEdit: canEdit,
|
|
17547
17554
|
entityId: null,
|
|
17548
17555
|
entityTypeId: null,
|
|
17549
17556
|
menuItemId: this.item.id,
|
|
17550
17557
|
menuItemType: this.item.Type,
|
|
17551
17558
|
priority: this.renderPriority,
|
|
17552
17559
|
visual: feature,
|
|
17553
|
-
accountId:
|
|
17560
|
+
accountId: accountId,
|
|
17554
17561
|
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
17555
17562
|
tilesetType: BModels.Tileset.EType.Cad,
|
|
17556
17563
|
rootId: this.rootId,
|
|
@@ -18162,6 +18169,7 @@
|
|
|
18162
18169
|
if (!rego) {
|
|
18163
18170
|
this.visualsManager.AddRego({
|
|
18164
18171
|
rego: {
|
|
18172
|
+
canEdit: true,
|
|
18165
18173
|
entityId: id,
|
|
18166
18174
|
menuItemId: this.item.id,
|
|
18167
18175
|
menuItemType: this.item.Type,
|
|
@@ -18508,6 +18516,7 @@
|
|
|
18508
18516
|
// Doesn't exist. Create a rego.
|
|
18509
18517
|
else {
|
|
18510
18518
|
rego = {
|
|
18519
|
+
canEdit: false,
|
|
18511
18520
|
entityId: bruceId,
|
|
18512
18521
|
menuItemId: this.item.id,
|
|
18513
18522
|
menuItemType: this.item.Type,
|
|
@@ -18787,16 +18796,19 @@
|
|
|
18787
18796
|
}
|
|
18788
18797
|
}
|
|
18789
18798
|
if (id) {
|
|
18799
|
+
const accountId = (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
18800
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
18790
18801
|
const rego = {
|
|
18802
|
+
canEdit: canEdit,
|
|
18791
18803
|
entityId: id,
|
|
18792
18804
|
entityTypeId: this.typeId,
|
|
18793
18805
|
menuItemId: this.item.id,
|
|
18794
18806
|
menuItemType: this.item.Type,
|
|
18795
18807
|
priority: this.renderPriority,
|
|
18796
18808
|
visual: feature,
|
|
18797
|
-
tilesetId: (
|
|
18809
|
+
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
18798
18810
|
tilesetType: BModels.Tileset.EType.EntitiesSet,
|
|
18799
|
-
accountId:
|
|
18811
|
+
accountId: accountId
|
|
18800
18812
|
};
|
|
18801
18813
|
this.visualsManager.AddRego({
|
|
18802
18814
|
rego,
|
|
@@ -19334,14 +19346,17 @@
|
|
|
19334
19346
|
}
|
|
19335
19347
|
mapTilesetFeature(feature) {
|
|
19336
19348
|
var _a, _b, _c, _d;
|
|
19349
|
+
const accountId = (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
19350
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
19337
19351
|
let rego = {
|
|
19352
|
+
canEdit: canEdit,
|
|
19338
19353
|
entityId: null,
|
|
19339
19354
|
entityTypeId: null,
|
|
19340
19355
|
menuItemId: this.item.id,
|
|
19341
19356
|
menuItemType: this.item.Type,
|
|
19342
19357
|
priority: this.renderPriority,
|
|
19343
19358
|
visual: feature,
|
|
19344
|
-
accountId:
|
|
19359
|
+
accountId: accountId,
|
|
19345
19360
|
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
19346
19361
|
tilesetType: this.tilesetType
|
|
19347
19362
|
};
|
|
@@ -19743,6 +19758,7 @@
|
|
|
19743
19758
|
if (!visual || visual != cEntity) {
|
|
19744
19759
|
this.register.AddRego({
|
|
19745
19760
|
rego: {
|
|
19761
|
+
canEdit: false,
|
|
19746
19762
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : BModels.ObjectUtils.UId(),
|
|
19747
19763
|
menuItemId: this.item.id,
|
|
19748
19764
|
menuItemType: this.item.Type,
|
|
@@ -20120,6 +20136,7 @@
|
|
|
20120
20136
|
if (!visual || visual != cEntity) {
|
|
20121
20137
|
this.register.AddRego({
|
|
20122
20138
|
rego: {
|
|
20139
|
+
canEdit: false,
|
|
20123
20140
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : BModels.ObjectUtils.UId(),
|
|
20124
20141
|
menuItemId: this.item.id,
|
|
20125
20142
|
menuItemType: this.item.Type,
|
|
@@ -20416,6 +20433,7 @@
|
|
|
20416
20433
|
if (vehicleEntity) {
|
|
20417
20434
|
this.register.AddRego({
|
|
20418
20435
|
rego: {
|
|
20436
|
+
canEdit: false,
|
|
20419
20437
|
entityId: vehicleEntityId,
|
|
20420
20438
|
menuItemId: this.item.id,
|
|
20421
20439
|
menuItemType: this.item.Type,
|
|
@@ -20439,6 +20457,7 @@
|
|
|
20439
20457
|
if (nextspaceEntityId) {
|
|
20440
20458
|
this.register.AddRego({
|
|
20441
20459
|
rego: {
|
|
20460
|
+
canEdit: false,
|
|
20442
20461
|
entityId: nextspaceEntityId,
|
|
20443
20462
|
menuItemId: this.item.id,
|
|
20444
20463
|
menuItemType: this.item.Type,
|
|
@@ -21023,6 +21042,7 @@
|
|
|
21023
21042
|
});
|
|
21024
21043
|
this.register.AddRego({
|
|
21025
21044
|
rego: {
|
|
21045
|
+
canEdit: false,
|
|
21026
21046
|
// If we ever want the user to be able to create a Nextspace record-
|
|
21027
21047
|
//we must match this logic with the OSM logic.
|
|
21028
21048
|
entityId: itemId,
|
|
@@ -21226,6 +21246,203 @@
|
|
|
21226
21246
|
return window["google"];
|
|
21227
21247
|
}
|
|
21228
21248
|
|
|
21249
|
+
(function (AssemblyRenderManager) {
|
|
21250
|
+
class Manager {
|
|
21251
|
+
get Disposed() {
|
|
21252
|
+
return this.disposed;
|
|
21253
|
+
}
|
|
21254
|
+
constructor(params) {
|
|
21255
|
+
this.disposed = false;
|
|
21256
|
+
// Cache of the hierarchy so that our scene-tree can reference it.
|
|
21257
|
+
this.hierarchy = null;
|
|
21258
|
+
const { viewer, register: visualsManager, getters, item } = params;
|
|
21259
|
+
this.viewer = viewer;
|
|
21260
|
+
this.getters = getters;
|
|
21261
|
+
this.item = item;
|
|
21262
|
+
this.visualsManager = visualsManager;
|
|
21263
|
+
}
|
|
21264
|
+
Init() {
|
|
21265
|
+
this.renderPriority = this.item.renderPriority;
|
|
21266
|
+
if (this.renderPriority == null) {
|
|
21267
|
+
this.renderPriority = 1;
|
|
21268
|
+
}
|
|
21269
|
+
(async () => {
|
|
21270
|
+
var _a;
|
|
21271
|
+
if (this.disposed) {
|
|
21272
|
+
return;
|
|
21273
|
+
}
|
|
21274
|
+
try {
|
|
21275
|
+
const flatEntityIds = [];
|
|
21276
|
+
let rootId = null;
|
|
21277
|
+
{
|
|
21278
|
+
const hierarchy = await this.getters.GetBruceApi().GET(`v3/assembly/${this.item["Assembly.ID"]}/hierarchy`);
|
|
21279
|
+
this.hierarchy = hierarchy;
|
|
21280
|
+
if (this.disposed) {
|
|
21281
|
+
return;
|
|
21282
|
+
}
|
|
21283
|
+
const traverseHierarchy = (node, leavesOnly) => {
|
|
21284
|
+
var _a;
|
|
21285
|
+
if (node.Children) {
|
|
21286
|
+
for (let i = 0; i < node.Children.length; i++) {
|
|
21287
|
+
traverseHierarchy(node.Children[i], leavesOnly);
|
|
21288
|
+
}
|
|
21289
|
+
}
|
|
21290
|
+
const addNode = !leavesOnly || !((_a = node.Children) === null || _a === void 0 ? void 0 : _a.length);
|
|
21291
|
+
if (addNode && node.ID && !flatEntityIds.includes(node.ID)) {
|
|
21292
|
+
flatEntityIds.push(node.ID);
|
|
21293
|
+
}
|
|
21294
|
+
};
|
|
21295
|
+
if (hierarchy === null || hierarchy === void 0 ? void 0 : hierarchy.Root) {
|
|
21296
|
+
traverseHierarchy(hierarchy.Root, true);
|
|
21297
|
+
rootId = hierarchy.Root.ID;
|
|
21298
|
+
}
|
|
21299
|
+
}
|
|
21300
|
+
if (this.disposed) {
|
|
21301
|
+
return;
|
|
21302
|
+
}
|
|
21303
|
+
const BATCH_SIZE = 200;
|
|
21304
|
+
let batches = Math.ceil(flatEntityIds.length / BATCH_SIZE);
|
|
21305
|
+
for (let i = 0; i < batches; i++) {
|
|
21306
|
+
const batch = flatEntityIds.slice(i * BATCH_SIZE, (i + 1) * BATCH_SIZE);
|
|
21307
|
+
if (!batch.length) {
|
|
21308
|
+
continue;
|
|
21309
|
+
}
|
|
21310
|
+
const { entities } = await BModels.Entity.GetListByIds({
|
|
21311
|
+
entityIds: batch,
|
|
21312
|
+
api: this.getters.GetBruceApi(),
|
|
21313
|
+
expandLODs: true,
|
|
21314
|
+
expandLocation: true
|
|
21315
|
+
});
|
|
21316
|
+
if (this.disposed) {
|
|
21317
|
+
return;
|
|
21318
|
+
}
|
|
21319
|
+
for (const entity of entities) {
|
|
21320
|
+
const lod = entity.Bruce.LOD ? entity.Bruce.LOD[0] : null;
|
|
21321
|
+
if (!lod || !((_a = lod["ClientFile"]) === null || _a === void 0 ? void 0 : _a.URL)) {
|
|
21322
|
+
// Won't bother with vector data for this experiment.
|
|
21323
|
+
continue;
|
|
21324
|
+
}
|
|
21325
|
+
const pos3d = calcEntityLocation(entity);
|
|
21326
|
+
const orient = calcEntityOrientation(entity, pos3d);
|
|
21327
|
+
if (!pos3d || !orient) {
|
|
21328
|
+
continue;
|
|
21329
|
+
}
|
|
21330
|
+
const cEntity = this.viewer.entities.add({
|
|
21331
|
+
model: {
|
|
21332
|
+
uri: lod["ClientFile"].URL,
|
|
21333
|
+
heightReference: Cesium.HeightReference.NONE
|
|
21334
|
+
},
|
|
21335
|
+
// point: {
|
|
21336
|
+
// pixelSize: 50,
|
|
21337
|
+
// disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
21338
|
+
// color: Cesium.Color.fromCssColorString("#FF0000"),
|
|
21339
|
+
// heightReference: Cesium.HeightReference.NONE
|
|
21340
|
+
// },
|
|
21341
|
+
position: pos3d,
|
|
21342
|
+
orientation: new Cesium.ConstantProperty(orient)
|
|
21343
|
+
});
|
|
21344
|
+
this.visualsManager.AddRego({
|
|
21345
|
+
rego: {
|
|
21346
|
+
canEdit: false,
|
|
21347
|
+
entityId: entity.Bruce.ID,
|
|
21348
|
+
menuItemId: this.item.id,
|
|
21349
|
+
menuItemType: this.item.Type,
|
|
21350
|
+
priority: this.renderPriority,
|
|
21351
|
+
visual: cEntity,
|
|
21352
|
+
accountId: this.getters.GetAccountId(),
|
|
21353
|
+
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
21354
|
+
name: entity.Bruce.Name,
|
|
21355
|
+
rootId: rootId
|
|
21356
|
+
},
|
|
21357
|
+
requestRender: false
|
|
21358
|
+
});
|
|
21359
|
+
}
|
|
21360
|
+
this.viewer.scene.requestRender();
|
|
21361
|
+
}
|
|
21362
|
+
}
|
|
21363
|
+
catch (e) {
|
|
21364
|
+
console.error("AssemblyRenderManager.Manager.Init()", e);
|
|
21365
|
+
}
|
|
21366
|
+
})();
|
|
21367
|
+
}
|
|
21368
|
+
Dispose() {
|
|
21369
|
+
if (this.disposed) {
|
|
21370
|
+
return;
|
|
21371
|
+
}
|
|
21372
|
+
this.disposed = true;
|
|
21373
|
+
this.visualsManager.RemoveRegos({
|
|
21374
|
+
menuItemId: this.item.id
|
|
21375
|
+
});
|
|
21376
|
+
}
|
|
21377
|
+
async ReRender(params) {
|
|
21378
|
+
let { entityIds, force, entities } = params;
|
|
21379
|
+
if (entities && !entityIds) {
|
|
21380
|
+
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
21381
|
+
}
|
|
21382
|
+
}
|
|
21383
|
+
}
|
|
21384
|
+
AssemblyRenderManager.Manager = Manager;
|
|
21385
|
+
})(exports.AssemblyRenderManager || (exports.AssemblyRenderManager = {}));
|
|
21386
|
+
const axis_shift = new Cesium.Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
21387
|
+
function calcEntityLocation(entity) {
|
|
21388
|
+
const aRootLocation = entity.Bruce.AssemblyRootLocation;
|
|
21389
|
+
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
21390
|
+
if (!worldPosition) {
|
|
21391
|
+
return null;
|
|
21392
|
+
}
|
|
21393
|
+
let offset = new Cesium.Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
21394
|
+
let heading = 0;
|
|
21395
|
+
let pitch = 0;
|
|
21396
|
+
let roll = 0;
|
|
21397
|
+
{
|
|
21398
|
+
const eTransform = entity.Bruce.Transform;
|
|
21399
|
+
if (eTransform) {
|
|
21400
|
+
if (eTransform.heading) {
|
|
21401
|
+
heading = eTransform.heading;
|
|
21402
|
+
}
|
|
21403
|
+
if (eTransform.pitch) {
|
|
21404
|
+
pitch = eTransform.pitch;
|
|
21405
|
+
}
|
|
21406
|
+
if (eTransform.roll) {
|
|
21407
|
+
roll = eTransform.roll;
|
|
21408
|
+
}
|
|
21409
|
+
}
|
|
21410
|
+
}
|
|
21411
|
+
let pos3d = Cesium.Cartesian3.fromDegrees(EnsureNumber(aRootLocation.longitude), EnsureNumber(aRootLocation.latitude), EnsureNumber(aRootLocation.altitude));
|
|
21412
|
+
const m1 = Cesium.Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
21413
|
+
const hpr = Cesium.HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll), new Cesium.HeadingPitchRoll());
|
|
21414
|
+
const transform = Cesium.Matrix3.fromHeadingPitchRoll(hpr);
|
|
21415
|
+
const transformedOffset = Cesium.Matrix3.multiplyByVector(transform, offset, new Cesium.Cartesian3());
|
|
21416
|
+
pos3d = Cesium.Matrix4.multiplyByPoint(m1, transformedOffset, new Cesium.Cartesian3());
|
|
21417
|
+
return pos3d;
|
|
21418
|
+
}
|
|
21419
|
+
function calcEntityOrientation(entity, pos3d) {
|
|
21420
|
+
var _a, _b, _c;
|
|
21421
|
+
if (!entity.Bruce || !pos3d) {
|
|
21422
|
+
return null;
|
|
21423
|
+
}
|
|
21424
|
+
let hpr = Cesium.HeadingPitchRoll.fromDegrees(((_a = entity.Bruce.Transform) === null || _a === void 0 ? void 0 : _a.heading) || 90, ((_b = entity.Bruce.Transform) === null || _b === void 0 ? void 0 : _b.pitch) || 0, ((_c = entity.Bruce.Transform) === null || _c === void 0 ? void 0 : _c.roll) || 0);
|
|
21425
|
+
let orientation = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
21426
|
+
if (entity.Bruce.AssemblyWorldPosition) {
|
|
21427
|
+
// extract rot, scale
|
|
21428
|
+
const awp = entity.Bruce.AssemblyWorldPosition;
|
|
21429
|
+
const mawp = new Cesium.Matrix4(+awp[0][0], +awp[0][1], +awp[0][2], +awp[0][3], +awp[1][0], +awp[1][1], +awp[1][2], +awp[1][3], +awp[2][0], +awp[2][1], +awp[2][2], +awp[2][3], +awp[3][0], +awp[3][1], +awp[3][2], +awp[3][3]);
|
|
21430
|
+
let rotmat = new Cesium.Matrix3();
|
|
21431
|
+
rotmat = Cesium.Matrix4.getRotation(mawp, rotmat);
|
|
21432
|
+
// chuck on a heading rotation of +90
|
|
21433
|
+
// according to docs, that is around -z
|
|
21434
|
+
// https://cesium.com/learn/ion-sdk/ref-doc/HeadingPitchRoll.html
|
|
21435
|
+
// see axis_shift quat defined above (could possibly be -ve z value)
|
|
21436
|
+
const q = Cesium.Quaternion.fromRotationMatrix(rotmat);
|
|
21437
|
+
hpr = Cesium.HeadingPitchRoll.fromQuaternion(q);
|
|
21438
|
+
orientation = Cesium.Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
21439
|
+
// add another h +90, quats multiply to concat rotations - but are not
|
|
21440
|
+
// subject to order of rotation like HPR
|
|
21441
|
+
orientation = Cesium.Quaternion.multiply(orientation, axis_shift, new Cesium.Quaternion());
|
|
21442
|
+
}
|
|
21443
|
+
return orientation;
|
|
21444
|
+
}
|
|
21445
|
+
|
|
21229
21446
|
(function (MenuItemManager) {
|
|
21230
21447
|
class Manager {
|
|
21231
21448
|
get Getters() {
|
|
@@ -21409,6 +21626,14 @@
|
|
|
21409
21626
|
item: params.item
|
|
21410
21627
|
});
|
|
21411
21628
|
break;
|
|
21629
|
+
case BModels.MenuItem.EType.Assembly:
|
|
21630
|
+
rItem.renderManager = new exports.AssemblyRenderManager.Manager({
|
|
21631
|
+
viewer: this.viewer,
|
|
21632
|
+
register: this.visualsRegister,
|
|
21633
|
+
getters: params.getters,
|
|
21634
|
+
item: params.item
|
|
21635
|
+
});
|
|
21636
|
+
break;
|
|
21412
21637
|
case BModels.MenuItem.EType.Osm:
|
|
21413
21638
|
rItem.renderManager = new exports.TilesetOsmRenderManager.Manager({
|
|
21414
21639
|
viewer: this.viewer,
|
|
@@ -31124,7 +31349,7 @@
|
|
|
31124
31349
|
}
|
|
31125
31350
|
}
|
|
31126
31351
|
|
|
31127
|
-
const VERSION = "5.5.
|
|
31352
|
+
const VERSION = "5.5.7";
|
|
31128
31353
|
|
|
31129
31354
|
exports.VERSION = VERSION;
|
|
31130
31355
|
exports.isHistoricMetadataChanged = isHistoricMetadataChanged;
|