bruce-cesium 6.4.8 → 6.4.9

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, Carto, ProjectView, ProjectViewBookmark, Bounds, Camera, ProjectViewLegacyTile, AbstractApi, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils } 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, ProjectViewLegacyTile, Camera, 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, 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';
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, 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';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -32834,12 +32834,7 @@ 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);
32838
32837
  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
- }
32843
32838
  const outerRing = pRings.find(x => x.Facing == Geometry.EPolygonRingType.Boundaries);
32844
32839
  const points = Geometry.ParsePoints(outerRing === null || outerRing === void 0 ? void 0 : outerRing.LinearRing);
32845
32840
  let posses = points.map(x => Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)));
@@ -32860,19 +32855,10 @@ var EntityRenderEnginePolygon;
32860
32855
  }).filter(x => x.length >= 4);
32861
32856
  const zIndex = getZIndex$1(style, entity, params.tags);
32862
32857
  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);
32869
32858
  let classification = ClassificationType.TERRAIN;
32870
32859
  if (style.drapeOver == "ALL") {
32871
32860
  classification = ClassificationType.BOTH;
32872
32861
  }
32873
- if (forcePerPositionHeight) {
32874
- classification = undefined;
32875
- }
32876
32862
  const prepareExistingGraphic = (cEntity, siblings = 0) => {
32877
32863
  // Gather entity in case previous version had sibling graphics we no longer need.
32878
32864
  const parts = EntityUtils.GatherEntity({
@@ -32905,10 +32891,10 @@ var EntityRenderEnginePolygon;
32905
32891
  extrudedHeightReference: extrusion.exHeightRef,
32906
32892
  shadows: ShadowMode.ENABLED,
32907
32893
  heightReference: heightRef,
32908
- classificationType: classification != null ? classification : undefined,
32909
- perPositionHeight: forcePerPositionHeight || heightRef != HeightReference.CLAMP_TO_GROUND,
32894
+ classificationType: classification,
32895
+ perPositionHeight: heightRef == HeightReference.CLAMP_TO_GROUND ? false : true,
32910
32896
  zIndex: zIndex,
32911
- distanceDisplayCondition: polygonDistanceDisplayCondition
32897
+ distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true)
32912
32898
  },
32913
32899
  position: EntityUtils.GetPos({
32914
32900
  viewer: params.viewer,
@@ -32944,9 +32930,8 @@ var EntityRenderEnginePolygon;
32944
32930
  cEntity.polygon.heightReference = new ConstantProperty(heightRef);
32945
32931
  }
32946
32932
  const oldPerPosHeight = GetCValue(params.viewer, cEntity.polygon.perPositionHeight);
32947
- const newPerPosHeight = forcePerPositionHeight || heightRef != HeightReference.CLAMP_TO_GROUND;
32948
- if (oldPerPosHeight != newPerPosHeight) {
32949
- cEntity.polygon.perPositionHeight = new ConstantProperty(newPerPosHeight);
32933
+ if (oldPerPosHeight != (heightRef == HeightReference.CLAMP_TO_GROUND ? false : true)) {
32934
+ cEntity.polygon.perPositionHeight = new ConstantProperty(heightRef == HeightReference.CLAMP_TO_GROUND ? false : true);
32950
32935
  }
32951
32936
  const oldPosition = GetCValue(params.viewer, cEntity.position);
32952
32937
  const newPosition = EntityUtils.GetPos({
@@ -32963,9 +32948,9 @@ var EntityRenderEnginePolygon;
32963
32948
  if (oldZIndex != zIndex) {
32964
32949
  cEntity.polygon.zIndex = new ConstantProperty(zIndex);
32965
32950
  }
32966
- cEntity.polygon.distanceDisplayCondition = polygonDistanceDisplayCondition != null ? new ConstantProperty(polygonDistanceDisplayCondition) : undefined;
32951
+ cEntity.polygon.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true));
32967
32952
  cEntity.polygon.shadows = new ConstantProperty(ShadowMode.ENABLED);
32968
- cEntity.polygon.classificationType = classification != null ? new ConstantProperty(classification) : undefined;
32953
+ cEntity.polygon.classificationType = new ConstantProperty(classification);
32969
32954
  // We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
32970
32955
  // WARNING: polygon does not support animation (yet?).
32971
32956
  CesiumEntityStyler.SetDefaultColor({
@@ -33003,7 +32988,7 @@ var EntityRenderEnginePolygon;
33003
32988
  classificationType: ClassificationType.TERRAIN,
33004
32989
  arcType: ArcType.GEODESIC,
33005
32990
  zIndex: zIndex,
33006
- distanceDisplayCondition: lineDistanceDisplayCondition
32991
+ distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance)
33007
32992
  }) : null,
33008
32993
  corridor: units == "m" ? {
33009
32994
  positions: borderPosses,
@@ -33015,7 +33000,7 @@ var EntityRenderEnginePolygon;
33015
33000
  zIndex: zIndex + 1,
33016
33001
  cornerType: CornerType.MITERED,
33017
33002
  classificationType: classification,
33018
- distanceDisplayCondition: corridorDistanceDisplayCondition,
33003
+ distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width),
33019
33004
  shadows: ShadowMode.ENABLED
33020
33005
  } : null,
33021
33006
  show: true
@@ -33046,7 +33031,7 @@ var EntityRenderEnginePolygon;
33046
33031
  cEntityBorder.polyline.material = newMaterial;
33047
33032
  }
33048
33033
  cEntityBorder.polyline.classificationType = new ConstantProperty(ClassificationType.TERRAIN);
33049
- cEntityBorder.polyline.distanceDisplayCondition = lineDistanceDisplayCondition != null ? new ConstantProperty(lineDistanceDisplayCondition) : undefined;
33034
+ cEntityBorder.polyline.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
33050
33035
  cEntityBorder.corridor = undefined;
33051
33036
  }
33052
33037
  else {
@@ -33076,7 +33061,7 @@ var EntityRenderEnginePolygon;
33076
33061
  cEntityBorder.corridor.material = newMaterial;
33077
33062
  }
33078
33063
  cEntityBorder.corridor.fill = new ConstantProperty(true);
33079
- cEntityBorder.corridor.distanceDisplayCondition = corridorDistanceDisplayCondition != null ? new ConstantProperty(corridorDistanceDisplayCondition) : undefined;
33064
+ cEntityBorder.corridor.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width));
33080
33065
  cEntityBorder.polyline = undefined;
33081
33066
  }
33082
33067
  cEntityBorder.show = true;
@@ -33096,7 +33081,7 @@ var EntityRenderEnginePolygon;
33096
33081
  classificationType: ClassificationType.TERRAIN,
33097
33082
  arcType: ArcType.GEODESIC,
33098
33083
  zIndex: zIndex,
33099
- distanceDisplayCondition: lineDistanceDisplayCondition
33084
+ distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance)
33100
33085
  }) : null,
33101
33086
  corridor: units == "m" ? {
33102
33087
  positions: borderPosses,
@@ -33108,7 +33093,7 @@ var EntityRenderEnginePolygon;
33108
33093
  zIndex: zIndex + 1,
33109
33094
  cornerType: CornerType.MITERED,
33110
33095
  classificationType: classification,
33111
- distanceDisplayCondition: corridorDistanceDisplayCondition,
33096
+ distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance, width),
33112
33097
  shadows: ShadowMode.ENABLED,
33113
33098
  } : null,
33114
33099
  show: true
@@ -33553,7 +33538,7 @@ var EntityRenderEngine;
33553
33538
  }
33554
33539
  EntityRenderEngine.GetRenderGroupId = GetRenderGroupId;
33555
33540
  async function Render(params) {
33556
- var _a, _b, _c, _d, _e;
33541
+ var _a, _b, _c, _d;
33557
33542
  const groupRenderParams = {
33558
33543
  apiGetter: params.apiGetter,
33559
33544
  viewer: params.viewer,
@@ -33715,21 +33700,14 @@ var EntityRenderEngine;
33715
33700
  };
33716
33701
  pParams.entitiesHistoric = params.entitiesHistoric;
33717
33702
  const zoomItem = pParams.zoomItems[entity.Bruce.ID];
33718
- // Preserve the full feature extent so tiny child polygons don't get over-culled.
33719
- const multiGeometryBounds = Bounds.FromEntity(entity);
33720
33703
  for (let j = 0; j < geometry.MultiGeometry.length; j++) {
33721
33704
  const subEntity = {
33722
33705
  ...entity,
33723
- __bruceSyntheticMultiGeometryChild: true,
33724
33706
  geometry: null,
33725
33707
  Bruce: {
33726
33708
  ...entity.Bruce,
33727
33709
  ID: ObjectUtils.UId(),
33728
- Location: null,
33729
- VectorGeometry: geometry.MultiGeometry[j],
33730
- Boundaries: multiGeometryBounds ? {
33731
- ...multiGeometryBounds
33732
- } : (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.Boundaries
33710
+ VectorGeometry: geometry.MultiGeometry[j]
33733
33711
  }
33734
33712
  };
33735
33713
  pParams.zoomItems[subEntity.Bruce.ID] = zoomItem;
@@ -35303,7 +35281,7 @@ class WidgetViewBar extends Widget.AWidget {
35303
35281
  }
35304
35282
  }
35305
35283
 
35306
- const VERSION = "6.4.8";
35284
+ const VERSION = "6.4.9";
35307
35285
  /**
35308
35286
  * Updates the environment instance used by bruce-cesium to one specified.
35309
35287
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.