bruce-cesium 6.9.5 → 6.9.7
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 +67 -8
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +65 -5
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine-polygon.js +14 -0
- package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine.js +15 -5
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/utils/cesium-entity-styler.js +36 -0
- package/dist/lib/utils/cesium-entity-styler.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/entity-render-engine.d.ts +1 -5
- package/dist/types/utils/cesium-entity-styler.d.ts +6 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cesium from 'cesium';
|
|
2
|
-
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition,
|
|
3
|
-
import { Cartes, Entity as Entity$1, ENVIRONMENT, Calculator, ClientFile,
|
|
2
|
+
import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, HeightReference, HorizontalOrigin, VerticalOrigin, Cartesian3, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, Math as Math$1, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, ColorBlendMode, Model, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Cartesian2, SceneTransforms, NearFarScalar, Matrix3, Rectangle, KmlDataSource, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, Cesium3DTileColorBlendMode, Cesium3DTileset, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, Fullscreen, Intersect, CzmlDataSource } from 'cesium';
|
|
3
|
+
import { Cartes, Entity as Entity$1, ENVIRONMENT, Api, Calculator, ClientFile, EntityTag, EntityType, LRUCache, ObjectUtils, Style, Carto, Geometry, EntityLod, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, Bounds, Color as Color$1, DataLab, DelayQueue, EntityHistoricData, BruceApi, EntityRelation, AccountConcept, RecordChangeFeed, ProgramKey, EntitySource, ProjectViewLegacyTile, ProjectViewTile, Camera, Session, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType } from 'bruce-models';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Ensures a number is returned from a given value.
|
|
@@ -1725,6 +1725,9 @@ function storeDefaultTextureImage(graphic, image) {
|
|
|
1725
1725
|
function getDefaultTextureImage(graphic) {
|
|
1726
1726
|
return graphic[STORE_TEXTURE_IMAGE_KEY];
|
|
1727
1727
|
}
|
|
1728
|
+
function clearDefaultTextureImage(graphic) {
|
|
1729
|
+
delete graphic[STORE_TEXTURE_IMAGE_KEY];
|
|
1730
|
+
}
|
|
1728
1731
|
/**
|
|
1729
1732
|
* Returns a color property from a graphic.
|
|
1730
1733
|
* This will turn materials properties into colors before returning them.
|
|
@@ -2262,6 +2265,39 @@ var CesiumEntityStyler;
|
|
|
2262
2265
|
}
|
|
2263
2266
|
}
|
|
2264
2267
|
CesiumEntityStyler.SetDefaultColor = SetDefaultColor;
|
|
2268
|
+
/*
|
|
2269
|
+
* Updates (or clears) the baked default texture image for a graphic's polygon parts.
|
|
2270
|
+
*/
|
|
2271
|
+
function SetDefaultTextureImage(params) {
|
|
2272
|
+
const { viewer, entity, image, requestRender } = params;
|
|
2273
|
+
if (!entity) {
|
|
2274
|
+
return;
|
|
2275
|
+
}
|
|
2276
|
+
const parts = EntityUtils.GatherEntity({
|
|
2277
|
+
entity: entity,
|
|
2278
|
+
selectable: true
|
|
2279
|
+
});
|
|
2280
|
+
for (let i = 0; i < parts.length; i++) {
|
|
2281
|
+
const part = parts[i];
|
|
2282
|
+
if (!isAlive(viewer, part)) {
|
|
2283
|
+
continue;
|
|
2284
|
+
}
|
|
2285
|
+
// Texture fill only applies to polygons.
|
|
2286
|
+
if (part instanceof Entity && part.polygon) {
|
|
2287
|
+
if (image == null) {
|
|
2288
|
+
clearDefaultTextureImage(part.polygon);
|
|
2289
|
+
}
|
|
2290
|
+
else {
|
|
2291
|
+
storeDefaultTextureImage(part.polygon, image);
|
|
2292
|
+
}
|
|
2293
|
+
refreshColor(viewer, part.polygon, getAppliedOpacity(part.polygon));
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
if (requestRender != false) {
|
|
2297
|
+
viewer.scene.requestRender();
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
CesiumEntityStyler.SetDefaultTextureImage = SetDefaultTextureImage;
|
|
2265
2301
|
/**
|
|
2266
2302
|
* Updates the opacity of the graphic.
|
|
2267
2303
|
* This will multiply against the current colour's opacity before applying.
|
|
@@ -36861,9 +36897,23 @@ var EntityRenderEnginePolygon;
|
|
|
36861
36897
|
cEntity.polygon.classificationType = new ConstantProperty(classification);
|
|
36862
36898
|
// TODO: animate the texture!
|
|
36863
36899
|
if (textureDataUri) {
|
|
36900
|
+
// Rebaking texture to ensure we don't revert to the wrong one later.
|
|
36864
36901
|
cEntity.polygon.material = fillMaterial;
|
|
36902
|
+
CesiumEntityStyler.SetDefaultTextureImage({
|
|
36903
|
+
entity: cEntity,
|
|
36904
|
+
image: textureDataUri,
|
|
36905
|
+
viewer: params.viewer,
|
|
36906
|
+
requestRender: false
|
|
36907
|
+
});
|
|
36865
36908
|
}
|
|
36866
36909
|
else {
|
|
36910
|
+
// Clear any baked texture from a previous textured style so reverting to default uses the colour fill.
|
|
36911
|
+
CesiumEntityStyler.SetDefaultTextureImage({
|
|
36912
|
+
entity: cEntity,
|
|
36913
|
+
image: null,
|
|
36914
|
+
viewer: params.viewer,
|
|
36915
|
+
requestRender: false
|
|
36916
|
+
});
|
|
36867
36917
|
// We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
|
|
36868
36918
|
// WARNING: polygon does not support animation (yet?).
|
|
36869
36919
|
CesiumEntityStyler.SetDefaultColor({
|
|
@@ -37504,11 +37554,19 @@ function getHeightRef$3(style, defaultStyle) {
|
|
|
37504
37554
|
return heightRef;
|
|
37505
37555
|
}
|
|
37506
37556
|
|
|
37507
|
-
|
|
37508
|
-
* Returns if the
|
|
37509
|
-
* @param rego
|
|
37510
|
-
* @param entity
|
|
37557
|
+
/*
|
|
37558
|
+
* Returns if the style applied to a rego differs from the one the zoom item now wants.
|
|
37511
37559
|
*/
|
|
37560
|
+
function isStyleChanged(rego, zoomItem) {
|
|
37561
|
+
var _a;
|
|
37562
|
+
if (!rego) {
|
|
37563
|
+
return false;
|
|
37564
|
+
}
|
|
37565
|
+
// Normalize the same way cEntity.styleId is set when rendering (see RenderGroup callers).
|
|
37566
|
+
const newStyleId = (zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) == -1 ? -1 : (+(zoomItem === null || zoomItem === void 0 ? void 0 : zoomItem.StyleID) || null);
|
|
37567
|
+
const oldStyleId = (_a = rego.styleId) !== null && _a !== void 0 ? _a : null;
|
|
37568
|
+
return newStyleId != oldStyleId;
|
|
37569
|
+
}
|
|
37512
37570
|
function isOutlineChanged$1(rego, entity) {
|
|
37513
37571
|
var _a, _b, _c, _d, _e, _f;
|
|
37514
37572
|
if (((_a = rego.outline) === null || _a === void 0 ? void 0 : _a.length) != ((_c = (_b = entity.Bruce) === null || _b === void 0 ? void 0 : _b.Outline) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
@@ -37703,6 +37761,7 @@ var EntityRenderEngine;
|
|
|
37703
37761
|
if (!params.force &&
|
|
37704
37762
|
newRenderId == oldRenderId &&
|
|
37705
37763
|
!(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
|
|
37764
|
+
!isStyleChanged(existingRego, zoomItem) &&
|
|
37706
37765
|
!isOutlineChanged$1(existingRego, entity)) {
|
|
37707
37766
|
// No sorting category needed. Already rendered the way we want.
|
|
37708
37767
|
cEntities.set(id, existingRego.visual);
|
|
@@ -38591,7 +38650,7 @@ var StyleUtils;
|
|
|
38591
38650
|
StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
|
|
38592
38651
|
})(StyleUtils || (StyleUtils = {}));
|
|
38593
38652
|
|
|
38594
|
-
const VERSION = "6.9.
|
|
38653
|
+
const VERSION = "6.9.7";
|
|
38595
38654
|
/**
|
|
38596
38655
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
38597
38656
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|
|
@@ -38608,5 +38667,5 @@ const getENVIRONMENT = () => {
|
|
|
38608
38667
|
return ENVIRONMENT;
|
|
38609
38668
|
};
|
|
38610
38669
|
|
|
38611
|
-
export { VERSION, setENVIRONMENT, getENVIRONMENT, CesiumAnimatedInOut, CesiumAnimatedProperty, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, EntityRenderEnginePolygon, EntityRenderEnginePolyline, MenuItemCreator, MenuItemManager, CesiumParabola, EntityLabel, LiveCursor, SharedGetters, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
|
|
38670
|
+
export { VERSION, setENVIRONMENT, getENVIRONMENT, CesiumAnimatedInOut, CesiumAnimatedProperty, isStyleChanged, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, EntityRenderEnginePolygon, EntityRenderEnginePolyline, MenuItemCreator, MenuItemManager, CesiumParabola, EntityLabel, LiveCursor, SharedGetters, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
|
|
38612
38671
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|