bruce-cesium 4.4.9 → 4.5.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 { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, AbstractApi, Session, EntityAttribute, EntityAttachment, EntityAttachmentType } from 'bruce-models';
1
+ import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttribute, EntityAttachment, EntityAttachmentType, AbstractApi, Session } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, PolygonHierarchy, ShadowMode, PolylineGraphics, ArcType, CornerType, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, BoundingSphere, GeometryInstance, CesiumInspector, ClockRange, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, CzmlDataSource, Intersect } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6883,7 +6883,7 @@ var EntityRenderEnginePolyline;
6883
6883
  if (style.smoothen && style.smoothen > 2) {
6884
6884
  // Keeping reference to original points for editing tools.
6885
6885
  orgPosses = posses.map(function (x) { return x.clone ? x.clone() : new Cartesian3(x.x, x.y, x.z); });
6886
- var smoothed = smoothenPoints(posses, style.smoothen, false);
6886
+ var smoothed = DrawingUtils.SmoothPoints(posses, style.smoothen, false);
6887
6887
  if (smoothed.find(function (x) { return !Cartes.ValidateCartes3(x); })) {
6888
6888
  console.error("Polyline.Render: Smoothening failed. Invalid Cartesian3 found. Defaulting to original points.");
6889
6889
  orgPosses = null;
@@ -7048,9 +7048,11 @@ var EntityRenderEnginePolyline;
7048
7048
  // Used when we run a smooth.
7049
7049
  if (cEntity === null || cEntity === void 0 ? void 0 : cEntity.polyline) {
7050
7050
  cEntity.polyline._orgPosses = orgPosses;
7051
+ cEntity.polyline._smoothen = style.smoothen;
7051
7052
  }
7052
7053
  else if (cEntity === null || cEntity === void 0 ? void 0 : cEntity.corridor) {
7053
7054
  cEntity.corridor._orgPosses = orgPosses;
7055
+ cEntity.corridor._smoothen = style.smoothen;
7054
7056
  }
7055
7057
  return cEntity;
7056
7058
  }
@@ -7257,52 +7259,6 @@ function getHeightRef$2(style, defaultStyle) {
7257
7259
  }
7258
7260
  return heightRef;
7259
7261
  }
7260
- function smoothenPoints(points, multiplier, closed) {
7261
- if (points.length < 4 || multiplier < 2) {
7262
- return points;
7263
- }
7264
- if (!closed) {
7265
- points.unshift(Cartesian3.subtract(points[0], points[1], new Cartesian3()));
7266
- points.push(Cartesian3.subtract(points[points.length - 1], points[points.length - 2], new Cartesian3()));
7267
- }
7268
- else {
7269
- points.unshift(points[points.length - 1]);
7270
- points.unshift(points[points.length - 2]);
7271
- points.push(points[2]);
7272
- }
7273
- var splinePoints = [];
7274
- var _loop_1 = function (i) {
7275
- var _a = [0, 1, 2, 3].map(function (n) { return points[i + n]; }), P0 = _a[0], P1 = _a[1], P2 = _a[2], P3 = _a[3];
7276
- for (var j = 0; j <= multiplier; j++) {
7277
- splinePoints.push(catmullRom$1(P0, P1, P2, P3, j / multiplier));
7278
- }
7279
- };
7280
- for (var i = 0; i < points.length - 3; i++) {
7281
- _loop_1(i);
7282
- }
7283
- return splinePoints;
7284
- }
7285
- function catmullRom$1(p0, p1, p2, p3, t) {
7286
- var t0 = 0;
7287
- var t1 = getT$1(t0, 0.5, p0, p1);
7288
- var t2 = getT$1(t1, 0.5, p1, p2);
7289
- var t3 = getT$1(t2, 0.5, p2, p3);
7290
- t = Math$1.lerp(t1, t2, t);
7291
- var _a = [function (l, r) { return Cartesian3.add(l, r, new Cartesian3()); }, function (l, r) { return Cartesian3.multiplyByScalar(l, r, new Cartesian3()); }], add = _a[0], mul = _a[1];
7292
- var A1 = add(mul(p0, (t1 - t) / (t1 - t0)), mul(p1, (t - t0) / (t1 - t0)));
7293
- var A2 = add(mul(p1, (t2 - t) / (t2 - t1)), mul(p2, (t - t1) / (t2 - t1)));
7294
- var A3 = add(mul(p2, (t3 - t) / (t3 - t2)), mul(p3, (t - t2) / (t3 - t2)));
7295
- var B1 = add(mul(A1, (t2 - t) / (t2 - t0)), mul(A2, (t - t0) / (t2 - t0)));
7296
- var B2 = add(mul(A2, (t3 - t) / (t3 - t1)), mul(A3, (t - t1) / (t3 - t1)));
7297
- var C = add(mul(B1, (t2 - t) / (t2 - t1)), mul(B2, (t - t1) / (t2 - t1)));
7298
- return C;
7299
- }
7300
- function getT$1(t, alpha, p0, p1) {
7301
- var d = Cartesian3.subtract(p1, p0, new Cartesian3());
7302
- var a = Cartesian3.dot(d, d);
7303
- var b = Math.pow(a, alpha * 0.5);
7304
- return b + t;
7305
- }
7306
7262
 
7307
7263
  var EntityRenderEnginePolygon;
7308
7264
  (function (EntityRenderEnginePolygon) {
@@ -27284,7 +27240,7 @@ var ViewerUtils;
27284
27240
  ViewerUtils.AssertIonToken = AssertIonToken;
27285
27241
  })(ViewerUtils || (ViewerUtils = {}));
27286
27242
 
27287
- var VERSION = "4.4.9";
27243
+ var VERSION = "4.5.0";
27288
27244
 
27289
- export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, smoothenPoints, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, WidgetSearchBar, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
27245
+ export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, WidgetSearchBar, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
27290
27246
  //# sourceMappingURL=bruce-cesium.es5.js.map