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.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileStyle,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -13287,6 +13287,7 @@ var EntitiesRenderManager;
|
|
|
13287
13287
|
groups.push(group);
|
|
13288
13288
|
applyStyle(thing, entityId, group.data);
|
|
13289
13289
|
const rego = {
|
|
13290
|
+
canEdit: true,
|
|
13290
13291
|
entityId: entityId,
|
|
13291
13292
|
menuItemId: this.item.id,
|
|
13292
13293
|
menuItemType: this.item.Type,
|
|
@@ -13436,6 +13437,7 @@ var EntitiesRenderManager;
|
|
|
13436
13437
|
const wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
13437
13438
|
const tagIds = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e["Layer.ID"];
|
|
13438
13439
|
const rego = {
|
|
13440
|
+
canEdit: true,
|
|
13439
13441
|
entityId: id,
|
|
13440
13442
|
schemaId: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
|
|
13441
13443
|
menuItemId: this.item.id,
|
|
@@ -14160,6 +14162,7 @@ var EntitiesLoadedRenderManager;
|
|
|
14160
14162
|
groups.push(group);
|
|
14161
14163
|
applyStyle(thing, entityId, group.data);
|
|
14162
14164
|
const rego = {
|
|
14165
|
+
canEdit: true,
|
|
14163
14166
|
entityId: entityId,
|
|
14164
14167
|
menuItemId: this.item.id,
|
|
14165
14168
|
menuItemType: this.item.Type,
|
|
@@ -14258,6 +14261,7 @@ var EntitiesLoadedRenderManager;
|
|
|
14258
14261
|
if (!visual || visual != cEntity) {
|
|
14259
14262
|
this.visualsManager.AddRego({
|
|
14260
14263
|
rego: {
|
|
14264
|
+
canEdit: true,
|
|
14261
14265
|
entityId: id,
|
|
14262
14266
|
menuItemId: this.item.id,
|
|
14263
14267
|
menuItemType: this.item.Type,
|
|
@@ -14585,6 +14589,7 @@ var EntitiesIdsRenderManager;
|
|
|
14585
14589
|
const clustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
14586
14590
|
this.visualsManager.AddRego({
|
|
14587
14591
|
rego: {
|
|
14592
|
+
canEdit: true,
|
|
14588
14593
|
entityId: id,
|
|
14589
14594
|
menuItemId: this.item.id,
|
|
14590
14595
|
menuItemType: this.item.Type,
|
|
@@ -14908,6 +14913,7 @@ var EntityRenderManager;
|
|
|
14908
14913
|
if (!visual || visual != cEntity) {
|
|
14909
14914
|
this.visualsManager.AddRego({
|
|
14910
14915
|
rego: {
|
|
14916
|
+
canEdit: true,
|
|
14911
14917
|
entityId: entity.Bruce.ID,
|
|
14912
14918
|
menuItemId: this.item.id,
|
|
14913
14919
|
menuItemType: this.item.Type,
|
|
@@ -16013,20 +16019,18 @@ var TilesetRenderEngine;
|
|
|
16013
16019
|
}
|
|
16014
16020
|
}
|
|
16015
16021
|
else {
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
root.updateTransform();
|
|
16029
|
-
}
|
|
16022
|
+
const translationMatrix = Matrix4.fromTranslation(new Cartesian3(EnsureNumber(transform.x), EnsureNumber(transform.y), EnsureNumber(transform.z)), new Matrix4());
|
|
16023
|
+
const pos3d = 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));
|
|
16024
|
+
const m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
16025
|
+
const hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(transform.heading), EnsureNumber(transform.pitch), EnsureNumber(transform.roll), new HeadingPitchRoll());
|
|
16026
|
+
const hprRotation = Matrix3.fromHeadingPitchRoll(hpr);
|
|
16027
|
+
const scaleMatrix = Matrix4.fromUniformScale(EnsureNumber(transform.scale), new Matrix4());
|
|
16028
|
+
let combinedMatrix = Matrix4.multiply(m1, translationMatrix, new Matrix4());
|
|
16029
|
+
combinedMatrix = Matrix4.multiply(combinedMatrix, Matrix4.fromRotation(hprRotation), new Matrix4());
|
|
16030
|
+
combinedMatrix = Matrix4.multiply(combinedMatrix, scaleMatrix, new Matrix4());
|
|
16031
|
+
root.transform = combinedMatrix;
|
|
16032
|
+
// Force matrix to update
|
|
16033
|
+
root.updateTransform();
|
|
16030
16034
|
}
|
|
16031
16035
|
// Store data in the tileset as we can't interpret it using the cesium primitive later.
|
|
16032
16036
|
const cTilesetExt = cTileset;
|
|
@@ -17603,14 +17607,17 @@ var TilesetCadRenderManager;
|
|
|
17603
17607
|
*/
|
|
17604
17608
|
mapTilesetFeature(feature, add) {
|
|
17605
17609
|
var _a, _b, _c, _d, _e;
|
|
17610
|
+
const accountId = (_b = ((_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID)) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
17611
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
17606
17612
|
let rego = {
|
|
17613
|
+
canEdit: canEdit,
|
|
17607
17614
|
entityId: null,
|
|
17608
17615
|
entityTypeId: null,
|
|
17609
17616
|
menuItemId: this.item.id,
|
|
17610
17617
|
menuItemType: this.item.Type,
|
|
17611
17618
|
priority: this.renderPriority,
|
|
17612
17619
|
visual: feature,
|
|
17613
|
-
accountId:
|
|
17620
|
+
accountId: accountId,
|
|
17614
17621
|
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
17615
17622
|
tilesetType: Tileset.EType.Cad,
|
|
17616
17623
|
rootId: this.rootId,
|
|
@@ -18223,6 +18230,7 @@ var DataLabRenderManager;
|
|
|
18223
18230
|
if (!rego) {
|
|
18224
18231
|
this.visualsManager.AddRego({
|
|
18225
18232
|
rego: {
|
|
18233
|
+
canEdit: true,
|
|
18226
18234
|
entityId: id,
|
|
18227
18235
|
menuItemId: this.item.id,
|
|
18228
18236
|
menuItemType: this.item.Type,
|
|
@@ -18570,6 +18578,7 @@ var TilesetOsmRenderManager;
|
|
|
18570
18578
|
// Doesn't exist. Create a rego.
|
|
18571
18579
|
else {
|
|
18572
18580
|
rego = {
|
|
18581
|
+
canEdit: false,
|
|
18573
18582
|
entityId: bruceId,
|
|
18574
18583
|
menuItemId: this.item.id,
|
|
18575
18584
|
menuItemType: this.item.Type,
|
|
@@ -18850,16 +18859,19 @@ var TilesetEntitiesRenderManager;
|
|
|
18850
18859
|
}
|
|
18851
18860
|
}
|
|
18852
18861
|
if (id) {
|
|
18862
|
+
const accountId = (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
18863
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
18853
18864
|
const rego = {
|
|
18865
|
+
canEdit: canEdit,
|
|
18854
18866
|
entityId: id,
|
|
18855
18867
|
entityTypeId: this.typeId,
|
|
18856
18868
|
menuItemId: this.item.id,
|
|
18857
18869
|
menuItemType: this.item.Type,
|
|
18858
18870
|
priority: this.renderPriority,
|
|
18859
18871
|
visual: feature,
|
|
18860
|
-
tilesetId: (
|
|
18872
|
+
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
18861
18873
|
tilesetType: Tileset.EType.EntitiesSet,
|
|
18862
|
-
accountId:
|
|
18874
|
+
accountId: accountId
|
|
18863
18875
|
};
|
|
18864
18876
|
this.visualsManager.AddRego({
|
|
18865
18877
|
rego,
|
|
@@ -19400,14 +19412,17 @@ var TilesetArbRenderManager;
|
|
|
19400
19412
|
}
|
|
19401
19413
|
mapTilesetFeature(feature) {
|
|
19402
19414
|
var _a, _b, _c, _d;
|
|
19415
|
+
const accountId = (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
19416
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
19403
19417
|
let rego = {
|
|
19418
|
+
canEdit: canEdit,
|
|
19404
19419
|
entityId: null,
|
|
19405
19420
|
entityTypeId: null,
|
|
19406
19421
|
menuItemId: this.item.id,
|
|
19407
19422
|
menuItemType: this.item.Type,
|
|
19408
19423
|
priority: this.renderPriority,
|
|
19409
19424
|
visual: feature,
|
|
19410
|
-
accountId:
|
|
19425
|
+
accountId: accountId,
|
|
19411
19426
|
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
19412
19427
|
tilesetType: this.tilesetType
|
|
19413
19428
|
};
|
|
@@ -19810,6 +19825,7 @@ var RelationsRenderManager;
|
|
|
19810
19825
|
if (!visual || visual != cEntity) {
|
|
19811
19826
|
this.register.AddRego({
|
|
19812
19827
|
rego: {
|
|
19828
|
+
canEdit: false,
|
|
19813
19829
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
19814
19830
|
menuItemId: this.item.id,
|
|
19815
19831
|
menuItemType: this.item.Type,
|
|
@@ -20188,6 +20204,7 @@ var LegacyRelationsRenderManager;
|
|
|
20188
20204
|
if (!visual || visual != cEntity) {
|
|
20189
20205
|
this.register.AddRego({
|
|
20190
20206
|
rego: {
|
|
20207
|
+
canEdit: false,
|
|
20191
20208
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
20192
20209
|
menuItemId: this.item.id,
|
|
20193
20210
|
menuItemType: this.item.Type,
|
|
@@ -20484,6 +20501,7 @@ var DataSourceStaticCsvManager;
|
|
|
20484
20501
|
if (vehicleEntity) {
|
|
20485
20502
|
this.register.AddRego({
|
|
20486
20503
|
rego: {
|
|
20504
|
+
canEdit: false,
|
|
20487
20505
|
entityId: vehicleEntityId,
|
|
20488
20506
|
menuItemId: this.item.id,
|
|
20489
20507
|
menuItemType: this.item.Type,
|
|
@@ -20507,6 +20525,7 @@ var DataSourceStaticCsvManager;
|
|
|
20507
20525
|
if (nextspaceEntityId) {
|
|
20508
20526
|
this.register.AddRego({
|
|
20509
20527
|
rego: {
|
|
20528
|
+
canEdit: false,
|
|
20510
20529
|
entityId: nextspaceEntityId,
|
|
20511
20530
|
menuItemId: this.item.id,
|
|
20512
20531
|
menuItemType: this.item.Type,
|
|
@@ -21092,6 +21111,7 @@ var GoogleSearchRenderManager;
|
|
|
21092
21111
|
});
|
|
21093
21112
|
this.register.AddRego({
|
|
21094
21113
|
rego: {
|
|
21114
|
+
canEdit: false,
|
|
21095
21115
|
// If we ever want the user to be able to create a Nextspace record-
|
|
21096
21116
|
//we must match this logic with the OSM logic.
|
|
21097
21117
|
entityId: itemId,
|
|
@@ -21295,6 +21315,210 @@ function getGoogle() {
|
|
|
21295
21315
|
return window["google"];
|
|
21296
21316
|
}
|
|
21297
21317
|
|
|
21318
|
+
/**
|
|
21319
|
+
* Menu Item that will render an Assembly.
|
|
21320
|
+
*
|
|
21321
|
+
* If a Tileset is specified, then that will be used, if not, then the Entities are rendered as-is.
|
|
21322
|
+
* ^ WARNING: Right now we're only doing the Entity side of things.
|
|
21323
|
+
*/
|
|
21324
|
+
var AssemblyRenderManager;
|
|
21325
|
+
(function (AssemblyRenderManager) {
|
|
21326
|
+
class Manager {
|
|
21327
|
+
get Disposed() {
|
|
21328
|
+
return this.disposed;
|
|
21329
|
+
}
|
|
21330
|
+
constructor(params) {
|
|
21331
|
+
this.disposed = false;
|
|
21332
|
+
// Cache of the hierarchy so that our scene-tree can reference it.
|
|
21333
|
+
this.hierarchy = null;
|
|
21334
|
+
const { viewer, register: visualsManager, getters, item } = params;
|
|
21335
|
+
this.viewer = viewer;
|
|
21336
|
+
this.getters = getters;
|
|
21337
|
+
this.item = item;
|
|
21338
|
+
this.visualsManager = visualsManager;
|
|
21339
|
+
}
|
|
21340
|
+
Init() {
|
|
21341
|
+
this.renderPriority = this.item.renderPriority;
|
|
21342
|
+
if (this.renderPriority == null) {
|
|
21343
|
+
this.renderPriority = 1;
|
|
21344
|
+
}
|
|
21345
|
+
(async () => {
|
|
21346
|
+
var _a;
|
|
21347
|
+
if (this.disposed) {
|
|
21348
|
+
return;
|
|
21349
|
+
}
|
|
21350
|
+
try {
|
|
21351
|
+
const flatEntityIds = [];
|
|
21352
|
+
let rootId = null;
|
|
21353
|
+
{
|
|
21354
|
+
const hierarchy = await this.getters.GetBruceApi().GET(`v3/assembly/${this.item["Assembly.ID"]}/hierarchy`);
|
|
21355
|
+
this.hierarchy = hierarchy;
|
|
21356
|
+
if (this.disposed) {
|
|
21357
|
+
return;
|
|
21358
|
+
}
|
|
21359
|
+
const traverseHierarchy = (node, leavesOnly) => {
|
|
21360
|
+
var _a;
|
|
21361
|
+
if (node.Children) {
|
|
21362
|
+
for (let i = 0; i < node.Children.length; i++) {
|
|
21363
|
+
traverseHierarchy(node.Children[i], leavesOnly);
|
|
21364
|
+
}
|
|
21365
|
+
}
|
|
21366
|
+
const addNode = !leavesOnly || !((_a = node.Children) === null || _a === void 0 ? void 0 : _a.length);
|
|
21367
|
+
if (addNode && node.ID && !flatEntityIds.includes(node.ID)) {
|
|
21368
|
+
flatEntityIds.push(node.ID);
|
|
21369
|
+
}
|
|
21370
|
+
};
|
|
21371
|
+
if (hierarchy === null || hierarchy === void 0 ? void 0 : hierarchy.Root) {
|
|
21372
|
+
traverseHierarchy(hierarchy.Root, true);
|
|
21373
|
+
rootId = hierarchy.Root.ID;
|
|
21374
|
+
}
|
|
21375
|
+
}
|
|
21376
|
+
if (this.disposed) {
|
|
21377
|
+
return;
|
|
21378
|
+
}
|
|
21379
|
+
const BATCH_SIZE = 200;
|
|
21380
|
+
let batches = Math.ceil(flatEntityIds.length / BATCH_SIZE);
|
|
21381
|
+
for (let i = 0; i < batches; i++) {
|
|
21382
|
+
const batch = flatEntityIds.slice(i * BATCH_SIZE, (i + 1) * BATCH_SIZE);
|
|
21383
|
+
if (!batch.length) {
|
|
21384
|
+
continue;
|
|
21385
|
+
}
|
|
21386
|
+
const { entities } = await Entity$1.GetListByIds({
|
|
21387
|
+
entityIds: batch,
|
|
21388
|
+
api: this.getters.GetBruceApi(),
|
|
21389
|
+
expandLODs: true,
|
|
21390
|
+
expandLocation: true
|
|
21391
|
+
});
|
|
21392
|
+
if (this.disposed) {
|
|
21393
|
+
return;
|
|
21394
|
+
}
|
|
21395
|
+
for (const entity of entities) {
|
|
21396
|
+
const lod = entity.Bruce.LOD ? entity.Bruce.LOD[0] : null;
|
|
21397
|
+
if (!lod || !((_a = lod["ClientFile"]) === null || _a === void 0 ? void 0 : _a.URL)) {
|
|
21398
|
+
// Won't bother with vector data for this experiment.
|
|
21399
|
+
continue;
|
|
21400
|
+
}
|
|
21401
|
+
const pos3d = calcEntityLocation(entity);
|
|
21402
|
+
const orient = calcEntityOrientation(entity, pos3d);
|
|
21403
|
+
if (!pos3d || !orient) {
|
|
21404
|
+
continue;
|
|
21405
|
+
}
|
|
21406
|
+
const cEntity = this.viewer.entities.add({
|
|
21407
|
+
model: {
|
|
21408
|
+
uri: lod["ClientFile"].URL,
|
|
21409
|
+
heightReference: HeightReference.NONE
|
|
21410
|
+
},
|
|
21411
|
+
// point: {
|
|
21412
|
+
// pixelSize: 50,
|
|
21413
|
+
// disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
21414
|
+
// color: Cesium.Color.fromCssColorString("#FF0000"),
|
|
21415
|
+
// heightReference: Cesium.HeightReference.NONE
|
|
21416
|
+
// },
|
|
21417
|
+
position: pos3d,
|
|
21418
|
+
orientation: new ConstantProperty(orient)
|
|
21419
|
+
});
|
|
21420
|
+
this.visualsManager.AddRego({
|
|
21421
|
+
rego: {
|
|
21422
|
+
canEdit: false,
|
|
21423
|
+
entityId: entity.Bruce.ID,
|
|
21424
|
+
menuItemId: this.item.id,
|
|
21425
|
+
menuItemType: this.item.Type,
|
|
21426
|
+
priority: this.renderPriority,
|
|
21427
|
+
visual: cEntity,
|
|
21428
|
+
accountId: this.getters.GetAccountId(),
|
|
21429
|
+
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
21430
|
+
name: entity.Bruce.Name,
|
|
21431
|
+
rootId: rootId
|
|
21432
|
+
},
|
|
21433
|
+
requestRender: false
|
|
21434
|
+
});
|
|
21435
|
+
}
|
|
21436
|
+
this.viewer.scene.requestRender();
|
|
21437
|
+
}
|
|
21438
|
+
}
|
|
21439
|
+
catch (e) {
|
|
21440
|
+
console.error("AssemblyRenderManager.Manager.Init()", e);
|
|
21441
|
+
}
|
|
21442
|
+
})();
|
|
21443
|
+
}
|
|
21444
|
+
Dispose() {
|
|
21445
|
+
if (this.disposed) {
|
|
21446
|
+
return;
|
|
21447
|
+
}
|
|
21448
|
+
this.disposed = true;
|
|
21449
|
+
this.visualsManager.RemoveRegos({
|
|
21450
|
+
menuItemId: this.item.id
|
|
21451
|
+
});
|
|
21452
|
+
}
|
|
21453
|
+
async ReRender(params) {
|
|
21454
|
+
let { entityIds, force, entities } = params;
|
|
21455
|
+
if (entities && !entityIds) {
|
|
21456
|
+
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
21457
|
+
}
|
|
21458
|
+
}
|
|
21459
|
+
}
|
|
21460
|
+
AssemblyRenderManager.Manager = Manager;
|
|
21461
|
+
})(AssemblyRenderManager || (AssemblyRenderManager = {}));
|
|
21462
|
+
const axis_shift = new Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
21463
|
+
function calcEntityLocation(entity) {
|
|
21464
|
+
const aRootLocation = entity.Bruce.AssemblyRootLocation;
|
|
21465
|
+
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
21466
|
+
if (!worldPosition) {
|
|
21467
|
+
return null;
|
|
21468
|
+
}
|
|
21469
|
+
let offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
21470
|
+
let heading = 0;
|
|
21471
|
+
let pitch = 0;
|
|
21472
|
+
let roll = 0;
|
|
21473
|
+
{
|
|
21474
|
+
const eTransform = entity.Bruce.Transform;
|
|
21475
|
+
if (eTransform) {
|
|
21476
|
+
if (eTransform.heading) {
|
|
21477
|
+
heading = eTransform.heading;
|
|
21478
|
+
}
|
|
21479
|
+
if (eTransform.pitch) {
|
|
21480
|
+
pitch = eTransform.pitch;
|
|
21481
|
+
}
|
|
21482
|
+
if (eTransform.roll) {
|
|
21483
|
+
roll = eTransform.roll;
|
|
21484
|
+
}
|
|
21485
|
+
}
|
|
21486
|
+
}
|
|
21487
|
+
let pos3d = Cartesian3.fromDegrees(EnsureNumber(aRootLocation.longitude), EnsureNumber(aRootLocation.latitude), EnsureNumber(aRootLocation.altitude));
|
|
21488
|
+
const m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
21489
|
+
const hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll), new HeadingPitchRoll());
|
|
21490
|
+
const transform = Matrix3.fromHeadingPitchRoll(hpr);
|
|
21491
|
+
const transformedOffset = Matrix3.multiplyByVector(transform, offset, new Cartesian3());
|
|
21492
|
+
pos3d = Matrix4.multiplyByPoint(m1, transformedOffset, new Cartesian3());
|
|
21493
|
+
return pos3d;
|
|
21494
|
+
}
|
|
21495
|
+
function calcEntityOrientation(entity, pos3d) {
|
|
21496
|
+
var _a, _b, _c;
|
|
21497
|
+
if (!entity.Bruce || !pos3d) {
|
|
21498
|
+
return null;
|
|
21499
|
+
}
|
|
21500
|
+
let hpr = 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);
|
|
21501
|
+
let orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
21502
|
+
if (entity.Bruce.AssemblyWorldPosition) {
|
|
21503
|
+
// extract rot, scale
|
|
21504
|
+
const awp = entity.Bruce.AssemblyWorldPosition;
|
|
21505
|
+
const mawp = new 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]);
|
|
21506
|
+
let rotmat = new Matrix3();
|
|
21507
|
+
rotmat = Matrix4.getRotation(mawp, rotmat);
|
|
21508
|
+
// chuck on a heading rotation of +90
|
|
21509
|
+
// according to docs, that is around -z
|
|
21510
|
+
// https://cesium.com/learn/ion-sdk/ref-doc/HeadingPitchRoll.html
|
|
21511
|
+
// see axis_shift quat defined above (could possibly be -ve z value)
|
|
21512
|
+
const q = Quaternion.fromRotationMatrix(rotmat);
|
|
21513
|
+
hpr = HeadingPitchRoll.fromQuaternion(q);
|
|
21514
|
+
orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
21515
|
+
// add another h +90, quats multiply to concat rotations - but are not
|
|
21516
|
+
// subject to order of rotation like HPR
|
|
21517
|
+
orientation = Quaternion.multiply(orientation, axis_shift, new Quaternion());
|
|
21518
|
+
}
|
|
21519
|
+
return orientation;
|
|
21520
|
+
}
|
|
21521
|
+
|
|
21298
21522
|
/**
|
|
21299
21523
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
21300
21524
|
*/
|
|
@@ -21482,6 +21706,14 @@ var MenuItemManager;
|
|
|
21482
21706
|
item: params.item
|
|
21483
21707
|
});
|
|
21484
21708
|
break;
|
|
21709
|
+
case MenuItem.EType.Assembly:
|
|
21710
|
+
rItem.renderManager = new AssemblyRenderManager.Manager({
|
|
21711
|
+
viewer: this.viewer,
|
|
21712
|
+
register: this.visualsRegister,
|
|
21713
|
+
getters: params.getters,
|
|
21714
|
+
item: params.item
|
|
21715
|
+
});
|
|
21716
|
+
break;
|
|
21485
21717
|
case MenuItem.EType.Osm:
|
|
21486
21718
|
rItem.renderManager = new TilesetOsmRenderManager.Manager({
|
|
21487
21719
|
viewer: this.viewer,
|
|
@@ -31221,7 +31453,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
31221
31453
|
}
|
|
31222
31454
|
}
|
|
31223
31455
|
|
|
31224
|
-
const VERSION = "5.5.
|
|
31456
|
+
const VERSION = "5.5.7";
|
|
31225
31457
|
|
|
31226
|
-
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
31458
|
+
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
31227
31459
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|