bruce-cesium 5.8.4 → 5.8.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 +464 -14
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +463 -13
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js +211 -2
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +251 -9
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/other/assembly-render-manager.d.ts +60 -0
- package/dist/types/rendering/render-managers/tilesets/tileset-cad-render-manager.d.ts +55 -0
- package/dist/types/rendering/visuals-register.d.ts +8 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Entity as Entity$1, ProjectViewTile, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, 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,
|
|
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, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, Cesium3DTileset, IonResource, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -18369,6 +18369,7 @@ var TilesetCadRenderManager;
|
|
|
18369
18369
|
rego.entityId = meta.entityId;
|
|
18370
18370
|
rego.entityTypeId = meta.typeId;
|
|
18371
18371
|
rego.name = meta.name;
|
|
18372
|
+
rego.parentId = meta.parentId;
|
|
18372
18373
|
}
|
|
18373
18374
|
}
|
|
18374
18375
|
}
|
|
@@ -18500,7 +18501,11 @@ var TilesetCadRenderManager;
|
|
|
18500
18501
|
buildModelTreeNodes(modelTree) {
|
|
18501
18502
|
this.treeNodeByGeomId = {};
|
|
18502
18503
|
this.treeNodeByEntityId = {};
|
|
18503
|
-
const
|
|
18504
|
+
const stack = [
|
|
18505
|
+
{ node: modelTree, parentId: null, firstFoundCollapsedBranch: null }
|
|
18506
|
+
];
|
|
18507
|
+
while (stack.length > 0) {
|
|
18508
|
+
const { node, parentId, firstFoundCollapsedBranch } = stack.pop();
|
|
18504
18509
|
if (firstFoundCollapsedBranch) {
|
|
18505
18510
|
this.treeNodeByGeomId[node.geomId] = firstFoundCollapsedBranch;
|
|
18506
18511
|
this.treeNodeByEntityId[node.id] = firstFoundCollapsedBranch;
|
|
@@ -18510,21 +18515,27 @@ var TilesetCadRenderManager;
|
|
|
18510
18515
|
entityId: node.id,
|
|
18511
18516
|
typeId: node.typeId,
|
|
18512
18517
|
name: node.name,
|
|
18513
|
-
geomId: node.geomId
|
|
18518
|
+
geomId: node.geomId,
|
|
18519
|
+
parentId: parentId
|
|
18514
18520
|
};
|
|
18515
18521
|
this.treeNodeByGeomId[node.geomId] = cache;
|
|
18516
18522
|
this.treeNodeByEntityId[node.id] = cache;
|
|
18523
|
+
let newFirstFoundCollapsedBranch = firstFoundCollapsedBranch;
|
|
18517
18524
|
if (!firstFoundCollapsedBranch && node.collapsed) {
|
|
18518
|
-
|
|
18519
|
-
}
|
|
18520
|
-
|
|
18521
|
-
|
|
18522
|
-
|
|
18523
|
-
|
|
18525
|
+
newFirstFoundCollapsedBranch = cache;
|
|
18526
|
+
}
|
|
18527
|
+
// Push children to stack in reverse order to maintain correct traversal
|
|
18528
|
+
if (node.children) {
|
|
18529
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
18530
|
+
stack.push({
|
|
18531
|
+
node: node.children[i],
|
|
18532
|
+
parentId: node.id,
|
|
18533
|
+
firstFoundCollapsedBranch: newFirstFoundCollapsedBranch
|
|
18534
|
+
});
|
|
18535
|
+
}
|
|
18524
18536
|
}
|
|
18525
18537
|
}
|
|
18526
|
-
}
|
|
18527
|
-
recurse(modelTree, null);
|
|
18538
|
+
}
|
|
18528
18539
|
}
|
|
18529
18540
|
getEntityTypeByPath(path) {
|
|
18530
18541
|
var _a, _b;
|
|
@@ -18543,6 +18554,236 @@ var TilesetCadRenderManager;
|
|
|
18543
18554
|
const node = this.treeNodeByEntityId[entityId] || null;
|
|
18544
18555
|
return node ? node.typeId : null;
|
|
18545
18556
|
}
|
|
18557
|
+
/**
|
|
18558
|
+
* Gets the parent node of a given entity.
|
|
18559
|
+
* @param entityId The entity ID to find the parent for
|
|
18560
|
+
* @returns The parent node or null if no parent exists
|
|
18561
|
+
*/
|
|
18562
|
+
getParentNode(entityId) {
|
|
18563
|
+
var _a, _b;
|
|
18564
|
+
if (this.treeNodeByEntityId == null) {
|
|
18565
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18566
|
+
if (!modelTree) {
|
|
18567
|
+
modelTree = this.modelTree;
|
|
18568
|
+
}
|
|
18569
|
+
if (!modelTree) {
|
|
18570
|
+
return null;
|
|
18571
|
+
}
|
|
18572
|
+
this.buildModelTreeNodes(modelTree);
|
|
18573
|
+
}
|
|
18574
|
+
const node = this.treeNodeByEntityId[entityId];
|
|
18575
|
+
if (node === null || node === void 0 ? void 0 : node.parentId) {
|
|
18576
|
+
return this.treeNodeByEntityId[node.parentId] || null;
|
|
18577
|
+
}
|
|
18578
|
+
return null;
|
|
18579
|
+
}
|
|
18580
|
+
/**
|
|
18581
|
+
* Gets all child nodes of a given entity.
|
|
18582
|
+
* @param entityId The entity ID to find children for
|
|
18583
|
+
* @returns Array of child nodes
|
|
18584
|
+
*/
|
|
18585
|
+
getChildNodes(entityId) {
|
|
18586
|
+
var _a, _b;
|
|
18587
|
+
if (this.treeNodeByEntityId == null) {
|
|
18588
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18589
|
+
if (!modelTree) {
|
|
18590
|
+
modelTree = this.modelTree;
|
|
18591
|
+
}
|
|
18592
|
+
if (!modelTree) {
|
|
18593
|
+
return [];
|
|
18594
|
+
}
|
|
18595
|
+
this.buildModelTreeNodes(modelTree);
|
|
18596
|
+
}
|
|
18597
|
+
const children = [];
|
|
18598
|
+
for (const nodeId in this.treeNodeByEntityId) {
|
|
18599
|
+
const node = this.treeNodeByEntityId[nodeId];
|
|
18600
|
+
if (node.parentId === entityId) {
|
|
18601
|
+
children.push(node);
|
|
18602
|
+
}
|
|
18603
|
+
}
|
|
18604
|
+
return children;
|
|
18605
|
+
}
|
|
18606
|
+
/**
|
|
18607
|
+
* Gets all descendant nodes of a given entity (children, grandchildren, etc.).
|
|
18608
|
+
* @param entityId The entity ID to find descendants for
|
|
18609
|
+
* @returns Array of descendant nodes
|
|
18610
|
+
*/
|
|
18611
|
+
getDescendantNodes(entityId) {
|
|
18612
|
+
var _a, _b;
|
|
18613
|
+
if (this.treeNodeByEntityId == null) {
|
|
18614
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18615
|
+
if (!modelTree) {
|
|
18616
|
+
modelTree = this.modelTree;
|
|
18617
|
+
}
|
|
18618
|
+
if (!modelTree) {
|
|
18619
|
+
return [];
|
|
18620
|
+
}
|
|
18621
|
+
this.buildModelTreeNodes(modelTree);
|
|
18622
|
+
}
|
|
18623
|
+
const descendants = [];
|
|
18624
|
+
const stack = [entityId];
|
|
18625
|
+
// Use iterative approach with a stack instead of recursion
|
|
18626
|
+
while (stack.length > 0) {
|
|
18627
|
+
const currentId = stack.pop();
|
|
18628
|
+
if (!currentId)
|
|
18629
|
+
continue;
|
|
18630
|
+
for (const nodeId in this.treeNodeByEntityId) {
|
|
18631
|
+
const node = this.treeNodeByEntityId[nodeId];
|
|
18632
|
+
if (node.parentId === currentId) {
|
|
18633
|
+
descendants.push(node);
|
|
18634
|
+
stack.push(node.entityId);
|
|
18635
|
+
}
|
|
18636
|
+
}
|
|
18637
|
+
}
|
|
18638
|
+
return descendants;
|
|
18639
|
+
}
|
|
18640
|
+
/**
|
|
18641
|
+
* Gets the root node of the model tree.
|
|
18642
|
+
* @returns The root node or null if no tree exists
|
|
18643
|
+
*/
|
|
18644
|
+
getRootNode() {
|
|
18645
|
+
var _a, _b;
|
|
18646
|
+
if (this.treeNodeByEntityId == null) {
|
|
18647
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18648
|
+
if (!modelTree) {
|
|
18649
|
+
modelTree = this.modelTree;
|
|
18650
|
+
}
|
|
18651
|
+
if (!modelTree) {
|
|
18652
|
+
return null;
|
|
18653
|
+
}
|
|
18654
|
+
this.buildModelTreeNodes(modelTree);
|
|
18655
|
+
}
|
|
18656
|
+
// Find the node with no parent (root node)
|
|
18657
|
+
for (const nodeId in this.treeNodeByEntityId) {
|
|
18658
|
+
const node = this.treeNodeByEntityId[nodeId];
|
|
18659
|
+
if (!node.parentId) {
|
|
18660
|
+
return node;
|
|
18661
|
+
}
|
|
18662
|
+
}
|
|
18663
|
+
return null;
|
|
18664
|
+
}
|
|
18665
|
+
/**
|
|
18666
|
+
* Gets the path from root to a given entity.
|
|
18667
|
+
* @param entityId The entity ID to find the path for
|
|
18668
|
+
* @returns Array of node IDs representing the path from root to the entity
|
|
18669
|
+
*/
|
|
18670
|
+
getNodePath(entityId) {
|
|
18671
|
+
var _a, _b;
|
|
18672
|
+
if (this.treeNodeByEntityId == null) {
|
|
18673
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18674
|
+
if (!modelTree) {
|
|
18675
|
+
modelTree = this.modelTree;
|
|
18676
|
+
}
|
|
18677
|
+
if (!modelTree) {
|
|
18678
|
+
return [];
|
|
18679
|
+
}
|
|
18680
|
+
this.buildModelTreeNodes(modelTree);
|
|
18681
|
+
}
|
|
18682
|
+
const path = [];
|
|
18683
|
+
let currentId = entityId;
|
|
18684
|
+
while (currentId) {
|
|
18685
|
+
const node = this.treeNodeByEntityId[currentId];
|
|
18686
|
+
if (!node) {
|
|
18687
|
+
break;
|
|
18688
|
+
}
|
|
18689
|
+
path.unshift(currentId);
|
|
18690
|
+
currentId = node.parentId;
|
|
18691
|
+
}
|
|
18692
|
+
return path;
|
|
18693
|
+
}
|
|
18694
|
+
/**
|
|
18695
|
+
* Batch operation to get multiple node paths efficiently.
|
|
18696
|
+
* @param entityIds Array of entity IDs to get paths for
|
|
18697
|
+
* @returns Map of entityId to path array
|
|
18698
|
+
*/
|
|
18699
|
+
getNodePathsBatch(entityIds) {
|
|
18700
|
+
var _a, _b;
|
|
18701
|
+
if (this.treeNodeByEntityId == null) {
|
|
18702
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18703
|
+
if (!modelTree) {
|
|
18704
|
+
modelTree = this.modelTree;
|
|
18705
|
+
}
|
|
18706
|
+
if (!modelTree) {
|
|
18707
|
+
return new Map();
|
|
18708
|
+
}
|
|
18709
|
+
this.buildModelTreeNodes(modelTree);
|
|
18710
|
+
}
|
|
18711
|
+
const paths = new Map();
|
|
18712
|
+
for (const entityId of entityIds) {
|
|
18713
|
+
const path = [];
|
|
18714
|
+
let currentId = entityId;
|
|
18715
|
+
while (currentId) {
|
|
18716
|
+
const node = this.treeNodeByEntityId[currentId];
|
|
18717
|
+
if (!node) {
|
|
18718
|
+
break;
|
|
18719
|
+
}
|
|
18720
|
+
path.unshift(currentId);
|
|
18721
|
+
currentId = node.parentId;
|
|
18722
|
+
}
|
|
18723
|
+
paths.set(entityId, path);
|
|
18724
|
+
}
|
|
18725
|
+
return paths;
|
|
18726
|
+
}
|
|
18727
|
+
/**
|
|
18728
|
+
* Batch operation to get multiple parent nodes efficiently.
|
|
18729
|
+
* @param entityIds Array of entity IDs to get parents for
|
|
18730
|
+
* @returns Map of entityId to parent node
|
|
18731
|
+
*/
|
|
18732
|
+
getParentNodesBatch(entityIds) {
|
|
18733
|
+
var _a, _b;
|
|
18734
|
+
if (this.treeNodeByEntityId == null) {
|
|
18735
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18736
|
+
if (!modelTree) {
|
|
18737
|
+
modelTree = this.modelTree;
|
|
18738
|
+
}
|
|
18739
|
+
if (!modelTree) {
|
|
18740
|
+
return new Map();
|
|
18741
|
+
}
|
|
18742
|
+
this.buildModelTreeNodes(modelTree);
|
|
18743
|
+
}
|
|
18744
|
+
const parents = new Map();
|
|
18745
|
+
for (const entityId of entityIds) {
|
|
18746
|
+
const node = this.treeNodeByEntityId[entityId];
|
|
18747
|
+
if (node === null || node === void 0 ? void 0 : node.parentId) {
|
|
18748
|
+
parents.set(entityId, this.treeNodeByEntityId[node.parentId] || null);
|
|
18749
|
+
}
|
|
18750
|
+
else {
|
|
18751
|
+
parents.set(entityId, null);
|
|
18752
|
+
}
|
|
18753
|
+
}
|
|
18754
|
+
return parents;
|
|
18755
|
+
}
|
|
18756
|
+
/**
|
|
18757
|
+
* Batch operation to get multiple child nodes efficiently.
|
|
18758
|
+
* @param entityIds Array of entity IDs to get children for
|
|
18759
|
+
* @returns Map of entityId to array of child nodes
|
|
18760
|
+
*/
|
|
18761
|
+
getChildNodesBatch(entityIds) {
|
|
18762
|
+
var _a, _b;
|
|
18763
|
+
if (this.treeNodeByEntityId == null) {
|
|
18764
|
+
let modelTree = (_b = (_a = this.cTileset) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.modelTree;
|
|
18765
|
+
if (!modelTree) {
|
|
18766
|
+
modelTree = this.modelTree;
|
|
18767
|
+
}
|
|
18768
|
+
if (!modelTree) {
|
|
18769
|
+
return new Map();
|
|
18770
|
+
}
|
|
18771
|
+
this.buildModelTreeNodes(modelTree);
|
|
18772
|
+
}
|
|
18773
|
+
const children = new Map();
|
|
18774
|
+
// Initialize all entityIds with empty arrays
|
|
18775
|
+
for (const entityId of entityIds) {
|
|
18776
|
+
children.set(entityId, []);
|
|
18777
|
+
}
|
|
18778
|
+
// Build a reverse lookup for efficiency
|
|
18779
|
+
for (const nodeId in this.treeNodeByEntityId) {
|
|
18780
|
+
const node = this.treeNodeByEntityId[nodeId];
|
|
18781
|
+
if (node.parentId && children.has(node.parentId)) {
|
|
18782
|
+
children.get(node.parentId).push(node);
|
|
18783
|
+
}
|
|
18784
|
+
}
|
|
18785
|
+
return children;
|
|
18786
|
+
}
|
|
18546
18787
|
Dispose() {
|
|
18547
18788
|
if (this.disposed) {
|
|
18548
18789
|
return;
|
|
@@ -22075,6 +22316,8 @@ var AssemblyRenderManager;
|
|
|
22075
22316
|
this.disposed = false;
|
|
22076
22317
|
// Cache of the hierarchy so that our scene-tree can reference it.
|
|
22077
22318
|
this.hierarchy = null;
|
|
22319
|
+
// Quick look-up of the hierarchy nodes by entity ID.
|
|
22320
|
+
this.hierarchyNodeByEntityId = null;
|
|
22078
22321
|
this.modelSpace = false;
|
|
22079
22322
|
const { viewer, register: visualsManager, getters, item } = params;
|
|
22080
22323
|
this.viewer = viewer;
|
|
@@ -22089,7 +22332,7 @@ var AssemblyRenderManager;
|
|
|
22089
22332
|
this.renderPriority = 1;
|
|
22090
22333
|
}
|
|
22091
22334
|
(async () => {
|
|
22092
|
-
var _a;
|
|
22335
|
+
var _a, _b, _c;
|
|
22093
22336
|
if (this.disposed) {
|
|
22094
22337
|
return;
|
|
22095
22338
|
}
|
|
@@ -22102,6 +22345,8 @@ var AssemblyRenderManager;
|
|
|
22102
22345
|
if (this.disposed) {
|
|
22103
22346
|
return;
|
|
22104
22347
|
}
|
|
22348
|
+
// Build hierarchy node cache for quick lookups
|
|
22349
|
+
this.buildHierarchyNodes(hierarchy);
|
|
22105
22350
|
const traverseHierarchy = (node, leavesOnly) => {
|
|
22106
22351
|
var _a;
|
|
22107
22352
|
if (node.Children) {
|
|
@@ -22174,7 +22419,8 @@ var AssemblyRenderManager;
|
|
|
22174
22419
|
accountId: this.getters.GetAccountId(),
|
|
22175
22420
|
entityTypeId: entity.Bruce["EntityType.ID"],
|
|
22176
22421
|
name: entity.Bruce.Name,
|
|
22177
|
-
rootId: rootId
|
|
22422
|
+
rootId: rootId,
|
|
22423
|
+
parentId: (_c = (_b = this.hierarchyNodeByEntityId) === null || _b === void 0 ? void 0 : _b[entity.Bruce.ID]) === null || _c === void 0 ? void 0 : _c.parentId
|
|
22178
22424
|
},
|
|
22179
22425
|
requestRender: false
|
|
22180
22426
|
});
|
|
@@ -22202,6 +22448,210 @@ var AssemblyRenderManager;
|
|
|
22202
22448
|
entityIds = entities.map(x => { var _a; return (_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.ID; });
|
|
22203
22449
|
}
|
|
22204
22450
|
}
|
|
22451
|
+
/**
|
|
22452
|
+
* Builds quick look-up of the hierarchy nodes by entity ID.
|
|
22453
|
+
* @param hierarchy The hierarchy data from the API
|
|
22454
|
+
*/
|
|
22455
|
+
buildHierarchyNodes(hierarchy) {
|
|
22456
|
+
this.hierarchyNodeByEntityId = {};
|
|
22457
|
+
if (!(hierarchy === null || hierarchy === void 0 ? void 0 : hierarchy.Root)) {
|
|
22458
|
+
return;
|
|
22459
|
+
}
|
|
22460
|
+
// Use iterative approach with a stack instead of recursion
|
|
22461
|
+
const stack = [
|
|
22462
|
+
{ node: hierarchy.Root, parentId: null }
|
|
22463
|
+
];
|
|
22464
|
+
while (stack.length > 0) {
|
|
22465
|
+
const { node, parentId } = stack.pop();
|
|
22466
|
+
if (node.ID) {
|
|
22467
|
+
const cache = {
|
|
22468
|
+
entityId: node.ID,
|
|
22469
|
+
name: node.Name || node.ID,
|
|
22470
|
+
parentId: parentId
|
|
22471
|
+
};
|
|
22472
|
+
this.hierarchyNodeByEntityId[node.ID] = cache;
|
|
22473
|
+
}
|
|
22474
|
+
// Push children to stack in reverse order to maintain correct traversal
|
|
22475
|
+
if (node.Children) {
|
|
22476
|
+
for (let i = node.Children.length - 1; i >= 0; i--) {
|
|
22477
|
+
stack.push({
|
|
22478
|
+
node: node.Children[i],
|
|
22479
|
+
parentId: node.ID
|
|
22480
|
+
});
|
|
22481
|
+
}
|
|
22482
|
+
}
|
|
22483
|
+
}
|
|
22484
|
+
}
|
|
22485
|
+
/**
|
|
22486
|
+
* Gets the parent node of a given entity.
|
|
22487
|
+
* @param entityId The entity ID to find the parent for
|
|
22488
|
+
* @returns The parent node or null if no parent exists
|
|
22489
|
+
*/
|
|
22490
|
+
getParentNode(entityId) {
|
|
22491
|
+
var _a;
|
|
22492
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22493
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22494
|
+
}
|
|
22495
|
+
const node = (_a = this.hierarchyNodeByEntityId) === null || _a === void 0 ? void 0 : _a[entityId];
|
|
22496
|
+
if (node === null || node === void 0 ? void 0 : node.parentId) {
|
|
22497
|
+
return this.hierarchyNodeByEntityId[node.parentId] || null;
|
|
22498
|
+
}
|
|
22499
|
+
return null;
|
|
22500
|
+
}
|
|
22501
|
+
/**
|
|
22502
|
+
* Gets all child nodes of a given entity.
|
|
22503
|
+
* @param entityId The entity ID to find children for
|
|
22504
|
+
* @returns Array of child nodes
|
|
22505
|
+
*/
|
|
22506
|
+
getChildNodes(entityId) {
|
|
22507
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22508
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22509
|
+
}
|
|
22510
|
+
const children = [];
|
|
22511
|
+
for (const nodeId in this.hierarchyNodeByEntityId) {
|
|
22512
|
+
const node = this.hierarchyNodeByEntityId[nodeId];
|
|
22513
|
+
if (node.parentId === entityId) {
|
|
22514
|
+
children.push(node);
|
|
22515
|
+
}
|
|
22516
|
+
}
|
|
22517
|
+
return children;
|
|
22518
|
+
}
|
|
22519
|
+
/**
|
|
22520
|
+
* Gets all descendant nodes of a given entity (children, grandchildren, etc.).
|
|
22521
|
+
* @param entityId The entity ID to find descendants for
|
|
22522
|
+
* @returns Array of descendant nodes
|
|
22523
|
+
*/
|
|
22524
|
+
getDescendantNodes(entityId) {
|
|
22525
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22526
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22527
|
+
}
|
|
22528
|
+
const descendants = [];
|
|
22529
|
+
const stack = [entityId];
|
|
22530
|
+
// Use iterative approach with a stack instead of recursion
|
|
22531
|
+
while (stack.length > 0) {
|
|
22532
|
+
const currentId = stack.pop();
|
|
22533
|
+
if (!currentId)
|
|
22534
|
+
continue;
|
|
22535
|
+
for (const nodeId in this.hierarchyNodeByEntityId) {
|
|
22536
|
+
const node = this.hierarchyNodeByEntityId[nodeId];
|
|
22537
|
+
if (node.parentId === currentId) {
|
|
22538
|
+
descendants.push(node);
|
|
22539
|
+
stack.push(node.entityId);
|
|
22540
|
+
}
|
|
22541
|
+
}
|
|
22542
|
+
}
|
|
22543
|
+
return descendants;
|
|
22544
|
+
}
|
|
22545
|
+
/**
|
|
22546
|
+
* Gets the root node of the hierarchy.
|
|
22547
|
+
* @returns The root node or null if no hierarchy exists
|
|
22548
|
+
*/
|
|
22549
|
+
getRootNode() {
|
|
22550
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22551
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22552
|
+
}
|
|
22553
|
+
// Find the node with no parent (root node)
|
|
22554
|
+
for (const nodeId in this.hierarchyNodeByEntityId) {
|
|
22555
|
+
const node = this.hierarchyNodeByEntityId[nodeId];
|
|
22556
|
+
if (!node.parentId) {
|
|
22557
|
+
return node;
|
|
22558
|
+
}
|
|
22559
|
+
}
|
|
22560
|
+
return null;
|
|
22561
|
+
}
|
|
22562
|
+
/**
|
|
22563
|
+
* Gets the path from root to a given entity.
|
|
22564
|
+
* @param entityId The entity ID to find the path for
|
|
22565
|
+
* @returns Array of node IDs representing the path from root to the entity
|
|
22566
|
+
*/
|
|
22567
|
+
getNodePath(entityId) {
|
|
22568
|
+
var _a;
|
|
22569
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22570
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22571
|
+
}
|
|
22572
|
+
const path = [];
|
|
22573
|
+
let currentId = entityId;
|
|
22574
|
+
while (currentId) {
|
|
22575
|
+
const node = (_a = this.hierarchyNodeByEntityId) === null || _a === void 0 ? void 0 : _a[currentId];
|
|
22576
|
+
if (!node) {
|
|
22577
|
+
break;
|
|
22578
|
+
}
|
|
22579
|
+
path.unshift(currentId);
|
|
22580
|
+
currentId = node.parentId;
|
|
22581
|
+
}
|
|
22582
|
+
return path;
|
|
22583
|
+
}
|
|
22584
|
+
/**
|
|
22585
|
+
* Batch operation to get multiple node paths efficiently.
|
|
22586
|
+
* @param entityIds Array of entity IDs to get paths for
|
|
22587
|
+
* @returns Map of entityId to path array
|
|
22588
|
+
*/
|
|
22589
|
+
getNodePathsBatch(entityIds) {
|
|
22590
|
+
var _a;
|
|
22591
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22592
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22593
|
+
}
|
|
22594
|
+
const paths = new Map();
|
|
22595
|
+
for (const entityId of entityIds) {
|
|
22596
|
+
const path = [];
|
|
22597
|
+
let currentId = entityId;
|
|
22598
|
+
while (currentId) {
|
|
22599
|
+
const node = (_a = this.hierarchyNodeByEntityId) === null || _a === void 0 ? void 0 : _a[currentId];
|
|
22600
|
+
if (!node) {
|
|
22601
|
+
break;
|
|
22602
|
+
}
|
|
22603
|
+
path.unshift(currentId);
|
|
22604
|
+
currentId = node.parentId;
|
|
22605
|
+
}
|
|
22606
|
+
paths.set(entityId, path);
|
|
22607
|
+
}
|
|
22608
|
+
return paths;
|
|
22609
|
+
}
|
|
22610
|
+
/**
|
|
22611
|
+
* Batch operation to get multiple parent nodes efficiently.
|
|
22612
|
+
* @param entityIds Array of entity IDs to get parents for
|
|
22613
|
+
* @returns Map of entityId to parent node
|
|
22614
|
+
*/
|
|
22615
|
+
getParentNodesBatch(entityIds) {
|
|
22616
|
+
var _a;
|
|
22617
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22618
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22619
|
+
}
|
|
22620
|
+
const parents = new Map();
|
|
22621
|
+
for (const entityId of entityIds) {
|
|
22622
|
+
const node = (_a = this.hierarchyNodeByEntityId) === null || _a === void 0 ? void 0 : _a[entityId];
|
|
22623
|
+
if (node === null || node === void 0 ? void 0 : node.parentId) {
|
|
22624
|
+
parents.set(entityId, this.hierarchyNodeByEntityId[node.parentId] || null);
|
|
22625
|
+
}
|
|
22626
|
+
else {
|
|
22627
|
+
parents.set(entityId, null);
|
|
22628
|
+
}
|
|
22629
|
+
}
|
|
22630
|
+
return parents;
|
|
22631
|
+
}
|
|
22632
|
+
/**
|
|
22633
|
+
* Batch operation to get multiple child nodes efficiently.
|
|
22634
|
+
* @param entityIds Array of entity IDs to get children for
|
|
22635
|
+
* @returns Map of entityId to array of child nodes
|
|
22636
|
+
*/
|
|
22637
|
+
getChildNodesBatch(entityIds) {
|
|
22638
|
+
if (this.hierarchyNodeByEntityId == null && this.hierarchy) {
|
|
22639
|
+
this.buildHierarchyNodes(this.hierarchy);
|
|
22640
|
+
}
|
|
22641
|
+
const children = new Map();
|
|
22642
|
+
// Initialize all entityIds with empty arrays
|
|
22643
|
+
for (const entityId of entityIds) {
|
|
22644
|
+
children.set(entityId, []);
|
|
22645
|
+
}
|
|
22646
|
+
// Build a reverse lookup for efficiency
|
|
22647
|
+
for (const nodeId in this.hierarchyNodeByEntityId) {
|
|
22648
|
+
const node = this.hierarchyNodeByEntityId[nodeId];
|
|
22649
|
+
if (node.parentId && children.has(node.parentId)) {
|
|
22650
|
+
children.get(node.parentId).push(node);
|
|
22651
|
+
}
|
|
22652
|
+
}
|
|
22653
|
+
return children;
|
|
22654
|
+
}
|
|
22205
22655
|
}
|
|
22206
22656
|
AssemblyRenderManager.Manager = Manager;
|
|
22207
22657
|
})(AssemblyRenderManager || (AssemblyRenderManager = {}));
|
|
@@ -32412,7 +32862,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
32412
32862
|
}
|
|
32413
32863
|
}
|
|
32414
32864
|
|
|
32415
|
-
const VERSION = "5.8.
|
|
32865
|
+
const VERSION = "5.8.6";
|
|
32416
32866
|
|
|
32417
32867
|
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isOutlineChanged, 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 };
|
|
32418
32868
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|