bruce-cesium 6.5.5 → 6.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 +81 -143
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +79 -141
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine-model3d.js +17 -4
- package/dist/lib/rendering/entity-render-engine-model3d.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +4 -0
- package/dist/lib/rendering/getters/entity-filter-getter.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 +1 -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/other/assembly-render-manager.js +9 -85
- package/dist/lib/rendering/render-managers/other/assembly-render-manager.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +42 -50
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/entity-utils.d.ts +5 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Cartes, Entity as Entity$1, Calculator, EntityRelationType, EntityType, Style, ENVIRONMENT, ProjectViewTile, DelayQueue, LRUCache, BruceEvent, ObjectUtils, Geometry, EntityHistoricData, EntityLod, ZoomControl, EntityTag, Tileset, Api, EntityCoords, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, ProgramKey,
|
|
1
|
+
import { Cartes, Entity as Entity$1, Calculator, EntityRelationType, EntityType, Style, ENVIRONMENT, ProjectViewTile, DelayQueue, LRUCache, BruceEvent, ObjectUtils, Geometry, EntityHistoricData, EntityLod, ZoomControl, EntityTag, Tileset, Api, EntityCoords, DataLab, EntitySource, ClientFile, MenuItem, EntityRelation, ProgramKey, Bounds, Carto, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature,
|
|
3
|
+
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, DistanceDisplayCondition, HeightReference, ClassificationType, PolygonHierarchy, ShadowMode, ConstantPositionProperty, PolylineGraphics, ArcType, CornerType, HorizontalOrigin, VerticalOrigin, ColorBlendMode, Model, Cartesian2, SceneTransforms, Rectangle, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Ion, Cesium3DTileColorBlendMode, Cesium3DTileset, IonResource, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a number is returned from a given value.
|
|
@@ -8640,6 +8640,7 @@ var EntitiesRenderManager;
|
|
|
8640
8640
|
historicPoint: this.viewer.clock.currentTime.toString(),
|
|
8641
8641
|
schemaId: (_e = this.item.BruceEntity) === null || _e === void 0 ? void 0 : _e.schemaId,
|
|
8642
8642
|
expandSources: true,
|
|
8643
|
+
expandLocation: true,
|
|
8643
8644
|
scenario: this.scenario,
|
|
8644
8645
|
migrated: true,
|
|
8645
8646
|
maxSearchTimeSec: 60 * 2
|
|
@@ -8748,6 +8749,7 @@ var EntitiesRenderManager;
|
|
|
8748
8749
|
schemaId: (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.schemaId,
|
|
8749
8750
|
scenario: this.scenario,
|
|
8750
8751
|
expandSources: true,
|
|
8752
|
+
expandLocation: true,
|
|
8751
8753
|
migrated: true,
|
|
8752
8754
|
maxSearchTimeSec: 60 * 2
|
|
8753
8755
|
});
|
|
@@ -9680,6 +9682,7 @@ var EntitiesLoadedRenderManager;
|
|
|
9680
9682
|
api,
|
|
9681
9683
|
entityIds,
|
|
9682
9684
|
expandSources: true,
|
|
9685
|
+
expandLocation: true,
|
|
9683
9686
|
migrated: true,
|
|
9684
9687
|
maxSearchTimeSec: 60 * 2
|
|
9685
9688
|
});
|
|
@@ -10342,6 +10345,7 @@ var EntitiesIdsRenderManager;
|
|
|
10342
10345
|
historicPoint: newDateTime,
|
|
10343
10346
|
historicKey: this.item.BruceEntity.historicAttrKey,
|
|
10344
10347
|
expandSources: true,
|
|
10348
|
+
expandLocation: true,
|
|
10345
10349
|
migrated: true,
|
|
10346
10350
|
// If we're taking 5+ minutes to make a query, it's a dud.
|
|
10347
10351
|
// This is a timeout imposed on our DB and not external sources.
|
|
@@ -13064,6 +13068,8 @@ var EntityFilterGetter;
|
|
|
13064
13068
|
scenario: this.scenario,
|
|
13065
13069
|
historicKey: this.historicAttrKey,
|
|
13066
13070
|
historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : null,
|
|
13071
|
+
expandSources: true,
|
|
13072
|
+
expandLocation: true,
|
|
13067
13073
|
schemaId: this.schemaId,
|
|
13068
13074
|
filter: {
|
|
13069
13075
|
pageSize: PAGE_SIZE,
|
|
@@ -13233,6 +13239,8 @@ var EntityFilterGetter;
|
|
|
13233
13239
|
scenario: this.scenario,
|
|
13234
13240
|
historicKey: this.historicAttrKey,
|
|
13235
13241
|
historicPoint: historicAttrDateTime,
|
|
13242
|
+
expandSources: true,
|
|
13243
|
+
expandLocation: true,
|
|
13236
13244
|
schemaId: this.schemaId,
|
|
13237
13245
|
filter: {
|
|
13238
13246
|
pageSize: batch.length,
|
|
@@ -18949,8 +18957,14 @@ var AssemblyRenderManager;
|
|
|
18949
18957
|
// Won't bother with vector data for this experiment.
|
|
18950
18958
|
continue;
|
|
18951
18959
|
}
|
|
18952
|
-
const pos3d =
|
|
18953
|
-
|
|
18960
|
+
const pos3d = EntityUtils.GetPos({
|
|
18961
|
+
viewer: this.viewer,
|
|
18962
|
+
entity,
|
|
18963
|
+
recordHeightRef: HeightReference.NONE,
|
|
18964
|
+
returnHeightRef: HeightReference.NONE,
|
|
18965
|
+
allowRendered: false
|
|
18966
|
+
});
|
|
18967
|
+
const orient = EntityUtils.GetAssemblyOrientation(entity, pos3d);
|
|
18954
18968
|
if (!pos3d || !orient) {
|
|
18955
18969
|
continue;
|
|
18956
18970
|
}
|
|
@@ -19220,87 +19234,6 @@ var AssemblyRenderManager;
|
|
|
19220
19234
|
}
|
|
19221
19235
|
AssemblyRenderManager.Manager = Manager;
|
|
19222
19236
|
})(AssemblyRenderManager || (AssemblyRenderManager = {}));
|
|
19223
|
-
const axis_shift = new Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
19224
|
-
function calcEntityLocation(entity, modelSpace) {
|
|
19225
|
-
let aRootLocation = entity.Bruce.AssemblyRootLocation;
|
|
19226
|
-
// If we're in model-space we cull location.
|
|
19227
|
-
// This puts it at 0,0 lat/lon which we treat as 0,0,0 for model-space viewing.
|
|
19228
|
-
if (modelSpace) {
|
|
19229
|
-
aRootLocation = null;
|
|
19230
|
-
}
|
|
19231
|
-
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
19232
|
-
if (!worldPosition) {
|
|
19233
|
-
return null;
|
|
19234
|
-
}
|
|
19235
|
-
let offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
19236
|
-
let heading = 0;
|
|
19237
|
-
let pitch = 0;
|
|
19238
|
-
let roll = 0;
|
|
19239
|
-
if (!modelSpace) {
|
|
19240
|
-
const eTransform = entity.Bruce.Transform;
|
|
19241
|
-
if (eTransform) {
|
|
19242
|
-
if (eTransform.heading) {
|
|
19243
|
-
heading = eTransform.heading;
|
|
19244
|
-
}
|
|
19245
|
-
if (eTransform.pitch) {
|
|
19246
|
-
pitch = eTransform.pitch;
|
|
19247
|
-
}
|
|
19248
|
-
if (eTransform.roll) {
|
|
19249
|
-
roll = eTransform.roll;
|
|
19250
|
-
}
|
|
19251
|
-
}
|
|
19252
|
-
}
|
|
19253
|
-
let pos3d = Cartesian3.fromDegrees(EnsureNumber(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.longitude), EnsureNumber(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.latitude), EnsureNumber(aRootLocation === null || aRootLocation === void 0 ? void 0 : aRootLocation.altitude));
|
|
19254
|
-
const m1 = Transforms.eastNorthUpToFixedFrame(pos3d);
|
|
19255
|
-
const hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll), new HeadingPitchRoll());
|
|
19256
|
-
const transform = Matrix3.fromHeadingPitchRoll(hpr);
|
|
19257
|
-
const transformedOffset = Matrix3.multiplyByVector(transform, offset, new Cartesian3());
|
|
19258
|
-
pos3d = Matrix4.multiplyByPoint(m1, transformedOffset, new Cartesian3());
|
|
19259
|
-
return pos3d;
|
|
19260
|
-
}
|
|
19261
|
-
function calcEntityOrientation(entity, pos3d, modelSpace) {
|
|
19262
|
-
if (!entity.Bruce || !pos3d) {
|
|
19263
|
-
return null;
|
|
19264
|
-
}
|
|
19265
|
-
// 0 or 90 for these?
|
|
19266
|
-
let heading = 90;
|
|
19267
|
-
let pitch = 0;
|
|
19268
|
-
let roll = 0;
|
|
19269
|
-
if (!modelSpace) {
|
|
19270
|
-
const eTransform = entity.Bruce.Transform;
|
|
19271
|
-
if (eTransform) {
|
|
19272
|
-
if (eTransform.heading) {
|
|
19273
|
-
heading = eTransform.heading;
|
|
19274
|
-
}
|
|
19275
|
-
if (eTransform.pitch) {
|
|
19276
|
-
pitch = eTransform.pitch;
|
|
19277
|
-
}
|
|
19278
|
-
if (eTransform.roll) {
|
|
19279
|
-
roll = eTransform.roll;
|
|
19280
|
-
}
|
|
19281
|
-
}
|
|
19282
|
-
}
|
|
19283
|
-
let hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll));
|
|
19284
|
-
let orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
19285
|
-
if (entity.Bruce.AssemblyWorldPosition) {
|
|
19286
|
-
// extract rot, scale
|
|
19287
|
-
const awp = entity.Bruce.AssemblyWorldPosition;
|
|
19288
|
-
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]);
|
|
19289
|
-
let rotmat = new Matrix3();
|
|
19290
|
-
rotmat = Matrix4.getRotation(mawp, rotmat);
|
|
19291
|
-
// chuck on a heading rotation of +90
|
|
19292
|
-
// according to docs, that is around -z
|
|
19293
|
-
// https://cesium.com/learn/ion-sdk/ref-doc/HeadingPitchRoll.html
|
|
19294
|
-
// see axis_shift quat defined above (could possibly be -ve z value)
|
|
19295
|
-
const q = Quaternion.fromRotationMatrix(rotmat);
|
|
19296
|
-
hpr = HeadingPitchRoll.fromQuaternion(q);
|
|
19297
|
-
orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
19298
|
-
// add another h +90, quats multiply to concat rotations - but are not
|
|
19299
|
-
// subject to order of rotation like HPR
|
|
19300
|
-
orientation = Quaternion.multiply(orientation, axis_shift, new Quaternion());
|
|
19301
|
-
}
|
|
19302
|
-
return orientation;
|
|
19303
|
-
}
|
|
19304
19237
|
|
|
19305
19238
|
/**
|
|
19306
19239
|
* Utility to keep track of enabled menu items within a Cesium viewer.
|
|
@@ -28880,63 +28813,35 @@ const getLocationFromFeature = (feature) => {
|
|
|
28880
28813
|
}
|
|
28881
28814
|
return result;
|
|
28882
28815
|
};
|
|
28883
|
-
function calcEntityLocation
|
|
28884
|
-
|
|
28885
|
-
|
|
28886
|
-
// This puts it at 0,0 lat/lon which we treat as 0,0,0 for model-space viewing.
|
|
28887
|
-
if (modelSpace) {
|
|
28888
|
-
aRootLocation = null;
|
|
28889
|
-
}
|
|
28890
|
-
const worldPosition = entity.Bruce.AssemblyWorldPosition;
|
|
28816
|
+
function calcEntityLocation(entity, modelSpace) {
|
|
28817
|
+
var _a, _b;
|
|
28818
|
+
const worldPosition = (_a = entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyWorldPosition;
|
|
28891
28819
|
if (!worldPosition) {
|
|
28892
28820
|
return null;
|
|
28893
28821
|
}
|
|
28894
|
-
|
|
28895
|
-
|
|
28896
|
-
|
|
28897
|
-
|
|
28898
|
-
|
|
28899
|
-
|
|
28900
|
-
|
|
28901
|
-
|
|
28902
|
-
|
|
28903
|
-
|
|
28904
|
-
|
|
28905
|
-
|
|
28906
|
-
|
|
28907
|
-
const inverseRotmat = Matrix3.transpose(rotmat, new Matrix3());
|
|
28908
|
-
offset = Matrix3.multiplyByVector(inverseRotmat, translation, new Cartesian3());
|
|
28909
|
-
}
|
|
28910
|
-
// For translation-only matrices, extract translation directly.
|
|
28911
|
-
else {
|
|
28912
|
-
offset = new Cartesian3(+worldPosition[0][3], +worldPosition[1][3], +worldPosition[2][3]);
|
|
28913
|
-
}
|
|
28822
|
+
// The translation column of AssemblyWorldPosition is in ENU space:
|
|
28823
|
+
// [0][3] = East offset (m)
|
|
28824
|
+
// [1][3] = North offset (m)
|
|
28825
|
+
// [2][3] = Up/altitude offset (m)
|
|
28826
|
+
// All relative to the Assembly root's world location.
|
|
28827
|
+
// "Bruce.Location" stores the geometry-pivot centre instead of the Entity origin.
|
|
28828
|
+
// So we compute directly from the matrix translation to get the model origin position.
|
|
28829
|
+
const tx = +worldPosition[0][3];
|
|
28830
|
+
const ty = +worldPosition[1][3];
|
|
28831
|
+
const tz = +worldPosition[2][3];
|
|
28832
|
+
let rootPos;
|
|
28833
|
+
if (modelSpace) {
|
|
28834
|
+
rootPos = Cartesian3.fromDegrees(0, 0, 0);
|
|
28914
28835
|
}
|
|
28915
|
-
|
|
28916
|
-
|
|
28917
|
-
|
|
28918
|
-
if (!modelSpace) {
|
|
28919
|
-
const eTransform = entity.Bruce.Transform;
|
|
28920
|
-
if (eTransform) {
|
|
28921
|
-
if (eTransform.heading) {
|
|
28922
|
-
heading = eTransform.heading;
|
|
28923
|
-
}
|
|
28924
|
-
if (eTransform.pitch) {
|
|
28925
|
-
pitch = eTransform.pitch;
|
|
28926
|
-
}
|
|
28927
|
-
if (eTransform.roll) {
|
|
28928
|
-
roll = eTransform.roll;
|
|
28929
|
-
}
|
|
28930
|
-
}
|
|
28836
|
+
else {
|
|
28837
|
+
const rootLoc = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.AssemblyRootLocation;
|
|
28838
|
+
rootPos = Cartesian3.fromDegrees(EnsureNumber(rootLoc === null || rootLoc === void 0 ? void 0 : rootLoc.longitude), EnsureNumber(rootLoc === null || rootLoc === void 0 ? void 0 : rootLoc.latitude), EnsureNumber(rootLoc === null || rootLoc === void 0 ? void 0 : rootLoc.altitude));
|
|
28931
28839
|
}
|
|
28932
|
-
|
|
28933
|
-
|
|
28934
|
-
const hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(heading), EnsureNumber(pitch), EnsureNumber(roll), new HeadingPitchRoll());
|
|
28935
|
-
const transform = Matrix3.fromHeadingPitchRoll(hpr);
|
|
28936
|
-
const transformedOffset = Matrix3.multiplyByVector(transform, offset, new Cartesian3());
|
|
28937
|
-
pos3d = Matrix4.multiplyByPoint(m1, transformedOffset, new Cartesian3());
|
|
28938
|
-
return pos3d;
|
|
28840
|
+
const m1 = Transforms.eastNorthUpToFixedFrame(rootPos);
|
|
28841
|
+
return Matrix4.multiplyByPoint(m1, new Cartesian3(tx, ty, tz), new Cartesian3());
|
|
28939
28842
|
}
|
|
28843
|
+
// +90° rotation around Z: aligns GLTF Y-up forward with Cesium ENU North.
|
|
28844
|
+
const _assemblyAxisShift = new Quaternion(0, 0, -Math.SQRT1_2, Math.SQRT1_2);
|
|
28940
28845
|
var EntityUtils;
|
|
28941
28846
|
(function (EntityUtils) {
|
|
28942
28847
|
/**
|
|
@@ -29402,7 +29307,7 @@ var EntityUtils;
|
|
|
29402
29307
|
}
|
|
29403
29308
|
let pos3d = null;
|
|
29404
29309
|
if (modelSpace) {
|
|
29405
|
-
pos3d = calcEntityLocation
|
|
29310
|
+
pos3d = calcEntityLocation(entity, modelSpace);
|
|
29406
29311
|
}
|
|
29407
29312
|
else {
|
|
29408
29313
|
const eLocation = Entity$1.GetValue({
|
|
@@ -29700,7 +29605,7 @@ var EntityUtils;
|
|
|
29700
29605
|
}
|
|
29701
29606
|
function evaluateRecord() {
|
|
29702
29607
|
if (isAssemblyEntity) {
|
|
29703
|
-
return calcEntityLocation
|
|
29608
|
+
return calcEntityLocation(entity, isModelSpace);
|
|
29704
29609
|
}
|
|
29705
29610
|
const location = Entity$1.GetValue({
|
|
29706
29611
|
entity: entity,
|
|
@@ -29793,6 +29698,26 @@ var EntityUtils;
|
|
|
29793
29698
|
});
|
|
29794
29699
|
}
|
|
29795
29700
|
EntityUtils.GetPos = GetPos;
|
|
29701
|
+
/**
|
|
29702
|
+
* Returns the orientation quaternion for an assembly entity using its world position matrix.
|
|
29703
|
+
* Uses the rotation component of AssemblyWorldPosition to match the tileset rendering.
|
|
29704
|
+
*/
|
|
29705
|
+
function GetAssemblyOrientation(entity, pos3d) {
|
|
29706
|
+
var _a;
|
|
29707
|
+
const awp = (_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyWorldPosition;
|
|
29708
|
+
if (!awp || !pos3d) {
|
|
29709
|
+
return null;
|
|
29710
|
+
}
|
|
29711
|
+
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]);
|
|
29712
|
+
let rotmat = new Matrix3();
|
|
29713
|
+
rotmat = Matrix4.getRotation(mawp, rotmat);
|
|
29714
|
+
const q = Quaternion.fromRotationMatrix(rotmat);
|
|
29715
|
+
const hpr = HeadingPitchRoll.fromQuaternion(q);
|
|
29716
|
+
const orientation = Transforms.headingPitchRollQuaternion(pos3d, hpr);
|
|
29717
|
+
// Correct for GLTF Y-up vs Cesium ENU Z-up axis convention (+90° around Z).
|
|
29718
|
+
return Quaternion.multiply(orientation, _assemblyAxisShift, new Quaternion());
|
|
29719
|
+
}
|
|
29720
|
+
EntityUtils.GetAssemblyOrientation = GetAssemblyOrientation;
|
|
29796
29721
|
/**
|
|
29797
29722
|
* Returns the position of the entity.
|
|
29798
29723
|
* This is an async variant that checks for related assemblies.
|
|
@@ -31619,11 +31544,12 @@ var EntityRenderEngineModel3d;
|
|
|
31619
31544
|
* @returns
|
|
31620
31545
|
*/
|
|
31621
31546
|
function Render(params) {
|
|
31622
|
-
var _a, _b, _c, _d;
|
|
31547
|
+
var _a, _b, _c, _d, _e;
|
|
31623
31548
|
const entity = params.entity;
|
|
31624
31549
|
if (!params.entityHistoric) {
|
|
31625
31550
|
params.entityHistoric = [];
|
|
31626
31551
|
}
|
|
31552
|
+
const hasAssemblyMatrix = !!((_a = entity === null || entity === void 0 ? void 0 : entity.Bruce) === null || _a === void 0 ? void 0 : _a.AssemblyWorldPosition);
|
|
31627
31553
|
const transform = Entity$1.GetValue({
|
|
31628
31554
|
entity: entity,
|
|
31629
31555
|
path: ["Bruce", "Transform"]
|
|
@@ -31764,6 +31690,12 @@ var EntityRenderEngineModel3d;
|
|
|
31764
31690
|
return animatePosition.GetOrient();
|
|
31765
31691
|
}, false);
|
|
31766
31692
|
}
|
|
31693
|
+
else if (hasAssemblyMatrix) {
|
|
31694
|
+
getOrient = new CallbackProperty(() => {
|
|
31695
|
+
const currentPos = position ? GetCValue(params.viewer, position) : pos3d;
|
|
31696
|
+
return EntityUtils.GetAssemblyOrientation(entity, currentPos || pos3d);
|
|
31697
|
+
}, false);
|
|
31698
|
+
}
|
|
31767
31699
|
else {
|
|
31768
31700
|
const hpr = new HeadingPitchRoll(Math$1.toRadians(heading), Math$1.toRadians(pitch), Math$1.toRadians(roll));
|
|
31769
31701
|
getOrient = new CallbackProperty(() => {
|
|
@@ -31815,7 +31747,7 @@ var EntityRenderEngineModel3d;
|
|
|
31815
31747
|
cEntity.model.colorBlendAmount = new ConstantProperty(blendAmount);
|
|
31816
31748
|
cEntity.model.colorBlendMode = new ConstantProperty(blendMode);
|
|
31817
31749
|
cEntity.model.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
|
|
31818
|
-
let dateTimeStr = (
|
|
31750
|
+
let dateTimeStr = (_c = (_b = entity.Bruce.Outline) === null || _b === void 0 ? void 0 : _b.find(x => !!x.DateTime)) === null || _c === void 0 ? void 0 : _c.DateTime;
|
|
31819
31751
|
const isHistoric = Boolean(dateTimeStr);
|
|
31820
31752
|
let dateTime = dateTimeStr ? new Date(dateTimeStr) : null;
|
|
31821
31753
|
// Initial animation check to see if we're continuing an animation.
|
|
@@ -31928,7 +31860,13 @@ var EntityRenderEngineModel3d;
|
|
|
31928
31860
|
const hasExplicitTransformHeading = (transform === null || transform === void 0 ? void 0 : transform.heading) != null && !isNaN(EnsureNumber(transform === null || transform === void 0 ? void 0 : transform.heading));
|
|
31929
31861
|
const isDirectRealtimeUpdate = !isHistoric && !(params.entityHistoric && params.entityHistoric.length > 0);
|
|
31930
31862
|
const preferTransformHeadingForRealtime = isDirectRealtimeUpdate && hasExplicitTransformHeading;
|
|
31931
|
-
if (
|
|
31863
|
+
if (hasAssemblyMatrix) {
|
|
31864
|
+
cEntity.orientation = new CallbackProperty(() => {
|
|
31865
|
+
const currentPos = GetCValue(params.viewer, cEntity.position);
|
|
31866
|
+
return EntityUtils.GetAssemblyOrientation(entity, currentPos || pos3d);
|
|
31867
|
+
}, false);
|
|
31868
|
+
}
|
|
31869
|
+
else if (preferTransformHeadingForRealtime) {
|
|
31932
31870
|
const hpr = new HeadingPitchRoll(Math$1.toRadians(heading), Math$1.toRadians(pitch), Math$1.toRadians(roll));
|
|
31933
31871
|
cEntity.orientation = new CallbackProperty(() => {
|
|
31934
31872
|
const currentPos = GetCValue(params.viewer, cEntity.position);
|
|
@@ -32086,7 +32024,7 @@ var EntityRenderEngineModel3d;
|
|
|
32086
32024
|
// Generate a polyline 'track' for the historic data.
|
|
32087
32025
|
// We do this for historic data that exists and is moving.
|
|
32088
32026
|
if (shouldShowTrack && animatePosition && animatePosition instanceof CesiumAnimatedProperty.AnimatePositionSeries && animatePosition.GetSeries) {
|
|
32089
|
-
const lStyle = (
|
|
32027
|
+
const lStyle = (_e = (_d = params.fullStyle) === null || _d === void 0 ? void 0 : _d.polylineStyle) !== null && _e !== void 0 ? _e : {};
|
|
32090
32028
|
const bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
|
|
32091
32029
|
const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
|
|
32092
32030
|
let width = lStyle.lineWidth ? EnsureNumber(Calculator.GetNumber(lStyle.lineWidth, entity, params.tags)) : 2;
|
|
@@ -35326,7 +35264,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
35326
35264
|
}
|
|
35327
35265
|
}
|
|
35328
35266
|
|
|
35329
|
-
const VERSION = "6.5.
|
|
35267
|
+
const VERSION = "6.5.6";
|
|
35330
35268
|
/**
|
|
35331
35269
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
35332
35270
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|