@arcgis/core 4.23.0-next.20220118 → 4.23.0-next.20220126
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/Graphic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00c5bb5eecb0e89266df.js +1 -0
- package/assets/esri/core/workers/chunks/021a37e2b191298e80b7.js +1 -0
- package/assets/esri/core/workers/chunks/1370c92c40fd6271553c.js +1 -0
- package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
- package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
- package/assets/esri/core/workers/chunks/1fbcc8424452d0256bd6.js +1 -0
- package/assets/esri/core/workers/chunks/{7c9d2638693d5f798b23.js → 23b15e7c2f96d260e16c.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
- package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
- package/assets/esri/core/workers/chunks/2792ca40f1e92849247c.js +1 -0
- package/assets/esri/core/workers/chunks/2a96f1bba9ce6883e5e0.js +1 -0
- package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
- package/assets/esri/core/workers/chunks/3231ee3e090bb4cac3fc.js +1 -0
- package/assets/esri/core/workers/chunks/{0c3e3a5baf54bd5e210c.js → 36e250278b5622ccf068.js} +1 -1
- package/assets/esri/core/workers/chunks/395ba088d4864588ff66.js +1 -0
- package/assets/esri/core/workers/chunks/3cc77692b2eee27b9c9e.js +1 -0
- package/assets/esri/core/workers/chunks/3f343f792fd9f44d6f25.js +1 -0
- package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
- package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
- package/assets/esri/core/workers/chunks/{ba6fdaed6c315dc13981.js → 434b16731c6a81f868ef.js} +1 -1
- package/assets/esri/core/workers/chunks/4385a268c2a64281d1c1.js +1 -0
- package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 438f0b5ae5c53ae4f06a.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 46b4bb66a54bbd8e2e57.js} +1 -1
- package/assets/esri/core/workers/chunks/4c76146014dc15143ba3.js +1 -0
- package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
- package/assets/esri/core/workers/chunks/5d991b74d958005c26c4.js +1 -0
- package/assets/esri/core/workers/chunks/5dfe1f8d520025e2118b.js +1 -0
- package/assets/esri/core/workers/chunks/601e697dc7414bda128a.js +1 -0
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
- package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
- package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
- package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → 6f50a9647f026a8d4729.js} +1 -1
- package/assets/esri/core/workers/chunks/{47395d225229d237f0ac.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
- package/assets/esri/core/workers/chunks/7d661129a0d8c466eeec.js +1 -0
- package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
- package/assets/esri/core/workers/chunks/8070972c0efb78523b68.js +1 -0
- package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
- package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
- package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
- package/assets/esri/core/workers/chunks/97a28641b3b2fd31bea2.js +1 -0
- package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 97ec9eef0048760fa260.js} +1 -1
- package/assets/esri/core/workers/chunks/98986e6601b0366376b4.js +1 -0
- package/assets/esri/core/workers/chunks/9cdcf9309d6feda70185.js +1 -0
- package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
- package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
- package/assets/esri/core/workers/chunks/{b10fcbe1393c812fc219.js → aa861b8eae6c85f3dad4.js} +1 -1
- package/assets/esri/core/workers/chunks/aace7e1fef256bb961c9.js +1 -0
- package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → af5694b4d278cf1db2d9.js} +1 -1
- package/assets/esri/core/workers/chunks/afbb4f802ca5774f0326.js +1 -0
- package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
- package/assets/esri/core/workers/chunks/b2c5f92e3d7606297ca9.js +1 -0
- package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
- package/assets/esri/core/workers/chunks/b2ebe4f6d100e15b512d.js +1 -0
- package/assets/esri/core/workers/chunks/b8316c6469a543029bc6.js +1 -0
- package/assets/esri/core/workers/chunks/{4b69129c0557852d9b3d.js → ba5eb394f098968c22d2.js} +1 -1
- package/assets/esri/core/workers/chunks/bf0a65b4be31959f921d.js +1 -0
- package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
- package/assets/esri/core/workers/chunks/c890c7fca27170e3341f.js +1 -0
- package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
- package/assets/esri/core/workers/chunks/c976785f2391c77d8a30.js +1 -0
- package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
- package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
- package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e596478507466953e65.js → cef4af64860ebbfc1c47.js} +1 -1
- package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
- package/assets/esri/core/workers/chunks/e4b84ca8ddfd48dd79b1.js +1 -0
- package/assets/esri/core/workers/chunks/e4e2036373166c1d5cf5.js +1 -0
- package/assets/esri/core/workers/chunks/e4f93c55eaefab4192b5.js +1 -0
- package/assets/esri/core/workers/chunks/e6165e17fbb07bfc40a1.js +1 -0
- package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
- package/assets/esri/core/workers/chunks/{f678293de9a6d8f5b5db.js → ec89466f76d0ba22525e.js} +1 -1
- package/assets/esri/core/workers/chunks/ee45618c45806ab654cb.js +1 -0
- package/assets/esri/core/workers/chunks/f4baa5ea2e42b1317941.js +1 -0
- package/assets/esri/core/workers/chunks/f760a3e030b0f358a92a.js +1 -0
- package/assets/esri/core/workers/chunks/face43cf5abcd2f5bd9d.js +1 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/_mixins.scss +4 -1
- package/assets/esri/themes/base/icons/style.scss +11 -2
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
- package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
- package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
- package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
- package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
- package/assets/esri/themes/base/widgets/_Print.scss +24 -11
- package/assets/esri/themes/base/widgets/_Search.scss +4 -2
- package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
- package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
- package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
- package/chunks/CloudsComposition.glsl.js +4 -4
- package/chunks/ComponentShader.glsl.js +19 -19
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +11 -11
- package/chunks/WaterSurface.glsl.js +21 -21
- package/chunks/pe.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/set.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/pe.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/interfaces.d.ts +315 -78
- package/layers/RouteLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerScene.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/libs/vxl/enums.js +1 -1
- package/package.json +2 -2
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/support/mediaInfoTypes.js +1 -1
- package/portal/schemas/buildingSceneLayerItem.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/integratedMeshLayerItem.js +1 -1
- package/portal/schemas/pointCloudLayerItem.js +1 -1
- package/portal/schemas/sceneLayerItem.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/rasterRenderers.js +1 -1
- package/rest/find.js +1 -1
- package/rest/geometryService/generalize.js +1 -1
- package/rest/geometryService/lengths.js +1 -1
- package/rest/geometryService/offset.js +1 -1
- package/rest/geometryService/relation.js +1 -1
- package/rest/geometryService/trimExtend.js +1 -1
- package/rest/identify.js +1 -1
- package/{tasks → rest}/operations/find.js +0 -0
- package/{tasks → rest}/operations/generalize.js +0 -0
- package/rest/operations/identify.js +5 -0
- package/{tasks → rest}/operations/lengths.js +0 -0
- package/{tasks → rest}/operations/offset.js +0 -0
- package/{tasks → rest}/operations/relation.js +0 -0
- package/{tasks → rest}/operations/trimExtend.js +0 -0
- package/{tasks → rest}/operations/urlUtils.js +0 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryAttachments.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/route/utils.js +1 -1
- package/rest/support/NetworkServiceDescription.js +1 -1
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/RouteSettings.js +5 -0
- package/rest/support/Stop.js +1 -1
- package/rest/support/networkEnums.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/Font.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/support/Symbol3DVerticalOffset.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/textUtils.js +5 -0
- package/symbols.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +1 -1
- package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/support/engineHelpers.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +5 -0
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/{Graphics3DGraphicLikeLayerView.js → GraphicsProcessor.js} +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +7 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +28 -24
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +21 -13
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/webgl/ContextState.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Renderbuffer.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModel.js +1 -1
- package/widgets/support/geolocationUtils.js +1 -1
- package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
- package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
- package/assets/components/assets/calcite-icon/squareF16.json +0 -1
- package/assets/components/assets/calcite-icon/squareF24.json +0 -1
- package/assets/components/assets/calcite-icon/squareF32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
- package/assets/esri/core/workers/chunks/01ef8de7f76a8c61b464.js +0 -1
- package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
- package/assets/esri/core/workers/chunks/0f254c3e91e8fee55f28.js +0 -1
- package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
- package/assets/esri/core/workers/chunks/21a77eed1a4ef5b0ff08.js +0 -1
- package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
- package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
- package/assets/esri/core/workers/chunks/2d947080a27db6ce0d75.js +0 -1
- package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
- package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
- package/assets/esri/core/workers/chunks/3564e14010953def6df9.js +0 -1
- package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
- package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
- package/assets/esri/core/workers/chunks/403c7d64f12f00330d88.js +0 -1
- package/assets/esri/core/workers/chunks/4409d77c9734de4e82a7.js +0 -1
- package/assets/esri/core/workers/chunks/4c301ca9c493b96df746.js +0 -1
- package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
- package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
- package/assets/esri/core/workers/chunks/631c5b514bb73782c570.js +0 -1
- package/assets/esri/core/workers/chunks/6c1e92ff4c732dfda756.js +0 -1
- package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
- package/assets/esri/core/workers/chunks/75d53b28afe732c459b2.js +0 -1
- package/assets/esri/core/workers/chunks/85b34d91cf07567d6873.js +0 -1
- package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
- package/assets/esri/core/workers/chunks/89de05207744149fb58b.js +0 -1
- package/assets/esri/core/workers/chunks/8fdd5bca3716816d359b.js +0 -1
- package/assets/esri/core/workers/chunks/987182b3a578fc7de251.js +0 -1
- package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
- package/assets/esri/core/workers/chunks/9d9dffc8884d66a258e4.js +0 -1
- package/assets/esri/core/workers/chunks/a28b53c61bddefb6616e.js +0 -1
- package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
- package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
- package/assets/esri/core/workers/chunks/a960074644c3722be71e.js +0 -1
- package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
- package/assets/esri/core/workers/chunks/b99e69302ea701fff0ea.js +0 -971
- package/assets/esri/core/workers/chunks/b9de831ac379cf1d2969.js +0 -1
- package/assets/esri/core/workers/chunks/bc790b2f964144d10abe.js +0 -1
- package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
- package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
- package/assets/esri/core/workers/chunks/c3eca92d02958732e141.js +0 -1
- package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
- package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
- package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
- package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
- package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
- package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
- package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
- package/assets/esri/core/workers/chunks/dd433c160f7a0c120b82.js +0 -1
- package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
- package/assets/esri/core/workers/chunks/e2d68bcd2f99a65387bf.js +0 -1
- package/assets/esri/core/workers/chunks/ef8b75b92cf549e0507e.js +0 -1
- package/assets/esri/core/workers/chunks/f7fc4c993536e62f7f3e.js +0 -1
- package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
- package/symbols/support/constants.js +0 -5
- package/tasks/operations/identify.js +0 -5
- package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import"../../../../renderers/ClassBreaksRenderer.js";import"../../../../renderers/DictionaryRenderer.js";import"../../../../renderers/DotDensityRenderer.js";import"../../../../renderers/HeatmapRenderer.js";import"../../../../renderers/Renderer.js";import"../../../../renderers/SimpleRenderer.js";import t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import"../../../../symbols.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Handles.js";import a from"../../../../core/Logger.js";import{someMap as n,findInMap as o}from"../../../../core/MapUtils.js";import{isSome as l,unwrapOr as h,isNone as d,removeMaybe as c,destroyMaybe as p,get as y,unwrap as m}from"../../../../core/maybe.js";import g from"../../../../core/PooledArray.js";import{throwIfAborted as u,eachAlways as b,createDeferred as f,isAbortError as v}from"../../../../core/promiseUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{when as S,whenFalse as _,init as w,whenOnce as G,on as x}from"../../../../core/watchUtils.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as R}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as D,isEmpty as E}from"../../../../core/accessorSupport/diffUtils.js";import{s as I,b as U,a as O}from"../../../../chunks/vec3.js";import{c as A}from"../../../../chunks/vec3f64.js";import{projectVectorToVector as L,projectXYZToVector as j,canProjectWithoutEngine as V,projectBuffer as F}from"../../../../geometry/projection.js";import{create as T,center as k,fromRect as W,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as N}from"../../../../geometry/support/aaBoundingRect.js";import z from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as H}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as Y}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as $,validateTo3D as Z}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as J}from"../../../../support/arcadeOnDemand.js";import{getDefaultSymbol3D as Q}from"../../../../symbols/support/defaults3D.js";import{to3D as K}from"../../../../symbols/support/symbolConversion.js";import{ViewElevationProvider as X}from"./ElevationQuery.js";import{VisibilityFlag as ee,VisibilityGroup as te}from"./enums.js";import{extractExpressionInfo as ie,createContext as re}from"./featureExpressionInfoUtils.js";import se from"./Graphics3DFeatureStore.js";import ae from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ne}from"./Graphics3DSymbolCreationContext.js";import{make as oe}from"./Graphics3DSymbolFactory.js";import le from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as he}from"./GraphicStateTracking.js";import{computeCentroid as de}from"./graphicUtils.js";import{ApplyRendererDiffResult as ce}from"./interfaces.js";import{LoadStatus as pe}from"./Loadable.js";import{SpatialIndex2D as ye}from"./SpatialIndex2D.js";import{averageSymbolComplexities as me,defaultSymbolComplexity as ge}from"./symbolComplexity.js";import{StageLayerElevationProvider as ue}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as be}from"../../support/extentUtils.js";import{PropertiesPool as fe}from"../../support/PropertiesPool.js";import{UpdatePolicy as ve}from"../../webgl-engine/lib/basicInterfaces.js";import{GridLocalOriginFactory as Ce}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{WebGLLayer as Se}from"../../webgl-engine/lib/WebGLLayer.js";import{ImmediateTask as _e,noBudget as we,TaskPriority as Ge}from"../../../support/Scheduler.js";import xe from"../../../../geometry/Extent.js";import Pe from"../../../../geometry/Point.js";import Re from"../../../../symbols/LabelSymbol3D.js";import De from"../../../../symbols/TextSymbol.js";import Ee from"../../../../symbols/WebStyleSymbol.js";var Ie;const Ue=A(),Oe=T(),Ae=a.getLogger("esri.views.3d.layers.graphics.Graphics3DCore");let Le=Ie=class extends i{constructor(e){super(e),this.propertiesPool=new fe({computedExtent:xe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new ne(((e,t)=>this._frameTask.schedule(e,t))),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new s,this._frameTask=_e,this.suspendSymbolCleanup=!1,this._spatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this.filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this.pendingUpdatesPool=new g({allocator:e=>e||new Ve,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new g,this.preferredUpdatePolicy=ve.SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){var e;this._spatialIndex||(this._spatialIndex=new ye({objectIdField:null==(e=this.owner.layer)?void 0:e.objectIdField,spatialReference:this._spatialReference,hasZ:this.hasZ,hasM:this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values())));return this._spatialIndex.update(),this._spatialIndex}get effectiveUpdatePolicy(){return l(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?ve.ASYNC:h(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){var e,t;return!!(this.graphicsWaitingForSymbol.size>0||this.running||null!=(e=this.elevationAlignment)&&e.updating||l(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(t=this.filterVisibility)&&t.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating)}get running(){var e;return this.pendingUpdates.size>0||!(null==(e=this._spatialIndex)||!e.updating)}get suspendedOrOutsideOfView(){var e;return this.owner.suspended||(null==(e=this.owner.suspendInfo)?void 0:e.outsideOfView)}get updatingRemaining(){var e,t;return this.updating?this.pendingUpdates.size+.1*((null==(e=this._spatialIndex)?void 0:e.updatingRemaining)||0)+.1*((null==(t=this.elevationAlignment)?void 0:t.updatingRemaining)||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,r=e?e.graphics3D.maxTotalNumberOfPrimitives:0,s=this.averageSymbolComplexity,a=Math.max(1,l(s)?s.primitivesPerFeature:1),n=l(s)&&s.drawCallsPerFeature>0?i/s.drawCallsPerFeature*.3:i,o=Math.ceil(r/a),h=Math.max(t,Math.min(i,o,n)),d=this._get("displayFeatureLimit");return d&&d.minimumTotalNumberOfFeatures===t&&d.maximumTotalNumberOfFeatures===i&&d.maximumTotalNumberOfPrimitives===r&&d.averageSymbolComplexity===s&&d.maximumNumberOfFeatures===h?d:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:r,averageSymbolComplexity:s,maximumNumberOfFeatures:h}}get averageSymbolComplexity(){const e=me(this.symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||l(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get spatialReference(){return this._spatialReference}get usedMemory(){const e=l(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(l(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(l(t))return t;const i=K(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return d(r)&&i.error&&Ae.error(i.error.message),this.symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(d(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);l(s)&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);l(e)&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(d(e))return null;const t=this.symbols.get(e.id);if(l(t))return t.complexity;const i=this._getConvertedSymbol(e);return l(i)?ge(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach((t=>{l(t)&&e.push(t.complexity)})),e}initialize(){this._spatialReference=this.owner.view.spatialReference,this._set("featureStore",new se({objectIdField:this.owner.layer&&this.owner.layer.objectIdField,hasZ:this.hasZ,hasM:this.hasM,spatialReference:this._spatialReference,getSpatialIndex:()=>this.spatialIndex,forAllGraphics:e=>this.graphics3DGraphics.forEach(e)}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new X(this._spatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),l(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.layerView=this.owner,this.symbolCreationContext.localOriginFactory=new Ce(i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled;const s="layer"in this.owner?["layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled"]:"view.screenSizePerspectiveEnabled";this._handles.add([this.watch("suspendedOrOutsideOfView",(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),this.owner.watch(s,(()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;var t;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,null==(t=this.labeler)||t.reset(),this.recreateAllGraphics())})),this.owner.watch("slicePlaneEnabled",(e=>this._slicePlaneEnabledChange(!!e))),this.owner.view.watch("pixelRatio",(()=>this._pixelRatioChange())),this.owner.view.watch("qualitySettings.physicallyBasedRenderingEnabled",(e=>this._physicalBasedRenderingChange(e))),S(i.basemapTerrain,"tilingScheme",(e=>{e.spatialReference.equals(this.symbolCreationContext.overlaySR)||(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics")?this.recreateAllGraphics():this._handles.add([x(this.owner,"loadedGraphics","change",(e=>this._graphicsCollectionChanged(e)),(()=>this.recreateAllGraphics())),x(this.owner,"loadedGraphics","after-changes",(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()),(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()))],"loaded-graphics")})),_(this,"asyncUpdates",(()=>this.runTask(we)),!0),w(this,"effectiveUpdatePolicy",(e=>{l(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===ve.ASYNC,e===ve.SYNC&&this.runTask(we)}),!0)]),this._frameTask=i.resourceController.scheduler.registerTask(Ge.GRAPHICS_CORE,this),this.owner.layer&&"featureReduction"in this.owner.layer&&this._handles.add(this.owner.watch("layer.featureReduction",(()=>this.deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}u(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=c(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=p(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=p(this._handles),this._frameTask.remove(),this._frameTask=_e,this._spatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=c(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=p(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=p(this._spatialIndex),this._set("featureStore",p(this.featureStore))}clear(){var e,t;null==(e=this.objectStates)||e.allGraphicsDeleted(),l(this.graphicStateTracking)&&this.graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach((e=>e.destroy())),null==(t=this._spatialIndex)||t.clear(),this.graphics3DGraphics.clear(),this.numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this.symbols.forEach(p),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Se({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",(e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid))),i.on("objectGeometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("objectGeometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("vertexAttrsUpdated",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)))}notifyGraphicGeometryChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Fe,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){var t;return null!=(t=this.owner.layer)&&t.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);l(s)&&t.set(s,i)})),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await b([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return n(this.symbols,((i,r)=>{if(l(i)){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this.graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);l(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return o(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(d(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(d(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag(ee.USER_SETTING,r,te.GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=f();return this.whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._spatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>F(e,r,t,e,i,t,s),n=(e,t,r)=>F(e,s,t,e,i,t,r),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:l(t)&&t.useViewElevation,minDemResolution:l(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,d=await e.getProjectedBoundingBox(a,n,o,y(t,"signal"));if(!d)return null;const c=d.boundingBox;if(d.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){k(c,Ue);const t=h(e.getElevation(Ue[0],Ue[1],0,i,"ground"),0);c[2]=Math.min(c[2],t),c[5]=Math.max(c[5],t)}}return{boundingBox:c,screenSpaceObjects:d.screenSpaceObjects}}async whenGraphicBounds(e,t){await G(this.owner,"loadedGraphics");const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find((t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;I(Te,0,0,0);let s=0;if(r.render.num>0){if(!L(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,ke,t))return null;U(Te,Te,ke),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=h(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(I(ke,e,i,a),!L(ke,this.viewElevationProvider.spatialReference,ke,t))return null;U(Te,Te,ke),s++}return s>1&&O(Te,Te,1/s),new Pe({x:Te[0],y:Te[1],z:Te[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(d(i))throw new r("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new r("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new r("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t),r=this.graphicsWithoutSymbol.get(t);if(i||r)switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(d(i))return void this._recreateGraphic(t.graphic);if(d(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(l(t)&&t.loadStatus===pe.LOADING)return}return void this._recreateGraphic(t.graphic)}const r=e.graphics3DSymbol;!d(t.newValue)&&r.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=l(e)?e.graphics3DSymbol:l(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(d(r)||d(t.newValue))return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(l(a)&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this.graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=D(s,a);if(d(o))return void this._updateSymbolMapping(s.id,a);const h={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(h),!E(h.diff))return void this._recreateGraphic(i);const c=this._getRenderingInfo(i);if(d(c))return void this._recreateGraphic(i);const p=r.extentPadding;for(const l of h.symbolStatePatches)l();if(p!==r.extentPadding&&this._recomputeExtentPadding(),l(e))for(const l of h.graphics3DGraphicPatches)l(e,c);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===ve.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach((t=>{l(t)&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Oe,i=e.spatialReference;q(e,t);const r=this._spatialReference,s=Ie.tmpVec;if(i.equals(r)||j(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],j(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(!a||null==a.zmin||t[2]<a.zmin),h=o&&(!a||null==a.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){var e,t;this._abortElevationInfoChange();const i=new AbortController;this.elevationInfoChangeAbortController=i;const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(i),this.elevationInfoChangeAbortController=null,null==(e=this.labeler)||e.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelGraphics;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),null==(t=this.elevationAlignment)||t.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new ue({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var e,t,i,r,s;this.clear(),null==(e=this.filterVisibility)||e.clear(),null==(t=this.labeler)||t.reset(),null==(i=this.deconflictor)||i.clear(),null==(r=this.elevationAlignment)||r.clear(),null==(s=this.stageLayer)||s.invalidateSpatialQueryAccelerator(),this.stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{var r;const s=e.usedMemory;this._conditionalRemove(e,t),null==(r=this._spatialIndex)||r.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,s),this._updateLayerVisibility(),this.featureStore.events.emit("changed")})),this.graphicsBySymbol.set(e,new Map));const r=this.symbols.get(e);p(r),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){var i,r,s;this.graphicsDrapedUids.delete(t),null==(i=this.objectStates)||i.removeGraphic(e),null==(r=this.labeler)||r.removeGraphic(e),null==(s=this.deconflictor)||s.removeGraphic(e),l(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===ve.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ae.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===ve.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(l(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return ve.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ae),ve.SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==je.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===ve.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===je.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&Ae.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){var t;if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&null!=(t=this._spatialIndex)&&t.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===je.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==je.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=ve.SYNC),i.add)switch(i.state){case je.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this.pendingAdds--,e.madeProgress();break;case je.REJECTED:i.add=null,this.pendingAdds--;case je.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=je.READY);const t=e.add.geometry;l(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=je.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,v(t)?e.state=je.NEW:e.state=je.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(d(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ae),void(e.state=je.READY);e.state=je.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(v(i)?e.state=je.NEW:e.state=je.REJECTED)}d(t)||d(t.symbol)?(Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=je.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),d(t)||d(t.symbol)||!H(e))return;const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(d(s))return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new ae(e,t,this.layer);let o=!1;const h=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(h);const c=()=>{if(this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this.graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced;else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&l(t)&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()},p=t=>{this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),o||(v(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};i===ve.ASYNC?s.load((()=>this._frameTask.schedule(c)),(e=>this._frameTask.schedule((()=>p(e))))):s.load(c,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){var r;i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,s=i.isElevationSource;this._conditionalRemove(i,t),null==(r=this._spatialIndex)||r.remove(i);const a=i.graphics3DSymbol.symbol.id;this.graphicsBySymbol.get(a).delete(t),this.graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,s),i.destroy(),this.featureStore.events.emit("changed")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Re||e instanceof De){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some((t=>t.symbol===e))}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof Re&&!this._hasLabelingContext(e))||(Ae.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(d(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!V(i.spatialReference,this._spatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||l(this.currentRenderer)))s=this.owner.getRenderingInfo(r,this.currentRenderer,m(this.arcadeOnDemand));else{s={symbol:r.symbol||Q(r.geometry)}}return d(s)||d(s.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){const i=e.geometry;if(d(i))return Ae&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;return this.owner.getRenderingInfoAsync(r,m(this.currentRenderer),m(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(l(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=K(t.backgroundFillSymbol,{ignoreDrivers:!0});l(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=oe(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof Ee?new le(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),l(i)&&++i.referenced,i}trackGraphicState(e){return d(this.graphicStateTracking)&&(this.graphicStateTracking=new he(this)),this.graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this.numberOfGraphics++,e.isElevationSource&&(this.numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this.numberOfGraphics--,i&&(this.numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){var i,r,s,a;const n=t.graphic;if(this.graphicsWithoutSymbol.delete(n.uid),!this.symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;const o=e.createGraphics3DGraphic(t);if(d(o))return null;this._addGraphics3DGraphic(o);const h=e.symbol.id;this.graphicsBySymbol.has(h)||this.graphicsBySymbol.set(h,new Map),this.graphicsBySymbol.get(h).set(n.uid,o);o.isDraped&&this.graphicsDrapedUids.add(n.uid),o.centroid=null,l(n.geometry)&&"point"!==n.geometry.type&&(o.centroid=de(n.geometry,this._spatialReference)),this._updateUserVisibility(o),l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(o),null==(i=this.filterVisibility)||i.updateVisibility(o),null==(r=this.deconflictor)||r.addGraphic(o),null==(s=this.labeler)||s.addGraphic(o),null==(a=this.objectStates)||a.addGraphic(o),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,o),o.initialize(this.stage,this.stageLayer,this.owner),l(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(o);const c=this.whenGraphics3DGraphicRequests[n.uid];return c&&(delete this.whenGraphics3DGraphicRequests[n.uid],c.resolve(o)),o}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),d(e)&&this._currentRendererChange(null,!1),$(e))if(l(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();u(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),u(t)),this.effectiveUpdatePolicy===ve.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,!0)),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===ve.ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return d(this.arcadeOnDemand)?(this.arcadeOnDemand=await J(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=m(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),d(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=D(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,d(r)||("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this.graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof z?this.layer:null,h=m(this.arcadeOnDemand);if(s===i.defaultSymbol&&i.getSymbol(Y(o,l),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this.graphicsWithoutSymbol.set(n,o);const c=this.graphics3DGraphics.get(n);this._conditionalRemove(c,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()})),this._whenSymbolRemoved.forAll((e=>e(s.id)))}(e.length||r.length)&&(this.graphicsWithoutSymbol.forEach((e=>r.push(e))),this.graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,s=e.diff.uniqueValueInfos;if(r||s){const a=s?s.added.map((e=>e.symbol)):[],n=s?s.removed.map((e=>e.symbol)):[];if(s)for(let e=0;e<s.changed.length;e++)a.push(s.changed[e].newValue.symbol),n.push(s.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&a.push(t.defaultSymbol)):i.defaultSymbol&&a.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(a,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,i,r){const s=e=>l(e)?e.id:null;if(i instanceof t&&r instanceof t&&(d(e)||"partial"===e.type)){const t=e&&e.diff,a=t&&t.defaultSymbol,n=t&&t.uniqueValueInfos;let o;return o=n?n.unchanged.map((e=>({oldId:s(e.oldValue.symbol),newId:s(e.newValue.symbol)}))):r.uniqueValueInfos.map(((e,t)=>({oldId:s(e.symbol),newId:s(i.uniqueValueInfos[t].symbol)}))),!a&&r.defaultSymbol&&o.push({oldId:s(r.defaultSymbol),newId:s(i.defaultSymbol)}),o}return[]}_updateSymbolMapping(e,t){const i=l(t)&&t?"string"==typeof t?t:t.id:null,r="string"==typeof t?null:t;if(!e||e===i)return;const s=this.graphicsBySymbol.get(e);this.graphicsBySymbol.delete(e),void 0!==s&&this.graphicsBySymbol.set(i,s);const a=this.symbols.get(e);void 0!==a&&(this.symbols.delete(e),this.symbols.set(i,a),l(a)&&(l(r)?a.symbol=r:a.symbol.id=i))}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this.graphicsBySymbol){const r=this.symbols.get(t);if(l(r))switch(r.applyRendererDiff(e,i)){case ce.Recreate_Symbol:this._recreateSymbol(t);break;case ce.Recreate_Graphics:this._recreateGraphicsForSymbol(t);case ce.Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=N();return be(e,r,t)?this.symbolCreationContext.clippingExtent=W(T(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(d(i))return;e(i,this.graphicsBySymbol.get(t)||We,t)}}updateAllGraphicsVisibility(){this.filterVisibility&&(this.filterVisibility.dirty=!0),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(ee.USER_SETTING,!1,te.GRAPHIC)))}_validateRenderer(e){const t=Z(e);if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ae.warn(e,t.message)}}_volatileGraphicsUpdated(){var e;null==(e=this.labeler)||e.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach(((t,i)=>{if(d(t)||t.referenced>0)return;const r=this.graphicsBySymbol.get(i);r&&0!==r.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),p(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var je;Le.tmpVec=A(),e([P({readOnly:!0})],Le.prototype,"computedExtent",void 0),e([P()],Le.prototype,"currentRenderer",void 0),e([P()],Le.prototype,"rendererHasGeometryOperations",void 0),e([P()],Le.prototype,"_frameTask",void 0),e([P()],Le.prototype,"rendererChangeAbortController",void 0),e([P()],Le.prototype,"elevationInfoChangeAbortController",void 0),e([P()],Le.prototype,"setupAbortController",void 0),e([P({readOnly:!0})],Le.prototype,"elevationAlignment",void 0),e([P({readOnly:!0})],Le.prototype,"scaleVisibility",void 0),e([P({readOnly:!0})],Le.prototype,"filterVisibility",void 0),e([P()],Le.prototype,"_spatialIndex",void 0),e([P({readOnly:!0})],Le.prototype,"extentPadding",void 0),e([P()],Le.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([P({readOnly:!0})],Le.prototype,"featureStore",void 0),e([P({readOnly:!0})],Le.prototype,"deconflictor",void 0),e([P({readOnly:!0})],Le.prototype,"labeler",void 0),e([P({readOnly:!0})],Le.prototype,"objectStates",void 0),e([P()],Le.prototype,"preferredUpdatePolicy",void 0),e([P()],Le.prototype,"forcedUpdatePolicy",void 0),e([P({readOnly:!0})],Le.prototype,"effectiveUpdatePolicy",null),e([P({constructOnly:!0})],Le.prototype,"elevationFeatureExpressionEnabled",void 0),e([P({constructOnly:!0})],Le.prototype,"owner",void 0),e([P({constructOnly:!0})],Le.prototype,"layer",void 0),e([P({constructOnly:!0})],Le.prototype,"graphicSymbolSupported",void 0),e([P({constructOnly:!0})],Le.prototype,"getRenderingInfoWithoutRenderer",void 0),e([P({readOnly:!0})],Le.prototype,"updating",null),e([P({readOnly:!0})],Le.prototype,"running",null),e([P({readOnly:!0})],Le.prototype,"suspendedOrOutsideOfView",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"updatingRemaining",null),e([P({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Le.prototype,"displayFeatureLimit",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"averageSymbolComplexity",null),e([P({constructOnly:!0})],Le.prototype,"hasZ",void 0),e([P({constructOnly:!0})],Le.prototype,"hasM",void 0),Le=Ie=e([R("esri.views.3d.layers.graphics.Graphics3DCore")],Le),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(je||(je={}));class Ve{constructor(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.abortController=null,this.remove=null}}const Fe=10,Te=A(),ke=A(),We=new Map;export{Le as Graphics3DCore};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import"../../../../renderers/ClassBreaksRenderer.js";import"../../../../renderers/DictionaryRenderer.js";import"../../../../renderers/DotDensityRenderer.js";import"../../../../renderers/HeatmapRenderer.js";import"../../../../renderers/Renderer.js";import"../../../../renderers/SimpleRenderer.js";import t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import"../../../../symbols.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Handles.js";import a from"../../../../core/Logger.js";import{someMap as n,findInMap as o}from"../../../../core/MapUtils.js";import{isSome as l,unwrapOr as h,isNone as d,removeMaybe as c,destroyMaybe as p,get as y,unwrap as m}from"../../../../core/maybe.js";import g from"../../../../core/PooledArray.js";import{throwIfAborted as u,eachAlways as b,createDeferred as f,isAbortError as v}from"../../../../core/promiseUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{when as S,whenFalse as _,init as w,whenOnce as G,on as x}from"../../../../core/watchUtils.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as R}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as D,isEmpty as E}from"../../../../core/accessorSupport/diffUtils.js";import{s as I,b as U,a as O}from"../../../../chunks/vec3.js";import{c as A}from"../../../../chunks/vec3f64.js";import{projectVectorToVector as L,projectXYZToVector as j,canProjectWithoutEngine as V,projectBuffer as F}from"../../../../geometry/projection.js";import{create as T,center as k,fromRect as W,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as N}from"../../../../geometry/support/aaBoundingRect.js";import z from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as H}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as Y}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as $,validateTo3D as Z}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as J}from"../../../../support/arcadeOnDemand.js";import{getDefaultSymbol3D as Q}from"../../../../symbols/support/defaults3D.js";import{to3D as K}from"../../../../symbols/support/symbolConversion.js";import{ViewElevationProvider as X}from"./ElevationQuery.js";import{VisibilityFlag as ee,VisibilityGroup as te}from"./enums.js";import{extractExpressionInfo as ie,createContext as re}from"./featureExpressionInfoUtils.js";import se from"./Graphics3DFeatureStore.js";import ae from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ne}from"./Graphics3DSymbolCreationContext.js";import{make as oe}from"./Graphics3DSymbolFactory.js";import le from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as he}from"./GraphicStateTracking.js";import{computeCentroid as de}from"./graphicUtils.js";import{ApplyRendererDiffResult as ce}from"./interfaces.js";import{LoadStatus as pe}from"./Loadable.js";import{SpatialIndex2D as ye}from"./SpatialIndex2D.js";import{averageSymbolComplexities as me,defaultSymbolComplexity as ge}from"./symbolComplexity.js";import{StageLayerElevationProvider as ue}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as be}from"../../support/extentUtils.js";import{PropertiesPool as fe}from"../../support/PropertiesPool.js";import{UpdatePolicy as ve}from"../../webgl-engine/lib/basicInterfaces.js";import{GridLocalOriginFactory as Ce}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{WebGLLayer as Se}from"../../webgl-engine/lib/WebGLLayer.js";import{ImmediateTask as _e,noBudget as we,TaskPriority as Ge}from"../../../support/Scheduler.js";import xe from"../../../../geometry/Extent.js";import Pe from"../../../../geometry/Point.js";import Re from"../../../../symbols/LabelSymbol3D.js";import De from"../../../../symbols/TextSymbol.js";import Ee from"../../../../symbols/WebStyleSymbol.js";var Ie;const Ue=A(),Oe=T(),Ae=a.getLogger("esri.views.3d.layers.graphics.Graphics3DCore");let Le=Ie=class extends i{constructor(e){super(e),this.propertiesPool=new fe({computedExtent:xe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new ne(((e,t)=>this._frameTask.schedule(e,t))),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new s,this._frameTask=_e,this.suspendSymbolCleanup=!1,this._spatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this.filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this.pendingUpdatesPool=new g({allocator:e=>e||new Ve,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new g,this.preferredUpdatePolicy=ve.SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){var e;this._spatialIndex||(this._spatialIndex=new ye({objectIdField:null==(e=this.owner.layer)?void 0:e.objectIdField,spatialReference:this._spatialReference,hasZ:this.hasZ,hasM:this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values())));return this._spatialIndex.update(),this._spatialIndex}get effectiveUpdatePolicy(){return l(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?ve.ASYNC:h(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){var e,t;return!!(this.graphicsWaitingForSymbol.size>0||this.running||null!=(e=this.elevationAlignment)&&e.updating||l(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(t=this.filterVisibility)&&t.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating)}get running(){var e;return this.pendingUpdates.size>0||!(null==(e=this._spatialIndex)||!e.updating)}get suspendedOrOutsideOfView(){var e;return this.owner.suspended||(null==(e=this.owner.suspendInfo)?void 0:e.outsideOfView)}get updatingRemaining(){var e,t;return this.updating?this.pendingUpdates.size+.1*((null==(e=this._spatialIndex)?void 0:e.updatingRemaining)||0)+.1*((null==(t=this.elevationAlignment)?void 0:t.updatingRemaining)||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,r=e?e.graphics3D.maxTotalNumberOfPrimitives:0,s=this.averageSymbolComplexity,a=Math.max(1,l(s)?s.primitivesPerFeature:1),n=l(s)&&s.drawCallsPerFeature>0?i/s.drawCallsPerFeature*.3:i,o=Math.ceil(r/a),h=Math.max(t,Math.min(i,o,n)),d=this._get("displayFeatureLimit");return d&&d.minimumTotalNumberOfFeatures===t&&d.maximumTotalNumberOfFeatures===i&&d.maximumTotalNumberOfPrimitives===r&&d.averageSymbolComplexity===s&&d.maximumNumberOfFeatures===h?d:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:r,averageSymbolComplexity:s,maximumNumberOfFeatures:h}}get averageSymbolComplexity(){const e=me(this.symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||l(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get spatialReference(){return this._spatialReference}get usedMemory(){const e=l(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(l(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(l(t))return t;const i=K(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return d(r)&&i.error&&Ae.error(i.error.message),this.symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(d(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);l(s)&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);l(e)&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(d(e))return null;const t=this.symbols.get(e.id);if(l(t))return t.complexity;const i=this._getConvertedSymbol(e);return l(i)?ge(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach((t=>{l(t)&&e.push(t.complexity)})),e}initialize(){this._spatialReference=this.owner.view.spatialReference,this._set("featureStore",new se({objectIdField:this.owner.layer&&this.owner.layer.objectIdField,hasZ:this.hasZ,hasM:this.hasM,spatialReference:this._spatialReference,getSpatialIndex:()=>this.spatialIndex,forAllGraphics:e=>this.graphics3DGraphics.forEach(e)}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new X(this._spatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),l(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Ce(i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled;const s="layer"in this.owner?["layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled"]:"view.screenSizePerspectiveEnabled";this._handles.add([this.watch("suspendedOrOutsideOfView",(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),this.owner.watch(s,(()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;var t;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,null==(t=this.labeler)||t.reset(),this.recreateAllGraphics())})),this.owner.watch("slicePlaneEnabled",(e=>this._slicePlaneEnabledChange(!!e))),this.owner.view.watch("pixelRatio",(()=>this._pixelRatioChange())),this.owner.view.watch("qualitySettings.physicallyBasedRenderingEnabled",(e=>this._physicalBasedRenderingChange(e))),S(i.basemapTerrain,"tilingScheme",(e=>{e.spatialReference.equals(this.symbolCreationContext.overlaySR)||(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics")?this.recreateAllGraphics():this._handles.add([x(this.owner,"loadedGraphics","change",(e=>this._graphicsCollectionChanged(e)),(()=>this.recreateAllGraphics())),x(this.owner,"loadedGraphics","after-changes",(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()),(()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange()))],"loaded-graphics")})),_(this,"asyncUpdates",(()=>this.runTask(we)),!0),w(this,"effectiveUpdatePolicy",(e=>{l(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===ve.ASYNC,e===ve.SYNC&&this.runTask(we)}),!0)]),this._frameTask=i.resourceController.scheduler.registerTask(Ge.GRAPHICS_CORE,this),this.owner.layer&&"featureReduction"in this.owner.layer&&this._handles.add(this.owner.watch("layer.featureReduction",(()=>this.deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}u(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=c(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=p(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=p(this._handles),this._frameTask.remove(),this._frameTask=_e,this._spatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=c(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=p(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=p(this._spatialIndex),this._set("featureStore",p(this.featureStore))}clear(){var e,t;null==(e=this.objectStates)||e.allGraphicsDeleted(),l(this.graphicStateTracking)&&this.graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach((e=>e.destroy())),null==(t=this._spatialIndex)||t.clear(),this.graphics3DGraphics.clear(),this.numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this.symbols.forEach(p),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Se({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",(e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid))),i.on("objectGeometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("objectGeometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("vertexAttrsUpdated",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)))}notifyGraphicGeometryChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(d(this.graphicStateTracking)||d(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Fe,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){var t;return null!=(t=this.owner.layer)&&t.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);l(s)&&t.set(s,i)})),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await b([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return n(this.symbols,((i,r)=>{if(l(i)){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this.graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);l(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return o(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(d(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(d(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag(ee.USER_SETTING,r,te.GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=f();return this.whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._spatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>F(e,r,t,e,i,t,s),n=(e,t,r)=>F(e,s,t,e,i,t,r),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:l(t)&&t.useViewElevation,minDemResolution:l(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,d=await e.getProjectedBoundingBox(a,n,o,y(t,"signal"));if(!d)return null;const c=d.boundingBox;if(d.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){k(c,Ue);const t=h(e.getElevation(Ue[0],Ue[1],0,i,"ground"),0);c[2]=Math.min(c[2],t),c[5]=Math.max(c[5],t)}}return{boundingBox:c,screenSpaceObjects:d.screenSpaceObjects}}async whenGraphicBounds(e,t){await G(this.owner,"loadedGraphics");const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find((t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;I(Te,0,0,0);let s=0;if(r.render.num>0){if(!L(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,ke,t))return null;U(Te,Te,ke),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=h(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(I(ke,e,i,a),!L(ke,this.viewElevationProvider.spatialReference,ke,t))return null;U(Te,Te,ke),s++}return s>1&&O(Te,Te,1/s),new Pe({x:Te[0],y:Te[1],z:Te[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(d(i))throw new r("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new r("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new r("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t);if(!d(i)||!d(this.graphicsWithoutSymbol.get(t)))switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":break;case"transform":this._graphicUpdateTransformHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(d(i))return void this._recreateGraphic(t.graphic);if(d(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(l(t)&&t.loadStatus===pe.LOADING)return}return void this._recreateGraphic(t.graphic)}const r=e.graphics3DSymbol;!d(t.newValue)&&r.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=l(e)?e.graphics3DSymbol:l(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(d(r)||d(t.newValue))return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(l(a)&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this.graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=D(s,a);if(d(o))return void this._updateSymbolMapping(s.id,a);const h={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(h),!E(h.diff))return void this._recreateGraphic(i);const c=this._getRenderingInfo(i);if(d(c))return void this._recreateGraphic(i);const p=r.extentPadding;for(const l of h.symbolStatePatches)l();if(p!==r.extentPadding&&this._recomputeExtentPadding(),l(e))for(const l of h.graphics3DGraphicPatches)l(e,c);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}_graphicUpdateTransformHandler(e,t){}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===ve.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach((t=>{l(t)&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Oe,i=e.spatialReference;q(e,t);const r=this._spatialReference,s=Ie.tmpVec;if(i.equals(r)||j(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],j(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(!a||null==a.zmin||t[2]<a.zmin),h=o&&(!a||null==a.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){var e,t;this._abortElevationInfoChange();const i=new AbortController;this.elevationInfoChangeAbortController=i;const r=ie(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await re(r,this._spatialReference,Ae),u(i),this.elevationInfoChangeAbortController=null,null==(e=this.labeler)||e.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelGraphics;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),null==(t=this.elevationAlignment)||t.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new ue({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var e,t,i,r,s;this.clear(),null==(e=this.filterVisibility)||e.clear(),null==(t=this.labeler)||t.reset(),null==(i=this.deconflictor)||i.clear(),null==(r=this.elevationAlignment)||r.clear(),null==(s=this.stageLayer)||s.invalidateSpatialQueryAccelerator(),this.stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{var r;const s=e.usedMemory;this._conditionalRemove(e,t),null==(r=this._spatialIndex)||r.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,s),this._updateLayerVisibility(),this.featureStore.events.emit("changed")})),this.graphicsBySymbol.set(e,new Map));const r=this.symbols.get(e);p(r),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){var i,r,s;this.graphicsDrapedUids.delete(t),null==(i=this.objectStates)||i.removeGraphic(e),null==(r=this.labeler)||r.removeGraphic(e),null==(s=this.deconflictor)||s.removeGraphic(e),l(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===ve.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ae.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===ve.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(l(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return ve.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ae),ve.SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==je.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===ve.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===je.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&Ae.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){var t;if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&null!=(t=this._spatialIndex)&&t.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===je.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==je.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=ve.SYNC),i.add)switch(i.state){case je.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this.pendingAdds--,e.madeProgress();break;case je.REJECTED:i.add=null,this.pendingAdds--;case je.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=je.READY);const t=e.add.geometry;l(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=je.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,v(t)?e.state=je.NEW:e.state=je.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(d(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ae),void(e.state=je.READY);e.state=je.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(v(i)?e.state=je.NEW:e.state=je.REJECTED)}d(t)||d(t.symbol)?(Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=je.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),d(t)||d(t.symbol)||!H(e))return;const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(d(s))return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new ae(e,t,this.layer);let o=!1;const h=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(h);const c=()=>{if(this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this.graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced;else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&l(t)&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()},p=t=>{this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),o||(v(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};i===ve.ASYNC?s.load((()=>this._frameTask.schedule(c)),(e=>this._frameTask.schedule((()=>p(e))))):s.load(c,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){var r;i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,s=i.isElevationSource;this._conditionalRemove(i,t),null==(r=this._spatialIndex)||r.remove(i);const a=i.graphics3DSymbol.symbol.id;this.graphicsBySymbol.get(a).delete(t),this.graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,s),i.destroy(),this.featureStore.events.emit("changed")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Re||e instanceof De){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some((t=>t.symbol===e))}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof Re&&!this._hasLabelingContext(e))||(Ae.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(d(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!V(i.spatialReference,this._spatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||l(this.currentRenderer)))s=this.owner.getRenderingInfo(r,this.currentRenderer,m(this.arcadeOnDemand));else{s={symbol:r.symbol||Q(r.geometry)}}return d(s)||d(s.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){const i=e.geometry;if(d(i))return Ae&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&l(e.symbol))return Ae&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ae.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Y(e,this.layer):e;return this.owner.getRenderingInfoAsync(r,m(this.currentRenderer),m(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(l(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=K(t.backgroundFillSymbol,{ignoreDrivers:!0});l(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=oe(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof Ee?new le(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),l(i)&&++i.referenced,i}trackGraphicState(e){return d(this.graphicStateTracking)&&(this.graphicStateTracking=new he(this)),this.graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this.numberOfGraphics++,e.isElevationSource&&(this.numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this.numberOfGraphics--,i&&(this.numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){var i,r,s,a;const n=t.graphic;if(this.graphicsWithoutSymbol.delete(n.uid),!this.symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;const o=e.createGraphics3DGraphic(t);if(d(o))return null;this._addGraphics3DGraphic(o);const h=e.symbol.id;this.graphicsBySymbol.has(h)||this.graphicsBySymbol.set(h,new Map),this.graphicsBySymbol.get(h).set(n.uid,o);o.isDraped&&this.graphicsDrapedUids.add(n.uid),o.centroid=null,l(n.geometry)&&"point"!==n.geometry.type&&(o.centroid=de(n.geometry,this._spatialReference)),this._updateUserVisibility(o),l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(o),null==(i=this.filterVisibility)||i.updateVisibility(o),null==(r=this.deconflictor)||r.addGraphic(o),null==(s=this.labeler)||s.addGraphic(o),null==(a=this.objectStates)||a.addGraphic(o),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,o),o.initialize(this.stage,this.stageLayer,this.owner),l(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(o);const c=this.whenGraphics3DGraphicRequests[n.uid];return c&&(delete this.whenGraphics3DGraphicRequests[n.uid],c.resolve(o)),o}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),d(e)&&this._currentRendererChange(null,!1),$(e))if(l(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();u(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),u(t)),this.effectiveUpdatePolicy===ve.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,!0)),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===ve.ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return d(this.arcadeOnDemand)?(this.arcadeOnDemand=await J(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=m(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),d(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=D(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,d(r)||("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this.graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof z?this.layer:null,h=m(this.arcadeOnDemand);if(s===i.defaultSymbol&&i.getSymbol(Y(o,l),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this.graphicsWithoutSymbol.set(n,o);const c=this.graphics3DGraphics.get(n);this._conditionalRemove(c,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()})),this._whenSymbolRemoved.forAll((e=>e(s.id)))}(e.length||r.length)&&(this.graphicsWithoutSymbol.forEach((e=>r.push(e))),this.graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,s=e.diff.uniqueValueInfos;if(r||s){const a=s?s.added.map((e=>e.symbol)):[],n=s?s.removed.map((e=>e.symbol)):[];if(s)for(let e=0;e<s.changed.length;e++)a.push(s.changed[e].newValue.symbol),n.push(s.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&a.push(t.defaultSymbol)):i.defaultSymbol&&a.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(a,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,i,r){const s=e=>l(e)?e.id:null;if(i instanceof t&&r instanceof t&&(d(e)||"partial"===e.type)){const t=e&&e.diff,a=t&&t.defaultSymbol,n=t&&t.uniqueValueInfos;let o;return o=n?n.unchanged.map((e=>({oldId:s(e.oldValue.symbol),newId:s(e.newValue.symbol)}))):r.uniqueValueInfos.map(((e,t)=>({oldId:s(e.symbol),newId:s(i.uniqueValueInfos[t].symbol)}))),!a&&r.defaultSymbol&&o.push({oldId:s(r.defaultSymbol),newId:s(i.defaultSymbol)}),o}return[]}_updateSymbolMapping(e,t){const i=l(t)&&t?"string"==typeof t?t:t.id:null,r="string"==typeof t?null:t;if(!e||e===i)return;const s=this.graphicsBySymbol.get(e);this.graphicsBySymbol.delete(e),void 0!==s&&this.graphicsBySymbol.set(i,s);const a=this.symbols.get(e);void 0!==a&&(this.symbols.delete(e),this.symbols.set(i,a),l(a)&&(l(r)?a.symbol=r:a.symbol.id=i))}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this.graphicsBySymbol){const r=this.symbols.get(t);if(l(r))switch(r.applyRendererDiff(e,i)){case ce.Recreate_Symbol:this._recreateSymbol(t);break;case ce.Recreate_Graphics:this._recreateGraphicsForSymbol(t);case ce.Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=N();return be(e,r,t)?this.symbolCreationContext.clippingExtent=W(T(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(d(i))return;e(i,this.graphicsBySymbol.get(t)||We,t)}}updateAllGraphicsVisibility(){this.filterVisibility&&(this.filterVisibility.dirty=!0),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=l(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(ee.USER_SETTING,!1,te.GRAPHIC)))}_validateRenderer(e){const t=Z(e);if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ae.warn(e,t.message)}}_volatileGraphicsUpdated(){var e;null==(e=this.labeler)||e.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach(((t,i)=>{if(d(t)||t.referenced>0)return;const r=this.graphicsBySymbol.get(i);r&&0!==r.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),p(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var je;Le.tmpVec=A(),e([P({readOnly:!0})],Le.prototype,"computedExtent",void 0),e([P()],Le.prototype,"currentRenderer",void 0),e([P()],Le.prototype,"rendererHasGeometryOperations",void 0),e([P()],Le.prototype,"_frameTask",void 0),e([P()],Le.prototype,"rendererChangeAbortController",void 0),e([P()],Le.prototype,"elevationInfoChangeAbortController",void 0),e([P()],Le.prototype,"setupAbortController",void 0),e([P({readOnly:!0})],Le.prototype,"elevationAlignment",void 0),e([P({readOnly:!0})],Le.prototype,"scaleVisibility",void 0),e([P({readOnly:!0})],Le.prototype,"filterVisibility",void 0),e([P()],Le.prototype,"_spatialIndex",void 0),e([P({readOnly:!0})],Le.prototype,"extentPadding",void 0),e([P()],Le.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([P({readOnly:!0})],Le.prototype,"featureStore",void 0),e([P({readOnly:!0})],Le.prototype,"deconflictor",void 0),e([P({readOnly:!0})],Le.prototype,"labeler",void 0),e([P({readOnly:!0})],Le.prototype,"objectStates",void 0),e([P()],Le.prototype,"preferredUpdatePolicy",void 0),e([P()],Le.prototype,"forcedUpdatePolicy",void 0),e([P({readOnly:!0})],Le.prototype,"effectiveUpdatePolicy",null),e([P({constructOnly:!0})],Le.prototype,"elevationFeatureExpressionEnabled",void 0),e([P({constructOnly:!0})],Le.prototype,"owner",void 0),e([P({constructOnly:!0})],Le.prototype,"layer",void 0),e([P({constructOnly:!0})],Le.prototype,"graphicSymbolSupported",void 0),e([P({constructOnly:!0})],Le.prototype,"getRenderingInfoWithoutRenderer",void 0),e([P({readOnly:!0})],Le.prototype,"updating",null),e([P({readOnly:!0})],Le.prototype,"running",null),e([P({readOnly:!0})],Le.prototype,"suspendedOrOutsideOfView",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"updatingRemaining",null),e([P({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Le.prototype,"displayFeatureLimit",null),e([P({readOnly:!0,dependsOn:[]})],Le.prototype,"averageSymbolComplexity",null),e([P({constructOnly:!0})],Le.prototype,"hasZ",void 0),e([P({constructOnly:!0})],Le.prototype,"hasM",void 0),Le=Ie=e([R("esri.views.3d.layers.graphics.Graphics3DCore")],Le),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(je||(je={}));class Ve{constructor(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=je.NEW,this.abortController=null,this.remove=null}}const Fe=10,Te=A(),ke=A(),We=new Map;export{Le as Graphics3DCore};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import{s as t}from"../../../../chunks/vec3.js";import{c as
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{s as t}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{create as i,empty as s,expandWithRect as o,center as n,set as a,toRect as d}from"../../../../geometry/support/aaBoundingBox.js";import{create as h}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as c}from"./graphicUtils.js";import{Object3DState as g}from"../../webgl-engine/lib/basicInterfaces.js";import{ModelDirty as m}from"../../webgl-engine/lib/ModelDirtyTypes.js";class l{constructor(e,t,r){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=r,this.type="draped",this.stage=null,this._visible=!1,this._addedToStage=!1,this._graphicsCoreOwner=null,this.isElevationSource=!1}initialize(e,t,r){this.stage=e,this._graphicsCoreOwner=r,this._overlayRenderer=this._graphicsCoreOwner.view.basemapTerrain.overlayManager.renderer}setVisibility(e){if(null!=this.stage&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._overlayRenderer.addGeometries(this.renderGeometries,this._graphicsCoreOwner,m.Geometry.ADD);if(e||this._addedToStage){for(const e of this.renderGeometries)e.instanceParameters.visible=this._visible;this._overlayRenderer.updateGeometries(this.renderGeometries,this._graphicsCoreOwner,m.State.VISIBILITIES)}}}destroy(){this.stage&&this._addedToStage&&this._overlayRenderer.removeGeometries(this.renderGeometries,this._graphicsCoreOwner,m.Geometry.REMOVE),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(e=r()){return t(e,0,0,0)}getBoundingBoxObjectSpace(e=i()){return s(e)}addObjectState(e,t){e===g.Highlight&&(this.renderGeometries.forEach((e=>{const r=e.addHighlight();t.addRenderGeometry(e,r,this)})),this._addedToStage&&this._overlayRenderer.updateHighlights(this.renderGeometries,this._graphicsCoreOwner))}removeObjectState(e){this.renderGeometries.forEach((t=>{e.removeRenderGeometry(t)}))}removeRenderGeometryObjectState(e,t){e.removeHighlight(t),this._addedToStage&&this._overlayRenderer.updateHighlights(this.renderGeometries,this._graphicsCoreOwner)}computeAttachmentOrigin(e){for(const t of this.renderGeometries)t.computeAttachmentOrigin(_)&&(e.draped.origin[0]+=_[0],e.draped.origin[1]+=_[1],e.draped.num++)}async getProjectedBoundingBox(t,r,i,a,d){s(d);for(let e=0;e<this.renderGeometries.length;e++){const r=this.renderGeometries[e];this._getRenderGeometryProjectedBoundingRect(r,t,p,i),o(d,p)}if(r){let t;n(d,_);const i=c(d,r);try{t=await r.service.queryElevation(_[0],_[1],a,i,"ground")}catch(h){}e(t)&&(d[2]=Math.min(d[2],t),d[5]=Math.max(d[5],t))}return d}_getRenderGeometryProjectedBoundingRect(e,t,r,i){if(this.boundingBox)a(u,this.boundingBox);else{const t=e.boundingSphere,r=t[3];u[0]=t[0]-r,u[1]=t[1]-r,u[2]=t[2]-r,u[3]=t[0]+r,u[4]=t[1]+r,u[5]=t[2]+r}return t(u,0,2),this.calculateRelativeScreenBounds&&i.push({location:n(u),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),d(u,r)}}const p=h(),u=i(),_=r();export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import i from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{isSome as r}from"../../../../core/maybe.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ExtentSet as h}from"./ExtentSet.js";import{UpdatePolicy as o}from"../../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as p}from"../../../support/Scheduler.js";let
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import i from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{isSome as r}from"../../../../core/maybe.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ExtentSet as h}from"./ExtentSet.js";import{UpdatePolicy as o}from"../../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as p}from"../../../support/Scheduler.js";let c=class extends t{constructor(){super(...arguments),this.dirtyExtents=new h,this.globalDirty=!1,this.averageExtentUpdateSize=0,this.dirtyGraphicsSet=new Set,this.handles=new s,this.updateElevation=!1,this.graphicsCoreOwner=null,this.graphicsCore=null,this.events=new i}setup(e,t,i,s){this.graphicsCoreOwner=e,this.queryGraphicUIDsInExtent=t,this.graphicsCore=i,this.elevationProvider=s;const r=this.graphicsCoreOwner.view.resourceController.scheduler;this.handles.add([s.on("elevation-change",(e=>this._elevationChanged(e))),this.graphicsCoreOwner.watch("suspended",(()=>this._suspendedChange())),r.registerTask(p.ELEVATION_ALIGNMENT,this)])}destroy(){this.dirtyGraphicsSet.clear(),this.handles.destroy(),this.handles=null,this.graphicsCoreOwner=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null}clear(){this.dirtyGraphicsSet.clear(),this.notifyChange("updating")}_suspendedChange(){!0===this.graphicsCoreOwner.suspended?this.updateElevation=!1:!1===this.graphicsCoreOwner.suspended&&this.updateElevation&&(this.globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this.globalDirty=!0,this.notifyChange("updating")}get updating(){return this.running}get running(){return this.dirtyGraphicsSet.size>0||this.dirtyExtents&&!this.dirtyExtents.empty||this.globalDirty}get updatingRemaining(){return this.dirtyGraphicsSet.size+this.dirtyExtents.size*this.averageExtentUpdateSize}runTask(e){for(this.globalDirty&&(this._markAllGraphicsElevationDirty(),this.globalDirty=!1,e.madeProgress()),e.run((()=>this.dirtyExtents.merge(e)));this.running&&!e.done;)this._updateDirtyGraphics(e),this._updateDirtyExtents(e);this.graphicsCoreOwner.view.deconflictor.setDirty(),this.notifyChange("updating")}_updateDirtyGraphics(e){const t=this.graphicsCoreOwner.view.renderCoordsHelper,i=this.graphicsCore.effectiveUpdatePolicy===o.ASYNC;for(const s of this.dirtyGraphicsSet.keys()){const a=this.graphicsCore.getGraphics3DGraphicById(s);if(this.dirtyGraphicsSet.delete(s),r(a)&&(a.alignWithElevation(this.elevationProvider,t,i),e.madeProgress()),e.done)return}}_updateDirtyExtents(e){for(;!this.dirtyExtents.empty&&!e.done;){const t=this.dirtyExtents.pop(),i=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:t,spatialReference:i});const s=this.dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(t,i,(e=>{const t=this.graphicsCore.getGraphics3DGraphicById(e);r(t)&&t.needsElevationUpdates()&&this.dirtyGraphicsSet.add(e)})),this.averageExtentUpdateSize=.1*(this.dirtyGraphicsSet.size-s)+.9*this.averageExtentUpdateSize,e.madeProgress()}}_markAllGraphicsElevationDirty(){this.dirtyExtents.clear(),this.dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach(((e,t)=>this.dirtyGraphicsSet.add(t)))}_elevationChanged(e){if("scene"===e.context&&(!this.graphicsCore.layer.elevationInfo||"relative-to-scene"!==this.graphicsCore.layer.elevationInfo.mode))return;const{extent:t,spatialReference:i}=e;if(this.graphicsCoreOwner.suspended){if(!this.updateElevation){const e=this.graphicsCore.computedExtent;e&&t[2]>e.xmin&&t[0]<e.xmax&&t[3]>e.ymin&&t[1]<e.ymax&&(this.updateElevation=!0)}this.events.emit("invalidate-elevation",{extent:t,spatialReference:i})}else t[0]===-1/0?this.globalDirty=!0:this.dirtyExtents.add(t),this.notifyChange("updating")}};e([a({readOnly:!0})],c.prototype,"updating",null),e([a({readOnly:!0})],c.prototype,"updatingRemaining",null),c=e([n("esri.views.3d.layers.graphics.Graphics3DElevationAlignment")],c);const d=c;export{d as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{neverReached as i}from"../../../../core/compilerUtils.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{destroyMaybe as r,isSome as n,unwrap as a}from"../../../../core/maybe.js";import{logOnError as o}from"../../../../core/promiseUtils.js";import{watch as l,initial as p,when as h}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as c}from"../../../../core/accessorSupport/diffUtils.js";import{canProject as y,project as g}from"../../../../geometry/support/webMercatorUtils.js";import{getRenderingInfo as m,getRenderingInfoAsync as f}from"../../../../renderers/support/renderingInfoUtils.js";import b from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as v}from"./constants.js";import{Graphics3DCore as E}from"./Graphics3DCore.js";import C from"./Graphics3DElevationAlignment.js";import{Graphics3DFilterVisibility as x}from"./Graphics3DFilterVisibility.js";import w from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as V}from"./Graphics3DObjectStates.js";import S from"./Graphics3DScaleVisibility.js";import{enlargeExtent as j}from"./graphicUtils.js";import{attributeLookup as R}from"../support/attributeUtils.js";import{UpdatePolicy as O,Object3DState as G}from"../../webgl-engine/lib/basicInterfaces.js";let _=class extends s{constructor(e){super(e),this.type="graphics-3d",this.elevationFeatureExpressionEnabled=!1,this.dataExtent=null,this.preferredUpdatePolicy=O.ASYNC,this.suspendResumeExtent=null}normalizeCtorArgs(e){const t=e.frustumVisibilityEnabled?new w:null,i=e.scaleVisibilityEnabled?new S:null,s=(e.filterVisibilityEnabled||e.timeExtentVisibilityEnabled)&&"multipatch"!==e.owner.layer.geometryType?new x:null,r=e.elevationAlignmentEnabled?new C:null,{owner:n,updateClippingExtent:a,dataExtent:o,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}=e;return{owner:n,updateClippingExtent:a,dataExtent:o,frustumVisibility:t,scaleVisibility:i,filterVisibility:s,elevationAlignment:r,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}}initialize(){const e=new E({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:this.owner.hasZ,hasM:this.owner.hasM});this._set("graphicsCore",e),this.scaleVisibility&&this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this.scaleVisibility.layerMinMaxScaleChangeHandler())),this.filterVisibility&&(this.updatingHandles.add((()=>"filter"in this.owner&&this.owner.filter),(()=>this.filterVisibility.filterChanged())),this.updatingHandles.add((()=>"timeExtent"in this.owner&&this.owner.timeExtent),(()=>this.filterVisibility.filterChanged()))),this.elevationAlignment&&this.updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{c(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this.updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this.updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{c(e,t)&&this.graphicsCore.updateLabelingInfo()})),this.updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",r(this.frustumVisibility)),this._set("scaleVisibility",r(this.scaleVisibility)),this._set("filterVisibility",r(this.filterVisibility)),this._set("elevationAlignment",r(this.elevationAlignment)),this._set("objectStates",r(this.objectStates)),this._set("graphicsCore",r(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get suspended(){var e;return null==(e=this.scaleVisibility)?void 0:e.suspended}get suspendInfo(){var e,t;const i={};return null!=(e=this.scaleVisibility)&&e.suspended&&(i.outsideScaleRange=!0),null!=(t=this.frustumVisibility)&&t.suspended&&(i.outsideOfView=!0),i}get updating(){var e,t,i;return!!(null!=(e=this.graphicsCore)&&e.updating||null!=(t=this.frustumVisibility)&&t.updating||null!=(i=this.updatingHandles)&&i.updating)}get featureStore(){var e;return null==(e=this.graphicsCore)?void 0:e.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get drapeSourceType(){return this.owner.drapeSourceType}get updatePolicy(){return this.owner.updatePolicy}get graphics3DGraphics(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphicsByObjectID}get symbolUpdateType(){var e;return null==(e=this.graphicsCore)?void 0:e.symbolUpdateType}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibility.suspended}}async setup(){this.frustumVisibility&&this.frustumVisibility.setup(this);const e=this.owner,t=this.owner.view.basemapTerrain,i=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.scaleVisibility&&this.scaleVisibility.setup(this,this.layer,i,this.graphicsCore,t),this.filterVisibility&&("filter"in e||"timeExtent"in e)&&this.filterVisibility.setup(e,this.graphicsCore),this.elevationAlignment){const t=e.view.elevationProvider;this.elevationAlignment.setup(this,i,this.graphicsCore,t)}this._set("objectStates",new V(this.graphicsCore)),this._set("labeling",this.owner.view.labeler.addGraphicsOwner(this.graphicsCore,this.scaleVisibility)),this._set("deconfliction",e.view.deconflictor.addGraphicsOwner(this.graphicsCore)),await o(this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,filterVisibility:this.filterVisibility,deconflictor:this.deconfliction,labeler:this.labeling,objectStates:this.objectStates})),this.updatingHandles.add((()=>this.layer.renderer),(e=>this.updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this.updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this.updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await o(this.graphicsCore.updateLabelingInfo())}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(G.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof b){const{set:t,handle:s}=this.objectStates.acquireSet(G.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==R(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(G.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>R(this.layer.fieldsIndex,e.attributes,i)))}if("number"==typeof e[0]||"string"==typeof e[0]){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(G.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return U}whenGraphicBounds(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=m(e,{renderer:t,arcade:i});if(n(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return f(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.getSymbolLayerSize(e,t)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.handles.add(l((()=>this.suspendResumeExtentMode),(()=>{switch(this.handles.remove(I),this.suspendResumeExtentMode){case"computed":this.handles.add([l((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],I);break;case"data":this.handles.add([h((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(a(this.dataExtent))))],I);break;default:i(this.suspendResumeExtentMode)}}),p))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this.suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!y(e,i))return;e=g(e,i)}return j(e,t,v,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){this.frustumVisibility&&this.frustumVisibility.setExtent(e),this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([d()],_.prototype,"type",void 0),e([d({constructOnly:!0})],_.prototype,"owner",void 0),e([d()],_.prototype,"layer",null),e([d({constructOnly:!0})],_.prototype,"updateClippingExtent",void 0),e([d({constructOnly:!0})],_.prototype,"elevationFeatureExpressionEnabled",void 0),e([d({constructOnly:!0})],_.prototype,"graphicsCore",void 0),e([d({constructOnly:!0})],_.prototype,"scaleVisibility",void 0),e([d({constructOnly:!0})],_.prototype,"filterVisibility",void 0),e([d({constructOnly:!0})],_.prototype,"elevationAlignment",void 0),e([d({constructOnly:!0})],_.prototype,"frustumVisibility",void 0),e([d({readOnly:!0})],_.prototype,"deconfliction",void 0),e([d({readOnly:!0})],_.prototype,"labeling",void 0),e([d({readOnly:!0})],_.prototype,"objectStates",void 0),e([d()],_.prototype,"suspendResumeExtentMode",null),e([d()],_.prototype,"dataExtent",void 0),e([d()],_.prototype,"suspended",null),e([d()],_.prototype,"suspendInfo",null),e([d()],_.prototype,"updating",null),e([d()],_.prototype,"featureStore",null),e([d()],_.prototype,"view",null),e([d()],_.prototype,"loadedGraphics",null),e([d()],_.prototype,"fullOpacity",null),e([d()],_.prototype,"filter",null),e([d()],_.prototype,"slicePlaneEnabled",null),e([d()],_.prototype,"drapeSourceType",null),e([d()],_.prototype,"updatePolicy",null),e([d()],_.prototype,"preferredUpdatePolicy",void 0),_=e([u("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],_);const A=_,I="suspendResumeExtentMode",U={remove(){},pause(){},resume(){}};export{A as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Handles.js";import{init as i}from"../../../../core/watchUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as o}from"../../../../geometry/projectionEllipsoid.js";import{FrustumExtentIntersection as a}from"../../support/FrustumExtentIntersection.js";import{TaskPriority as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import s from"../../../../core/Handles.js";import{init as i}from"../../../../core/watchUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as o}from"../../../../geometry/projectionEllipsoid.js";import{FrustumExtentIntersection as a}from"../../support/FrustumExtentIntersection.js";import{TaskPriority as h}from"../../../support/Scheduler.js";const c=1.2;let p=class extends t{constructor(){super(...arguments),this.suspended=!1,this.extent=null,this.extentIntersectionDirty=!0,this._isVisibleBelowSurface=!1,this.handles=new s,this.graphicsCoreOwner=null,this.updating=!0}setup(e){this.graphicsCoreOwner=e,this.extentIntersection=new a({renderCoordsHelper:e.view.renderCoordsHelper});const t=e.view,s=t.basemapTerrain,r=t.resourceController.scheduler;this.handles.add([t.on("resize",(()=>this._viewChange())),t.state.watch("camera",(()=>this._viewChange()),!0),r.registerTask(h.FRUSTUM_VISIBILITY,this),s.on("elevation-bounds-change",(()=>this._elevationBoundsChange()))]),"local"===t.viewingMode?this.isVisibleBelowSurface=!0:this.handles.add([i(s,["opacity","wireframe"],(()=>this._updateIsVisibleBelowSurface())),i(t,"map.ground.navigationConstraint.type",(()=>this._updateIsVisibleBelowSurface()))])}destroy(){this.graphicsCoreOwner=null,this.extent=null,this.extentIntersection=null,this.handles&&(this.handles.destroy(),this.handles=null)}_setDirty(){this.updating||this._set("updating",!0)}setExtent(e){this.extent=e,this.extentIntersectionDirty=!0,this._setDirty()}_viewChange(){this._setDirty()}_elevationBoundsChange(){this._setDirty(),this.extentIntersectionDirty=!0}set isVisibleBelowSurface(e){this._isVisibleBelowSurface=e,this._setDirty(),this.extentIntersectionDirty=!0}_updateIsVisibleBelowSurface(){const e=this.graphicsCoreOwner.view,t=e.basemapTerrain,s="local"===e.viewingMode,i=e.map.ground&&e.map.ground.navigationConstraint&&"none"===e.map.ground.navigationConstraint.type;this.isVisibleBelowSurface=s||!t.opaque||i}_updateExtentIntersection(){if(!this.extentIntersectionDirty)return;this.extentIntersectionDirty=!1;const e=this.graphicsCoreOwner.view;let t;if(this._isVisibleBelowSurface)t=-.3*o(e.spatialReference).radius;else{const{min:s,max:i}=e.basemapTerrain.elevationBounds;t=s-Math.max(1,(i-s)*(c-1))}this.extentIntersection.update(this.extent,e.spatialReference,t)}get running(){return this.updating}runTask(){if(this._set("updating",!1),!this.extent)return void this._set("suspended",!1);this._updateExtentIntersection();const e=this.graphicsCoreOwner.view.frustum,t=o(this.graphicsCoreOwner.view.spatialReference).radius;this._set("suspended",!this.extentIntersection.isVisibleInFrustum(e,t))}};e([r({readOnly:!0})],p.prototype,"suspended",void 0),e([r({readOnly:!0})],p.prototype,"updating",void 0),p=e([n("esri.views.3d.layers.graphics.Graphics3DFrustumVisibility")],p);const l=p;export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../Color.js";import"../../../../symbols.js";import{result as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/has.js";import i from"../../../../core/Error.js";import{isSome as s,get as a,isNone as o,releaseMaybe as n,unwrap as l}from"../../../../core/maybe.js";import{throwIfAbortError as c,throwIfAborted as h}from"../../../../core/promiseUtils.js";import{pt2px as m,px2pt as u}from"../../../../core/screenUtils.js";import{dataComponents as d,isSVG as _}from"../../../../core/urlUtils.js";import{c as p}from"../../../../chunks/mat4f64.js";import{f,a as y}from"../../../../chunks/vec2f64.js";import{Z as g,O as b,f as x}from"../../../../chunks/vec3f64.js";import{c as S}from"../../../../chunks/vec4.js";import{f as v,c as z}from"../../../../chunks/vec4f64.js";import{projectPointToVector as P}from"../../../../geometry/projection.js";import{containsPoint as R}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as M}from"../../../../support/arcadeOnDemand.js";import{defaultPrimitive as w}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import j from"../../../2d/arcade/callExpressionWithFeature.js";import{TRANSPARENT_UNIT as I}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{SymbolUpdateType as O,elevationModeChangeUpdateType as T,needsElevationUpdates2D as L}from"./elevationAlignmentUtils.js";import{ElevationContext as D}from"./ElevationContext.js";import F from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as G}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as U}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A,namedAnchorToHUDMaterialAnchorPos as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as k}from"./interfaces.js";import{placePointOnGeometry as B,createStageObjectForHUD as N,extendPointGraphicElevationContext as q}from"./pointUtils.js";import{createTriangle as H,createX as W,createCross as Z,createKite as $,createSquare as J,createCircle as K}from"./sdfPrimitives.js";import{initFastSymbolUpdatesState as Q,updateFastSymbolUpdatesState as X,evaluateModelTransform as Y}from"../support/FastSymbolUpdates.js";import{DRAPED_Z as ee}from"../../terrain/OverlayRenderer.js";import{PowerOfTwoResizeMode as te}from"../../webgl-engine/lib/basicInterfaces.js";import re from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as ie}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as se}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ae}from"../../webgl-engine/materials/HUDMaterial.js";import{TextureWrapMode as oe}from"../../../webgl/enums.js";import ne from"../../../../symbols/CIMSymbol.js";const le=p(),ce=x(0,0,1),he=16,me=1.5,ue=128,de=.5,_e=[de/2,de/2,1-de/2,1-de/2],pe=[ue*de,ue*de];class fe extends U{constructor(e,t,r,i){super(e,t,r,i),this._cimLayers=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimRequiredFields=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}getCachedSize(){return{size:this._getIconSize()}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(s(r))this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbol,this.symbolLayer),i=d(r);i&&"application/json"===i.mediaType?await this._prepareResourcesCIM(t,JSON.parse(i.data),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?m(e.size):he);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._getGraphicHash(e);let r=""===t?null:this._cimSymbolTextures.get(t);if(!r){const i={scaleFactor:this._cimScaleFactorOrFunction},s=this._context.sharedResources.cimSymbolRasterizer.rasterizeCIMSymbol(this._cimLayers,e,"esriGeometryPoint",i,null,null);this._cimMaterialParametersInfo.anchorPos=this._getAnchorPos("relative",s.anchorPosition);const a={width:s.imageData.width,height:s.imageData.height,powerOfTwoResizeMode:te.PAD};r=new se(s.imageData,a),this._cimSymbolTextures.set(t,r),this._context.stage.add(r)}return r}_computeSize(e,t){const r=e.width/e.height;return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}_prepareMaterialParameters(){const e={anchorPos:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},t=this.symbol;if(ye(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:m(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.slicePlaneEnabled=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(ge(t)&&0===r)throw new Error("Nothing to render");this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize;const i=this._context.sharedResources.textures.fromData(t,(()=>be(t)));this._texture=i.texture,this._releaseTexture=i,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=_e,e.textureId=this._texture.id;const s=this._getIconSize();this._size=[s,s],this._symbolTextureRatio=1/de,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,s,a){if(!r("esri-canvas-svg-support")&&_(s)){throw new i("graphics3diconsymbollayer:unsupported-image-format","IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)")}this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),n=o*this._context.layerView.view.pixelRatio,l=await t(this._context.sharedResources.textures.fromUrl(s,n,{signal:a}));if(!1===l.ok){c(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${s})`)}this._releaseTexture=l.value;const h=l.value.texture,m=h.params;this._size=this._computeSize(m,o),e.textureId=h.id,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const i=new ne({data:t});if(!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;h(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference,!0))}const s=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):null;let a,o;if(this._cimLayers=await this._context.sharedResources.cimSymbolRasterizer.analyzeCIMSymbol(i,s,this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null,"esriGeometryPoint",{signal:r}),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(isNaN(e.scaleExpression)){const t=e.scaleExpression,r=await M(t,this._context.layer.spatialReference,s);o=(e,t,i)=>{const s=j(r,e,{$view:i},"esriGeometryPoint",t);return null!==s?s:1}}else a=Number(e.scaleExpression)}this._cimScaleFactorOrFunction=a||o||1;const n=this._context.renderer?await this._context.renderer.getRequiredFields(this._context.layer.fieldsIndex):[];h(r);const l=this._context.layer.fieldsIndex;this._cimRequiredFields=n.map((e=>l.get(e).name)),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||w}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(s(t.outline)&&null!=t.outline.size)return Math.max(m(t.outline.size),0);return e=ge(this._getPrimitive())?me:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=a(r,"outline","color");if(s(i)){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(ge(this._getPrimitive()))return I;const e=o(this._getPrimitive()),t=a(this.symbolLayer,"material","color");return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getAnchorPos(e,t){return"relative"===e?f((t.x||0)+.5,.5-(t.y||0)):e in V?V[e]:V.center}_createMaterialAndAddToStage(e,t){if(this._cimLayers?this._fastUpdates={enabled:!1}:this._fastUpdates=Q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates.enabled&&Object.assign(e,this._fastUpdates.materialParameters),this._cimLayers){let r=this._cimSymbolMaterials.get(e.textureId);return r||(r=new ae(e),this._cimSymbolMaterials.set(e.textureId,r),t.add(r)),r}return this._material=new ae(e),t.add(this._material),this._material}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,slicePlaneEnabled:!1,shaderPolygonOffset:0,isDraped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._material=null,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._releaseTexture=n(this._releaseTexture)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){for(let t=0;t<3;t++){const r=e.size[t];r&&"symbol-value"!==r&&"proportional"!==r&&(e.size[t]=m(r))}if("symbol-value"===e.size[0])return 1;if(isFinite(+e.size[0]))return+e.size[0]/t;if(isFinite(+e.size[2]))return+e.size[2]/t}return 1}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i;if(this._cimLayers){if(!this._cimLayers.length)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,...this._cimMaterialParametersInfo};i=this._createMaterialAndAddToStage(s,this._context.stage),r=[e.params.width,e.params.height]}else r=this._size,i=l(this._material);const s=B(t.geometry);if(o(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a);let c=1;if(!this._fastUpdates.enabled||!this._fastUpdates.visualVariables.size){const e=r[0]>r[1]?r[0]:r[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=[r[0]*c,r[1]*c],m=this.setGraphicElevationContext(t,new D);return this.ensureDrapedStatus("on-the-ground"===m.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,i,n,h,e.layer.uid):this._createAs3DShape(t,s,i,n,h,m,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();return this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})),!0}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=T(fe.elevationModeChangeTypes,r,i);if(s!==O.UPDATE)return s;const a=L(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>a))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!!this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return k.Recreate_Symbol;if(!X(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return k.Recreate_Symbol;s(this._material)&&this._material.setParameters(this._fastUpdates.materialParameters)}return k.Fast_Update}_defaultElevationInfoNoZ(){return xe}_createAs3DShape(e,t,r,i,s,a,o){const n=this.getFastUpdateAttrValues(e),l=n?e=>Y(this._fastUpdates.materialParameters,n,e):null,c=[re.createPointGeometry(ce,null,i,s,Se,null,n)],h=N(this._context,t,c,[r],a,this._context.layer.uid,o,l);if(null===h)return null;const m=new G(this,h.object,c,null,null,E,a);return m.alignedSampledElevation=h.sampledElevation,m.needsElevationUpdates=L(a.mode)||"absolute-height"===a.mode,m.getScreenSize=this._createScreenSizeGetter(s,l),m.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(m.getScreenSize(),1,e),q(m,t,this._context.elevationProvider),m}_createAsOverlay(e,t,r,i,a,o){r.renderPriority=this._renderPriority;const n=z();P(t,n,this._context.overlaySR),n[2]=ee;const l=this._context.clippingExtent;if(s(l)&&!R(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=c?e=>Y(this._fastUpdates.materialParameters,c,e):null,m=re.createPointGeometry(ce,n,i,a,null,null,c),u=new ie(m,r,o,e.uid);n[3]=0,S(u.boundingSphere,n),u.calculateShaderTransformation=h;const d=new F(this,[u],null);return d.getScreenSize=this._createScreenSizeGetter(a,h),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates.enabled){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=y())=>{const a=t(le);return e[0]=a[0]*i+r,e[1]=a[5]*s+r,e}}{const t=e[0]/this._symbolTextureRatio+r,i=e[1]/this._symbolTextureRatio+r;return(e=y())=>(e[0]=t,e[1]=i,e)}}_fastVisualVariableConvertOptions(){const e=this._size[0]>this._size[1]?this._size[0]:this._size[1],t=x(e,e,e),r=u(1),i=e*r;return{modelSize:t,symbolSize:x(i,i,i),unitInMeters:r,transformation:{anchor:g,scale:b,rotation:g}}}_getGraphicHash(e){let t="";for(const r of this._cimRequiredFields)t+=r+e.attributes[r];return t}_forEachMaterial(e){s(this._material)&&e(this._material),this._cimSymbolMaterials.forEach(e)}}function ye(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function ge(e){return!!s(e)&&("cross"===e||"x"===e)}function be(e){let t;const r=ue,i=r*de;switch(e){case"circle":t=K(r,i);break;case"square":t=J(r,i);break;case"kite":t=$(r,i);break;case"cross":t=Z(r,i);break;case"x":t=W(r,i);break;case"triangle":t=H(r,i)}return new se(t,{mipmap:!1,wrap:{s:oe.CLAMP_TO_EDGE,t:oe.CLAMP_TO_EDGE},width:ue,height:ue,components:4,noUnpackFlip:!0})}fe.PRIMITIVE_SIZE=pe,fe.elevationModeChangeTypes={definedChanged:O.UPDATE,staysOnTheGround:O.NONE,onTheGroundChanged:O.RECREATE};const xe={mode:"relative-to-ground",offset:0},Se=v(0,0,0,1);export{fe as Graphics3DIconSymbolLayer,fe as default};
|
|
5
|
+
import e from"../../../../Color.js";import"../../../../symbols.js";import{result as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/has.js";import i from"../../../../core/Error.js";import{isSome as s,get as a,isNone as o,releaseMaybe as n,unwrap as l}from"../../../../core/maybe.js";import{throwIfAbortError as c,throwIfAborted as h}from"../../../../core/promiseUtils.js";import{pt2px as m,px2pt as u}from"../../../../core/screenUtils.js";import{dataComponents as d,isSVG as _}from"../../../../core/urlUtils.js";import{c as p}from"../../../../chunks/mat4f64.js";import{f,a as y}from"../../../../chunks/vec2f64.js";import{Z as g,O as b,f as x}from"../../../../chunks/vec3f64.js";import{c as S}from"../../../../chunks/vec4.js";import{f as v,c as z}from"../../../../chunks/vec4f64.js";import{projectPointToVector as P}from"../../../../geometry/projection.js";import{containsPoint as R}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as M}from"../../../../support/arcadeOnDemand.js";import{defaultPrimitive as C}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{getIconHref as w}from"../../../../symbols/support/utils.js";import j from"../../../2d/arcade/callExpressionWithFeature.js";import{TRANSPARENT_UNIT as I}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{SymbolUpdateType as O,elevationModeChangeUpdateType as T,needsElevationUpdates2D as L}from"./elevationAlignmentUtils.js";import{ElevationContext as D}from"./ElevationContext.js";import U from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as F}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as G}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A,namedAnchorToHUDMaterialAnchorPos as V}from"./graphicUtils.js";import{ApplyRendererDiffResult as k}from"./interfaces.js";import{placePointOnGeometry as B,createStageObjectForHUD as N,extendPointGraphicElevationContext as q}from"./pointUtils.js";import{createTriangle as H,createX as W,createCross as Z,createKite as $,createSquare as J,createCircle as K}from"./sdfPrimitives.js";import{initFastSymbolUpdatesState as Q,updateFastSymbolUpdatesState as X,evaluateModelTransform as Y}from"../support/FastSymbolUpdates.js";import{DRAPED_Z as ee}from"../../terrain/OverlayRenderer.js";import{PowerOfTwoResizeMode as te}from"../../webgl-engine/lib/basicInterfaces.js";import re from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as ie}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as se}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ae}from"../../webgl-engine/materials/HUDMaterial.js";import{TextureWrapMode as oe}from"../../../webgl/enums.js";import ne from"../../../../symbols/CIMSymbol.js";const le=p(),ce=x(0,0,1),he=16,me=1.5,ue=128,de=.5,_e=[de/2,de/2,1-de/2,1-de/2],pe=[ue*de,ue*de];class fe extends G{constructor(e,t,r,i){super(e,t,r,i),this._cimLayers=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimRequiredFields=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}getCachedSize(){return{size:this._getIconSize()}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(s(r))this._prepareResourcesPrimitive(t,r);else{const r=w(this.symbol,this.symbolLayer),i=d(r);i&&"application/json"===i.mediaType?await this._prepareResourcesCIM(t,JSON.parse(i.data),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?m(e.size):he);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._getGraphicHash(e);let r=""===t?null:this._cimSymbolTextures.get(t);if(!r){const i={scaleFactor:this._cimScaleFactorOrFunction},s=this._context.sharedResources.cimSymbolRasterizer.rasterizeCIMSymbol(this._cimLayers,e,"esriGeometryPoint",i,null,null);this._cimMaterialParametersInfo.anchorPos=this._getAnchorPos("relative",s.anchorPosition);const a={width:s.imageData.width,height:s.imageData.height,powerOfTwoResizeMode:te.PAD};r=new se(s.imageData,a),this._cimSymbolTextures.set(t,r),this._context.stage.add(r)}return r}_computeSize(e,t){const r=e.width/e.height;return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}_prepareMaterialParameters(){const e={anchorPos:this._getAnchorPos(this.symbolLayer.anchor,this.symbolLayer.anchorPosition)},t=this.symbol;if(ye(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:m(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}return this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),e.occlusionTest=!0,e.slicePlaneEnabled=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(ge(t)&&0===r)throw new Error("Nothing to render");this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize;const i=this._context.sharedResources.textures.fromData(t,(()=>be(t)));this._texture=i.texture,this._releaseTexture=i,e.textureIsSignedDistanceField=!0,e.distanceFieldBoundingBox=_e,e.textureId=this._texture.id;const s=this._getIconSize();this._size=[s,s],this._symbolTextureRatio=1/de,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,s,a){if(!r("esri-canvas-svg-support")&&_(s)){throw new i("graphics3diconsymbollayer:unsupported-image-format","IconSymbol3DLayer failed to load (SVG symbols are not supported in IE11)")}this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),n=o*this._context.graphicsCoreOwner.view.pixelRatio,l=await t(this._context.sharedResources.textures.fromUrl(s,n,{signal:a}));if(!1===l.ok){c(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${s})`)}this._releaseTexture=l.value;const h=l.value.texture,m=h.params;this._size=this._computeSize(m,o),e.textureId=h.id,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const i=new ne({data:t});if(!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;h(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference,!0))}const s=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):null;let a,o;if(this._cimLayers=await this._context.sharedResources.cimSymbolRasterizer.analyzeCIMSymbol(i,s,this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null,"esriGeometryPoint",{signal:r}),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(isNaN(e.scaleExpression)){const t=e.scaleExpression,r=await M(t,this._context.layer.spatialReference,s);o=(e,t,i)=>{const s=j(r,e,{$view:i},"esriGeometryPoint",t);return null!==s?s:1}}else a=Number(e.scaleExpression)}this._cimScaleFactorOrFunction=a||o||1;const n=this._context.renderer?await this._context.renderer.getRequiredFields(this._context.layer.fieldsIndex):[];h(r);const l=this._context.layer.fieldsIndex;this._cimRequiredFields=n.map((e=>l.get(e).name)),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||C}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(s(t.outline)&&null!=t.outline.size)return Math.max(m(t.outline.size),0);return e=ge(this._getPrimitive())?me:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=a(r,"outline","color");if(s(i)){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(ge(this._getPrimitive()))return I;const e=o(this._getPrimitive()),t=a(this.symbolLayer,"material","color");return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getAnchorPos(e,t){return"relative"===e?f((t.x||0)+.5,.5-(t.y||0)):e in V?V[e]:V.center}_createMaterialAndAddToStage(e,t){if(this._cimLayers?this._fastUpdates={enabled:!1}:this._fastUpdates=Q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates.enabled&&Object.assign(e,this._fastUpdates.materialParameters),this._cimLayers){let r=this._cimSymbolMaterials.get(e.textureId);return r||(r=new ae(e),this._cimSymbolMaterials.set(e.textureId,r),t.add(r)),r}return this._material=new ae(e),t.add(this._material),this._material}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,slicePlaneEnabled:!1,shaderPolygonOffset:0,isDraped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._material=null,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._releaseTexture=n(this._releaseTexture)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){for(let t=0;t<3;t++){const r=e.size[t];r&&"symbol-value"!==r&&"proportional"!==r&&(e.size[t]=m(r))}if("symbol-value"===e.size[0])return 1;if(isFinite(+e.size[0]))return+e.size[0]/t;if(isFinite(+e.size[2]))return+e.size[2]/t}return 1}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i;if(this._cimLayers){if(!this._cimLayers.length)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,...this._cimMaterialParametersInfo};i=this._createMaterialAndAddToStage(s,this._context.stage),r=[e.params.width,e.params.height]}else r=this._size,i=l(this._material);const s=B(t.geometry);if(o(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a);let c=1;if(!this._fastUpdates.enabled||!this._fastUpdates.visualVariables.size){const e=r[0]>r[1]?r[0]:r[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=[r[0]*c,r[1]*c],m=this.setGraphicElevationContext(t,new D);return this.ensureDrapedStatus("on-the-ground"===m.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,i,n,h,e.layer.uid):this._createAs3DShape(t,s,i,n,h,m,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();return this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})),!0}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=T(fe.elevationModeChangeTypes,r,i);if(s!==O.UPDATE)return s;const a=L(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>a))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!!this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return k.Recreate_Symbol;if(!X(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return k.Recreate_Symbol;s(this._material)&&this._material.setParameters(this._fastUpdates.materialParameters)}return k.Fast_Update}_defaultElevationInfoNoZ(){return xe}_createAs3DShape(e,t,r,i,s,a,o){const n=this.getFastUpdateAttrValues(e),l=n?e=>Y(this._fastUpdates.materialParameters,n,e):null,c=[re.createPointGeometry(ce,null,i,s,Se,null,n)],h=N(this._context,t,c,[r],a,this._context.layer.uid,o,l);if(null===h)return null;const m=new F(this,h.object,c,null,null,E,a);return m.alignedSampledElevation=h.sampledElevation,m.needsElevationUpdates=L(a.mode)||"absolute-height"===a.mode,m.getScreenSize=this._createScreenSizeGetter(s,l),m.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(m.getScreenSize(),1,e),q(m,t,this._context.elevationProvider),m}_createAsOverlay(e,t,r,i,a,o){r.renderPriority=this._renderPriority;const n=z();P(t,n,this._context.overlaySR),n[2]=ee;const l=this._context.clippingExtent;if(s(l)&&!R(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=c?e=>Y(this._fastUpdates.materialParameters,c,e):null,m=re.createPointGeometry(ce,n,i,a,null,null,c),u=new ie(m,r,{layerUid:o,graphicUid:e.uid,calculateShaderTransformation:h});n[3]=0,S(u.boundingSphere,n);const d=new U(this,[u],null);return d.getScreenSize=this._createScreenSizeGetter(a,h),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates.enabled){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=y())=>{const a=t(le);return e[0]=a[0]*i+r,e[1]=a[5]*s+r,e}}{const t=e[0]/this._symbolTextureRatio+r,i=e[1]/this._symbolTextureRatio+r;return(e=y())=>(e[0]=t,e[1]=i,e)}}_fastVisualVariableConvertOptions(){const e=this._size[0]>this._size[1]?this._size[0]:this._size[1],t=x(e,e,e),r=u(1),i=e*r;return{modelSize:t,symbolSize:x(i,i,i),unitInMeters:r,transformation:{anchor:g,scale:b,rotation:g}}}_getGraphicHash(e){let t="";for(const r of this._cimRequiredFields)t+=r+e.attributes[r];return t}_forEachMaterial(e){s(this._material)&&e(this._material),this._cimSymbolMaterials.forEach(e)}}function ye(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function ge(e){return!!s(e)&&("cross"===e||"x"===e)}function be(e){let t;const r=ue,i=r*de;switch(e){case"circle":t=K(r,i);break;case"square":t=J(r,i);break;case"kite":t=$(r,i);break;case"cross":t=Z(r,i);break;case"x":t=W(r,i);break;case"triangle":t=H(r,i)}return new se(t,{mipmap:!1,wrap:{s:oe.CLAMP_TO_EDGE,t:oe.CLAMP_TO_EDGE},width:ue,height:ue,components:4,noUnpackFlip:!0})}fe.PRIMITIVE_SIZE=pe,fe.elevationModeChangeTypes={definedChanged:O.UPDATE,staysOnTheGround:O.NONE,onTheGroundChanged:O.RECREATE};const xe={mode:"relative-to-ground",offset:0},Se=v(0,0,0,1);export{fe as Graphics3DIconSymbolLayer,fe as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../geometry.js";import e from"../../../../core/Error.js";import{get as t,isNone as i,isSome as r}from"../../../../core/maybe.js";import{px2pt as a,pt2px as s}from"../../../../core/screenUtils.js";import{I as n}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec4.js";import{f as l}from"../../../../chunks/vec4f64.js";import{create as h,empty as p,expandWithBuffer as m,intersectsClippingArea as c,expandWithAABB as d}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as y}from"../../../../renderers/support/renderingInfoUtils.js";import{perVertexElevationAligner as _}from"./ElevationAligners.js";import{SymbolUpdateType as g,elevationModeChangeUpdateType as u,needsElevationUpdates2D as f}from"./elevationAlignmentUtils.js";import{ElevationContext as b}from"./ElevationContext.js";import E from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as v}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M,getAttributeValue as w}from"./Graphics3DSymbolLayer.js";import{ApplyRendererDiffResult as P}from"./interfaces.js";import{parseCapType as D,geometryToRenderInfo as L,RemoveDuplicateStartEnd as R,createGeometry as x,geometryToRenderInfoDraped as A}from"./lineUtils.js";import{initFastSymbolUpdatesState as S,updateFastSymbolUpdatesState as U}from"../support/FastSymbolUpdates.js";import C from"../../support/debugFlags.js";import{Object3D as j}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as z}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as G}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import V from"../../../../geometry/Extent.js";import F from"../../../../geometry/Polygon.js";const I=["polyline","polygon","extent"];class T extends M{constructor(e,t,i,r){super(e,t,i,r),this._uniformSize=1}async doLoad(){if(this._vvConvertOptions={modelSize:[1,1,1],symbolSize:[1,1,1],unitInMeters:1,transformation:{anchor:[0,0,0],scale:[1,1,1],rotation:[0,0,0]},supportedTypes:{size:!0,color:!0,opacity:!0,rotation:!1}},this._context.renderer&&this._context.renderer.visualVariables&&this._context.renderer.visualVariables.length>0?this._fastUpdates=S(this._context.renderer,this._vvConvertOptions):this._fastUpdates={enabled:!1},!this._drivenProperties.size){const t=null!=this.symbolLayer.size?this.symbolLayer.size:a(1);if(t<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values");this._uniformSize=t}}_getMaterialParameters(e){const i=t(this.symbolLayer,"material","color"),r=this._getCombinedOpacityAndColor(i);this._patternHidesLine&&(r[3]=0);const n=r[3],o={width:1,color:r,polygonOffset:!0,join:this.symbolLayer.join||"miter",cap:D(this.symbolLayer.cap||"butt"),transparent:n<1||this.needsDrivenTransparentPass,slicePlaneEnabled:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:G(this.symbolLayer.pattern),stippleScaleWithLineWidth:!0};if(this._drivenProperties.size)this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size&&(o.width=s(1));else{const e=null!=this.symbolLayer.size?this.symbolLayer.size:a(1);o.width=s(e)}return this._fastUpdates&&this._fastUpdates.visualVariables?{...o,...this._fastUpdates.materialParameters}:o}get lineMaterial(){return i(this._lineMaterial)&&(this._lineMaterial=new O(this._getMaterialParameters(!1)),this._context.stage.add(this._lineMaterial)),this._lineMaterial}get ringMaterial(){return i(this._ringMaterial)&&(this._ringMaterial=new O(this._getMaterialParameters(!0)),this._context.stage.add(this._ringMaterial)),this._ringMaterial}get wireframeLineMaterial(){return i(this._wireframeLineMaterial)&&(this._wireframeLineMaterial=new O({...this._getMaterialParameters(!1),wireframe:!0}),this._context.stage.add(this._wireframeLineMaterial)),this._wireframeLineMaterial}get wireframeRingMaterial(){return i(this._wireframeRingMaterial)&&(this._wireframeRingMaterial=new O({...this._getMaterialParameters(!0),wireframe:!0}),this._context.stage.add(this._wireframeRingMaterial)),this._wireframeRingMaterial}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._lineMaterial=null,this._ringMaterial=null,this._wireframeLineMaterial=null,this._wireframeRingMaterial=null}_getDrivenSize(e){return this._drivenProperties.size&&e.size?s(y(e.size)):1}_getSizeFeatureAttributeData(e){return this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size?w(this._fastUpdates.visualVariables.size.field,e):null}_getDrivenColor(e){const t=l(1,1,1,1);return this._drivenProperties.color&&e.color&&(t[0]=e.color[0],t[1]=e.color[1],t[2]=e.color[2],e.color.length>0&&(t[3]=e.color[3])),this._drivenProperties.opacity&&e.opacity&&(t[3]=e.opacity),t}_getColorFeatureAttributeData(e){return this._fastUpdates.enabled&&this._fastUpdates.visualVariables.color?w(this._fastUpdates.visualVariables.color.field,e):null}_getOpacityFeatureAttributeData(e){return this._fastUpdates.enabled&&this._fastUpdates.visualVariables.opacity?w(this._fastUpdates.visualVariables.opacity.field,e):null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,I,this.symbolLayer.type))return null;const i=this.setGraphicElevationContext(t,new b);return this.ensureDrapedStatus("on-the-ground"===i.mode),this.draped?this._createAsOverlay(e,this._context.layer.uid):this._createAs3DShape(e,i,t.uid)}applyRendererDiff(e,t){for(const i in e.diff){if("visualVariables"!==i)return P.Recreate_Symbol;if(!U(this._fastUpdates,t,this._vvConvertOptions))return P.Recreate_Symbol;this._forEachMaterial((e=>e.setParameters(this._fastUpdates.materialParameters)))}return P.Fast_Update}layerOpacityChanged(){return this._forEachMaterial((e=>this._updateMaterialLayerOpacity(e))),!0}_forEachMaterial(e){r(this._lineMaterial)&&e(this._lineMaterial),r(this._ringMaterial)&&e(this._ringMaterial),r(this._wireframeLineMaterial)&&e(this._wireframeLineMaterial),r(this._wireframeRingMaterial)&&e(this._wireframeRingMaterial)}_updateMaterialLayerOpacity(e){const i=e.parameters.color,r=t(this.symbolLayer,"material","color"),a=this._patternHidesLine?0:this._getCombinedOpacity(r),s=a<1||this.needsDrivenTransparentPass,n=[i[0],i[1],i[2],a];e.setParameters({color:n,transparent:s})}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,a=u(T.elevationModeChangeTypes,i,r);if(a!==g.UPDATE)return a;const s=f(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>s))}slicePlaneEnabledChanged(){const e={slicePlaneEnabled:this._context.slicePlaneEnabled};return this._forEachMaterial((t=>t.setParameters(e))),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_getGeometryAsPolygonOrPolyline(e){switch(e.type){case"extent":if(e instanceof V)return F.fromExtent(e);break;case"polygon":case"polyline":return e}return null}_createAs3DShape(e,t,i){const a=e.graphic,s=this._getGeometryAsPolygonOrPolyline(a.geometry),o="polygon"===s.type?s.rings:s.paths,l=new Array,d=new Array,y=new Array,g=h(),u=L(s,this._context.elevationProvider,this._context.renderCoordsHelper,t),b="polygon"===s.type?"rings":"paths";this._logGeometryCreationWarnings(u,o,b,"LineSymbol3DLayer");for(let h=0;h<u.lines.length;h++){const{position:t,mapPosition:i}=u.lines[h];r(this._context.clippingExtent)&&(p(g),m(g,i),!c(g,this._context.clippingExtent))||(l.push(this._createGeometry(e,t,i,s.type,W.ELEVATED)),d.push("polygon"===s.type?this.ringMaterial:this.lineMaterial),y.push(n),C.LINE_WIREFRAMES&&(l.push(this._createGeometry(e,t,i,s.type,W.ELEVATED)),d.push("polygon"===s.type?this.wireframeRingMaterial:this.wireframeLineMaterial),y.push(n)))}if(0===l.length)return null;const E=new j({geometries:l,materials:d,transformations:y,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:i}}),M=new v(this,E,l,null,null,_,t);return M.alignedSampledElevation=u.sampledElevation,M.needsElevationUpdates=f(t.mode),M}_createGeometry(e,t,i,r,a){const s="polygon"===r?R.REMOVE:R.KEEP,n=this._fastUpdates.enabled&&this._fastUpdates.visualVariables.color,o=this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size;return x({overlayInfo:a===W.DRAPED?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,removeDuplicateStartEnd:s,uniformSize:this._uniformSize,attributeData:{position:t,mapPosition:i,size:o?null:this._getDrivenSize(e.renderingInfo),color:n?null:this._getDrivenColor(e.renderingInfo),sizeFeature:this._getSizeFeatureAttributeData(e.graphic),colorFeature:this._getColorFeatureAttributeData(e.graphic),opacityFeature:this._getOpacityFeatureAttributeData(e.graphic)}})}_createAsOverlay(e,t){const i=e.graphic,r=this._getGeometryAsPolygonOrPolyline(i.geometry),a="polygon"===r.type?r.rings:r.paths,s="polygon"===r.type?this.ringMaterial:this.lineMaterial;s.renderPriority=this._renderPriority;const n=C.LINE_WIREFRAMES?"polygon"===r.type?this.wireframeRingMaterial:this.wireframeLineMaterial:null;n&&(n.renderPriority=this._renderPriority-.001);const o=new Array,l=h(),y=p(),_=A(r,this._context.overlaySR),g="polygon"===r.type?"rings":"paths";this._logGeometryCreationWarnings(_,a,g,"LineSymbol3DLayer");for(const h of _.lines){if(p(l),m(l,h.position),!c(l,this._context.clippingExtent))continue;d(y,l);const a=new z(this._createGeometry(e,h.position,null,r.type,W.DRAPED),s,t,i.uid);if(this._updateBoundingSphere(a,l),o.push(a),C.LINE_WIREFRAMES){const a=new z(this._createGeometry(e,h.position,null,r.type,W.DRAPED),n,t,i.uid);this._updateBoundingSphere(a,l),o.push(a)}}return new E(this,o,y)}_updateBoundingSphere(e,t){o(e.boundingSphere,.5*(t[0]+t[3]),.5*(t[1]+t[4]),0,.5*Math.sqrt((t[3]-t[0])*(t[3]-t[0])+(t[4]-t[1])*(t[4]-t[1])))}get _patternHidesLine(){const e=this.symbolLayer.pattern;return r(e)&&"style"===e.type&&"none"===e.style}}var W;T.elevationModeChangeTypes={definedChanged:g.RECREATE,staysOnTheGround:g.NONE,onTheGroundChanged:g.RECREATE},function(e){e[e.DRAPED=0]="DRAPED",e[e.ELEVATED=1]="ELEVATED"}(W||(W={}));export{T as Graphics3DLineSymbolLayer,T as default};
|
|
5
|
+
import"../../../../geometry.js";import e from"../../../../core/Error.js";import{get as t,isNone as i,isSome as r}from"../../../../core/maybe.js";import{px2pt as a,pt2px as s}from"../../../../core/screenUtils.js";import{I as n}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec4.js";import{f as l}from"../../../../chunks/vec4f64.js";import{create as h,empty as p,expandWithBuffer as c,intersectsClippingArea as m,expandWithAABB as d}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as y}from"../../../../renderers/support/renderingInfoUtils.js";import{perVertexElevationAligner as _}from"./ElevationAligners.js";import{SymbolUpdateType as g,elevationModeChangeUpdateType as u,needsElevationUpdates2D as f}from"./elevationAlignmentUtils.js";import{ElevationContext as b}from"./ElevationContext.js";import E from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as v}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M,getAttributeValue as w}from"./Graphics3DSymbolLayer.js";import{ApplyRendererDiffResult as P}from"./interfaces.js";import{parseCapType as D,geometryToRenderInfo as L,RemoveDuplicateStartEnd as U,createGeometry as R,geometryToRenderInfoDraped as x}from"./lineUtils.js";import{initFastSymbolUpdatesState as A,updateFastSymbolUpdatesState as S}from"../support/FastSymbolUpdates.js";import C from"../../support/debugFlags.js";import{Object3D as j}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as z}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as G}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as O}from"../../webgl-engine/materials/RibbonLineMaterial.js";import V from"../../../../geometry/Extent.js";import F from"../../../../geometry/Polygon.js";const I=["polyline","polygon","extent"];class T extends M{constructor(e,t,i,r){super(e,t,i,r),this._uniformSize=1}async doLoad(){if(this._vvConvertOptions={modelSize:[1,1,1],symbolSize:[1,1,1],unitInMeters:1,transformation:{anchor:[0,0,0],scale:[1,1,1],rotation:[0,0,0]},supportedTypes:{size:!0,color:!0,opacity:!0,rotation:!1}},this._context.renderer&&this._context.renderer.visualVariables&&this._context.renderer.visualVariables.length>0?this._fastUpdates=A(this._context.renderer,this._vvConvertOptions):this._fastUpdates={enabled:!1},!this._drivenProperties.size){const t=null!=this.symbolLayer.size?this.symbolLayer.size:a(1);if(t<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values");this._uniformSize=t}}_getMaterialParameters(e){const i=t(this.symbolLayer,"material","color"),r=this._getCombinedOpacityAndColor(i);this._patternHidesLine&&(r[3]=0);const n=r[3],o={width:1,color:r,polygonOffset:!0,join:this.symbolLayer.join||"miter",cap:D(this.symbolLayer.cap||"butt"),transparent:n<1||this.needsDrivenTransparentPass,slicePlaneEnabled:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:G(this.symbolLayer.pattern),stippleScaleWithLineWidth:!0};if(this._drivenProperties.size)this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size&&(o.width=s(1));else{const e=null!=this.symbolLayer.size?this.symbolLayer.size:a(1);o.width=s(e)}return this._fastUpdates&&this._fastUpdates.visualVariables?{...o,...this._fastUpdates.materialParameters}:o}get lineMaterial(){return i(this._lineMaterial)&&(this._lineMaterial=new O(this._getMaterialParameters(!1)),this._context.stage.add(this._lineMaterial)),this._lineMaterial}get ringMaterial(){return i(this._ringMaterial)&&(this._ringMaterial=new O(this._getMaterialParameters(!0)),this._context.stage.add(this._ringMaterial)),this._ringMaterial}get wireframeLineMaterial(){return i(this._wireframeLineMaterial)&&(this._wireframeLineMaterial=new O({...this._getMaterialParameters(!1),wireframe:!0}),this._context.stage.add(this._wireframeLineMaterial)),this._wireframeLineMaterial}get wireframeRingMaterial(){return i(this._wireframeRingMaterial)&&(this._wireframeRingMaterial=new O({...this._getMaterialParameters(!0),wireframe:!0}),this._context.stage.add(this._wireframeRingMaterial)),this._wireframeRingMaterial}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._lineMaterial=null,this._ringMaterial=null,this._wireframeLineMaterial=null,this._wireframeRingMaterial=null}_getDrivenSize(e){return this._drivenProperties.size&&e.size?s(y(e.size)):1}_getSizeFeatureAttributeData(e){return this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size?w(this._fastUpdates.visualVariables.size.field,e):null}_getDrivenColor(e){const t=l(1,1,1,1);return this._drivenProperties.color&&e.color&&(t[0]=e.color[0],t[1]=e.color[1],t[2]=e.color[2],e.color.length>0&&(t[3]=e.color[3])),this._drivenProperties.opacity&&e.opacity&&(t[3]=e.opacity),t}_getColorFeatureAttributeData(e){return this._fastUpdates.enabled&&this._fastUpdates.visualVariables.color?w(this._fastUpdates.visualVariables.color.field,e):null}_getOpacityFeatureAttributeData(e){return this._fastUpdates.enabled&&this._fastUpdates.visualVariables.opacity?w(this._fastUpdates.visualVariables.opacity.field,e):null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,I,this.symbolLayer.type))return null;const i=this.setGraphicElevationContext(t,new b);return this.ensureDrapedStatus("on-the-ground"===i.mode),this.draped?this._createAsOverlay(e,this._context.layer.uid):this._createAs3DShape(e,i,t.uid)}applyRendererDiff(e,t){for(const i in e.diff){if("visualVariables"!==i)return P.Recreate_Symbol;if(!S(this._fastUpdates,t,this._vvConvertOptions))return P.Recreate_Symbol;this._forEachMaterial((e=>e.setParameters(this._fastUpdates.materialParameters)))}return P.Fast_Update}layerOpacityChanged(){return this._forEachMaterial((e=>this._updateMaterialLayerOpacity(e))),!0}_forEachMaterial(e){r(this._lineMaterial)&&e(this._lineMaterial),r(this._ringMaterial)&&e(this._ringMaterial),r(this._wireframeLineMaterial)&&e(this._wireframeLineMaterial),r(this._wireframeRingMaterial)&&e(this._wireframeRingMaterial)}_updateMaterialLayerOpacity(e){const i=e.parameters.color,r=t(this.symbolLayer,"material","color"),a=this._patternHidesLine?0:this._getCombinedOpacity(r),s=a<1||this.needsDrivenTransparentPass,n=[i[0],i[1],i[2],a];e.setParameters({color:n,transparent:s})}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,a=u(T.elevationModeChangeTypes,i,r);if(a!==g.UPDATE)return a;const s=f(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>s))}slicePlaneEnabledChanged(){const e={slicePlaneEnabled:this._context.slicePlaneEnabled};return this._forEachMaterial((t=>t.setParameters(e))),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_getGeometryAsPolygonOrPolyline(e){switch(e.type){case"extent":if(e instanceof V)return F.fromExtent(e);break;case"polygon":case"polyline":return e}return null}_createAs3DShape(e,t,i){const a=e.graphic,s=this._getGeometryAsPolygonOrPolyline(a.geometry),o="polygon"===s.type?s.rings:s.paths,l=new Array,d=new Array,y=new Array,g=h(),u=L(s,this._context.elevationProvider,this._context.renderCoordsHelper,t),b="polygon"===s.type?"rings":"paths";this._logGeometryCreationWarnings(u,o,b,"LineSymbol3DLayer");for(let h=0;h<u.lines.length;h++){const{position:t,mapPosition:i}=u.lines[h];r(this._context.clippingExtent)&&(p(g),c(g,i),!m(g,this._context.clippingExtent))||(l.push(this._createGeometry(e,t,i,s.type,W.ELEVATED)),d.push("polygon"===s.type?this.ringMaterial:this.lineMaterial),y.push(n),C.LINE_WIREFRAMES&&(l.push(this._createGeometry(e,t,i,s.type,W.ELEVATED)),d.push("polygon"===s.type?this.wireframeRingMaterial:this.wireframeLineMaterial),y.push(n)))}if(0===l.length)return null;const E=new j({geometries:l,materials:d,transformations:y,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:i}}),M=new v(this,E,l,null,null,_,t);return M.alignedSampledElevation=u.sampledElevation,M.needsElevationUpdates=f(t.mode),M}_createGeometry(e,t,i,r,a){const s="polygon"===r?U.REMOVE:U.KEEP,n=this._fastUpdates.enabled&&this._fastUpdates.visualVariables.color,o=this._fastUpdates.enabled&&this._fastUpdates.visualVariables.size;return R({overlayInfo:a===W.DRAPED?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,removeDuplicateStartEnd:s,uniformSize:this._uniformSize,attributeData:{position:t,mapPosition:i,size:o?null:this._getDrivenSize(e.renderingInfo),color:n?null:this._getDrivenColor(e.renderingInfo),sizeFeature:this._getSizeFeatureAttributeData(e.graphic),colorFeature:this._getColorFeatureAttributeData(e.graphic),opacityFeature:this._getOpacityFeatureAttributeData(e.graphic)}})}_createAsOverlay(e,t){const i=e.graphic,r=this._getGeometryAsPolygonOrPolyline(i.geometry),a="polygon"===r.type?r.rings:r.paths,s="polygon"===r.type?this.ringMaterial:this.lineMaterial;s.renderPriority=this._renderPriority;const n=C.LINE_WIREFRAMES?"polygon"===r.type?this.wireframeRingMaterial:this.wireframeLineMaterial:null;n&&(n.renderPriority=this._renderPriority-.001);const o=new Array,l=h(),y=p(),_=x(r,this._context.overlaySR),g="polygon"===r.type?"rings":"paths";this._logGeometryCreationWarnings(_,a,g,"LineSymbol3DLayer");for(const h of _.lines){if(p(l),c(l,h.position),!m(l,this._context.clippingExtent))continue;d(y,l);const a=new z(this._createGeometry(e,h.position,null,r.type,W.DRAPED),s,{layerUid:t,graphicUid:i.uid});if(this._updateBoundingSphere(a,l),o.push(a),C.LINE_WIREFRAMES){const a=new z(this._createGeometry(e,h.position,null,r.type,W.DRAPED),n,{layerUid:t,graphicUid:i.uid});this._updateBoundingSphere(a,l),o.push(a)}}return new E(this,o,y)}_updateBoundingSphere(e,t){o(e.boundingSphere,.5*(t[0]+t[3]),.5*(t[1]+t[4]),0,.5*Math.sqrt((t[3]-t[0])*(t[3]-t[0])+(t[4]-t[1])*(t[4]-t[1])))}get _patternHidesLine(){const e=this.symbolLayer.pattern;return r(e)&&"style"===e.type&&"none"===e.style}}var W;T.elevationModeChangeTypes={definedChanged:g.RECREATE,staysOnTheGround:g.NONE,onTheGroundChanged:g.RECREATE},function(e){e[e.DRAPED=0]="DRAPED",e[e.ELEVATED=1]="ELEVATED"}(W||(W={}));export{T as Graphics3DLineSymbolLayer,T as default};
|