bruce-cesium 7.8.3 → 7.8.5
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 +260 -35
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +258 -33
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/common/entity-label-group.js +201 -20
- package/dist/lib/rendering/render-managers/common/entity-label-group.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/entity-label.js +14 -1
- package/dist/lib/rendering/render-managers/common/entity-label.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +32 -0
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/lib/rendering/xgrids-render-engine.js +10 -11
- package/dist/lib/rendering/xgrids-render-engine.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/common/entity-label-group.d.ts +33 -0
- package/dist/types/rendering/render-managers/common/entity-label.d.ts +1 -0
- package/dist/types/rendering/visuals-register.d.ts +5 -0
- package/dist/types/rendering/xgrids-render-engine.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -9660,8 +9660,18 @@
|
|
|
9660
9660
|
if (!selectOnClick || this.disposed || this.counter !== counter || !clickEntityIds.length || !this.visualRegister) {
|
|
9661
9661
|
return;
|
|
9662
9662
|
}
|
|
9663
|
+
// A group's places name no Entity to select, so the app is told about them instead.
|
|
9664
|
+
const places = clickEntityIds.filter(id => { var _a, _b; return (_b = (_a = this.visualRegister.GetLabelGroupFor(id)) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.placeId; });
|
|
9665
|
+
if (places.length) {
|
|
9666
|
+
const keys = event;
|
|
9667
|
+
this.visualRegister.ClickLabelPlaces(places, Boolean(keys.ctrlKey || keys.metaKey || keys.shiftKey));
|
|
9668
|
+
}
|
|
9669
|
+
const entityIds = clickEntityIds.filter(id => !places.includes(id));
|
|
9670
|
+
if (!entityIds.length) {
|
|
9671
|
+
return;
|
|
9672
|
+
}
|
|
9663
9673
|
this.visualRegister.ClearSelected({ requestRender: false });
|
|
9664
|
-
this.visualRegister.SetSelected({ entityIds
|
|
9674
|
+
this.visualRegister.SetSelected({ entityIds, selected: true });
|
|
9665
9675
|
};
|
|
9666
9676
|
const makeClickable = (target) => {
|
|
9667
9677
|
if (!selectOnClick || !this.visualRegister) {
|
|
@@ -9835,6 +9845,9 @@
|
|
|
9835
9845
|
ele.style.width = "max-content";
|
|
9836
9846
|
layer.element.appendChild(ele);
|
|
9837
9847
|
}
|
|
9848
|
+
// Follows the drawn shape, so a pin glows as a pin rather than as its box.
|
|
9849
|
+
const glow = this.options.highlightColor;
|
|
9850
|
+
ele.style.filter = glow ? `drop-shadow(0 0 1.5px ${glow}) drop-shadow(0 0 1.5px ${glow}) drop-shadow(0 0 4px ${glow})` : "";
|
|
9838
9851
|
if (this.line) {
|
|
9839
9852
|
lineEle = this.line;
|
|
9840
9853
|
runEle = this.leaderRun;
|
|
@@ -11159,6 +11172,39 @@
|
|
|
11159
11172
|
})(exports.EntityLabel || (exports.EntityLabel = {}));
|
|
11160
11173
|
|
|
11161
11174
|
(function (EntityLabelGroup) {
|
|
11175
|
+
// The glow a selected place is drawn with.
|
|
11176
|
+
const PLACE_SELECTED_COLOR = "#33B1FF";
|
|
11177
|
+
// Keys places share the entity bookkeeping under, scoped to their group so a copied group keeps its own.
|
|
11178
|
+
const PLACE_KEY_PREFIX = "place:";
|
|
11179
|
+
function GetPlaceKey(groupId, placeId) {
|
|
11180
|
+
return `${PLACE_KEY_PREFIX}${groupId}:${placeId}`;
|
|
11181
|
+
}
|
|
11182
|
+
EntityLabelGroup.GetPlaceKey = GetPlaceKey;
|
|
11183
|
+
function IsPlaceKey(key) {
|
|
11184
|
+
return typeof key === "string" && key.startsWith(PLACE_KEY_PREFIX);
|
|
11185
|
+
}
|
|
11186
|
+
EntityLabelGroup.IsPlaceKey = IsPlaceKey;
|
|
11187
|
+
/*
|
|
11188
|
+
* A group's places as label items, leaving out any without an id or a position on the globe.
|
|
11189
|
+
*/
|
|
11190
|
+
function FromPlaces(groupId, places) {
|
|
11191
|
+
return (Array.isArray(places) ? places : []).filter(place => {
|
|
11192
|
+
var _a;
|
|
11193
|
+
return typeof (place === null || place === void 0 ? void 0 : place.id) === "string" && place.id &&
|
|
11194
|
+
[place.longitude, place.latitude, (_a = place.altitude) !== null && _a !== void 0 ? _a : 0].every(Number.isFinite) &&
|
|
11195
|
+
Math.abs(place.latitude) <= 90;
|
|
11196
|
+
}).map(place => ({
|
|
11197
|
+
entityId: GetPlaceKey(groupId, place.id),
|
|
11198
|
+
placeId: place.id,
|
|
11199
|
+
text: place.text,
|
|
11200
|
+
longitude: place.longitude,
|
|
11201
|
+
latitude: place.latitude,
|
|
11202
|
+
altitude: place.altitude,
|
|
11203
|
+
look: place.look,
|
|
11204
|
+
selected: place.selected || undefined
|
|
11205
|
+
}));
|
|
11206
|
+
}
|
|
11207
|
+
EntityLabelGroup.FromPlaces = FromPlaces;
|
|
11162
11208
|
/*
|
|
11163
11209
|
* Keeps the query response useful even when the Entity has no loaded visual yet.
|
|
11164
11210
|
* An Assembly part is placed from its record when shown (Manager.RefreshEntity); Location is its fallback.
|
|
@@ -11348,6 +11394,7 @@
|
|
|
11348
11394
|
this.imagesQueued = new Set();
|
|
11349
11395
|
this.imagesAsking = new Set();
|
|
11350
11396
|
this.imagesTimer = null;
|
|
11397
|
+
this.placesInteractive = false;
|
|
11351
11398
|
}
|
|
11352
11399
|
notify() {
|
|
11353
11400
|
try {
|
|
@@ -11375,7 +11422,7 @@
|
|
|
11375
11422
|
return true;
|
|
11376
11423
|
}
|
|
11377
11424
|
async Set(definition) {
|
|
11378
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11425
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
11379
11426
|
if (!(definition === null || definition === void 0 ? void 0 : definition.id) || !definition.source) {
|
|
11380
11427
|
throw new Error("Label group requires id and source");
|
|
11381
11428
|
}
|
|
@@ -11397,7 +11444,7 @@
|
|
|
11397
11444
|
}
|
|
11398
11445
|
this.errors.delete(definition.id);
|
|
11399
11446
|
this.notify();
|
|
11400
|
-
const cancelled = () => ({ id: definition.id, entityIds: [], truncated: false, cancelled: true });
|
|
11447
|
+
const cancelled = () => ({ id: definition.id, entityIds: [], placeIds: [], truncated: false, cancelled: true });
|
|
11401
11448
|
const items = new Map();
|
|
11402
11449
|
let truncated = false;
|
|
11403
11450
|
try {
|
|
@@ -11439,6 +11486,11 @@
|
|
|
11439
11486
|
}
|
|
11440
11487
|
offset = next;
|
|
11441
11488
|
}
|
|
11489
|
+
// Placed by hand, so outside maxItems; read again as SetPlaces may change them during the load.
|
|
11490
|
+
definition = (_j = this.definitions.get(definition.id)) !== null && _j !== void 0 ? _j : definition;
|
|
11491
|
+
for (const place of FromPlaces(definition.id, definition.places)) {
|
|
11492
|
+
items.set(place.entityId, place);
|
|
11493
|
+
}
|
|
11442
11494
|
const previous = this.active.get(definition.id);
|
|
11443
11495
|
const affected = new Set([...((previous === null || previous === void 0 ? void 0 : previous.items.keys()) || []), ...items.keys()]);
|
|
11444
11496
|
this.unindex(definition.id);
|
|
@@ -11452,7 +11504,7 @@
|
|
|
11452
11504
|
this.members.get(id).add(definition.id);
|
|
11453
11505
|
}
|
|
11454
11506
|
this.refresh(affected);
|
|
11455
|
-
return { id: definition.id,
|
|
11507
|
+
return { id: definition.id, ...splitKeys(items), truncated, cancelled: false };
|
|
11456
11508
|
}
|
|
11457
11509
|
catch (error) {
|
|
11458
11510
|
if (controller.signal.aborted || this.register.Disposed) {
|
|
@@ -11468,13 +11520,90 @@
|
|
|
11468
11520
|
}
|
|
11469
11521
|
}
|
|
11470
11522
|
}
|
|
11523
|
+
/*
|
|
11524
|
+
* Replaces a group's places without reading its source again, redrawing only the places that changed.
|
|
11525
|
+
*/
|
|
11526
|
+
SetPlaces(id, places) {
|
|
11527
|
+
var _a, _b;
|
|
11528
|
+
const definition = this.definitions.get(id);
|
|
11529
|
+
if (!definition) {
|
|
11530
|
+
return false;
|
|
11531
|
+
}
|
|
11532
|
+
this.definitions.set(id, { ...definition, places: copyOptions(places) });
|
|
11533
|
+
const group = this.active.get(id);
|
|
11534
|
+
if (!group) {
|
|
11535
|
+
// Still loading, and Set takes them from the definition when it commits.
|
|
11536
|
+
return true;
|
|
11537
|
+
}
|
|
11538
|
+
group.definition = this.definitions.get(id);
|
|
11539
|
+
const next = new Map(FromPlaces(id, places).map(item => [item.entityId, item]));
|
|
11540
|
+
const changed = new Set();
|
|
11541
|
+
for (const [key, item] of group.items) {
|
|
11542
|
+
if (item.placeId && JSON.stringify(item) !== JSON.stringify(next.get(key))) {
|
|
11543
|
+
changed.add(key);
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
for (const [key, item] of next) {
|
|
11547
|
+
if (JSON.stringify(item) !== JSON.stringify(group.items.get(key))) {
|
|
11548
|
+
changed.add(key);
|
|
11549
|
+
}
|
|
11550
|
+
}
|
|
11551
|
+
if (!changed.size) {
|
|
11552
|
+
return true;
|
|
11553
|
+
}
|
|
11554
|
+
for (const key of changed) {
|
|
11555
|
+
const item = next.get(key);
|
|
11556
|
+
if (item) {
|
|
11557
|
+
group.items.set(key, item);
|
|
11558
|
+
if (!this.members.has(key)) {
|
|
11559
|
+
this.members.set(key, new Set());
|
|
11560
|
+
}
|
|
11561
|
+
this.members.get(key).add(id);
|
|
11562
|
+
}
|
|
11563
|
+
else {
|
|
11564
|
+
group.items.delete(key);
|
|
11565
|
+
(_a = this.members.get(key)) === null || _a === void 0 ? void 0 : _a.delete(id);
|
|
11566
|
+
if (!((_b = this.members.get(key)) === null || _b === void 0 ? void 0 : _b.size)) {
|
|
11567
|
+
this.members.delete(key);
|
|
11568
|
+
}
|
|
11569
|
+
}
|
|
11570
|
+
}
|
|
11571
|
+
// A place that stays where it is takes its new look in place, so a highlight or a colour never flickers it.
|
|
11572
|
+
const moved = new Set([...changed].filter(key => !SameSpot(this.standaloneItems.get(key), group.items.get(key))));
|
|
11573
|
+
this.refresh(moved);
|
|
11574
|
+
for (const key of changed) {
|
|
11575
|
+
if (!moved.has(key)) {
|
|
11576
|
+
this.RefreshEntity(key);
|
|
11577
|
+
}
|
|
11578
|
+
}
|
|
11579
|
+
this.notify();
|
|
11580
|
+
return true;
|
|
11581
|
+
}
|
|
11582
|
+
/*
|
|
11583
|
+
* Whether a click on a place is reported to the app, as it is while the app lets its markup be edited.
|
|
11584
|
+
*/
|
|
11585
|
+
SetPlacesInteractive(on) {
|
|
11586
|
+
if (this.placesInteractive === on) {
|
|
11587
|
+
return;
|
|
11588
|
+
}
|
|
11589
|
+
this.placesInteractive = on;
|
|
11590
|
+
const keys = new Set();
|
|
11591
|
+
for (const group of this.active.values()) {
|
|
11592
|
+
for (const [key, item] of group.items) {
|
|
11593
|
+
if (item.placeId) {
|
|
11594
|
+
keys.add(key);
|
|
11595
|
+
}
|
|
11596
|
+
}
|
|
11597
|
+
}
|
|
11598
|
+
this.refresh(keys);
|
|
11599
|
+
}
|
|
11471
11600
|
Get() {
|
|
11472
11601
|
return Array.from(this.definitions.keys(), id => {
|
|
11473
11602
|
var _a;
|
|
11474
11603
|
const group = this.active.get(id);
|
|
11475
11604
|
return {
|
|
11476
11605
|
id,
|
|
11477
|
-
|
|
11606
|
+
...splitKeys(group === null || group === void 0 ? void 0 : group.items),
|
|
11478
11607
|
truncated: (_a = group === null || group === void 0 ? void 0 : group.truncated) !== null && _a !== void 0 ? _a : false,
|
|
11479
11608
|
cancelled: false,
|
|
11480
11609
|
visible: this.visibility.get(id) !== false,
|
|
@@ -11493,21 +11622,22 @@
|
|
|
11493
11622
|
return false;
|
|
11494
11623
|
}
|
|
11495
11624
|
Resolve(entityId, menuItemId) {
|
|
11496
|
-
var _a, _b, _c, _d, _e;
|
|
11625
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11497
11626
|
const ids = Array.from(this.members.get(entityId) || []).reverse();
|
|
11498
11627
|
for (const id of ids) {
|
|
11499
11628
|
const group = this.active.get(id);
|
|
11500
11629
|
if (this.visibility.get(id) === false) {
|
|
11501
11630
|
continue;
|
|
11502
11631
|
}
|
|
11503
|
-
|
|
11632
|
+
// A place belongs to its group alone, never to a menu item's Entities.
|
|
11633
|
+
if (group.definition.menuItemId && group.definition.menuItemId !== menuItemId && !((_a = group.items.get(entityId)) === null || _a === void 0 ? void 0 : _a.placeId)) {
|
|
11504
11634
|
continue;
|
|
11505
11635
|
}
|
|
11506
11636
|
const options = this.compose(group, entityId, menuItemId);
|
|
11507
11637
|
const item = group.items.get(entityId);
|
|
11508
|
-
const image = (
|
|
11638
|
+
const image = (_b = this.images.get(entityId)) !== null && _b !== void 0 ? _b : (Array.isArray((_d = (_c = item.entity) === null || _c === void 0 ? void 0 : _c.Bruce) === null || _d === void 0 ? void 0 : _d.Attachment) ? exports.EntityLabel.GetDefaultImageUrl(item.entity, (_e = this.register.ApiGetters) === null || _e === void 0 ? void 0 : _e.GetBruceApi()) : null);
|
|
11509
11639
|
if (image && !exports.EntityLabel.HasIcon(options)) {
|
|
11510
|
-
(
|
|
11640
|
+
(_f = options.photo) !== null && _f !== void 0 ? _f : (options.photo = image);
|
|
11511
11641
|
}
|
|
11512
11642
|
return { groupId: id, options, item };
|
|
11513
11643
|
}
|
|
@@ -11517,7 +11647,7 @@
|
|
|
11517
11647
|
* One member's label settings, with any image its own text links to but before its default image.
|
|
11518
11648
|
*/
|
|
11519
11649
|
compose(group, entityId, menuItemId) {
|
|
11520
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
11650
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
11521
11651
|
const item = group.items.get(entityId);
|
|
11522
11652
|
const entity = (_a = item.entity) !== null && _a !== void 0 ? _a : { Bruce: { ID: entityId, Name: item.text } };
|
|
11523
11653
|
let iconPriority = (_b = group.definition.options) === null || _b === void 0 ? void 0 : _b.iconPriority;
|
|
@@ -11552,21 +11682,42 @@
|
|
|
11552
11682
|
}
|
|
11553
11683
|
const fallbackText = [item.text, (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.Name, (_f = this.register.GetRego({ entityId, menuItemId })) === null || _f === void 0 ? void 0 : _f.name, entityId]
|
|
11554
11684
|
.find(text => typeof text === "string" && text.trim().length > 0);
|
|
11685
|
+
if (item.placeId) {
|
|
11686
|
+
// A place says what it was given: its key is no name, and an expression has no record to read.
|
|
11687
|
+
resolvedText = (_g = item.text) !== null && _g !== void 0 ? _g : "";
|
|
11688
|
+
}
|
|
11555
11689
|
const options = {
|
|
11556
11690
|
...group.definition.options,
|
|
11557
11691
|
text: resolvedText !== null && resolvedText !== void 0 ? resolvedText : fallbackText,
|
|
11558
11692
|
iconScale: iconScale,
|
|
11559
|
-
icon: resolveIcon((
|
|
11560
|
-
iconUrl: resolveIcon((
|
|
11561
|
-
iconClass: resolveIcon((
|
|
11562
|
-
iconColor: resolveIcon((
|
|
11563
|
-
iconBackground: resolveBackground((
|
|
11693
|
+
icon: resolveIcon((_h = group.definition.options) === null || _h === void 0 ? void 0 : _h.icon, entity),
|
|
11694
|
+
iconUrl: resolveIcon((_j = group.definition.options) === null || _j === void 0 ? void 0 : _j.iconUrl, entity),
|
|
11695
|
+
iconClass: resolveIcon((_k = group.definition.options) === null || _k === void 0 ? void 0 : _k.iconClass, entity),
|
|
11696
|
+
iconColor: resolveIcon((_l = group.definition.options) === null || _l === void 0 ? void 0 : _l.iconColor, entity),
|
|
11697
|
+
iconBackground: resolveBackground((_m = group.definition.options) === null || _m === void 0 ? void 0 : _m.iconBackground, entity),
|
|
11564
11698
|
iconPriority: Number.isFinite(iconPriority) ? iconPriority : item.iconPriority,
|
|
11565
|
-
iconStatus: (
|
|
11699
|
+
iconStatus: (_p = resolveIcon((_o = group.definition.options) === null || _o === void 0 ? void 0 : _o.iconStatus, entity)) !== null && _p !== void 0 ? _p : item.iconStatus
|
|
11566
11700
|
};
|
|
11701
|
+
if (item.placeId) {
|
|
11702
|
+
// Clickable only when the app asks, and reported then, as there is no Entity to select.
|
|
11703
|
+
options.selectOnClick = this.placesInteractive;
|
|
11704
|
+
options.highlightColor = item.selected ? PLACE_SELECTED_COLOR : undefined;
|
|
11705
|
+
const look = item.look;
|
|
11706
|
+
if ((look === null || look === void 0 ? void 0 : look.iconUrl) || (look === null || look === void 0 ? void 0 : look.iconClass)) {
|
|
11707
|
+
options.icon = undefined;
|
|
11708
|
+
options.iconUrl = look.iconUrl || undefined;
|
|
11709
|
+
options.iconClass = look.iconUrl ? undefined : look.iconClass;
|
|
11710
|
+
}
|
|
11711
|
+
if (look === null || look === void 0 ? void 0 : look.iconColor) {
|
|
11712
|
+
options.iconColor = look.iconColor;
|
|
11713
|
+
}
|
|
11714
|
+
if ((look === null || look === void 0 ? void 0 : look.iconBackground) != null) {
|
|
11715
|
+
options.iconBackground = look.iconBackground;
|
|
11716
|
+
}
|
|
11717
|
+
}
|
|
11567
11718
|
if (options.attributes && item.entity && !(expression && resolvedText != null)) {
|
|
11568
11719
|
options.text = [
|
|
11569
|
-
(
|
|
11720
|
+
(_s = (_q = options.text) !== null && _q !== void 0 ? _q : (_r = item.entity.Bruce) === null || _r === void 0 ? void 0 : _r.Name) !== null && _s !== void 0 ? _s : entityId,
|
|
11570
11721
|
...options.attributes.map(path => BModels.Entity.GetValue({ entity: item.entity, path })).filter(value => value != null).map(String)
|
|
11571
11722
|
].join("\n");
|
|
11572
11723
|
}
|
|
@@ -11588,7 +11739,7 @@
|
|
|
11588
11739
|
RequestImage(entityId) {
|
|
11589
11740
|
var _a, _b, _c, _d, _e, _f;
|
|
11590
11741
|
const api = (_a = this.register.ApiGetters) === null || _a === void 0 ? void 0 : _a.GetBruceApi();
|
|
11591
|
-
if (!api || !entityId || this.images.has(entityId) || this.imagesAsking.has(entityId)) {
|
|
11742
|
+
if (!api || !entityId || IsPlaceKey(entityId) || this.images.has(entityId) || this.imagesAsking.has(entityId)) {
|
|
11592
11743
|
return;
|
|
11593
11744
|
}
|
|
11594
11745
|
// Members read with their attachments already know their image, or that they have none.
|
|
@@ -11647,8 +11798,9 @@
|
|
|
11647
11798
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11648
11799
|
const match = this.Resolve(entityId);
|
|
11649
11800
|
const registered = this.register.GetRego({ entityId });
|
|
11650
|
-
if (!registered && match && this.standalone.has(entityId) && this.standaloneItems.get(entityId)
|
|
11801
|
+
if (!registered && match && this.standalone.has(entityId) && SameSpot(this.standaloneItems.get(entityId), match.item)) {
|
|
11651
11802
|
this.standalone.get(entityId).Configure({ ...match.options, text: (_b = (_a = match.options.text) !== null && _a !== void 0 ? _a : match.item.text) !== null && _b !== void 0 ? _b : entityId }, match.groupId);
|
|
11803
|
+
this.standaloneItems.set(entityId, match.item);
|
|
11652
11804
|
return;
|
|
11653
11805
|
}
|
|
11654
11806
|
(_c = this.standalone.get(entityId)) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
@@ -11661,7 +11813,7 @@
|
|
|
11661
11813
|
return;
|
|
11662
11814
|
}
|
|
11663
11815
|
const item = match.item;
|
|
11664
|
-
const position = (_d = this.assemblyPosition(item.entity)) !== null && _d !== void 0 ? _d : ([item.longitude, item.latitude, (_e = item.altitude) !== null && _e !== void 0 ? _e : 0].every(Number.isFinite) && Math.abs(item.latitude) <= 90
|
|
11816
|
+
const position = (_d = (item.placeId ? null : this.assemblyPosition(item.entity))) !== null && _d !== void 0 ? _d : ([item.longitude, item.latitude, (_e = item.altitude) !== null && _e !== void 0 ? _e : 0].every(Number.isFinite) && Math.abs(item.latitude) <= 90
|
|
11665
11817
|
? Cesium.Cartesian3.fromDegrees(item.longitude, item.latitude, item.altitude || 0)
|
|
11666
11818
|
: null);
|
|
11667
11819
|
if (!position) {
|
|
@@ -11679,6 +11831,10 @@
|
|
|
11679
11831
|
options: { ...match.options, text: (_h = (_g = match.options.text) !== null && _g !== void 0 ? _g : item.text) !== null && _h !== void 0 ? _h : entityId },
|
|
11680
11832
|
groupId: match.groupId,
|
|
11681
11833
|
visible: () => {
|
|
11834
|
+
// A place is markup, which isolating Entities leaves alone.
|
|
11835
|
+
if (item.placeId) {
|
|
11836
|
+
return true;
|
|
11837
|
+
}
|
|
11682
11838
|
const state = this.register.GetState({ entityId });
|
|
11683
11839
|
return !state.hidden && (!this.register.GetIsIsolatedAny() || state.isolated || this.register.GetIsolationOpacity() != null);
|
|
11684
11840
|
}
|
|
@@ -11802,11 +11958,49 @@
|
|
|
11802
11958
|
this.standalone.delete(id);
|
|
11803
11959
|
this.standaloneItems.delete(id);
|
|
11804
11960
|
}
|
|
11805
|
-
|
|
11961
|
+
const all = Array.from(ids);
|
|
11962
|
+
this.register.ForceUpdate({ entityIds: all.filter(id => !IsPlaceKey(id)) });
|
|
11963
|
+
// Places skip the register, whose update events would announce them to the app as Entities.
|
|
11964
|
+
for (const id of all.filter(IsPlaceKey)) {
|
|
11965
|
+
this.RefreshEntity(id);
|
|
11966
|
+
}
|
|
11806
11967
|
this.register.Viewer.scene.requestRender();
|
|
11807
11968
|
}
|
|
11808
11969
|
}
|
|
11809
11970
|
EntityLabelGroup.Manager = Manager;
|
|
11971
|
+
/*
|
|
11972
|
+
* Whether a standalone label already drawn for one item can be reconfigured for the other rather than drawn again.
|
|
11973
|
+
*/
|
|
11974
|
+
function SameSpot(drawn, item) {
|
|
11975
|
+
var _a, _b;
|
|
11976
|
+
if (!drawn || !item) {
|
|
11977
|
+
return false;
|
|
11978
|
+
}
|
|
11979
|
+
if (drawn === item) {
|
|
11980
|
+
return true;
|
|
11981
|
+
}
|
|
11982
|
+
return Boolean(drawn.placeId &&
|
|
11983
|
+
drawn.placeId === item.placeId &&
|
|
11984
|
+
drawn.longitude === item.longitude &&
|
|
11985
|
+
drawn.latitude === item.latitude &&
|
|
11986
|
+
((_a = drawn.altitude) !== null && _a !== void 0 ? _a : 0) === ((_b = item.altitude) !== null && _b !== void 0 ? _b : 0));
|
|
11987
|
+
}
|
|
11988
|
+
/*
|
|
11989
|
+
* A group's members split into the Entities it labels and the ids of its places.
|
|
11990
|
+
*/
|
|
11991
|
+
function splitKeys(items) {
|
|
11992
|
+
const entityIds = [];
|
|
11993
|
+
const placeIds = [];
|
|
11994
|
+
for (const [key, item] of items !== null && items !== void 0 ? items : []) {
|
|
11995
|
+
if (item.placeId) {
|
|
11996
|
+
placeIds.push(item.placeId);
|
|
11997
|
+
}
|
|
11998
|
+
else {
|
|
11999
|
+
entityIds.push(key);
|
|
12000
|
+
}
|
|
12001
|
+
}
|
|
12002
|
+
return { entityIds, placeIds };
|
|
12003
|
+
}
|
|
11810
12004
|
/*
|
|
11811
12005
|
* Rejects invalid geometry settings before they can create unbounded spatial-index work.
|
|
11812
12006
|
*/
|
|
@@ -13668,6 +13862,7 @@
|
|
|
13668
13862
|
return this.onStyleChange;
|
|
13669
13863
|
}
|
|
13670
13864
|
get OnLabelGroupsChanged() { return this.labelGroupsChanged; }
|
|
13865
|
+
get OnLabelPlaceClick() { return this.labelPlaceClicked; }
|
|
13671
13866
|
constructor(params) {
|
|
13672
13867
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
13673
13868
|
this.id = BModels.ObjectUtils.UId();
|
|
@@ -13721,6 +13916,7 @@
|
|
|
13721
13916
|
this.simulationRemoval = null;
|
|
13722
13917
|
this.shadowsRemoval = null;
|
|
13723
13918
|
this.labelGroupsChanged = new BModels.BruceEvent();
|
|
13919
|
+
this.labelPlaceClicked = new BModels.BruceEvent();
|
|
13724
13920
|
this.hoverRingState = {};
|
|
13725
13921
|
this.retiringHoverLabels = new Map();
|
|
13726
13922
|
/*
|
|
@@ -14720,6 +14916,7 @@
|
|
|
14720
14916
|
this.retiringHoverLabels.clear();
|
|
14721
14917
|
(_c = this.labelGroups) === null || _c === void 0 ? void 0 : _c.Dispose();
|
|
14722
14918
|
this.labelGroupsChanged.Clear();
|
|
14919
|
+
this.labelPlaceClicked.Clear();
|
|
14723
14920
|
for (const regos of Object.values(this.rego)) {
|
|
14724
14921
|
for (const rego of regos)
|
|
14725
14922
|
exports.EntityLabel.Detatch({ rego, force: true });
|
|
@@ -16493,6 +16690,35 @@
|
|
|
16493
16690
|
}
|
|
16494
16691
|
return (_b = (_a = this.labelGroups) === null || _a === void 0 ? void 0 : _a.Refresh(id)) !== null && _b !== void 0 ? _b : Promise.reject(new Error(`Unknown label group: ${id}`));
|
|
16495
16692
|
}
|
|
16693
|
+
/*
|
|
16694
|
+
* Whether clicks on label group places are reported through OnLabelPlaceClick. Off by default.
|
|
16695
|
+
*/
|
|
16696
|
+
SetLabelPlacesInteractive(on) {
|
|
16697
|
+
if (this.disposed) {
|
|
16698
|
+
return;
|
|
16699
|
+
}
|
|
16700
|
+
if (!this.labelGroups) {
|
|
16701
|
+
this.labelGroups = new exports.EntityLabelGroup.Manager(this, () => this.labelGroupsChanged.Trigger(undefined));
|
|
16702
|
+
}
|
|
16703
|
+
this.labelGroups.SetPlacesInteractive(on);
|
|
16704
|
+
}
|
|
16705
|
+
/*
|
|
16706
|
+
* Called by a label clicked while places are interactive, with the place keys it stands for.
|
|
16707
|
+
*/
|
|
16708
|
+
ClickLabelPlaces(keys, additive) {
|
|
16709
|
+
const places = keys.map(key => { var _a, _b, _c; return ({ groupId: (_a = this.GetLabelGroupFor(key)) === null || _a === void 0 ? void 0 : _a.groupId, placeId: (_c = (_b = this.GetLabelGroupFor(key)) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.placeId }); })
|
|
16710
|
+
.filter(place => place.groupId && place.placeId);
|
|
16711
|
+
if (places.length) {
|
|
16712
|
+
this.labelPlaceClicked.Trigger({ places, additive });
|
|
16713
|
+
}
|
|
16714
|
+
}
|
|
16715
|
+
/*
|
|
16716
|
+
* Replaces a group's places without reading its source again. False when no such group was set.
|
|
16717
|
+
*/
|
|
16718
|
+
SetLabelGroupPlaces(id, places) {
|
|
16719
|
+
var _a, _b;
|
|
16720
|
+
return (_b = (_a = this.labelGroups) === null || _a === void 0 ? void 0 : _a.SetPlaces(id, places)) !== null && _b !== void 0 ? _b : false;
|
|
16721
|
+
}
|
|
16496
16722
|
SetLabelGroupVisible(id, visible) {
|
|
16497
16723
|
var _a, _b;
|
|
16498
16724
|
return (_b = (_a = this.labelGroups) === null || _a === void 0 ? void 0 : _a.SetVisible(id, visible)) !== null && _b !== void 0 ? _b : false;
|
|
@@ -29875,7 +30101,7 @@
|
|
|
29875
30101
|
* Loads a scan with optional SDK tuning and per-viewer budget control.
|
|
29876
30102
|
*/
|
|
29877
30103
|
function Render(params) {
|
|
29878
|
-
var _a, _b, _c
|
|
30104
|
+
var _a, _b, _c;
|
|
29879
30105
|
const { api, viewer, tileset } = params;
|
|
29880
30106
|
if (typeof LCCRender === "undefined" || typeof (LCCRender === null || LCCRender === void 0 ? void 0 : LCCRender.load) !== "function") {
|
|
29881
30107
|
console.warn("[XGridsRenderEngine] Render() LCCRender library not available.");
|
|
@@ -30006,8 +30232,7 @@
|
|
|
30006
30232
|
return null;
|
|
30007
30233
|
}
|
|
30008
30234
|
try {
|
|
30009
|
-
|
|
30010
|
-
maxSplats = GetSplatBudget(sdkBudget, profile);
|
|
30235
|
+
maxSplats = GetSplatBudget(profile);
|
|
30011
30236
|
if (LCCRender.nextspaceMetadataReady === 1 &&
|
|
30012
30237
|
typeof obj.setNextspaceMetadataCallback === "function" &&
|
|
30013
30238
|
typeof obj.setMaxSplats === "function") {
|
|
@@ -30049,16 +30274,16 @@
|
|
|
30049
30274
|
}
|
|
30050
30275
|
XGridsRenderEngine.Render = Render;
|
|
30051
30276
|
/*
|
|
30052
|
-
* The most splats a scan may load: the tier's,
|
|
30277
|
+
* The most splats a scan may load: the tier's, capped by what the SDK's splat texture can hold.
|
|
30053
30278
|
*/
|
|
30054
|
-
function GetSplatBudget(
|
|
30279
|
+
function GetSplatBudget(profile) {
|
|
30280
|
+
var _a;
|
|
30055
30281
|
const budget = exports.DeviceProfile.GetBudget(profile.tier).splats;
|
|
30056
|
-
//
|
|
30057
|
-
|
|
30058
|
-
|
|
30059
|
-
|
|
30060
|
-
|
|
30061
|
-
return Math.min(sdkBudget, budget);
|
|
30282
|
+
// The SDK's GPU guess misreads many GPU names and skips Firefox; only its texture cap is real.
|
|
30283
|
+
const size = (_a = profile.environment) === null || _a === void 0 ? void 0 : _a.maxTextureSize;
|
|
30284
|
+
if (Number.isFinite(size) &&
|
|
30285
|
+
size > 0) {
|
|
30286
|
+
return Math.min(budget, size * size / 4);
|
|
30062
30287
|
}
|
|
30063
30288
|
return budget;
|
|
30064
30289
|
}
|
|
@@ -60634,7 +60859,7 @@ void main() {
|
|
|
60634
60859
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
60635
60860
|
})(exports.StyleUtils || (exports.StyleUtils = {}));
|
|
60636
60861
|
|
|
60637
|
-
const VERSION = "7.8.
|
|
60862
|
+
const VERSION = "7.8.5";
|
|
60638
60863
|
/**
|
|
60639
60864
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
60640
60865
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|