bruce-cesium 7.2.5 → 7.2.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 +72 -26
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +70 -24
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/displaced-surface-primitive.js +5 -1
- package/dist/lib/rendering/displaced-surface-primitive.js.map +1 -1
- package/dist/lib/rendering/entity-gatherer.js +62 -20
- package/dist/lib/rendering/entity-gatherer.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/entity-gatherer.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cesium from 'cesium';
|
|
2
|
-
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1,
|
|
3
|
-
import { Cartes, Entity as Entity$1, ProjectViewTile, ENVIRONMENT,
|
|
2
|
+
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ShaderSource, Cartesian3, Math as Math$1, Ellipsoid, Transforms, Matrix4, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, Cartesian2, DistanceDisplayCondition, ClassificationType, ArcType, HeightReference, CornerType, ShadowMode, ConstantPositionProperty, JulianDate, Quaternion, HeadingPitchRoll, ColorBlendMode, Model, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, SceneTransforms, HorizontalOrigin, VerticalOrigin, NearFarScalar, Matrix3, KmlDataSource, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, Cesium3DTileColorBlendMode, IonResource, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileset, OrthographicFrustum, EasingFunction, Intersect, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, CustomDataSource, ScreenSpaceEventHandler, ScreenSpaceEventType, GeometryInstance, Fullscreen, CzmlDataSource } from 'cesium';
|
|
3
|
+
import { Cartes, Entity as Entity$1, ProjectViewTile, ENVIRONMENT, Calculator, Carto, EntityTag, EntityType, Geometry as Geometry$1, ObjectUtils, Style, ClientFile, EntityLod, LRUCache, Bounds, Color as Color$1, Api, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, DelayQueue, DataLab, EntityRelation, BruceApi, AccountConcept, RecordChangeFeed, EntitySource, ProgramKey, ProjectViewLegacyTile, Camera, Account, AccountLimits, Session, UrlUtils, ProjectViewBookmarkGroup, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType, EntityHistoricData } from 'bruce-models';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a number is returned from a given value.
|
|
@@ -14131,6 +14131,8 @@ class EntityGatherer {
|
|
|
14131
14131
|
this.lastFoundDateTimes = new Map();
|
|
14132
14132
|
// ID of Entity IDs that need to be requested.
|
|
14133
14133
|
this.eIdQueue = [];
|
|
14134
|
+
// Membership mirror of eIdQueue for quick checks.
|
|
14135
|
+
this.eIdQueued = new Set();
|
|
14134
14136
|
// Resolves where an Entity sits without reading its record, when the caller can say.
|
|
14135
14137
|
// Unset leaves the queue in insertion order, which is what sources that bake no coordinates get.
|
|
14136
14138
|
this.positionOf = null;
|
|
@@ -14240,6 +14242,7 @@ class EntityGatherer {
|
|
|
14240
14242
|
return;
|
|
14241
14243
|
}
|
|
14242
14244
|
this.eIdQueue = [];
|
|
14245
|
+
this.eIdQueued.clear();
|
|
14243
14246
|
this.priorityCount = 0;
|
|
14244
14247
|
this.lastOrderFocus = null;
|
|
14245
14248
|
this.allEIds.clear();
|
|
@@ -14251,6 +14254,7 @@ class EntityGatherer {
|
|
|
14251
14254
|
return;
|
|
14252
14255
|
}
|
|
14253
14256
|
this.eIdQueue = Array.from(this.allEIds);
|
|
14257
|
+
this.eIdQueued = new Set(this.eIdQueue);
|
|
14254
14258
|
this.priorityCount = 0;
|
|
14255
14259
|
this.lastOrderFocus = null;
|
|
14256
14260
|
}
|
|
@@ -14340,27 +14344,58 @@ class EntityGatherer {
|
|
|
14340
14344
|
return;
|
|
14341
14345
|
}
|
|
14342
14346
|
let changes = 0;
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
|
|
14349
|
-
|
|
14350
|
-
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14347
|
+
if (topOfQueue) {
|
|
14348
|
+
// Walked back to front so a repeated ID keeps the position of its last occurrence, then
|
|
14349
|
+
// laid down in that order, which is where inserting one at a time leaves them.
|
|
14350
|
+
const toFront = [];
|
|
14351
|
+
const promoting = new Set();
|
|
14352
|
+
let anyAlreadyQueued = false;
|
|
14353
|
+
for (let i = entityIds.length - 1; i >= 0; i--) {
|
|
14354
|
+
const eId = entityIds[i];
|
|
14355
|
+
this.allEIds.add(eId);
|
|
14356
|
+
if (promoting.has(eId)) {
|
|
14357
|
+
continue;
|
|
14358
|
+
}
|
|
14359
|
+
promoting.add(eId);
|
|
14360
|
+
toFront.push(eId);
|
|
14361
|
+
if (this.eIdQueued.has(eId)) {
|
|
14362
|
+
anyAlreadyQueued = true;
|
|
14363
|
+
}
|
|
14364
|
+
}
|
|
14365
|
+
if (anyAlreadyQueued && this.eIdQueue.length) {
|
|
14366
|
+
const kept = [];
|
|
14367
|
+
let removedFromPriority = 0;
|
|
14368
|
+
for (let i = 0; i < this.eIdQueue.length; i++) {
|
|
14369
|
+
const eId = this.eIdQueue[i];
|
|
14370
|
+
if (promoting.has(eId)) {
|
|
14371
|
+
if (i < this.priorityCount) {
|
|
14372
|
+
removedFromPriority += 1;
|
|
14373
|
+
}
|
|
14374
|
+
continue;
|
|
14375
|
+
}
|
|
14376
|
+
kept.push(eId);
|
|
14377
|
+
}
|
|
14378
|
+
this.eIdQueue = kept;
|
|
14379
|
+
this.priorityCount = Math.max(0, this.priorityCount - removedFromPriority);
|
|
14357
14380
|
}
|
|
14358
|
-
|
|
14381
|
+
this.eIdQueue = toFront.concat(this.eIdQueue);
|
|
14382
|
+
this.priorityCount += toFront.length;
|
|
14383
|
+
for (let i = 0; i < toFront.length; i++) {
|
|
14384
|
+
this.eIdQueued.add(toFront[i]);
|
|
14385
|
+
}
|
|
14386
|
+
changes = toFront.length;
|
|
14387
|
+
}
|
|
14388
|
+
else {
|
|
14389
|
+
for (let i = 0; i < entityIds.length; i++) {
|
|
14390
|
+
const eId = entityIds[i];
|
|
14391
|
+
this.allEIds.add(eId);
|
|
14392
|
+
if (this.eIdQueued.has(eId)) {
|
|
14393
|
+
continue;
|
|
14394
|
+
}
|
|
14395
|
+
this.eIdQueued.add(eId);
|
|
14359
14396
|
this.eIdQueue.push(eId);
|
|
14360
14397
|
changes += 1;
|
|
14361
14398
|
}
|
|
14362
|
-
// Flag that we've seen this ID.
|
|
14363
|
-
this.allEIds.add(entityIds[i]);
|
|
14364
14399
|
}
|
|
14365
14400
|
if (!changes) {
|
|
14366
14401
|
return;
|
|
@@ -14494,7 +14529,7 @@ class EntityGatherer {
|
|
|
14494
14529
|
this.emitEntities(toEmit, tags);
|
|
14495
14530
|
};
|
|
14496
14531
|
const QUEUE_BATCH_SIZE = 500;
|
|
14497
|
-
const requestedIds =
|
|
14532
|
+
const requestedIds = new Set();
|
|
14498
14533
|
// If we have a queue, we need to request those first.
|
|
14499
14534
|
if (this.eIdQueue.length) {
|
|
14500
14535
|
const total = this.eIdQueue.length;
|
|
@@ -14506,6 +14541,9 @@ class EntityGatherer {
|
|
|
14506
14541
|
this.orderQueueByCamera();
|
|
14507
14542
|
const batch = this.eIdQueue.splice(0, QUEUE_BATCH_SIZE);
|
|
14508
14543
|
this.priorityCount = Math.max(0, this.priorityCount - batch.length);
|
|
14544
|
+
for (let i = 0; i < batch.length; i++) {
|
|
14545
|
+
this.eIdQueued.delete(batch[i]);
|
|
14546
|
+
}
|
|
14509
14547
|
const { entities } = await Entity$1.GetListByIds({
|
|
14510
14548
|
entityIds: batch,
|
|
14511
14549
|
historicPoint: this.historic ? rTime : null,
|
|
@@ -14514,7 +14552,9 @@ class EntityGatherer {
|
|
|
14514
14552
|
maxSearchTimeSec: 60 * 2
|
|
14515
14553
|
});
|
|
14516
14554
|
handleResponse(batch, entities);
|
|
14517
|
-
|
|
14555
|
+
for (let i = 0; i < batch.length; i++) {
|
|
14556
|
+
requestedIds.add(batch[i]);
|
|
14557
|
+
}
|
|
14518
14558
|
done += batch.length;
|
|
14519
14559
|
if (this._onQueueProgress) {
|
|
14520
14560
|
let progress = (done / total) * 100;
|
|
@@ -14534,8 +14574,8 @@ class EntityGatherer {
|
|
|
14534
14574
|
// Now run through all IDs that we've seen and request them.
|
|
14535
14575
|
// We'll skip those that we just requested.
|
|
14536
14576
|
let allEIds = Array.from(this.allEIds);
|
|
14537
|
-
if (requestedIds.
|
|
14538
|
-
allEIds = allEIds.filter((eId) => requestedIds.
|
|
14577
|
+
if (requestedIds.size) {
|
|
14578
|
+
allEIds = allEIds.filter((eId) => !requestedIds.has(eId));
|
|
14539
14579
|
}
|
|
14540
14580
|
if (allEIds.length) {
|
|
14541
14581
|
// A historic tick re-reads the whole set, so the near ones are worth resolving
|
|
@@ -14554,7 +14594,9 @@ class EntityGatherer {
|
|
|
14554
14594
|
maxSearchTimeSec: 60 * 2
|
|
14555
14595
|
});
|
|
14556
14596
|
handleResponse(batch, entities);
|
|
14557
|
-
|
|
14597
|
+
for (let i = 0; i < batch.length; i++) {
|
|
14598
|
+
requestedIds.add(batch[i]);
|
|
14599
|
+
}
|
|
14558
14600
|
}
|
|
14559
14601
|
}
|
|
14560
14602
|
// If we had leftovers because we stopped early, we need to re-run the tick.
|
|
@@ -42605,7 +42647,11 @@ void main() {
|
|
|
42605
42647
|
// Value zero sits at the polygon's own altitude, plus the terrain underneath when the polygon
|
|
42606
42648
|
// is following the ground rather than absolutely positioned.
|
|
42607
42649
|
float ground = sampleGround(st) * u_groundWeight;
|
|
42608
|
-
|
|
42650
|
+
|
|
42651
|
+
// Coverage scales the displacement only where it is measured from the terrain, because there a
|
|
42652
|
+
// zero means the surface sits on the ground.
|
|
42653
|
+
float coverageScale = mix(1.0, texel.a, u_groundWeight);
|
|
42654
|
+
float displacement = u_baseHeight + ground + metres * coverageScale - skirt * u_skirtDepth;
|
|
42609
42655
|
|
|
42610
42656
|
// Added to the LOW half of the encoded position: a metre-scale offset added to the high half
|
|
42611
42657
|
// would be lost to float32 rounding at an earth radius.
|
|
@@ -45911,7 +45957,7 @@ var StyleUtils;
|
|
|
45911
45957
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
45912
45958
|
})(StyleUtils || (StyleUtils = {}));
|
|
45913
45959
|
|
|
45914
|
-
const VERSION = "7.2.
|
|
45960
|
+
const VERSION = "7.2.7";
|
|
45915
45961
|
/**
|
|
45916
45962
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
45917
45963
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|