bruce-cesium 6.4.7 → 6.4.8

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, Camera, ProjectViewLegacyTile, 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, Carto, ProjectView, ProjectViewBookmark, Bounds, Camera, ProjectViewLegacyTile, AbstractApi, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, DistanceDisplayCondition, HeightReference, ColorBlendMode, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Cartesian2, SceneTransforms, KmlDataSource, NearFarScalar, Matrix3, Rectangle, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, 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';
3
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, HeightReference, HorizontalOrigin, VerticalOrigin, Cartesian3, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, ColorBlendMode, HeadingPitchRoll, Math as Math$1, Transforms, Model, JulianDate, Quaternion, Matrix4, Cartesian2, PolygonHierarchy, PolylineGraphics, 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, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, BoundingSphere, GeometryInstance, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, Intersect, CzmlDataSource, Fullscreen } from 'cesium';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -32834,7 +32834,12 @@ var EntityRenderEnginePolygon;
32834
32834
  cFillColor.alpha <= 0) {
32835
32835
  return null;
32836
32836
  }
32837
+ const forcePerPositionHeight = Boolean(entity === null || entity === void 0 ? void 0 : entity.__bruceSyntheticMultiGeometryChild);
32837
32838
  let heightRef = getHeightRef$3(style);
32839
+ if (forcePerPositionHeight && heightRef == HeightReference.CLAMP_TO_GROUND) {
32840
+ // Synthetic multi-geometry children render more reliably as absolute polygons.
32841
+ heightRef = HeightReference.NONE;
32842
+ }
32838
32843
  const outerRing = pRings.find(x => x.Facing == Geometry.EPolygonRingType.Boundaries);
32839
32844
  const points = Geometry.ParsePoints(outerRing === null || outerRing === void 0 ? void 0 : outerRing.LinearRing);
32840
32845
  let posses = points.map(x => Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)));
@@ -32855,10 +32860,19 @@ var EntityRenderEnginePolygon;
32855
32860
  }).filter(x => x.length >= 4);
32856
32861
  const zIndex = getZIndex$1(style, entity, params.tags);
32857
32862
  const size = getSizeOfPolygonEntity(entity);
32863
+ const polygonDistanceDisplayCondition = forcePerPositionHeight ? undefined :
32864
+ EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true);
32865
+ const lineDistanceDisplayCondition = forcePerPositionHeight ? undefined :
32866
+ EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance);
32867
+ const corridorDistanceDisplayCondition = forcePerPositionHeight ? undefined :
32868
+ EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width);
32858
32869
  let classification = ClassificationType.TERRAIN;
32859
32870
  if (style.drapeOver == "ALL") {
32860
32871
  classification = ClassificationType.BOTH;
32861
32872
  }
32873
+ if (forcePerPositionHeight) {
32874
+ classification = undefined;
32875
+ }
32862
32876
  const prepareExistingGraphic = (cEntity, siblings = 0) => {
32863
32877
  // Gather entity in case previous version had sibling graphics we no longer need.
32864
32878
  const parts = EntityUtils.GatherEntity({
@@ -32891,10 +32905,10 @@ var EntityRenderEnginePolygon;
32891
32905
  extrudedHeightReference: extrusion.exHeightRef,
32892
32906
  shadows: ShadowMode.ENABLED,
32893
32907
  heightReference: heightRef,
32894
- classificationType: classification,
32895
- perPositionHeight: heightRef == HeightReference.CLAMP_TO_GROUND ? false : true,
32908
+ classificationType: classification != null ? classification : undefined,
32909
+ perPositionHeight: forcePerPositionHeight || heightRef != HeightReference.CLAMP_TO_GROUND,
32896
32910
  zIndex: zIndex,
32897
- distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true)
32911
+ distanceDisplayCondition: polygonDistanceDisplayCondition
32898
32912
  },
32899
32913
  position: EntityUtils.GetPos({
32900
32914
  viewer: params.viewer,
@@ -32930,8 +32944,9 @@ var EntityRenderEnginePolygon;
32930
32944
  cEntity.polygon.heightReference = new ConstantProperty(heightRef);
32931
32945
  }
32932
32946
  const oldPerPosHeight = GetCValue(params.viewer, cEntity.polygon.perPositionHeight);
32933
- if (oldPerPosHeight != (heightRef == HeightReference.CLAMP_TO_GROUND ? false : true)) {
32934
- cEntity.polygon.perPositionHeight = new ConstantProperty(heightRef == HeightReference.CLAMP_TO_GROUND ? false : true);
32947
+ const newPerPosHeight = forcePerPositionHeight || heightRef != HeightReference.CLAMP_TO_GROUND;
32948
+ if (oldPerPosHeight != newPerPosHeight) {
32949
+ cEntity.polygon.perPositionHeight = new ConstantProperty(newPerPosHeight);
32935
32950
  }
32936
32951
  const oldPosition = GetCValue(params.viewer, cEntity.position);
32937
32952
  const newPosition = EntityUtils.GetPos({
@@ -32948,9 +32963,9 @@ var EntityRenderEnginePolygon;
32948
32963
  if (oldZIndex != zIndex) {
32949
32964
  cEntity.polygon.zIndex = new ConstantProperty(zIndex);
32950
32965
  }
32951
- cEntity.polygon.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true));
32966
+ cEntity.polygon.distanceDisplayCondition = polygonDistanceDisplayCondition != null ? new ConstantProperty(polygonDistanceDisplayCondition) : undefined;
32952
32967
  cEntity.polygon.shadows = new ConstantProperty(ShadowMode.ENABLED);
32953
- cEntity.polygon.classificationType = new ConstantProperty(classification);
32968
+ cEntity.polygon.classificationType = classification != null ? new ConstantProperty(classification) : undefined;
32954
32969
  // We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
32955
32970
  // WARNING: polygon does not support animation (yet?).
32956
32971
  CesiumEntityStyler.SetDefaultColor({
@@ -32988,7 +33003,7 @@ var EntityRenderEnginePolygon;
32988
33003
  classificationType: ClassificationType.TERRAIN,
32989
33004
  arcType: ArcType.GEODESIC,
32990
33005
  zIndex: zIndex,
32991
- distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance)
33006
+ distanceDisplayCondition: lineDistanceDisplayCondition
32992
33007
  }) : null,
32993
33008
  corridor: units == "m" ? {
32994
33009
  positions: borderPosses,
@@ -33000,7 +33015,7 @@ var EntityRenderEnginePolygon;
33000
33015
  zIndex: zIndex + 1,
33001
33016
  cornerType: CornerType.MITERED,
33002
33017
  classificationType: classification,
33003
- distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width),
33018
+ distanceDisplayCondition: corridorDistanceDisplayCondition,
33004
33019
  shadows: ShadowMode.ENABLED
33005
33020
  } : null,
33006
33021
  show: true
@@ -33031,7 +33046,7 @@ var EntityRenderEnginePolygon;
33031
33046
  cEntityBorder.polyline.material = newMaterial;
33032
33047
  }
33033
33048
  cEntityBorder.polyline.classificationType = new ConstantProperty(ClassificationType.TERRAIN);
33034
- cEntityBorder.polyline.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
33049
+ cEntityBorder.polyline.distanceDisplayCondition = lineDistanceDisplayCondition != null ? new ConstantProperty(lineDistanceDisplayCondition) : undefined;
33035
33050
  cEntityBorder.corridor = undefined;
33036
33051
  }
33037
33052
  else {
@@ -33061,7 +33076,7 @@ var EntityRenderEnginePolygon;
33061
33076
  cEntityBorder.corridor.material = newMaterial;
33062
33077
  }
33063
33078
  cEntityBorder.corridor.fill = new ConstantProperty(true);
33064
- cEntityBorder.corridor.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width));
33079
+ cEntityBorder.corridor.distanceDisplayCondition = corridorDistanceDisplayCondition != null ? new ConstantProperty(corridorDistanceDisplayCondition) : undefined;
33065
33080
  cEntityBorder.polyline = undefined;
33066
33081
  }
33067
33082
  cEntityBorder.show = true;
@@ -33081,7 +33096,7 @@ var EntityRenderEnginePolygon;
33081
33096
  classificationType: ClassificationType.TERRAIN,
33082
33097
  arcType: ArcType.GEODESIC,
33083
33098
  zIndex: zIndex,
33084
- distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance)
33099
+ distanceDisplayCondition: lineDistanceDisplayCondition
33085
33100
  }) : null,
33086
33101
  corridor: units == "m" ? {
33087
33102
  positions: borderPosses,
@@ -33093,7 +33108,7 @@ var EntityRenderEnginePolygon;
33093
33108
  zIndex: zIndex + 1,
33094
33109
  cornerType: CornerType.MITERED,
33095
33110
  classificationType: classification,
33096
- distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width),
33111
+ distanceDisplayCondition: corridorDistanceDisplayCondition,
33097
33112
  shadows: ShadowMode.ENABLED,
33098
33113
  } : null,
33099
33114
  show: true
@@ -33705,10 +33720,12 @@ var EntityRenderEngine;
33705
33720
  for (let j = 0; j < geometry.MultiGeometry.length; j++) {
33706
33721
  const subEntity = {
33707
33722
  ...entity,
33723
+ __bruceSyntheticMultiGeometryChild: true,
33708
33724
  geometry: null,
33709
33725
  Bruce: {
33710
33726
  ...entity.Bruce,
33711
33727
  ID: ObjectUtils.UId(),
33728
+ Location: null,
33712
33729
  VectorGeometry: geometry.MultiGeometry[j],
33713
33730
  Boundaries: multiGeometryBounds ? {
33714
33731
  ...multiGeometryBounds
@@ -35286,7 +35303,7 @@ class WidgetViewBar extends Widget.AWidget {
35286
35303
  }
35287
35304
  }
35288
35305
 
35289
- const VERSION = "6.4.7";
35306
+ const VERSION = "6.4.8";
35290
35307
  /**
35291
35308
  * Updates the environment instance used by bruce-cesium to one specified.
35292
35309
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.