bruce-cesium 6.3.8 → 6.4.0

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.
@@ -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, Bounds, Carto, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, Session } from 'bruce-models';
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, DistanceDisplayCondition, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, BoundingSphere, GeometryInstance, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
3
+ import { Cartographic, Entity, DistanceDisplayCondition, ColorMaterialProperty, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, PolygonHierarchy, ConstantPositionProperty, PolylineGraphics, ArcType, CornerType, HorizontalOrigin, VerticalOrigin, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, 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, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -28563,7 +28563,6 @@ var EntityUtils;
28563
28563
  rectangle: null,
28564
28564
  sphere: null
28565
28565
  };
28566
- const spheres = [];
28567
28566
  const processPosHeight = async (pos3d, heightRef) => {
28568
28567
  // Raise to minimumAlt if needed.
28569
28568
  if ((!isNaN(minimumAlt) && minimumAlt != null)) {
@@ -28776,7 +28775,6 @@ var EntityUtils;
28776
28775
  if (modelExt._radius && modelExt._radius > -1) {
28777
28776
  const sphere = BoundingSphere.fromPoints([pos3d]);
28778
28777
  sphere.radius = modelExt._radius;
28779
- spheres.push(sphere);
28780
28778
  }
28781
28779
  }
28782
28780
  else if (part.ellipse) {
@@ -28795,7 +28793,6 @@ var EntityUtils;
28795
28793
  const radius = Math.max(semiMajorAxis, semiMinorAxis, height);
28796
28794
  if (radius && radius > 0) {
28797
28795
  const sphere = new BoundingSphere(pos3d, radius);
28798
- spheres.push(sphere);
28799
28796
  }
28800
28797
  }
28801
28798
  }
@@ -28814,7 +28811,6 @@ var EntityUtils;
28814
28811
  posses.push(pos3d);
28815
28812
  if (data.radius != null && !isNaN(data.radius)) {
28816
28813
  const sphere = new BoundingSphere(pos3d, data.radius);
28817
- spheres.push(sphere);
28818
28814
  }
28819
28815
  }
28820
28816
  }
@@ -28956,7 +28952,6 @@ var EntityUtils;
28956
28952
  // For now making sure it's less than x amount because we had a bug which made it huge.
28957
28953
  if (geometryRadius && geometryRadius < 500 && geometryRadius > 0.1) {
28958
28954
  sphere.radius = geometryRadius;
28959
- spheres.push(sphere);
28960
28955
  }
28961
28956
  }
28962
28957
  return [pos3d];
@@ -28974,7 +28969,6 @@ var EntityUtils;
28974
28969
  // For now making sure it's less than x amount because we had a bug which made it huge.
28975
28970
  if (geometryRadius && geometryRadius < 500 && geometryRadius > 0.1) {
28976
28971
  sphere.radius = geometryRadius;
28977
- spheres.push(sphere);
28978
28972
  }
28979
28973
  }
28980
28974
  return [pos3d];
@@ -29007,7 +29001,6 @@ var EntityUtils;
29007
29001
  // For now making sure it's less than x amount because we had a bug which made it huge.
29008
29002
  if (geometryRadius && geometryRadius < 500 && geometryRadius > 0.1) {
29009
29003
  sphere.radius = geometryRadius;
29010
- spheres.push(sphere);
29011
29004
  }
29012
29005
  }
29013
29006
  return [pos3d];
@@ -29037,7 +29030,6 @@ var EntityUtils;
29037
29030
  // For now making sure it's less than x amount because we had a bug which made it huge.
29038
29031
  if (geometryRadius && geometryRadius < 500 && geometryRadius > 0.1) {
29039
29032
  sphere.radius = geometryRadius;
29040
- spheres.push(sphere);
29041
29033
  }
29042
29034
  }
29043
29035
  }
@@ -29150,6 +29142,22 @@ var EntityUtils;
29150
29142
  }
29151
29143
  }
29152
29144
  }
29145
+ // DEBUG: visualize points.
29146
+ /*
29147
+ for (let i = 0; i < allPosses.length; i++) {
29148
+ const pos3d = allPosses[i];
29149
+ viewer.entities.add({
29150
+ position: pos3d,
29151
+ point: {
29152
+ pixelSize: 10,
29153
+ color: Cesium.Color.YELLOW,
29154
+ heightReference: Cesium.HeightReference.NONE,
29155
+ disableDepthTestDistance: Number.POSITIVE_INFINITY
29156
+ }
29157
+ });
29158
+ }
29159
+ viewer.scene.requestRender();
29160
+ */
29153
29161
  if (allPosses.length > 1) {
29154
29162
  const rect = allPosses.length == 1 ? null : Rectangle.fromCartesianArray(allPosses);
29155
29163
  if (rect.width > 0 && rect.height > 0) {
@@ -29177,7 +29185,6 @@ var EntityUtils;
29177
29185
  radius /= 2;
29178
29186
  }
29179
29187
  const sphere = new BoundingSphere(data.pos3d, radius);
29180
- spheres.push(sphere);
29181
29188
  data.sphere = sphere;
29182
29189
  }
29183
29190
  else {
@@ -29187,16 +29194,20 @@ var EntityUtils;
29187
29194
  else if (allPosses.length == 1) {
29188
29195
  data.pos3d = allPosses[0];
29189
29196
  }
29197
+ /*
29198
+ Was used to clean up bad radius data but now seems to do more harm than good.
29199
+ TODO: re-review edge cases.
29190
29200
  if ((data.rectangle && spheres.length > 1) || (!data.rectangle && spheres.length > 0)) {
29191
- const allPointSphere = BoundingSphere.fromPoints(allPosses);
29201
+ const allPointSphere = Cesium.BoundingSphere.fromPoints(allPosses);
29192
29202
  spheres.push(allPointSphere);
29193
29203
  if (data.rectangle) {
29194
- const rectSphere = BoundingSphere.fromRectangle3D(data.rectangle);
29204
+ const rectSphere = Cesium.BoundingSphere.fromRectangle3D(data.rectangle);
29195
29205
  spheres.push(rectSphere);
29196
29206
  }
29197
- const combinedSphere = BoundingSphere.fromBoundingSpheres(spheres);
29207
+ const combinedSphere = Cesium.BoundingSphere.fromBoundingSpheres(spheres);
29198
29208
  data.sphere = combinedSphere;
29199
29209
  }
29210
+ */
29200
29211
  if (data.sphere && data.sphere.radius <= 0) {
29201
29212
  data.sphere = null;
29202
29213
  }
@@ -34705,7 +34716,7 @@ class WidgetViewBar extends Widget.AWidget {
34705
34716
  }
34706
34717
  }
34707
34718
 
34708
- const VERSION = "6.3.8";
34719
+ const VERSION = "6.4.0";
34709
34720
  /**
34710
34721
  * Updates the environment instance used by bruce-cesium to one specified.
34711
34722
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.