bruce-cesium 5.5.4 → 5.5.6
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 +248 -8
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +239 -6
- 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 +218 -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/tile-render-engine.js +4 -1
- package/dist/lib/rendering/tile-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, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, 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,
|
|
@@ -17603,14 +17609,17 @@ var TilesetCadRenderManager;
|
|
|
17603
17609
|
*/
|
|
17604
17610
|
mapTilesetFeature(feature, add) {
|
|
17605
17611
|
var _a, _b, _c, _d, _e;
|
|
17612
|
+
const accountId = (_b = ((_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID)) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
17613
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
17606
17614
|
let rego = {
|
|
17615
|
+
canEdit: canEdit,
|
|
17607
17616
|
entityId: null,
|
|
17608
17617
|
entityTypeId: null,
|
|
17609
17618
|
menuItemId: this.item.id,
|
|
17610
17619
|
menuItemType: this.item.Type,
|
|
17611
17620
|
priority: this.renderPriority,
|
|
17612
17621
|
visual: feature,
|
|
17613
|
-
accountId:
|
|
17622
|
+
accountId: accountId,
|
|
17614
17623
|
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
17615
17624
|
tilesetType: Tileset.EType.Cad,
|
|
17616
17625
|
rootId: this.rootId,
|
|
@@ -18223,6 +18232,7 @@ var DataLabRenderManager;
|
|
|
18223
18232
|
if (!rego) {
|
|
18224
18233
|
this.visualsManager.AddRego({
|
|
18225
18234
|
rego: {
|
|
18235
|
+
canEdit: true,
|
|
18226
18236
|
entityId: id,
|
|
18227
18237
|
menuItemId: this.item.id,
|
|
18228
18238
|
menuItemType: this.item.Type,
|
|
@@ -18570,6 +18580,7 @@ var TilesetOsmRenderManager;
|
|
|
18570
18580
|
// Doesn't exist. Create a rego.
|
|
18571
18581
|
else {
|
|
18572
18582
|
rego = {
|
|
18583
|
+
canEdit: false,
|
|
18573
18584
|
entityId: bruceId,
|
|
18574
18585
|
menuItemId: this.item.id,
|
|
18575
18586
|
menuItemType: this.item.Type,
|
|
@@ -18850,16 +18861,19 @@ var TilesetEntitiesRenderManager;
|
|
|
18850
18861
|
}
|
|
18851
18862
|
}
|
|
18852
18863
|
if (id) {
|
|
18864
|
+
const accountId = (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
18865
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
18853
18866
|
const rego = {
|
|
18867
|
+
canEdit: canEdit,
|
|
18854
18868
|
entityId: id,
|
|
18855
18869
|
entityTypeId: this.typeId,
|
|
18856
18870
|
menuItemId: this.item.id,
|
|
18857
18871
|
menuItemType: this.item.Type,
|
|
18858
18872
|
priority: this.renderPriority,
|
|
18859
18873
|
visual: feature,
|
|
18860
|
-
tilesetId: (
|
|
18874
|
+
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
18861
18875
|
tilesetType: Tileset.EType.EntitiesSet,
|
|
18862
|
-
accountId:
|
|
18876
|
+
accountId: accountId
|
|
18863
18877
|
};
|
|
18864
18878
|
this.visualsManager.AddRego({
|
|
18865
18879
|
rego,
|
|
@@ -19400,14 +19414,17 @@ var TilesetArbRenderManager;
|
|
|
19400
19414
|
}
|
|
19401
19415
|
mapTilesetFeature(feature) {
|
|
19402
19416
|
var _a, _b, _c, _d;
|
|
19417
|
+
const accountId = (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId();
|
|
19418
|
+
const canEdit = accountId === this.getters.GetAccountId();
|
|
19403
19419
|
let rego = {
|
|
19420
|
+
canEdit: canEdit,
|
|
19404
19421
|
entityId: null,
|
|
19405
19422
|
entityTypeId: null,
|
|
19406
19423
|
menuItemId: this.item.id,
|
|
19407
19424
|
menuItemType: this.item.Type,
|
|
19408
19425
|
priority: this.renderPriority,
|
|
19409
19426
|
visual: feature,
|
|
19410
|
-
accountId:
|
|
19427
|
+
accountId: accountId,
|
|
19411
19428
|
tilesetId: (_c = this.item.tileset) === null || _c === void 0 ? void 0 : _c.TilesetID,
|
|
19412
19429
|
tilesetType: this.tilesetType
|
|
19413
19430
|
};
|
|
@@ -19810,6 +19827,7 @@ var RelationsRenderManager;
|
|
|
19810
19827
|
if (!visual || visual != cEntity) {
|
|
19811
19828
|
this.register.AddRego({
|
|
19812
19829
|
rego: {
|
|
19830
|
+
canEdit: false,
|
|
19813
19831
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
19814
19832
|
menuItemId: this.item.id,
|
|
19815
19833
|
menuItemType: this.item.Type,
|
|
@@ -20188,6 +20206,7 @@ var LegacyRelationsRenderManager;
|
|
|
20188
20206
|
if (!visual || visual != cEntity) {
|
|
20189
20207
|
this.register.AddRego({
|
|
20190
20208
|
rego: {
|
|
20209
|
+
canEdit: false,
|
|
20191
20210
|
entityId: (_b = relation["Data.Entity.ID"]) !== null && _b !== void 0 ? _b : ObjectUtils.UId(),
|
|
20192
20211
|
menuItemId: this.item.id,
|
|
20193
20212
|
menuItemType: this.item.Type,
|
|
@@ -20484,6 +20503,7 @@ var DataSourceStaticCsvManager;
|
|
|
20484
20503
|
if (vehicleEntity) {
|
|
20485
20504
|
this.register.AddRego({
|
|
20486
20505
|
rego: {
|
|
20506
|
+
canEdit: false,
|
|
20487
20507
|
entityId: vehicleEntityId,
|
|
20488
20508
|
menuItemId: this.item.id,
|
|
20489
20509
|
menuItemType: this.item.Type,
|
|
@@ -20507,6 +20527,7 @@ var DataSourceStaticCsvManager;
|
|
|
20507
20527
|
if (nextspaceEntityId) {
|
|
20508
20528
|
this.register.AddRego({
|
|
20509
20529
|
rego: {
|
|
20530
|
+
canEdit: false,
|
|
20510
20531
|
entityId: nextspaceEntityId,
|
|
20511
20532
|
menuItemId: this.item.id,
|
|
20512
20533
|
menuItemType: this.item.Type,
|
|
@@ -21092,6 +21113,7 @@ var GoogleSearchRenderManager;
|
|
|
21092
21113
|
});
|
|
21093
21114
|
this.register.AddRego({
|
|
21094
21115
|
rego: {
|
|
21116
|
+
canEdit: false,
|
|
21095
21117
|
// If we ever want the user to be able to create a Nextspace record-
|
|
21096
21118
|
//we must match this logic with the OSM logic.
|
|
21097
21119
|
entityId: itemId,
|
|
@@ -21295,6 +21317,213 @@ function getGoogle() {
|
|
|
21295
21317
|
return window["google"];
|
|
21296
21318
|
}
|
|
21297
21319
|
|
|
21320
|
+
/**
|
|
21321
|
+
* Menu Item that will render an Assembly.
|
|
21322
|
+
*
|
|
21323
|
+
* If a Tileset is specified, then that will be used, if not, then the Entities are rendered as-is.
|
|
21324
|
+
* ^ WARNING: Right now we're only doing the Entity side of things.
|
|
21325
|
+
*/
|
|
21326
|
+
var AssemblyRenderManager;
|
|
21327
|
+
(function (AssemblyRenderManager) {
|
|
21328
|
+
class Manager {
|
|
21329
|
+
get Disposed() {
|
|
21330
|
+
return this.disposed;
|
|
21331
|
+
}
|
|
21332
|
+
constructor(params) {
|
|
21333
|
+
this.disposed = false;
|
|
21334
|
+
// Cache of the hierarchy so that our scene-tree can reference it.
|
|
21335
|
+
this.hierarchy = null;
|
|
21336
|
+
const { viewer, register: visualsManager, getters, item } = params;
|
|
21337
|
+
this.viewer = viewer;
|
|
21338
|
+
this.getters = getters;
|
|
21339
|
+
this.item = item;
|
|
21340
|
+
this.visualsManager = visualsManager;
|
|
21341
|
+
}
|
|
21342
|
+
Init() {
|
|
21343
|
+
this.renderPriority = this.item.renderPriority;
|
|
21344
|
+
if (this.renderPriority == null) {
|
|
21345
|
+
this.renderPriority = 1;
|
|
21346
|
+
}
|
|
21347
|
+
(async () => {
|
|
21348
|
+
var _a;
|
|
21349
|
+
if (this.disposed) {
|
|
21350
|
+
return;
|
|
21351
|
+
}
|
|
21352
|
+
try {
|
|
21353
|
+
const flatEntityIds = [];
|
|
21354
|
+
let rootId = null;
|
|
21355
|
+
{
|
|
21356
|
+
const hierarchy = await this.getters.GetBruceApi().GET(`v3/assembly/${this.item["Assembly.ID"]}/hierarchy`);
|
|
21357
|
+
this.hierarchy = hierarchy;
|
|
21358
|
+
if (this.disposed) {
|
|
21359
|
+
return;
|
|
21360
|
+
}
|
|
21361
|
+
const traverseHierarchy = (node, leavesOnly) => {
|
|
21362
|
+
var _a;
|
|
21363
|
+
if (node.Children) {
|
|
21364
|
+
for (let i = 0; i < node.Children.length; i++) {
|
|
21365
|
+
traverseHierarchy(node.Children[i], leavesOnly);
|
|
21366
|
+
}
|
|
21367
|
+
}
|
|
21368
|
+
const addNode = !leavesOnly || !((_a = node.Children) === null || _a === void 0 ? void 0 : _a.length);
|
|
21369
|
+
if (addNode && node.ID && !flatEntityIds.includes(node.ID)) {
|
|
21370
|
+
flatEntityIds.push(node.ID);
|
|
21371
|
+
}
|
|
21372
|
+
};
|
|
21373
|
+
if (hierarchy === null || hierarchy === void 0 ? void 0 : hierarchy.Root) {
|
|
21374
|
+
traverseHierarchy(hierarchy.Root, true);
|
|
21375
|
+
rootId = hierarchy.Root.ID;
|
|
21376
|
+
}
|
|
21377
|
+
}
|
|
21378
|
+
if (this.disposed) {
|
|
21379
|
+
return;
|
|
21380
|
+
}
|
|
21381
|
+
const BATCH_SIZE = 200;
|
|
21382
|
+
let batches = Math.ceil(flatEntityIds.length / BATCH_SIZE);
|
|
21383
|
+
for (let i = 0; i < batches; i++) {
|
|
21384
|
+
const batch = flatEntityIds.slice(i * BATCH_SIZE, (i + 1) * BATCH_SIZE);
|
|
21385
|
+
if (!batch.length) {
|
|
21386
|
+
continue;
|
|
21387
|
+
}
|
|
21388
|
+
const { entities } = await Entity$1.GetListByIds({
|
|
21389
|
+
entityIds: batch,
|
|
21390
|
+
api: this.getters.GetBruceApi(),
|
|
21391
|
+
expandLODs: true,
|
|
21392
|
+
expandLocation: true
|
|
21393
|
+
});
|
|
21394
|
+
if (this.disposed) {
|
|
21395
|
+
return;
|
|
21396
|
+
}
|
|
21397
|
+
for (const entity of entities) {
|
|
21398
|
+
const lod = entity.Bruce.LOD ? entity.Bruce.LOD[0] : null;
|
|
21399
|
+
if (!lod || !((_a = lod["ClientFile"]) === null || _a === void 0 ? void 0 : _a.URL)) {
|
|
21400
|
+
// Won't bother with vector data for this experiment.
|
|
21401
|
+
continue;
|
|
21402
|
+
}
|
|
21403
|
+
const pos3d = calcEntityLocation(entity);
|
|
21404
|
+
const orient = calcEntityOrientation(entity, pos3d);
|
|
21405
|
+
if (!pos3d || !orient) {
|
|
21406
|
+
continue;
|
|
21407
|
+
}
|
|
21408
|
+
const cEntity = this.viewer.entities.add({
|
|
21409
|
+
model: {
|
|
21410
|
+
uri: lod["ClientFile"].URL,
|
|
21411
|
+
heightReference: HeightReference.NONE
|
|
21412
|
+
},
|
|
21413
|
+
// point: {
|
|
21414
|
+
// pixelSize: 50,
|
|
21415
|
+
// disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
21416
|
+
// color: Cesium.Color.fromCssColorString("#FF0000"),
|
|
21417
|
+
// heightReference: Cesium.HeightReference.NONE
|
|
21418
|
+
// },
|
|
21419
|
+
position: pos3d,
|
|
21420
|
+
orientation: new ConstantProperty(orient)
|
|
21421
|
+
});
|
|
21422
|
+
this.visualsManager.AddRego({
|
|
21423
|
+
rego: {
|
|
21424
|
+
canEdit: false,
|
|
21425
|
+
entityId: entity.Bruce.ID,
|
|
21426
|
+
menuItemId: this.item.id,
|
|
21427
|
+
menuItemType: this.item.Type,
|
|
21428
|
+
priority: this.renderPriority,
|
|
21429
|
+
visual: cEntity,
|
|
21430
|
+
accountId: this.getters.GetAccountId(),
|
|
21431
|
+
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
21432
|
+
name: entity.Bruce.Name,
|
|
21433
|
+
rootId: rootId
|
|
21434
|
+
},
|
|
21435
|
+
requestRender: false
|
|
21436
|
+
});
|
|
21437
|
+
}
|
|
21438
|
+
this.viewer.scene.requestRender();
|
|
21439
|
+
}
|
|
21440
|
+
}
|
|
21441
|
+
catch (e) {
|
|
21442
|
+
console.error("AssemblyRenderManager.Manager.Init()", e);
|
|
21443
|
+
}
|
|
21444
|
+
})();
|
|
21445
|
+
}
|
|
21446
|
+
Dispose() {
|
|
21447
|
+
if (this.disposed) {
|
|
21448
|
+
return;
|
|
21449
|
+
}
|
|
21450
|
+
this.disposed = true;
|
|
21451
|
+
this.visualsManager.RemoveRegos({
|
|
21452
|
+
menuItemId: this.item.id
|
|
21453
|
+
});
|
|
21454
|
+
}
|
|
21455
|
+
async ReRender(params) {
|
|
21456
|
+
let { entityIds, force, entities } = params;
|
|
21457
|
+
if (entities && !entityIds) {
|
|
21458
|
+
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
21459
|
+
}
|
|
21460
|
+
}
|
|
21461
|
+
}
|
|
21462
|
+
AssemblyRenderManager.Manager = Manager;
|
|
21463
|
+
})(AssemblyRenderManager || (AssemblyRenderManager = {}));
|
|
21464
|
+
const axis_shift = new Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
21465
|
+
function calcEntityLocation(entity) {
|
|
21466
|
+
const aRootLocation = entity.Bruce.AssemblyRootLocation;
|
|
21467
|
+
if (!(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.longitude) || !aRootLocation.latitude) {
|
|
21468
|
+
return null;
|
|
21469
|
+
}
|
|
21470
|
+
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
21471
|
+
if (!worldPosition) {
|
|
21472
|
+
return null;
|
|
21473
|
+
}
|
|
21474
|
+
let offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
21475
|
+
let heading = 0;
|
|
21476
|
+
let pitch = 0;
|
|
21477
|
+
let roll = 0;
|
|
21478
|
+
{
|
|
21479
|
+
const eTransform = entity.Bruce.Transform;
|
|
21480
|
+
if (eTransform) {
|
|
21481
|
+
if (eTransform.heading) {
|
|
21482
|
+
heading = eTransform.heading;
|
|
21483
|
+
}
|
|
21484
|
+
if (eTransform.pitch) {
|
|
21485
|
+
pitch = eTransform.pitch;
|
|
21486
|
+
}
|
|
21487
|
+
if (eTransform.roll) {
|
|
21488
|
+
roll = eTransform.roll;
|
|
21489
|
+
}
|
|
21490
|
+
}
|
|
21491
|
+
}
|
|
21492
|
+
let pos3d = Cartesian3.fromDegrees(aRootLocation.longitude, aRootLocation.latitude, aRootLocation.altitude || 0);
|
|
21493
|
+
const m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
21494
|
+
const hpr = HeadingPitchRoll.fromDegrees(heading, pitch, roll, new HeadingPitchRoll());
|
|
21495
|
+
const transform = Matrix3.fromHeadingPitchRoll(hpr);
|
|
21496
|
+
const transformedOffset = Matrix3.multiplyByVector(transform, offset, new Cartesian3());
|
|
21497
|
+
pos3d = Matrix4.multiplyByPoint(m1, transformedOffset, new Cartesian3());
|
|
21498
|
+
return pos3d;
|
|
21499
|
+
}
|
|
21500
|
+
function calcEntityOrientation(entity, pos3d) {
|
|
21501
|
+
var _a, _b, _c;
|
|
21502
|
+
if (!entity.Bruce || !pos3d) {
|
|
21503
|
+
return null;
|
|
21504
|
+
}
|
|
21505
|
+
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);
|
|
21506
|
+
let orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
21507
|
+
if (entity.Bruce.AssemblyWorldPosition) {
|
|
21508
|
+
// extract rot, scale
|
|
21509
|
+
const awp = entity.Bruce.AssemblyWorldPosition;
|
|
21510
|
+
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]);
|
|
21511
|
+
let rotmat = new Matrix3();
|
|
21512
|
+
rotmat = Matrix4.getRotation(mawp, rotmat);
|
|
21513
|
+
// chuck on a heading rotation of +90
|
|
21514
|
+
// according to docs, that is around -z
|
|
21515
|
+
// https://cesium.com/learn/ion-sdk/ref-doc/HeadingPitchRoll.html
|
|
21516
|
+
// see axis_shift quat defined above (could possibly be -ve z value)
|
|
21517
|
+
const q = Quaternion.fromRotationMatrix(rotmat);
|
|
21518
|
+
hpr = HeadingPitchRoll.fromQuaternion(q);
|
|
21519
|
+
orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
21520
|
+
// add another h +90, quats multiply to concat rotations - but are not
|
|
21521
|
+
// subject to order of rotation like HPR
|
|
21522
|
+
orientation = Quaternion.multiply(orientation, axis_shift, new Quaternion());
|
|
21523
|
+
}
|
|
21524
|
+
return orientation;
|
|
21525
|
+
}
|
|
21526
|
+
|
|
21298
21527
|
/**
|
|
21299
21528
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
21300
21529
|
*/
|
|
@@ -21482,6 +21711,14 @@ var MenuItemManager;
|
|
|
21482
21711
|
item: params.item
|
|
21483
21712
|
});
|
|
21484
21713
|
break;
|
|
21714
|
+
case MenuItem.EType.Assembly:
|
|
21715
|
+
rItem.renderManager = new AssemblyRenderManager.Manager({
|
|
21716
|
+
viewer: this.viewer,
|
|
21717
|
+
register: this.visualsRegister,
|
|
21718
|
+
getters: params.getters,
|
|
21719
|
+
item: params.item
|
|
21720
|
+
});
|
|
21721
|
+
break;
|
|
21485
21722
|
case MenuItem.EType.Osm:
|
|
21486
21723
|
rItem.renderManager = new TilesetOsmRenderManager.Manager({
|
|
21487
21724
|
viewer: this.viewer,
|
|
@@ -24120,9 +24357,12 @@ var TileRenderEngine;
|
|
|
24120
24357
|
else if (settings.terrainType == "CesiumIon") {
|
|
24121
24358
|
const ionId = settings.externalId;
|
|
24122
24359
|
const key = settings.key ? settings.key : await findKey(params.apiGetter, params.apiGetter.accountId, ProgramKey.EProgramId.CesiumIon);
|
|
24123
|
-
const resource = IonResource.fromAssetId(Number(ionId), {
|
|
24360
|
+
const resource = await IonResource.fromAssetId(Number(ionId), {
|
|
24124
24361
|
accessToken: key
|
|
24125
24362
|
});
|
|
24363
|
+
if (!assertIteration(params.viewer, iteration)) {
|
|
24364
|
+
return;
|
|
24365
|
+
}
|
|
24126
24366
|
if (CesiumTerrainProvider.hasOwnProperty("fromUrl")) {
|
|
24127
24367
|
provider = await CESIUM.CesiumTerrainProvider.fromUrl(resource, {
|
|
24128
24368
|
requestVertexNormals: vertexes
|
|
@@ -31218,7 +31458,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
31218
31458
|
}
|
|
31219
31459
|
}
|
|
31220
31460
|
|
|
31221
|
-
const VERSION = "5.5.
|
|
31461
|
+
const VERSION = "5.5.6";
|
|
31222
31462
|
|
|
31223
|
-
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 };
|
|
31463
|
+
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 };
|
|
31224
31464
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|