@arcgis/core 5.1.0-next.38 → 5.1.0-next.39
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/applications/WebEditor/sketchUtils.js +1 -1
- package/arcade/batchExec.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{11058e660139c427c3e7.js → 01777e91cd4e0bf04fd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{666db81085bc97831b18.js → 02a0a58ca5916db1db19.js} +1 -1
- package/assets/esri/core/workers/chunks/{3d18b8c1c759c7240721.js → 03c8453ae72a4e190252.js} +1 -1
- package/assets/esri/core/workers/chunks/{828998d33a48be161782.js → 04981ae9d7728208ffce.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2cf19a28aa5c32a99e3.js → 04b04548d4eb0941a01e.js} +1 -1
- package/assets/esri/core/workers/chunks/{64870f555fefa85a5c59.js → 06003996a378c45bc605.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce063df750018024c9ed.js → 0601c316da0256a60538.js} +1 -1
- package/assets/esri/core/workers/chunks/{93bf908f596140ea4c61.js → 0d321b3496adc640d96a.js} +1 -1
- package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +1 -0
- package/assets/esri/core/workers/chunks/{1ff40e6057916e8482b3.js → 0eb57ef4a1b387c951d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0554f310066937098099.js → 10941b50f5933d168df6.js} +1 -1
- package/assets/esri/core/workers/chunks/{22aeab5c363645c04806.js → 13a009229c96ecb7b04f.js} +1 -1
- package/assets/esri/core/workers/chunks/13d55e3c9aea04116eaa.js +1 -0
- package/assets/esri/core/workers/chunks/{3b86e8eb553122d3b68d.js → 167e4ff7cbc88b42db71.js} +1 -1
- package/assets/esri/core/workers/chunks/16a767cc5f3e2e0e49c2.js +1 -0
- package/assets/esri/core/workers/chunks/19cbaeda71486df01d0f.js +1 -0
- package/assets/esri/core/workers/chunks/{96132a37bc08c7fa8f2e.js → 1a6a77902dd8c84e059a.js} +1 -1
- package/assets/esri/core/workers/chunks/{00947268b6de12329146.js → 1f5d9e5d4ddc623fd511.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2d045217a42ecc36308.js → 236b4ab3da0bc8f788a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a66a2b4aaab0774c34f.js → 23af269e88f9ac101ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{da60a6df2f7858a2910e.js → 244dd7a948ca8a7dc6ef.js} +1 -1
- package/assets/esri/core/workers/chunks/25946077568ab14c7bfc.js +1 -0
- package/assets/esri/core/workers/chunks/{bb7e0334f438daa665da.js → 26cafd20c8d03c274389.js} +1 -1
- package/assets/esri/core/workers/chunks/284ce99af7bdd73dc7e9.js +1 -0
- package/assets/esri/core/workers/chunks/{1d0153c7d65bd9ea7d39.js → 2b386374330d96387aec.js} +1 -1
- package/assets/esri/core/workers/chunks/2c12b1488819c038c6b1.js +1 -0
- package/assets/esri/core/workers/chunks/2d2c10c31cc1460dd96a.js +1 -0
- package/assets/esri/core/workers/chunks/{8bd24534ed185afcb124.js → 30cdb2d1d9f018f1642d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5691c1624190abeaebea.js → 34484afe767d60f85982.js} +1 -1
- package/assets/esri/core/workers/chunks/35d115bde474c380c791.js +1 -0
- package/assets/esri/core/workers/chunks/{6a0c371ec3acd7529fe6.js → 36a0e48113ab59a4f21d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc3939983cf6f78f7243.js → 38c28189f273636e4017.js} +1 -1
- package/assets/esri/core/workers/chunks/{e00000468fb8ec2b3d43.js → 392941013107bbd96503.js} +1 -1
- package/assets/esri/core/workers/chunks/{43f60f41d353d3fc7c4b.js → 399fcea09dfb1ad6deaa.js} +1 -1
- package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +1 -0
- package/assets/esri/core/workers/chunks/{a52a8254577840a23aba.js → 3d4bb59ab2f644f4d675.js} +1 -1
- package/assets/esri/core/workers/chunks/3e2953ea62817e75d840.js +1 -0
- package/assets/esri/core/workers/chunks/{582d45a41e29005f6c63.js → 4005d37d03c834da7629.js} +1 -1
- package/assets/esri/core/workers/chunks/{285f3b07de852bfc1604.js → 427183ea93e759943a78.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ceba469398ef55de8ea.js → 42b556d56013350c9d80.js} +1 -1
- package/assets/esri/core/workers/chunks/{446bc8461403ed1ac7b2.js → 4577df99c92c7ec0f9de.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a2dd3d85d31dce29d94.js → 49d6249e98f023344e0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f3f7f785241edacdb8b.js → 4b5737021a149aa786af.js} +1 -1
- package/assets/esri/core/workers/chunks/{210ef3f1cc6ef8a831bf.js → 4b79ebfb3328f9483147.js} +1 -1
- package/assets/esri/core/workers/chunks/{305b2a8dc6438c5fd4aa.js → 4d378d4e021a33b0047e.js} +1 -1
- package/assets/esri/core/workers/chunks/{114aecdbd2bd92b24de2.js → 52175ff9e8c2c136f90a.js} +1 -1
- package/assets/esri/core/workers/chunks/{dfee98e7d1b206f33ba9.js → 54db91c0a3bd1946e026.js} +1 -1
- package/assets/esri/core/workers/chunks/{c79e8003812b789724af.js → 5b2fe488a461bc433f59.js} +1 -1
- package/assets/esri/core/workers/chunks/{1fa2bf0d6740092ec619.js → 5b70295da76d9227f64b.js} +1 -1
- package/assets/esri/core/workers/chunks/5e59ff96aecdf2adcb3b.js +1 -0
- package/assets/esri/core/workers/chunks/{cb482e20e10ab0f63617.js → 5e9595eb6ae6a40e7265.js} +1 -1
- package/assets/esri/core/workers/chunks/{de9fea9b6f2269ee0703.js → 604f9e7228a66b6cf2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0d836502321e7a80e61.js → 60d0f8a949b130baff81.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2303b2771fcd75f298b.js → 6258ae3d991ce652d97f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0d6292aaa3f8a796de3.js → 65865c25487d23dd2e31.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4b97ca16d79809ed6f2.js → 65ea5028eb12457a3aeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf100c80b75ba74b479c.js → 66a4d764937918a2779f.js} +1 -1
- package/assets/esri/core/workers/chunks/6ee956d5a92ca905f53f.js +1 -0
- package/assets/esri/core/workers/chunks/{14e05d37e10ebba8cf10.js → 6f58ec80abebb7bfbbb0.js} +1 -1
- package/assets/esri/core/workers/chunks/{5698098c3691b3b49283.js → 73d7337ac9efdbad14a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{568d32ceee1409809e5a.js → 749c368f5cc2366716f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{586bc903e2c285649bf2.js → 77769663cd712822d33e.js} +1 -1
- package/assets/esri/core/workers/chunks/{620965d2e1a9ccf81d43.js → 77f6659e400064d38130.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8f624f8c975728d75e2.js → 78472f69053061a18967.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e7d3f3479fcb366cc6f.js → 80a1ccabd4257cc61e0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d156e14fc34d0600fd5.js → 81b830f0d620587966ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cd548ea00b641d8e65d.js → 8333561a938bcdf6c2e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{283ce37403c5e7a76e95.js → 8677865189081e0b83bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{087403b53f15eb4d375c.js → 86f70bd786d6d57fde69.js} +1 -1
- package/assets/esri/core/workers/chunks/88c6cc90606409b5c884.js +1 -0
- package/assets/esri/core/workers/chunks/{8e10e4c25869af9da5ba.js → 8967a02f394a63f11030.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2fa8bd3f4cd3cf6b436.js → 89dbea6f436d45a3b185.js} +1 -1
- package/assets/esri/core/workers/chunks/{8eed5b6cac937099102c.js → 8d5bc17557a31ed79ed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d6165796af522858e56.js → 8e18ac7b22d8dca1e1e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae72c530d52a6d4461be.js → 8e3cb1c584951c3d1eb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{67f95c57c1679935570b.js → 92f6d637f4786ba0d3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/93846f8b77fc802069a7.js +1 -0
- package/assets/esri/core/workers/chunks/{34f2e9d7466abc0919e7.js → 9639b1dd27ccc17ee21e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ebd836b98d14c7d3ecf.js → 969f58a2de4ebe63619d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a3e5053e95db36f26dc.js → 9a95c28d4a3b3b4b2c50.js} +1 -1
- package/assets/esri/core/workers/chunks/{c3e4f8664988e50bda55.js → 9b365a6242b0287f8727.js} +1 -1
- package/assets/esri/core/workers/chunks/{e021b2f0e15aee5bf3ad.js → 9b80569819cd1c72a9ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{3dcb4ee8b862689a141b.js → 9bd68abc6b5b07b2add3.js} +1 -1
- package/assets/esri/core/workers/chunks/{952ff668d202e80b43b0.js → a029db48079af4b5cccd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cc1b44c5a325a840307.js → a1f36240a31057f998da.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff8de370abf661768380.js → a84d67c1a1008bca2075.js} +1 -1
- package/assets/esri/core/workers/chunks/{c6112dcd6b36e256d7b5.js → a90883ff02c0cc6450c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d196cf72cd8bef8d91d.js → abcb39ad1e2d54710766.js} +1 -1
- package/assets/esri/core/workers/chunks/{80f0810527743833b4b7.js → af804beb43d4d10c54d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c2e5b116bac21e7d577.js → b056b4c79bcd542dd1d2.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b9de873f87f0feeb20b.js → b1ac09d8fa340d194aa2.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f0e850ebea0ffd2708f.js → b1c5f69bd1400e66c635.js} +1 -1
- package/assets/esri/core/workers/chunks/{414a802b6365688d31cb.js → b6e63d8ce3c9ac9762f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7229019876c0e4ff545.js → b86cb84c03b76e824213.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b83e020ff08c51ac1.js +1 -0
- package/assets/esri/core/workers/chunks/{623bfacf4b9c9a5387cc.js → c2f3fc1b34a6782b431f.js} +1 -1
- package/assets/esri/core/workers/chunks/c4f64195e44986644993.js +1 -0
- package/assets/esri/core/workers/chunks/{b7a3a7f7fb747f9689d7.js → c7799ba861ac5af08e6a.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c6e96b1c2b0418a4f1c.js → ca1b0cb14ea9ae1bf2a3.js} +1 -1
- package/assets/esri/core/workers/chunks/cce2d2c60d136e1bac75.js +1 -0
- package/assets/esri/core/workers/chunks/{b98366d8a5bc6cc2b219.js → cda2e445eb2ac269abdf.js} +1 -1
- package/assets/esri/core/workers/chunks/{448620052233e51b496c.js → cf74d1605ad2f21699e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4301ea9a6cb3bcef906.js → d0983cc19d19c19c3478.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee582bbe7365b678ec54.js → d50e6681ecb9612e4528.js} +1 -1
- package/assets/esri/core/workers/chunks/{68abe4e70ea48e978642.js → d51c41c1944df0cbab3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2f497339493926d4c9e.js → d53b31c9056f82831bc0.js} +1 -1
- package/assets/esri/core/workers/chunks/{ffc87a038712a4c9d2cb.js → d6eddb94f5f2e9759bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{6cdda5aa35fa12ea9345.js → d7439d357f68160844cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c853fd89f0e9f102c6e.js → dba479176db0a23c8034.js} +1 -1
- package/assets/esri/core/workers/chunks/{6792e981a3c73063a3e6.js → dd26e3a29161ea411e41.js} +1 -1
- package/assets/esri/core/workers/chunks/{0337138d3702a1a52ce0.js → de79645e559a2d1ffa67.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ddfd406b9044390e9f7.js → e47dd011c06ab42c18e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0da3a44f33f4d8e682b.js → e68d7aec0f095b6d743d.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca64867bc322a354be8e.js → e907acaec4c62adac2f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9813f25192ea27084754.js → ea356a5b90ea44b5cbe1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d30253b4990a76bfd72b.js → eab74d830c2eaa9d133b.js} +1 -1
- package/assets/esri/core/workers/chunks/{eef102e13fd8878eeb96.js → eb36417edc11fa80e312.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5dbda08d7fd4bed1c62.js → eca45cd479f7fd28ca6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{56f64df68bb11c0c74d2.js → f209a7076d67cbf4d205.js} +1 -1
- package/assets/esri/core/workers/chunks/{b81780e5e7cd9a1a010a.js → f36a234ef35faf8ca04d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ae9e9a65cb08b12caeb.js → f45e4eb89db31d7a7640.js} +3 -3
- package/assets/esri/core/workers/chunks/{45d57e561fc993bc75ed.js → f9cde38cb56c547e87e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{0efe90bd43ab29dab8ae.js → f9da5c81535eaffc8b9c.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8ae8d1b456ace0b383b.js → fce8d4ff920baf8856e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fa5a2fb69f84e9092ba.js → fd629a3ab558adf52617.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bfc6f8c2d13ca4d2082.js → fdf4c1f202cfddf0f226.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b12865ac53d984d8149.js → fe7dec83e40014c55a6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{5f3b25b30acd7a07f5c0.js → ff31936236dd9b1acb24.js} +1 -1
- package/assets/esri/core/workers/chunks/{122ff8d0d428f31fc5d1.js → ff8ec6369c8a1bee9bb4.js} +1 -1
- package/chunks/GaussianSplatComposition.glsl.js +21 -3
- package/chunks/OITDim.glsl.js +3 -4
- package/config.js +1 -1
- package/core/Promise.js +1 -1
- package/core/QueueProcessor.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/scheduling.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/intl/messages.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationQuery.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +2 -0
- package/views/PopupView.js +1 -1
- package/views/ViewAnimation.js +1 -1
- package/views/analysis/ExclusiveOperationManager.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/views/support/LayerLayerViewInfo.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/ScheduledQueueProcessor.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/assets/esri/core/workers/chunks/1bf3e787eafec318bd2b.js +0 -1
- package/assets/esri/core/workers/chunks/1ee3d44e6d7add0b24cb.js +0 -1
- package/assets/esri/core/workers/chunks/34cdcee6d0ea595d7aed.js +0 -1
- package/assets/esri/core/workers/chunks/36f91b5c4345a179b8b1.js +0 -1
- package/assets/esri/core/workers/chunks/4d7f7b1e7663cf6088d1.js +0 -1
- package/assets/esri/core/workers/chunks/6997b4d5bcc9c4755375.js +0 -1
- package/assets/esri/core/workers/chunks/75664587bb80f4e187e1.js +0 -1
- package/assets/esri/core/workers/chunks/7975abb2162a82c88edb.js +0 -1
- package/assets/esri/core/workers/chunks/889835e61ea97f090082.js +0 -1
- package/assets/esri/core/workers/chunks/917474f9dd2039b82e9d.js +0 -1
- package/assets/esri/core/workers/chunks/bf668010f36179792592.js +0 -1
- package/assets/esri/core/workers/chunks/c7f27a84268a9b0d8cdb.js +0 -1
- package/assets/esri/core/workers/chunks/cd73d37ea0e66db46e45.js +0 -1
- package/assets/esri/core/workers/chunks/d456f06d0c6a5cc02be7.js +0 -1
- package/assets/esri/core/workers/chunks/dcef87f7d06c45cd928b.js +0 -1
- package/assets/esri/core/workers/chunks/e0344b45af88081fa186.js +0 -1
- package/assets/esri/core/workers/chunks/e16f5f089259988e8993.js +0 -1
- package/assets/esri/core/workers/chunks/fe21b2d31fbf83224e6b.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{lerp as e}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{transpose as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as l,scale as u,round as h,copy as d,set as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as _,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as f,transformMat4 as g,scale as m}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as O}from"../../../../geometry/ellipsoidUtils.js";import{create as w,empty as Q,copy as D,offset as G,width as I,height as j,expand as k}from"../../../../geometry/support/aaBoundingRect.js";import{e as P,d as S,c as C}from"../../../../chunks/boundedPlane.js";import{create as T}from"../../../../geometry/support/ray.js";import{Sphere as x,sphereCSO as M}from"../../../../geometry/support/sphere.js";import{RenderNodeOutput as V}from"../../webgl.js";import{DeconflictAABR as U}from"./DeconflictAABR.js";import{prepare as R,drawPoly as A}from"./deconflictorDebug.js";import{isSymbolLayerWithTransparencyMode as E}from"./transparencyUtils.js";import N from"../../webgl/RenderCamera.js";import{GPUPointOcclusionQuery as q}from"../../webgl-engine/lib/GPUPointOcclusionQuery.js";import{SeparateScreenSizePerspectiveEvaluators as H}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as W}from"../../webgl-engine/materials/HUDMaterial.js";import{Yield as z}from"../../../support/Yield.js";const F=y(),B=y(),L=v(),Y=v(),J=y(),K=n(),X=new x,Z=T(),$=y(),ii=w();class ti{constructor(i){this.id=i,this.aabr=w(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.culled=!1,this.visible=!1,this.priority=0}}function ei(i,t){const e=0!==i.distanceToOccluder&&i.distance>i.distanceToOccluder,s=0!==t.distanceToOccluder&&t.distance>t.distanceToOccluder;return e!==s?+e-+s:i.priority!==t.priority?t.priority-i.priority:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?+t.visible-+i.visible:i.id-t.id}class si{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this._info=null,this._labelInfo=null}ensureInfo(i){let t=this.getInfo(i);return t||(t=new ti(this.graphics3DGraphic.graphic.uid),this._setInfo(i,t)),t}getInfo(i){return 16===i?this._labelInfo:this._info}removeInfo(i){this._setInfo(i,null)}_setInfo(i,t){16===i?this._labelInfo=t:this._info=t}}class ri{constructor(){this.camera=new N,this.slicePlane=S(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.equals(i.camera)||this.camera.copyFrom(i.camera),C(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let oi=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._viewState=new ri,this._state=0,this._checkOcclusion=new Map,this._active=new Map,this._checkOcclusionIterator=null,this._activeIterator=null,this._occlusionQueryUids=new Array,this._updatingHandles=new b,this._deconflictor=new U((i,t)=>{i.visible=t,this._setGraphicVisibility(this._active.get(i.id),t)},(i,t)=>i.id!==t.id,ei),this._baseOccludedVisibility=10,this._altitudeFactor=2,this._minAltitudeDifference=100}initialize(){this._updatingHandles.add(()=>(this.view?.map?.ground?.opacity??0)>0,()=>this.setDirty()),this._updatingHandles.add(()=>this.view.ready,()=>{this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this.setDirty()})}destroy(){this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this._updatingHandles.destroy(),this._deconflictor.destroy(),this._checkOcclusion.clear(),this._active.clear()}setDirty(){!this._dirty&&(this._active.size>0||this._checkOcclusion.size>0)&&(this._dirty=!0,this.notifyChange("_readyToRun"))}setPriority(i,t){const e=this._active.get(i.graphic.uid)?.getInfo(this.visibilityGroup);e&&(e.priority=t)}get _readyToRun(){return 0!==this._state||this._dirty}get updating(){return this._readyToRun||this._updatingHandles.updating}get updatingProgress(){if(!this.updating)return 1;const i=this._state/5;return this._dirty?.5*i:i}get readyToRun(){return this.view.ready&&null!=this.view.state&&this._readyToRun}get usedMemory(){return this._occlusionQuery?.usedMemory??0+4*(this._occlusionQueryUids?.length??0)}runTask(i){switch(this._state){case 0:this._startUpdate(),i.madeProgress();case 1:if(this._state=1,!this._processCheckOcclusion(i))return;case 2:if(this._state=2,!(this._occlusionQuery?.done??1)||!(this._opaqueOcclusionQuery?.done??1))return z;this._readOcclusionQueryResult(),i.madeProgress();case 3:if(this._state=3,!this._collectActiveGraphics(i))return;case 4:if(this._state=4,this._deconflictor.run(i),!this._deconflictor.done)return;default:this._state=0,this.notifyChange("_readyToRun")}}setGraphicsActive(i,t){t?i.forEach(i=>this.addToActiveGraphics(i)):i.forEach(i=>this.removeFromActiveGraphics(i))}isSupportedLayer(i){if(null==i||!("hiddenIfDeconflicted"in i)||!i.hiddenIfDeconflicted)return!1;const t=i.stageObject;if(1!==(t?.geometries.length??0))return!1;const e=t?.geometries[0],s=e?.material;return s instanceof W}_startUpdate(){R(this.view),this._dirty=!1,this._viewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._viewState.camera;if(this._deconflictor.reset(i,t),this._resetIterators(),this._occlusionQueryUids.length=0,!this._checkOcclusion.size)return this._occlusionQuery=s(this._occlusionQuery),void(this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery))}addToActiveGraphics(i){i.ensureInfo(this.visibilityGroup),this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){ci(i,this.visibilityGroup),i.removeInfo(this.visibilityGroup),this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}addToCheckOcclusion(i){this._checkOcclusion.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromCheckOcclusion(i){this._checkOcclusion.delete(i.graphics3DGraphic.graphic.uid)}_processCheckOcclusion(i){if(0===this._checkOcclusion.size)return!0;const t=this._ensureCheckOcclusionIterator(),e=this._viewState.camera,r=c(K,e.viewInverseTransposeMatrix),o=this.view.map.ground.opacity>0,n="global"===this.view.viewingMode&&o&&e.relativeElevation>0?X:null;let a=0;null!=n&&(l(n.center,_,e.viewMatrix),n.radius=O(this.view.spatialReference).radius,a=M.distanceToSilhouette(n,_));const u=w();for(;;){if(i.done)return!1;i.madeProgress();const s=t.next();if(!0===s.done)break;const o=s.value,c=o.graphics3DGraphic;if(c.destroyed)continue;if(!c.isVisible(1,8))continue;const h=ui(c,this.visibilityGroup);let d=null,p=!0,_=!1;for(const i of h){if(!this.isSupportedLayer(i))continue;d=hi,this._projectHudLayer(i,e,d),Q(u);const t=i.stageObject.geometries[0].material;if(this._expandBoundingRect(u,e,i,t,d),d.isOutsideScreen){p=!1;break}if(this._isCulledBySlice(o,d.positionWorld)){p=!1;break}if(null!=n&&li(d,n,a)){p=!1;break}d.altitude=this.view.renderCoordsHelper.getAltitude(d.positionWorld);const s=o.ensureInfo(this.visibilityGroup);if(s.altitude=d.altitude,s.distance=d.distance,s.distanceToOccluder=d.distanceToOccluder,s.culled=!1,D(s.aabr,u),!i.occlusionCheck)break;l(B,d.positionView,r);const h=this._ensureOcclusionQuery(),y=this._ensureOpaqueOcclusionQuery();0===this._occlusionQueryUids.length&&(this._initOcclusionQuery(h),this._initOcclusionQuery(y));const f=h.addPosition(B),g=y.addPosition(B);if(f===this._occlusionQueryUids.length&&g===f){const t=i.adaptiveOcclusion;this._occlusionQueryUids.push(t?-c.graphic.uid:c.graphic.uid),_=!0}break}const y=this._active.has(c.graphic.uid);if(y||_){if(y&&(!p||!d)){const i=o.ensureInfo(this.visibilityGroup);i.visible=!d,i.culled=!0}}else this._setGraphicVisibility(o,p)}return this._checkOcclusionIterator=null,this._occlusionQueryUids.length||(this._occlusionQuery=s(this._occlusionQuery),this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery)),this._occlusionQuery?.start(),this._opaqueOcclusionQuery?.start(),!0}_readOcclusionQueryResult(){if(!this._occlusionQuery||!this._occlusionQueryUids.length)return;const i=this._viewState.camera,t=this.view.renderCoordsHelper.getAltitude(i.eye);for(let e=0;e<this._occlusionQueryUids.length;e++){const i=this._occlusionQueryUids[e],s=Math.abs(i),r=i<0,o=this._checkOcclusion.get(s);if(!o)continue;const c=this._occlusionQuery.getOcclusion(e)??-1,n=this._opaqueOcclusionQuery?.getOcclusion(e)??-1,a=o.getInfo(this.visibilityGroup);a&&(a.distanceToOccluder=c>0?a.distance-c:0);const l=0===n||n>0&&this._occludedVisibility(a?a.distance-n:0,a?.distance??n,a?.altitude??0,t,r),u=0===c||c>0&&this._occludedVisibility(a?.distanceToOccluder??0,a?.distance??c,a?.altitude??0,t,r),h=l||u;h&&this._setTransparentMode(o,l&&!u),this._active.has(s)?a&&(a.culled=!h,a.visible=h):this._setGraphicVisibility(o,h)}this._occlusionQueryUids.length=0}_collectActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),e=16===this.visibilityGroup;for(;!i.done;){i.madeProgress();const s=t.next();if(!0===s.done)return this._activeIterator=null,!0;const r=s.value,o=r.getInfo(this.visibilityGroup);if(!o)continue;const c=!e||r.graphics3DGraphic.isVisible();!c||o.culled?(A(o.aabr,!1,!0),this._setGraphicVisibility(r,c&&o.visible)):this._deconflictor.add(o)}return!1}_occludedVisibility(i,t,e,s,r=!0){const o=Math.max(this._minAltitudeDifference,Math.abs(e-s))-this._minAltitudeDifference,c=r?this._baseOccludedVisibility+this._altitudeFactor*o:0;return 0===i||t-i<=c}_resetIterators(){this._checkOcclusionIterator=null,this._activeIterator=null}_ensureCheckOcclusionIterator(){return this._checkOcclusionIterator??=this._checkOcclusion.values(),this._checkOcclusionIterator}_ensureActiveGraphicsIterator(){return this._activeIterator??=this._active.values(),this._activeIterator}_initOcclusionQuery(i){if(!i)return;const{camera:t}=this._viewState,e=2,s=Math.max(e,e+Math.round(Math.log2(Math.abs(t.relativeElevation))));u(F,this._viewState.camera.eye,2**-s),u(F,h(F,F),2**s),i.init(this._checkOcclusion.size,F)}_ensureOcclusionQuery(){return this._occlusionQuery??=new q({view:this.view}),this._occlusionQuery}_ensureOpaqueOcclusionQuery(){return this._opaqueOcclusionQuery??=new q({view:this.view,category:V.OPAQUE}),this._opaqueOcclusionQuery}_getNumVisible(i){return[...this._checkOcclusion.values()].reduce((t,e)=>t+(e.getInfo(i)?.visible?1:0),0)}_projectHudLayer(i,t,e){const s=i.stageObject,r=s.geometries[0],o=r.material;d(B,s.boundingVolumeWorldSpace.bounds.center),l(F,B,t.viewMatrix);const c=r.attributes,n=c.get("normal").data,a=c.get("centerOffset")?.data??_,[h]=c.get("groundDistance").data;o.applyShaderOffsets(B,F,n,s.transformation,a,h,t,e.screenSizePerspectiveEvaluators),f(L,F[0],F[1],F[2],1),g(Y,L,t.projectionMatrix),u(e.positionNDC,Y,1/Y[3]),o.applyShaderOffsetsNDC(e.positionNDC,a,h,t,e.positionNDC,J),e.distanceWithoutPolygonOffset=t.depthNDCToWorld(J[2]),e.distance=J[2]===e.positionNDC[2]?e.distanceWithoutPolygonOffset:t.depthNDCToWorld(e.positionNDC[2]),f(Y,e.positionNDC[0],e.positionNDC[1],e.positionNDC[2],1),g(L,Y,t.inverseProjectionMatrix),m(L,L,1/L[3]),p(e.positionView,L[0],L[1],L[2]),d(e.positionWorld,B)}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&P(this._viewState.slicePlane,t)}_expandBoundingRect(i,t,s,r,{positionNDC:o,screenSizePerspectiveEvaluators:c}){const n=s.getScreenSize(ni);c.evaluator.applyVec2(n,n),n[0]*=t.pixelRatio,n[1]*=t.pixelRatio;const a=G(r.calculateRelativeScreenBounds(n,c.alignmentEvaluator.apply(t.pixelRatio),ii),e(0,t.fullWidth,.5+.5*o[0]),e(0,t.fullHeight,.5+.5*o[1])),l=this.marginFactor;if(0!==l){const i=l*Math.min(I(a),j(a));a[0]-=i,a[1]-=i,a[2]+=i,a[3]+=i}k(i,a,i)}_setGraphicVisibility(i,t){const e=i?.graphics3DGraphic;e&&!e.destroyed&&(e.setVisibilityFlag(this.visibilityGroup,8,t),16===this.visibilityGroup&&this.view.labeler.setLabelGraphicVisibility(e,t))}_setTransparentMode(i,t){const e=i?.graphics3DGraphic;if(e&&!e.destroyed)for(const s of e.layers){if("object3d"!==s?.type)continue;const{graphics3DSymbolLayer:i}=s;E(i)&&i.updateTransparentMode(s,t)}}};function ci(i,t){const e=i.graphics3DGraphic;e.destroyed||e.setVisibilityFlag(t,8,!0)}i([r({constructOnly:!0})],oi.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],oi.prototype,"_readyToRun",null),i([r({type:Boolean,readOnly:!0})],oi.prototype,"updating",null),i([r({readOnly:!0})],oi.prototype,"_updatingHandles",void 0),oi=i([o("esri.views.3d.layers.graphics.Deconflictor")],oi);const ni=a();class ai{constructor(){this.positionWorld=y(),this.positionView=y(),this.positionNDC=y(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.distanceWithoutPolygonOffset=0,this.screenSizePerspectiveEvaluators=new H}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1||i[2]>=1}}function li(i,t,e){return d(Z.direction,i.positionView),p(Z.origin,0,0,0),!!t.intersectRay(Z,$)&&i.distanceWithoutPolygonOffset>e}function ui(i,t){return 16===t?i.labelLayers:i.layers}const hi=new ai;export{oi as Deconflictor,si as DeconflictorGraphic,ri as DeconflictorViewState};
|
|
2
|
+
import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{lerp as e}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{transpose as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as l,scale as u,round as h,copy as d,set as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as _,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as f,transformMat4 as g,scale as m}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as O}from"../../../../geometry/ellipsoidUtils.js";import{create as w,empty as Q,copy as D,offset as G,width as I,height as j,expand as P}from"../../../../geometry/support/aaBoundingRect.js";import{e as k,d as S,c as T}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{Sphere as x,sphereCSO as M}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as R}from"../../webgl.js";import{DeconflictAABR as V}from"./DeconflictAABR.js";import{prepare as A,drawPoly as U}from"./deconflictorDebug.js";import{isSymbolLayerWithTransparencyMode as N}from"./transparencyUtils.js";import E from"../../webgl/RenderCamera.js";import{GPUPointOcclusionQuery as q}from"../../webgl-engine/lib/GPUPointOcclusionQuery.js";import{SeparateScreenSizePerspectiveEvaluators as H}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as W}from"../../webgl-engine/materials/HUDMaterial.js";import{Yield as z}from"../../../support/Yield.js";const F=y(),B=y(),L=v(),Y=v(),J=y(),K=n(),X=new x,Z=C(),$=y(),ii=w();class ti{constructor(i){this.id=i,this.aabr=w(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.culled=!1,this.visible=!1,this.priority=0}}function ei(i,t){const e=0!==i.distanceToOccluder&&i.distance>i.distanceToOccluder,s=0!==t.distanceToOccluder&&t.distance>t.distanceToOccluder;return e!==s?+e-+s:i.priority!==t.priority?t.priority-i.priority:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?+t.visible-+i.visible:i.id-t.id}class si{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this._info=null,this._labelInfo=null}ensureInfo(i){let t=this.getInfo(i);return t||(t=new ti(this.graphics3DGraphic.graphic.uid),this._setInfo(i,t)),t}getInfo(i){return 16===i?this._labelInfo:this._info}removeInfo(i){this._setInfo(i,null)}_setInfo(i,t){16===i?this._labelInfo=t:this._info=t}}class ri{constructor(){this.camera=new E,this.slicePlane=S(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.equals(i.camera)||this.camera.copyFrom(i.camera),T(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let oi=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._viewState=new ri,this._state=0,this._checkOcclusion=new Map,this._active=new Map,this._checkOcclusionIterator=null,this._activeIterator=null,this._occlusionQueryUids=new Array,this._updatingHandles=new b,this._deconflictor=new V((i,t)=>{i.visible=t,this._setGraphicVisibility(this._active.get(i.id),t)},(i,t)=>i.id!==t.id,ei),this._baseOccludedVisibility=10,this._altitudeFactor=2,this._minAltitudeDifference=100}initialize(){this._updatingHandles.add(()=>(this.view?.map?.ground?.opacity??0)>0,()=>this.setDirty()),this._updatingHandles.add(()=>this.view.ready,()=>{this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this.setDirty()})}destroy(){this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this._updatingHandles.destroy(),this._deconflictor.destroy(),this._checkOcclusion.clear(),this._active.clear()}setDirty(){!this._dirty&&(this._active.size>0||this._checkOcclusion.size>0)&&(this._dirty=!0,this.notifyChange("_readyToRun"))}setPriority(i,t){const e=this._active.get(i.graphic.uid)?.getInfo(this.visibilityGroup);e&&(e.priority=t)}get _readyToRun(){return 0!==this._state||this._dirty}get updating(){return this._readyToRun||this._updatingHandles.updating}get updatingProgress(){if(!this.updating)return 1;const i=this._state/5;return this._dirty?.5*i:i}get readyToRun(){return this.view.ready&&null!=this.view.state&&this._readyToRun}get usedMemory(){return this._occlusionQuery?.usedMemory??0+4*(this._occlusionQueryUids?.length??0)}runTask(i){switch(this._state){case 0:this._startUpdate(),i.madeProgress();case 1:if(this._state=1,!this._processCheckOcclusion(i))return;case 2:if(this._state=2,!(this._occlusionQuery?.done??1)||!(this._opaqueOcclusionQuery?.done??1))return z;this._readOcclusionQueryResult(),i.madeProgress();case 3:if(this._state=3,!this._collectActiveGraphics(i))return;case 4:if(this._state=4,this._deconflictor.run(i),!this._deconflictor.done)return;default:this._state=0,this.notifyChange("_readyToRun")}}setGraphicsActive(i,t){t?i.forEach(i=>this.addToActiveGraphics(i)):i.forEach(i=>this.removeFromActiveGraphics(i))}isSupportedLayer(i){if(null==i||!("hiddenIfDeconflicted"in i)||!i.hiddenIfDeconflicted)return!1;const t=i.stageObject;if(1!==(t?.geometries.length??0))return!1;const e=t?.geometries[0],s=e?.material;return s instanceof W}_startUpdate(){A(this.view),this._dirty=!1,this._viewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._viewState.camera;if(this._deconflictor.reset(i,t),this._resetIterators(),this._occlusionQueryUids.length=0,!this._checkOcclusion.size)return this._occlusionQuery=s(this._occlusionQuery),void(this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery))}addToActiveGraphics(i){i.ensureInfo(this.visibilityGroup),this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){ci(i,this.visibilityGroup),i.removeInfo(this.visibilityGroup),this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}addToCheckOcclusion(i){this._checkOcclusion.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromCheckOcclusion(i){this._checkOcclusion.delete(i.graphics3DGraphic.graphic.uid)}_processCheckOcclusion(i){if(0===this._checkOcclusion.size)return!0;const t=this._ensureCheckOcclusionIterator(),e=this._viewState.camera,r=c(K,e.viewInverseTransposeMatrix),o=this.view.map.ground.opacity>0,n="global"===this.view.viewingMode&&o&&e.relativeElevation>0?X:null;let a=0;null!=n&&(l(n.center,_,e.viewMatrix),n.radius=O(this.view.spatialReference).radius,a=M.distanceToSilhouette(n,_));const u=w();for(;;){if(i.done)return!1;i.madeProgress();const s=t.next();if(!0===s.done)break;const o=s.value,c=o.graphics3DGraphic;if(c.destroyed)continue;if(!c.isVisible(1,8))continue;const h=ui(c,this.visibilityGroup);let d=null,p=!0,_=!1;for(const i of h){if(!this.isSupportedLayer(i))continue;d=hi,this._projectHudLayer(i,e,d),Q(u);const t=i.stageObject.geometries[0].material;if(this._expandBoundingRect(u,e,i,t,d),d.isOutsideScreen){p=!1;break}if(this._isCulledBySlice(o,d.positionWorld)){p=!1;break}if(null!=n&&li(d,n,a)){p=!1;break}d.altitude=this.view.renderCoordsHelper.getAltitude(d.positionWorld);const s=o.ensureInfo(this.visibilityGroup);if(s.altitude=d.altitude,s.distance=d.distance,s.distanceToOccluder=d.distanceToOccluder,s.culled=!1,D(s.aabr,u),!i.occlusionCheck)break;l(B,d.positionView,r);const h=this._ensureOcclusionQuery(),y=this._ensureOpaqueOcclusionQuery();0===this._occlusionQueryUids.length&&(this._initOcclusionQuery(h),this._initOcclusionQuery(y));const f=h.addPosition(B),g=y.addPosition(B);if(f===this._occlusionQueryUids.length&&g===f){const t=i.adaptiveOcclusion;this._occlusionQueryUids.push(t?-c.graphic.uid:c.graphic.uid),_=!0}break}const y=this._active.has(c.graphic.uid);if(y||_){if(y&&(!p||!d)){const i=o.ensureInfo(this.visibilityGroup);i.visible=!d,i.culled=!0}}else this._setGraphicVisibility(o,p)}return this._checkOcclusionIterator=null,this._occlusionQueryUids.length||(this._occlusionQuery=s(this._occlusionQuery),this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery)),this._occlusionQuery?.start(),this._opaqueOcclusionQuery?.start(),!0}_readOcclusionQueryResult(){if(!this._occlusionQuery||!this._occlusionQueryUids.length)return;const i=this._viewState.camera,t=this.view.renderCoordsHelper.getAltitude(i.eye);for(let e=0;e<this._occlusionQueryUids.length;e++){const i=this._occlusionQueryUids[e],s=Math.abs(i),r=i<0,o=this._checkOcclusion.get(s);if(!o)continue;const c=this._occlusionQuery.getOcclusion(e)??-1,n=this._opaqueOcclusionQuery?.getOcclusion(e)??-1,a=o.getInfo(this.visibilityGroup);a&&(a.distanceToOccluder=c>0?a.distance-c:0);const l=0===n||n>0&&this._occludedVisibility(a?a.distance-n:0,a?.distance??n,a?.altitude??0,t,r),u=0===c||c>0&&this._occludedVisibility(a?.distanceToOccluder??0,a?.distance??c,a?.altitude??0,t,r),h=l||u;h&&this._setTransparentMode(o,l&&!u),this._active.has(s)?a&&(a.culled=!h,a.visible=h):this._setGraphicVisibility(o,h)}this._occlusionQueryUids.length=0}_collectActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),e=16===this.visibilityGroup;for(;!i.done;){i.madeProgress();const s=t.next();if(!0===s.done)return this._activeIterator=null,!0;const r=s.value,o=r.getInfo(this.visibilityGroup);if(!o)continue;const c=!e||r.graphics3DGraphic.isVisible();!c||o.culled?(U(o.aabr,!1,!0),this._setGraphicVisibility(r,c&&o.visible)):this._deconflictor.add(o)}return!1}_occludedVisibility(i,t,e,s,r=!0){const o=Math.max(this._minAltitudeDifference,Math.abs(e-s))-this._minAltitudeDifference,c=r?this._baseOccludedVisibility+this._altitudeFactor*o:0;return 0===i||t-i<=c}_resetIterators(){this._checkOcclusionIterator=null,this._activeIterator=null}_ensureCheckOcclusionIterator(){return this._checkOcclusionIterator??=this._checkOcclusion.values(),this._checkOcclusionIterator}_ensureActiveGraphicsIterator(){return this._activeIterator??=this._active.values(),this._activeIterator}_initOcclusionQuery(i){if(!i)return;const{camera:t}=this._viewState,e=2,s=Math.max(e,e+Math.round(Math.log2(Math.abs(t.relativeElevation))));u(F,this._viewState.camera.eye,2**-s),u(F,h(F,F),2**s),i.init(this._checkOcclusion.size,F)}_ensureOcclusionQuery(){return this._occlusionQuery??=new q({view:this.view}),this._occlusionQuery}_ensureOpaqueOcclusionQuery(){return this._opaqueOcclusionQuery??=new q({view:this.view,category:R.PRE_TRANSPARENT}),this._opaqueOcclusionQuery}_getNumVisible(i){return[...this._checkOcclusion.values()].reduce((t,e)=>t+(e.getInfo(i)?.visible?1:0),0)}_projectHudLayer(i,t,e){const s=i.stageObject,r=s.geometries[0],o=r.material;d(B,s.boundingVolumeWorldSpace.bounds.center),l(F,B,t.viewMatrix);const c=r.attributes,n=c.get("normal").data,a=c.get("centerOffset")?.data??_,[h]=c.get("groundDistance").data;o.applyShaderOffsets(B,F,n,s.transformation,a,h,t,e.screenSizePerspectiveEvaluators),f(L,F[0],F[1],F[2],1),g(Y,L,t.projectionMatrix),u(e.positionNDC,Y,1/Y[3]),o.applyShaderOffsetsNDC(e.positionNDC,a,h,t,e.positionNDC,J),e.distanceWithoutPolygonOffset=t.depthNDCToWorld(J[2]),e.distance=J[2]===e.positionNDC[2]?e.distanceWithoutPolygonOffset:t.depthNDCToWorld(e.positionNDC[2]),f(Y,e.positionNDC[0],e.positionNDC[1],e.positionNDC[2],1),g(L,Y,t.inverseProjectionMatrix),m(L,L,1/L[3]),p(e.positionView,L[0],L[1],L[2]),d(e.positionWorld,B)}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&k(this._viewState.slicePlane,t)}_expandBoundingRect(i,t,s,r,{positionNDC:o,screenSizePerspectiveEvaluators:c}){const n=s.getScreenSize(ni);c.evaluator.applyVec2(n,n),n[0]*=t.pixelRatio,n[1]*=t.pixelRatio;const a=G(r.calculateRelativeScreenBounds(n,c.alignmentEvaluator.apply(t.pixelRatio),ii),e(0,t.fullWidth,.5+.5*o[0]),e(0,t.fullHeight,.5+.5*o[1])),l=this.marginFactor;if(0!==l){const i=l*Math.min(I(a),j(a));a[0]-=i,a[1]-=i,a[2]+=i,a[3]+=i}P(i,a,i)}_setGraphicVisibility(i,t){const e=i?.graphics3DGraphic;e&&!e.destroyed&&(e.setVisibilityFlag(this.visibilityGroup,8,t),16===this.visibilityGroup&&this.view.labeler.setLabelGraphicVisibility(e,t))}_setTransparentMode(i,t){const e=i?.graphics3DGraphic;if(e&&!e.destroyed)for(const s of e.layers){if("object3d"!==s?.type)continue;const{graphics3DSymbolLayer:i}=s;N(i)&&i.updateTransparentMode(s,t)}}};function ci(i,t){const e=i.graphics3DGraphic;e.destroyed||e.setVisibilityFlag(t,8,!0)}i([r({constructOnly:!0})],oi.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],oi.prototype,"_readyToRun",null),i([r({type:Boolean,readOnly:!0})],oi.prototype,"updating",null),i([r({readOnly:!0})],oi.prototype,"_updatingHandles",void 0),oi=i([o("esri.views.3d.layers.graphics.Deconflictor")],oi);const ni=a();class ai{constructor(){this.positionWorld=y(),this.positionView=y(),this.positionNDC=y(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.distanceWithoutPolygonOffset=0,this.screenSizePerspectiveEvaluators=new H}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1||i[2]>=1}}function li(i,t,e){return d(Z.direction,i.positionView),p(Z.origin,0,0,0),!!t.intersectRay(Z,$)&&i.distanceWithoutPolygonOffset>e}function ui(i,t){return 16===t?i.labelLayers:i.layers}const hi=new ai;export{oi as Deconflictor,si as DeconflictorGraphic,ri as DeconflictorViewState};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{remove as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{createAbortError as t,
|
|
2
|
+
import{remove as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{createAbortError as t,onAbort as s}from"../../../../core/promiseUtils.js";import r from"../../../../geometry/Multipoint.js";import{TaskPriority as i,noBudget as o}from"../../../support/Scheduler.js";class n{constructor(e,t){this.spatialReference=e,this._view=t}getElevation(e,t,s){return this._view.elevationProvider.getElevation(e,t,0,this.spatialReference,s)}async queryElevation(e,t,s,r,i){return this._view.elevationProvider.queryElevation(e,t,0,this.spatialReference,i,s,r)}}class a{constructor(e,t,s,r){this.spatialReference=t,this._getElevationQueryProvider=s,this._queries=new Array,this._queryOptions={...r,ignoreInvisibleLayers:!0},this._frameTask=e.registerTask(i.ELEVATION_QUERY,this)}destroy({completeTasks:e}={completeTasks:!1}){if(this._frameTask.remove(),this.readyToRun)if(e)this.runTask(o);else for(const s of this._queries)s.result.reject(t())}queryElevation(r,i,o,n=0){const a=Promise.withResolvers(),l={x:r,y:i,minDemResolution:n,result:a,signal:o};return this._queries.push(l),s(o,()=>{e(this._queries,l),a.reject(t())}),a.promise}get readyToRun(){return this._queries.length>0}runTask(e){const i=this._queries;this._queries=[];const o=this._getElevationQueryProvider();if(!o)return i.forEach(e=>e.result.reject()),void e.madeProgress();const n=i.map(e=>[e.x,e.y]),a=i.reduce((e,t)=>Math.min(e,t.minDemResolution),1/0),l=new r({points:n,spatialReference:this.spatialReference}),u=i.length>1&&i.some(e=>!!e.signal)?new AbortController:null,c=null!=u?u.signal:i[0].signal;if(null!=u){let e=0;i.forEach(r=>s(r.signal,()=>{e++,r.result.reject(t()),e===i.length&&u.abort()}))}const h={...this._queryOptions,minDemResolution:a,signal:c};o.queryElevation(l,h).then(e=>{i.forEach((s,r)=>{if(null!=s.signal&&s.signal.aborted)s.result.reject(t());else{const t=e.geometry.points[r][2],i=void 0!==h.noDataValue&&t===h.noDataValue?null:t;s.result.resolve(i)}})}).catch(e=>{i.forEach(t=>t.result.reject(e))}),e.madeProgress()}get test(){}}export{a as ElevationQuery,n as ViewElevationProvider};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import s from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as n,removeMaybe as o,destroyMaybe as l}from"../../../../core/maybe.js";import{MinPriority as h}from"../../../../core/MemCache.js";import d from"../../../../core/PooledArray.js";import{throwIfAborted as p,ignoreAbortErrors as c,createResolver as y,isAbortError as u}from"../../../../core/promiseUtils.js";import g from"../../../../core/Queue.js";import{when as m,watch as b,on as _,syncAndInitial as f,whenOnce as v}from"../../../../core/reactiveUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{property as S,subclass as G}from"../../../../core/accessorSupport/decorators.js";import{diff as w,isEmpty as x}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as P}from"../../../../core/accessorSupport/tracking.js";import{set as R,add as U,scale as D}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as I}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import E from"../../../../geometry/Extent.js";import L from"../../../../geometry/Point.js";import{canProjectWithoutEngine as j}from"../../../../geometry/projectionUtils.js";import{projectBuffer as A}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as V}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as F,fromRect as T,create as M,equals as k}from"../../../../geometry/support/aaBoundingBox.js";import{create as z}from"../../../../geometry/support/aaBoundingRect.js";import{equals as W}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as H}from"../../../../graphic/getPopupProvider.js";import B from"../../../../layers/Layer.js";import{getObjectId as q,computeAABB as Q,hasGeometry as N}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as $}from"../../../../layers/graphics/hydratedFeatures.js";import Z from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as Y,validateTo3D as X}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as J}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as K}from"../../../../support/basemapUtils.js";import{loadArcade as ee}from"../../../../support/loadArcade.js";import te from"../../../../symbols/LabelSymbol3D.js";import ie from"../../../../symbols/TextSymbol.js";import re from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as se}from"../../../../symbols/support/defaults3D.js";import{to3D as ae}from"../../../../symbols/support/symbolConversion.js";import{averageSymbolComplexities as ne,defaultSymbolComplexity as oe}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as le}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as he}from"./ElevationQuery.js";import{extractExpressionInfo as de,createContext as pe}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as ce}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as ye}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ue}from"./Graphics3DSymbolCreationContext.js";import{make as ge}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as me}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as be}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as _e}from"./GraphicStateTracking.js";import{computeCentroid as fe}from"./graphicUtils.js";import{placePointOnGeometry as ve}from"./pointUtils.js";import{SpatialIndex2D as Ce}from"./SpatialIndex2D.js";import{StageLayerElevationProvider as Se}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ge}from"../../support/extentUtils.js";import{GridLocalOriginFactory as we}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as xe}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/VertexAttribute.js";import{WebGLLayer as Re}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Ue}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as De}from"../../../layers/support/popupUtils.js";import{PromiseQueue as Ie}from"../../../support/PromiseQueue.js";import{PropertiesPool as Ee}from"../../../support/PropertiesPool.js";import{ImmediateTask as Le,noBudget as je,TaskPriority as Ae}from"../../../support/Scheduler.js";import{TextureCompressionTracker as Ve}from"../../../support/TextureCompressionTracker.js";import{Yield as Oe}from"../../../support/Yield.js";import{alphaCutoff as Fe}from"../../../../webscene/support/AlphaCutoff.js";var Te;const Me=I(),ke=M();let ze=class extends t{static{Te=this}static{this.tmpVec=I()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ce({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return P(()=>this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0)}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,i=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,s=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,n=Math.max(1,a?.verticesPerFeature??1),o=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:i,l=Math.ceil(s/n),h=Math.max(t,Math.min(i,l,o)),d=this._get("displayFeatureLimit");return d&&d.maximumTotalNumberOfVertices===s&&d.averageSymbolComplexity===a&&d.maximumNumberOfFeatures===h?d:new le(s,h,a)}get averageSymbolComplexity(){return P(()=>{const e=ne(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||null!=t&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get usedMemory(){const e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=this._getSymbolComplexitiesUsed().reduce((e,t)=>e+t.memory.resourceBytes,0);if(null==this._symbolMaterials){this._symbolMaterials=[];for(const e of this._symbols.values())if(null!=e)for(const t of e.symbolLayers)if(t)for(const e of t.materials)e&&this._symbolMaterials.push(e)}const i=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,s=this._symbolMaterials.reduce((e,t)=>e+((i.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+s}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(null!=this.averageSymbolComplexity){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(e){const t=e;if("web-style"===t.type)return t.clone();const i=this._symbolConversionCache.get(t.id);if(null!=i)return i;const r=ae(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return null==a&&r.error&&s.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){if(null==e)return[];const t=e.symbols,i="backgroundFillSymbol"in e?e.backgroundFillSymbol:null;if(!i&&!t.length)return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);null!=s&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);null!=e&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(null==e)return null;const t=this._symbols.get(e.id);if(null!=t)return t.complexity;const i=this._getConvertedSymbol(e);return null!=i?oe(i):null}_getSymbolComplexitiesUsed(){const e=[];return this._symbols.forEach(t=>{null!=t&&e.push(t.complexity)}),e}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new Ee({computedExtent:()=>new E},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,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._frameTaskHandle=Le,this._dataUpdateQueue=new Ie,this._updateQueue=new Ie,this._focusAreasGraphicsQueue=new g,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=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._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new Ve,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new d,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache("graphics-3d-unused-symbols",e=>e.destroy()),this.symbolCreationContext=new ue(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new ce({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});const e=(e,t,i)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,i),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(q(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(m(()=>this.owner.view.state.highlights,()=>{const{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){const e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new he(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);const i=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new we(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;const r=de(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await pe(r,this._viewSpatialReference,e,s.getLogger(this)),p(e),this.symbolCreationContext.screenSizePerspectiveEnabled=xe(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([b(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(c)),b(()=>xe(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),b(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),b(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),b(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),b(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),b(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),b(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),m(()=>t.basemapTerrain?.tilingScheme,e=>{if(e.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==t.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=t.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this.addHandles([_(e,"change",e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}},{initial:!0}),b(()=>this.effectiveUpdatePolicy,e=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=0===this.effectiveUpdatePolicy,1===e&&this.runTask(je)},f)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ae.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(b(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=n(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=n(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=Le,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=o(this._deconflictor),this._labeler=o(this._labeler),this._elevationAlignment=l(this._elevationAlignment),this._scaleVisibility=l(this._scaleVisibility),this._filterVisibility=l(this._filterVisibility),this._objectStates=l(this._objectStates),this.clear(),"drapeSourceType"in this.owner){const{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=l(this._featureStore),this._updatingPendingLoadedGraphicsChange=o(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=l(this._graphicStateTracking),this.stage&&(this.stageLayer=l(this.stageLayer),this.stage=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._propertiesPool=l(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=l(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(l),this._symbols.clear(),this._symbolMaterials&&(this._symbolMaterials.length=0,this._symbolMaterials=null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("dataUpdating"),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Re(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);const i=this.stageLayer.events;i.on("transformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("shaderTransformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("visibilityChanged",e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),i.on("geometryAdded",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("geometryRemoved",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("attributesChanged",e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*He,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){const e=this._visible&&(null==this.layer.opacity||this.layer.opacity>=Fe);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return null!=e?this.graphics3DGraphics.get(e):void 0}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return q(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer?.objectIdField;if(!e)return;const t=new Map;return this.graphics3DGraphics.forEach(i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);null!=s&&t.set(s,i)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){const t=this._deconflictor?.labelingInfoChange(e),i=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,i])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let e=!1,t=!1;for(const[i,r]of this._symbols)if(null!=r){switch(r.getFastUpdateStatus()){case 3:return"unknown";case 1:this._graphicsBySymbol.has(i)&&(t=!0);break;case 0:this._graphicsBySymbol.has(i)&&(e=!0);break;case 2:this._graphicsBySymbol.has(i)&&(t=e=!0)}}return t?e?"mixed":"fast":e?"slow":"mixed"}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange("readyToRun"),this.readyToRun||this.notifyChange("dataUpdating"),this.notifyChange("updatingRemaining"),!e.hasProgressed)return Oe}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);null!=i&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(null==e)return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(null==i||!this._objectIdInvisibleSet.has(i));return e.setVisibilityFlag(1,1,r)}_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=y();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>A(e,r,t,e,i,t,s),n=(e,t,r)=>A(e,s,t,e,i,t,r),o=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=t&&!!t.useViewElevation,minDemResolution:null!=t?t.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,t?.signal);if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){F(h,Me);const t=e.getElevation(Me[0],Me[1],0,i,"ground")??0;h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await v(()=>this.owner?.loadedGraphics);const i=this.owner.layer?.objectIdField,s=this.owner.loadedGraphics.find(t=>t===e||null!=i&&null!=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;R(Be,0,0,0);let s=0;if(r.render.num>0){if(!V(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,qe,t))return null;U(Be,Be,qe),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,i,"ground")??0;if(R(qe,e,i,a),!V(qe,this._viewElevationProvider.spatialReference,qe,t))return null;U(Be,Be,qe),s++}return s>1&&D(Be,Be,1/s),new L({x:Be[0],y:Be[1],z:Be[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this._symbols.get(e.id);if(null==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(null!=i||null!=this._graphicsWithoutSymbol.get(t)){switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e.graphic);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":{const t=this.symbolCreationContext.featureExpressionInfoContext;t?.arcade&&this._graphicUpdateGeometryHandler(i,e.graphic)}break;case"popupTemplate":break;case"origin-transform":this._graphicUpdateTransformHandler(i,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>!(null==e||!e.graphics3DSymbol.updateGeometry(e)||!(this._labeler?.updateGraphicGeometry(e)??1))&&(this._labeler?.setDirty(),this._deconflictor?.setDirty(),!0));const i=t.geometry;null!=i&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(e,t){const i=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>null!=t.newValue&&null!=e&&null!=i&&e.graphics3DSymbol.updateTransform(e,i.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,i){if(null!=t.geometry){if(null==e){const e=t.symbol?.id;if(e){const t=this._symbols.get(e);if(null!=t&&0===t.loadStatus)return}return void this._recreateGraphic(t)}if(!i()){const i=this._deconflictor?.getState(e);this._recreateGraphic(t);const r=this.graphics3DGraphics.get(t.uid);r&&null!=i&&this._deconflictor?.setState(r,i)}}else this._recreateGraphic(t)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=null!=e?e.graphics3DSymbol:null!=t.oldValue?this._symbols.get(t.oldValue.id):null;if(null==r||null==t.newValue)return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(null!=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=w(s,a);if(null==o)return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!x(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i,!1);if(null==h)return void this._recreateGraphic(i);const d=r.extentPadding;for(const p of l.symbolStatePatches)p();if(d!==r.extentPadding&&this._recomputeExtentPadding(),null!=e)for(const p of l.graphics3DGraphicPatches)p(e,h);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,1===this.effectiveUpdatePolicy&&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("dataUpdating"),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating")))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{null!=t&&(e=Math.max(e,t.extentPadding))}),this._set("extentPadding",e)}_expandComputedExtent(e){const t=ke,i=e.spatialReference;Q(e,t);const r=this._viewSpatialReference,s=Te.tmpVec;if(W(i,r)||O(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],O(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&&(null==a?.zmin||t[2]<a.zmin),h=o&&(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(){this._abortElevationInfoChange();const e=new AbortController;this._elevationInfoChangeAbortController=e;const t=de(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await pe(t,this._viewSpatialReference,e.signal,s.getLogger(this)),p(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t?.forEach(e=>{const t=e.graphic,i=e.labelLayers;for(const r of i){r.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,r)}}):this._recreateSymbol(i)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?"relative-to-scene"!==this.layer.elevationInfo?.mode&&0!==this._numberOfGraphicsProvidingElevation||(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Se({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),null!=this._filterVisibility&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider))}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?.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=xe(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)=>{const r=e.usedMemory;this._conditionalRemove(e,t),this._spatialIndex?.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,r),this._updateLayerVisibility(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));const r=this._symbols.get(e);l(r),this._symbols.delete(e),this._symbolMaterials=null,l(this._unusedSymbolsCache.pop(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){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain?.tilingScheme?(0===this._updatePolicyForGraphics(e)?this._addDelayed(e):this._addImmediate(e),this.notifyChange("dataUpdating")):s.getLogger(this).error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(1===this.effectiveUpdatePolicy&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(null!=t.geometry&&"mesh"===t.geometry.type&&!t.geometry.loaded)return 0;return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this._pendingUpdates.get(e);i?i.add?0!==i.state&&i.abortController?.abort():this._pendingAdds++:(i=new We,this._pendingAdds++,this._pendingUpdates.set(e,i)),i.add=t}this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}remove(e){0===this.effectiveUpdatePolicy?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("dataUpdating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._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),1===i.state&&i.abortController?.abort(),this._pendingAdds--);else{const i=new We;i.remove=t,this._pendingUpdates.set(e,i),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}0===this._pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&s.getLogger(this).warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();const t=this._focusAreasGraphicsQueue.pop(),i=ve(t.graphic.geometry);if(null==i)continue;const r=this.stage.view.focusAreasView?.containsGeometry(i)??!0;t.layers.forEach(e=>{if(e.stageObject){e.stageObject.geometries.some(e=>e.material instanceof Ue&&null==e.material.parameters.focusAreaStyle!==r)&&this.recreateGraphics([t.graphic])}})}0===this._focusAreasGraphicsQueue.length&&this.notifyChange("readyToRun")}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,0===this._pendingUpdates.size&&this._spatialIndex?.updating)return this._spatialIndex.update(),void e.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[t,i]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(i.remove&&!i.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,this._pendingUpdates.delete(t),0===this._pendingRemoves))break}}for(const[t,i]of this._pendingUpdates){if(e.done)break;i.add&&0===i.state&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&2!==i.state||(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=1),i.add)switch(i.state){case 2:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this._pendingAdds--,e.madeProgress();break;case 3:i.add=null,this._pendingAdds--}null==i.remove&&null==i.add&&this._pendingUpdates.delete(t)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("dataUpdating"))}_processPendingUpdateNew(e){if(!e.add)return void(e.state=2);const t=e.add.geometry;null==t||"mesh"!==t.type||t.loaded?this._processPendingUpdateNewRenderingInfo(e):this._processPendingUpdateNewMesh(e,t)}async _processPendingUpdateNewMesh(e,t){e.state=1,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,u(t)?e.state=0:e.state=3}async _processPendingUpdateNewRenderingInfo(e){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add),void(e.state=2);e.state=1,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(u(i)?e.state=0:e.state=3)}null==t?.symbol?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,i){if(this._graphicsWithoutSymbol.set(e.uid,e),null==t?.symbol||!N(e))return;const r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){const t=K(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(q(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,H(this.layer)&&!!this.layer.popupEnabled&&!t&&De(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}const s=t.symbol,a=this.getOrCreateGraphics3DSymbol(s,t.renderer);if(null==a)return;this._expandComputedExtent(e.geometry);const n=this._beginGraphicUpdate(e),o=new ye(e,t,this.layer);let l=!1;const h=e=>{e===a.symbol.id&&(l=!0)};this._whenSymbolRemoved.push(h);const d=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this._graphicsWaitingForSymbol.get(e.uid)!==n||l||a.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==a.symbol.id)--a.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(a,o);this._spatialIndex&&null!=t&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()},p=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),l||(u(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,0===i?a.load(()=>this._dataUpdateQueue.push(d,null).catch(c),e=>this._dataUpdateQueue.push(()=>p(e),null).catch(c)):a.load(d,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,r=i.isElevationSource;this._conditionalRemove(i,t),this._spatialIndex?.remove(i);const s=i.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(s)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,r),i.destroy(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating"))}_hasLabelingContext(e){if(e instanceof te||e instanceof ie){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some(t=>t.symbol===e)}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof te&&!this._hasLabelingContext(e))||(s.getLogger(this).error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t=!0){const i=e.geometry;if(null==i)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!j(i.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?$(e,this.layer,null):e;let a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{const e=r.symbol||se(r.geometry);a=new J(null,e)}return null==a?.symbol?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(null==e.geometry)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?$(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(null!=t&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=ae(t.backgroundFillSymbol,{ignoreDrivers:!0});null!=e.symbol&&(r=e.symbol.symbolLayers)}const s=ge(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);if(void 0===i){const r=this._unusedSymbolsCache.pop(e.id);i=null!=r?r:e instanceof re?new me(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t),this._symbols.set(e.id,i),this._symbolMaterials=null}return null!=i&&++i.referenced,i}trackGraphicState(e){return null==this._graphicStateTracking&&(this._graphicStateTracking=new _e(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){const{graphic:i}=t;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(e.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const r=e.createGraphics3DGraphic(t);if(null==r)return null;this._addGraphics3DGraphic(r);const s=e.symbol.id;this._graphicsBySymbol.has(s)||this._graphicsBySymbol.set(s,new Map),this._graphicsBySymbol.get(s).set(i.uid,r);if(r.isDraped&&this._graphicsDrapedUids.add(i.uid),r.centroid=null,null!=i.geometry&&"point"!==i.geometry.type&&(r.centroid=fe(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(r),null!=this._filterVisibility){const{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(r);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=n(this._rendererChangeAbortController),e!==this.currentRenderer)if(this._validateRenderer(e),null==e&&this._currentRendererChange(null,!1),Y(e))if(e?.arcadeRequired){const t=new AbortController;this._rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();p(t);const r=i.hasGeometryOperations(e);r&&(await i.enableGeometryOperations(),p(t)),0===this.effectiveUpdatePolicy?await this._updateQueue.push(()=>this._currentRendererChange(e,r),t.signal):this._currentRendererChange(e,r),this._rendererChangeAbortController=null}else if(0===this.effectiveUpdatePolicy){const t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return null==this._arcadeOnDemand?(this._arcadeOnDemand=await ee(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(e===i)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),null==e)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=w(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,null!=r&&("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":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 B?this.layer:null,h=this._arcadeOnDemand;if(s===i.defaultSymbol&&i.getSymbol($(o,l,null),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this._graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,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?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){const s=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(s||a){const n=a?.changed,o=a?.unchanged;if(n&&o&&n.some(e=>o.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;const l=a?a.added.map(e=>e.symbol).filter(i):[],h=a?a.removed.map(e=>e.symbol).filter(i):[];if(n)for(let e=0;e<n.length;e++)l.push(n[e].newValue.symbol),h.push(n[e].oldValue.symbol);return s?(r.defaultSymbol&&h.push(r.defaultSymbol),t.defaultSymbol&&l.push(t.defaultSymbol)):r.defaultSymbol&&l.length&&h.push(t.defaultSymbol),this._applySymbolSetDiff(l,h,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||null!=e&&"partial"!==e.type)return[];const r=e=>null!=e?e.id:null,s=e&&e.diff,a=s?.defaultSymbol,n=s&&s.uniqueValueInfos;let o;if(n)o=n.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{o=[];for(const e of i.uniqueValueInfos??[]){const i=r(e.symbol),s=t.uniqueValueInfos?.find(t=>t.value===e.value);s&&i!==r(s.symbol)&&o.push({oldId:i,newId:r(s.symbol)})}}return!a&&i.defaultSymbol&&o.push({oldId:r(i.defaultSymbol),newId:r(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=null!=t&&t?"string"==typeof t?t:t.id:null;if(null==e||e===i)return;const r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),void 0!==r&&this._graphicsBySymbol.set(i,r);const s=this._symbols.get(e);if(void 0!==s&&(this._symbols.delete(e),this._symbols.set(i,s),this._symbolMaterials=null,null!=s)){const e="string"==typeof t?null:t;null!=e?s.symbol=e:s.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,t,i){if(this._diffHasSymbolChange(e))return!1;if(t instanceof Z&&i instanceof Z&&this._applyUniqueValueRendererDiff(e,t,i)&&0===Object.keys(e.diff).length)return!0;for(const r of this._graphicsBySymbol.keys()){const i=this._symbols.get(r);if(null!=i)switch(i.applyRendererDiff(e,t)){case 0:this._recreateSymbol(r);break;case 1:this._recreateGraphicsForSymbol(r)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("opacity",t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("screenSizePerspectiveEnabled",t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("skipHighSymbolLods",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=z();return Ge(e,r,t)?this.symbolCreationContext.clippingExtent=T(M(),r):this.symbolCreationContext.clippingExtent=null,!k(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(i=>{e(i)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(const[i,r]of this._symbols){if(null==r)return;e(r,this._graphicsBySymbol.get(i)||Qe,i)}if(!t?.excludeUnused)for(const i of this._unusedSymbolsCache)e(i,void 0,i.symbol.id)}updateGraphicsVisibilities(){null!=this._filterVisibility&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{const t=this._updateUserVisibility(e),i=!!this._scaleVisibility?.updateVisibility(e);return t||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){const t=()=>`'${this.layer.title?`${this.layer.title}, `:""}id:${this.layer.id}'`,i=X(e,{geometryType:this.layer?.geometryType,logWarning:(e,i)=>s.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${i}`)});if(i){const e=`Renderer for layer ${t} is not supported in a SceneView`;s.getLogger(this).warn(e,i.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,i)=>{if(null==t||t.referenced>0)return;const r=this._graphicsBySymbol.get(i);r&&0!==r.size||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),this._symbolMaterials=null,this._unusedSymbolsCache.put(i,t,h),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){}get performanceInfo(){return new be(this.graphics3DGraphics.size,Array.from(this.graphics3DGraphics.values()).reduce((e,t)=>e+(t.isVisible()?1:0),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([S({readOnly:!0})],ze.prototype,"computedExtent",void 0),e([S()],ze.prototype,"currentRenderer",void 0),e([S()],ze.prototype,"rendererHasGeometryOperations",void 0),e([S()],ze.prototype,"_frameTaskHandle",void 0),e([S()],ze.prototype,"_dataUpdateQueue",void 0),e([S()],ze.prototype,"_updateQueue",void 0),e([S({readOnly:!0})],ze.prototype,"_viewSpatialReference",null),e([S()],ze.prototype,"_rendererChangeAbortController",void 0),e([S()],ze.prototype,"_elevationInfoChangeAbortController",void 0),e([S()],ze.prototype,"_initializeAbortController",void 0),e([S()],ze.prototype,"_elevationAlignment",void 0),e([S()],ze.prototype,"_scaleVisibility",void 0),e([S()],ze.prototype,"_filterVisibility",void 0),e([S()],ze.prototype,"_initializePromise",void 0),e([S()],ze.prototype,"_spatialIndex",void 0),e([S({readOnly:!0})],ze.prototype,"extentPadding",void 0),e([S()],ze.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([S()],ze.prototype,"_featureStore",void 0),e([S()],ze.prototype,"_objectStates",void 0),e([S()],ze.prototype,"_loadingSymbols",void 0),e([S({constructOnly:!0})],ze.prototype,"compressionTracker",void 0),e([S()],ze.prototype,"preferredUpdatePolicy",void 0),e([S()],ze.prototype,"_forcedUpdatePolicy",void 0),e([S({readOnly:!0})],ze.prototype,"effectiveUpdatePolicy",null),e([S({constructOnly:!0})],ze.prototype,"elevationFeatureExpressionEnabled",void 0),e([S({constructOnly:!0})],ze.prototype,"owner",void 0),e([S({constructOnly:!0})],ze.prototype,"layer",void 0),e([S({constructOnly:!0})],ze.prototype,"graphicSymbolSupported",void 0),e([S({constructOnly:!0})],ze.prototype,"getRenderingInfoWithoutRenderer",void 0),e([S({constructOnly:!0})],ze.prototype,"componentFactories",void 0),e([S({constructOnly:!0})],ze.prototype,"setUidToIdOnAdd",void 0),e([S()],ze.prototype,"featureStore",null),e([S()],ze.prototype,"initializePromise",null),e([S()],ze.prototype,"scaleVisibility",null),e([S()],ze.prototype,"elevationAlignment",null),e([S()],ze.prototype,"objectStates",null),e([S()],ze.prototype,"filterVisibility",null),e([S({readOnly:!0})],ze.prototype,"updating",null),e([S({readOnly:!0})],ze.prototype,"dataUpdating",null),e([S({readOnly:!0})],ze.prototype,"readyToRun",null),e([S({readOnly:!0})],ze.prototype,"suspendedOrOutsideOfView",null),e([S({readOnly:!0})],ze.prototype,"updatingRemaining",null),e([S({readOnly:!0})],ze.prototype,"displayFeatureLimit",null),e([S({readOnly:!0})],ze.prototype,"averageSymbolComplexity",null),e([S({constructOnly:!0})],ze.prototype,"hasZ",void 0),e([S({constructOnly:!0})],ze.prototype,"hasM",void 0),e([S()],ze.prototype,"_objectIdField",null),ze=Te=e([G("esri.views.3d.layers.graphics.Graphics3DCore")],ze);class We{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const He=10,Be=I(),qe=I(),Qe=new Map;export{ze as Graphics3DCore};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import s from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as n,removeMaybe as o,destroyMaybe as l}from"../../../../core/maybe.js";import{MinPriority as h}from"../../../../core/MemCache.js";import d from"../../../../core/PooledArray.js";import{throwIfAborted as p,ignoreAbortErrors as c,isAbortError as y}from"../../../../core/promiseUtils.js";import u from"../../../../core/Queue.js";import{when as g,watch as m,on as b,syncAndInitial as _,whenOnce as f}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as C,subclass as S}from"../../../../core/accessorSupport/decorators.js";import{diff as G,isEmpty as w}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as P,add as R,scale as U}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import I from"../../../../geometry/Extent.js";import E from"../../../../geometry/Point.js";import{canProjectWithoutEngine as L}from"../../../../geometry/projectionUtils.js";import{projectBuffer as j}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as A}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as V}from"../../../../geometry/projection/projectXYZToVector.js";import{center as O,fromRect as F,create as T,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as k}from"../../../../geometry/support/aaBoundingRect.js";import{equals as z}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as W}from"../../../../graphic/getPopupProvider.js";import H from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as Q}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import $ from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as Z,validateTo3D as Y}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as X}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as J}from"../../../../support/basemapUtils.js";import{loadArcade as K}from"../../../../support/loadArcade.js";import ee from"../../../../symbols/LabelSymbol3D.js";import te from"../../../../symbols/TextSymbol.js";import ie from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as re}from"../../../../symbols/support/defaults3D.js";import{to3D as se}from"../../../../symbols/support/symbolConversion.js";import{averageSymbolComplexities as ae,defaultSymbolComplexity as ne}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as oe}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as le}from"./ElevationQuery.js";import{extractExpressionInfo as he,createContext as de}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as pe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as ce}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ye}from"./Graphics3DSymbolCreationContext.js";import{make as ue}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as ge}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as me}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as be}from"./GraphicStateTracking.js";import{computeCentroid as _e}from"./graphicUtils.js";import{placePointOnGeometry as fe}from"./pointUtils.js";import{SpatialIndex2D as ve}from"./SpatialIndex2D.js";import{StageLayerElevationProvider as Ce}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Se}from"../../support/extentUtils.js";import{GridLocalOriginFactory as Ge}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as we}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{affectsGeometry as xe}from"../../webgl-engine/lib/VertexAttribute.js";import{WebGLLayer as Pe}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Re}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Ue}from"../../../layers/support/popupUtils.js";import{PromiseQueue as De}from"../../../support/PromiseQueue.js";import{PropertiesPool as Ie}from"../../../support/PropertiesPool.js";import{ImmediateTask as Ee,noBudget as Le,TaskPriority as je}from"../../../support/Scheduler.js";import{TextureCompressionTracker as Ae}from"../../../support/TextureCompressionTracker.js";import{Yield as Ve}from"../../../support/Yield.js";import{alphaCutoff as Oe}from"../../../../webscene/support/AlphaCutoff.js";var Fe;const Te=D(),Me=T();let ke=class extends t{static{Fe=this}static{this.tmpVec=D()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ve({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0)}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,i=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,s=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,n=Math.max(1,a?.verticesPerFeature??1),o=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:i,l=Math.ceil(s/n),h=Math.max(t,Math.min(i,l,o)),d=this._get("displayFeatureLimit");return d&&d.maximumTotalNumberOfVertices===s&&d.averageSymbolComplexity===a&&d.maximumNumberOfFeatures===h?d:new oe(s,h,a)}get averageSymbolComplexity(){return x(()=>{const e=ae(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||null!=t&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get usedMemory(){const e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=this._getSymbolComplexitiesUsed().reduce((e,t)=>e+t.memory.resourceBytes,0);if(null==this._symbolMaterials){this._symbolMaterials=[];for(const e of this._symbols.values())if(null!=e)for(const t of e.symbolLayers)if(t)for(const e of t.materials)e&&this._symbolMaterials.push(e)}const i=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,s=this._symbolMaterials.reduce((e,t)=>e+((i.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+s}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(null!=this.averageSymbolComplexity){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(e){const t=e;if("web-style"===t.type)return t.clone();const i=this._symbolConversionCache.get(t.id);if(null!=i)return i;const r=se(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return null==a&&r.error&&s.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){if(null==e)return[];const t=e.symbols,i="backgroundFillSymbol"in e?e.backgroundFillSymbol:null;if(!i&&!t.length)return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);null!=s&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);null!=e&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(null==e)return null;const t=this._symbols.get(e.id);if(null!=t)return t.complexity;const i=this._getConvertedSymbol(e);return null!=i?ne(i):null}_getSymbolComplexitiesUsed(){const e=[];return this._symbols.forEach(t=>{null!=t&&e.push(t.complexity)}),e}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new Ie({computedExtent:()=>new I},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,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._frameTaskHandle=Ee,this._dataUpdateQueue=new De,this._updateQueue=new De,this._focusAreasGraphicsQueue=new u,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=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._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new Ae,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new d,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache("graphics-3d-unused-symbols",e=>e.destroy()),this.symbolCreationContext=new ye(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new pe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});const e=(e,t,i)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,i),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(B(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(g(()=>this.owner.view.state.highlights,()=>{const{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){const e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new le(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);const i=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Ge(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;const r=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await de(r,this._viewSpatialReference,e,s.getLogger(this)),p(e),this.symbolCreationContext.screenSizePerspectiveEnabled=we(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([m(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(c)),m(()=>we(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),m(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),m(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),m(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),m(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),m(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),m(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),g(()=>t.basemapTerrain?.tilingScheme,e=>{if(e.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==t.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=t.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this.addHandles([b(e,"change",e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}},{initial:!0}),m(()=>this.effectiveUpdatePolicy,e=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=0===this.effectiveUpdatePolicy,1===e&&this.runTask(Le)},_)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(je.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(m(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=n(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=n(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=Ee,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=o(this._deconflictor),this._labeler=o(this._labeler),this._elevationAlignment=l(this._elevationAlignment),this._scaleVisibility=l(this._scaleVisibility),this._filterVisibility=l(this._filterVisibility),this._objectStates=l(this._objectStates),this.clear(),"drapeSourceType"in this.owner){const{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=l(this._featureStore),this._updatingPendingLoadedGraphicsChange=o(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=l(this._graphicStateTracking),this.stage&&(this.stageLayer=l(this.stageLayer),this.stage=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._propertiesPool=l(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=l(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(l),this._symbols.clear(),this._symbolMaterials&&(this._symbolMaterials.length=0,this._symbolMaterials=null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("dataUpdating"),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Pe(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);const i=this.stageLayer.events;i.on("transformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("shaderTransformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("visibilityChanged",e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),i.on("geometryAdded",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("geometryRemoved",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("attributesChanged",e=>xe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*We,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){const e=this._visible&&(null==this.layer.opacity||this.layer.opacity>=Oe);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return null!=e?this.graphics3DGraphics.get(e):void 0}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer?.objectIdField;if(!e)return;const t=new Map;return this.graphics3DGraphics.forEach(i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);null!=s&&t.set(s,i)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){const t=this._deconflictor?.labelingInfoChange(e),i=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,i])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let e=!1,t=!1;for(const[i,r]of this._symbols)if(null!=r){switch(r.getFastUpdateStatus()){case 3:return"unknown";case 1:this._graphicsBySymbol.has(i)&&(t=!0);break;case 0:this._graphicsBySymbol.has(i)&&(e=!0);break;case 2:this._graphicsBySymbol.has(i)&&(t=e=!0)}}return t?e?"mixed":"fast":e?"slow":"mixed"}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange("readyToRun"),this.readyToRun||this.notifyChange("dataUpdating"),this.notifyChange("updatingRemaining"),!e.hasProgressed)return Ve}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);null!=i&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(null==e)return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(null==i||!this._objectIdInvisibleSet.has(i));return e.setVisibilityFlag(1,1,r)}_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=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>j(e,r,t,e,i,t,s),n=(e,t,r)=>j(e,s,t,e,i,t,r),o=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=t&&!!t.useViewElevation,minDemResolution:null!=t?t.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,t?.signal);if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){O(h,Te);const t=e.getElevation(Te[0],Te[1],0,i,"ground")??0;h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await f(()=>this.owner?.loadedGraphics);const i=this.owner.layer?.objectIdField,s=this.owner.loadedGraphics.find(t=>t===e||null!=i&&null!=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;P(He,0,0,0);let s=0;if(r.render.num>0){if(!A(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,Be,t))return null;R(He,He,Be),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,i,"ground")??0;if(P(Be,e,i,a),!A(Be,this._viewElevationProvider.spatialReference,Be,t))return null;R(He,He,Be),s++}return s>1&&U(He,He,1/s),new E({x:He[0],y:He[1],z:He[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this._symbols.get(e.id);if(null==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(null!=i||null!=this._graphicsWithoutSymbol.get(t)){switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e.graphic);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":{const t=this.symbolCreationContext.featureExpressionInfoContext;t?.arcade&&this._graphicUpdateGeometryHandler(i,e.graphic)}break;case"popupTemplate":break;case"origin-transform":this._graphicUpdateTransformHandler(i,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>!(null==e||!e.graphics3DSymbol.updateGeometry(e)||!(this._labeler?.updateGraphicGeometry(e)??1))&&(this._labeler?.setDirty(),this._deconflictor?.setDirty(),!0));const i=t.geometry;null!=i&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(e,t){const i=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>null!=t.newValue&&null!=e&&null!=i&&e.graphics3DSymbol.updateTransform(e,i.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,i){if(null!=t.geometry){if(null==e){const e=t.symbol?.id;if(e){const t=this._symbols.get(e);if(null!=t&&0===t.loadStatus)return}return void this._recreateGraphic(t)}if(!i()){const i=this._deconflictor?.getState(e);this._recreateGraphic(t);const r=this.graphics3DGraphics.get(t.uid);r&&null!=i&&this._deconflictor?.setState(r,i)}}else this._recreateGraphic(t)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=null!=e?e.graphics3DSymbol:null!=t.oldValue?this._symbols.get(t.oldValue.id):null;if(null==r||null==t.newValue)return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(null!=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=G(s,a);if(null==o)return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!w(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i,!1);if(null==h)return void this._recreateGraphic(i);const d=r.extentPadding;for(const p of l.symbolStatePatches)p();if(d!==r.extentPadding&&this._recomputeExtentPadding(),null!=e)for(const p of l.graphics3DGraphicPatches)p(e,h);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,1===this.effectiveUpdatePolicy&&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("dataUpdating"),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating")))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{null!=t&&(e=Math.max(e,t.extentPadding))}),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Me,i=e.spatialReference;q(e,t);const r=this._viewSpatialReference,s=Fe.tmpVec;if(z(i,r)||V(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],V(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&&(null==a?.zmin||t[2]<a.zmin),h=o&&(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(){this._abortElevationInfoChange();const e=new AbortController;this._elevationInfoChangeAbortController=e;const t=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await de(t,this._viewSpatialReference,e.signal,s.getLogger(this)),p(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t?.forEach(e=>{const t=e.graphic,i=e.labelLayers;for(const r of i){r.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,r)}}):this._recreateSymbol(i)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?"relative-to-scene"!==this.layer.elevationInfo?.mode&&0!==this._numberOfGraphicsProvidingElevation||(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Ce({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),null!=this._filterVisibility&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider))}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?.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=we(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)=>{const r=e.usedMemory;this._conditionalRemove(e,t),this._spatialIndex?.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,r),this._updateLayerVisibility(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));const r=this._symbols.get(e);l(r),this._symbols.delete(e),this._symbolMaterials=null,l(this._unusedSymbolsCache.pop(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){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain?.tilingScheme?(0===this._updatePolicyForGraphics(e)?this._addDelayed(e):this._addImmediate(e),this.notifyChange("dataUpdating")):s.getLogger(this).error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(1===this.effectiveUpdatePolicy&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(null!=t.geometry&&"mesh"===t.geometry.type&&!t.geometry.loaded)return 0;return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this._pendingUpdates.get(e);i?i.add?0!==i.state&&i.abortController?.abort():this._pendingAdds++:(i=new ze,this._pendingAdds++,this._pendingUpdates.set(e,i)),i.add=t}this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}remove(e){0===this.effectiveUpdatePolicy?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("dataUpdating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._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),1===i.state&&i.abortController?.abort(),this._pendingAdds--);else{const i=new ze;i.remove=t,this._pendingUpdates.set(e,i),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}0===this._pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&s.getLogger(this).warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();const t=this._focusAreasGraphicsQueue.pop(),i=fe(t.graphic.geometry);if(null==i)continue;const r=this.stage.view.focusAreasView?.containsGeometry(i)??!0;t.layers.forEach(e=>{if(e.stageObject){e.stageObject.geometries.some(e=>e.material instanceof Re&&null==e.material.parameters.focusAreaStyle!==r)&&this.recreateGraphics([t.graphic])}})}0===this._focusAreasGraphicsQueue.length&&this.notifyChange("readyToRun")}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,0===this._pendingUpdates.size&&this._spatialIndex?.updating)return this._spatialIndex.update(),void e.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[t,i]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(i.remove&&!i.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,this._pendingUpdates.delete(t),0===this._pendingRemoves))break}}for(const[t,i]of this._pendingUpdates){if(e.done)break;i.add&&0===i.state&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&2!==i.state||(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=1),i.add)switch(i.state){case 2:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this._pendingAdds--,e.madeProgress();break;case 3:i.add=null,this._pendingAdds--}null==i.remove&&null==i.add&&this._pendingUpdates.delete(t)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("dataUpdating"))}_processPendingUpdateNew(e){if(!e.add)return void(e.state=2);const t=e.add.geometry;null==t||"mesh"!==t.type||t.loaded?this._processPendingUpdateNewRenderingInfo(e):this._processPendingUpdateNewMesh(e,t)}async _processPendingUpdateNewMesh(e,t){e.state=1,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,y(t)?e.state=0:e.state=3}async _processPendingUpdateNewRenderingInfo(e){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add),void(e.state=2);e.state=1,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(y(i)?e.state=0:e.state=3)}null==t?.symbol?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,i){if(this._graphicsWithoutSymbol.set(e.uid,e),null==t?.symbol||!Q(e))return;const r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){const t=J(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(B(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,W(this.layer)&&!!this.layer.popupEnabled&&!t&&Ue(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}const s=t.symbol,a=this.getOrCreateGraphics3DSymbol(s,t.renderer);if(null==a)return;this._expandComputedExtent(e.geometry);const n=this._beginGraphicUpdate(e),o=new ce(e,t,this.layer);let l=!1;const h=e=>{e===a.symbol.id&&(l=!0)};this._whenSymbolRemoved.push(h);const d=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this._graphicsWaitingForSymbol.get(e.uid)!==n||l||a.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==a.symbol.id)--a.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(a,o);this._spatialIndex&&null!=t&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()},p=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),l||(y(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,0===i?a.load(()=>this._dataUpdateQueue.push(d,null).catch(c),e=>this._dataUpdateQueue.push(()=>p(e),null).catch(c)):a.load(d,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,r=i.isElevationSource;this._conditionalRemove(i,t),this._spatialIndex?.remove(i);const s=i.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(s)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,r),i.destroy(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating"))}_hasLabelingContext(e){if(e instanceof ee||e instanceof te){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some(t=>t.symbol===e)}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof ee&&!this._hasLabelingContext(e))||(s.getLogger(this).error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t=!0){const i=e.geometry;if(null==i)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!L(i.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?N(e,this.layer,null):e;let a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{const e=r.symbol||re(r.geometry);a=new X(null,e)}return null==a?.symbol?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(null==e.geometry)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(null!=t&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=se(t.backgroundFillSymbol,{ignoreDrivers:!0});null!=e.symbol&&(r=e.symbol.symbolLayers)}const s=ue(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);if(void 0===i){const r=this._unusedSymbolsCache.pop(e.id);i=null!=r?r:e instanceof ie?new ge(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t),this._symbols.set(e.id,i),this._symbolMaterials=null}return null!=i&&++i.referenced,i}trackGraphicState(e){return null==this._graphicStateTracking&&(this._graphicStateTracking=new be(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){const{graphic:i}=t;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(e.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const r=e.createGraphics3DGraphic(t);if(null==r)return null;this._addGraphics3DGraphic(r);const s=e.symbol.id;this._graphicsBySymbol.has(s)||this._graphicsBySymbol.set(s,new Map),this._graphicsBySymbol.get(s).set(i.uid,r);if(r.isDraped&&this._graphicsDrapedUids.add(i.uid),r.centroid=null,null!=i.geometry&&"point"!==i.geometry.type&&(r.centroid=_e(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(r),null!=this._filterVisibility){const{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(r);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=n(this._rendererChangeAbortController),e!==this.currentRenderer)if(this._validateRenderer(e),null==e&&this._currentRendererChange(null,!1),Z(e))if(e?.arcadeRequired){const t=new AbortController;this._rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();p(t);const r=i.hasGeometryOperations(e);r&&(await i.enableGeometryOperations(),p(t)),0===this.effectiveUpdatePolicy?await this._updateQueue.push(()=>this._currentRendererChange(e,r),t.signal):this._currentRendererChange(e,r),this._rendererChangeAbortController=null}else if(0===this.effectiveUpdatePolicy){const t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return null==this._arcadeOnDemand?(this._arcadeOnDemand=await K(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(e===i)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),null==e)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=G(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,null!=r&&("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":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 H?this.layer:null,h=this._arcadeOnDemand;if(s===i.defaultSymbol&&i.getSymbol(N(o,l,null),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this._graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,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?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){const s=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(s||a){const n=a?.changed,o=a?.unchanged;if(n&&o&&n.some(e=>o.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;const l=a?a.added.map(e=>e.symbol).filter(i):[],h=a?a.removed.map(e=>e.symbol).filter(i):[];if(n)for(let e=0;e<n.length;e++)l.push(n[e].newValue.symbol),h.push(n[e].oldValue.symbol);return s?(r.defaultSymbol&&h.push(r.defaultSymbol),t.defaultSymbol&&l.push(t.defaultSymbol)):r.defaultSymbol&&l.length&&h.push(t.defaultSymbol),this._applySymbolSetDiff(l,h,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||null!=e&&"partial"!==e.type)return[];const r=e=>null!=e?e.id:null,s=e&&e.diff,a=s?.defaultSymbol,n=s&&s.uniqueValueInfos;let o;if(n)o=n.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{o=[];for(const e of i.uniqueValueInfos??[]){const i=r(e.symbol),s=t.uniqueValueInfos?.find(t=>t.value===e.value);s&&i!==r(s.symbol)&&o.push({oldId:i,newId:r(s.symbol)})}}return!a&&i.defaultSymbol&&o.push({oldId:r(i.defaultSymbol),newId:r(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=null!=t&&t?"string"==typeof t?t:t.id:null;if(null==e||e===i)return;const r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),void 0!==r&&this._graphicsBySymbol.set(i,r);const s=this._symbols.get(e);if(void 0!==s&&(this._symbols.delete(e),this._symbols.set(i,s),this._symbolMaterials=null,null!=s)){const e="string"==typeof t?null:t;null!=e?s.symbol=e:s.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,t,i){if(this._diffHasSymbolChange(e))return!1;if(t instanceof $&&i instanceof $&&this._applyUniqueValueRendererDiff(e,t,i)&&0===Object.keys(e.diff).length)return!0;for(const r of this._graphicsBySymbol.keys()){const i=this._symbols.get(r);if(null!=i)switch(i.applyRendererDiff(e,t)){case 0:this._recreateSymbol(r);break;case 1:this._recreateGraphicsForSymbol(r)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("opacity",t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("screenSizePerspectiveEnabled",t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("skipHighSymbolLods",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=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=k();return Se(e,r,t)?this.symbolCreationContext.clippingExtent=F(T(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(i=>{e(i)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(const[i,r]of this._symbols){if(null==r)return;e(r,this._graphicsBySymbol.get(i)||qe,i)}if(!t?.excludeUnused)for(const i of this._unusedSymbolsCache)e(i,void 0,i.symbol.id)}updateGraphicsVisibilities(){null!=this._filterVisibility&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{const t=this._updateUserVisibility(e),i=!!this._scaleVisibility?.updateVisibility(e);return t||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){const t=()=>`'${this.layer.title?`${this.layer.title}, `:""}id:${this.layer.id}'`,i=Y(e,{geometryType:this.layer?.geometryType,logWarning:(e,i)=>s.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${i}`)});if(i){const e=`Renderer for layer ${t} is not supported in a SceneView`;s.getLogger(this).warn(e,i.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,i)=>{if(null==t||t.referenced>0)return;const r=this._graphicsBySymbol.get(i);r&&0!==r.size||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),this._symbolMaterials=null,this._unusedSymbolsCache.put(i,t,h),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){}get performanceInfo(){return new me(this.graphics3DGraphics.size,Array.from(this.graphics3DGraphics.values()).reduce((e,t)=>e+(t.isVisible()?1:0),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([C({readOnly:!0})],ke.prototype,"computedExtent",void 0),e([C()],ke.prototype,"currentRenderer",void 0),e([C()],ke.prototype,"rendererHasGeometryOperations",void 0),e([C()],ke.prototype,"_frameTaskHandle",void 0),e([C()],ke.prototype,"_dataUpdateQueue",void 0),e([C()],ke.prototype,"_updateQueue",void 0),e([C({readOnly:!0})],ke.prototype,"_viewSpatialReference",null),e([C()],ke.prototype,"_rendererChangeAbortController",void 0),e([C()],ke.prototype,"_elevationInfoChangeAbortController",void 0),e([C()],ke.prototype,"_initializeAbortController",void 0),e([C()],ke.prototype,"_elevationAlignment",void 0),e([C()],ke.prototype,"_scaleVisibility",void 0),e([C()],ke.prototype,"_filterVisibility",void 0),e([C()],ke.prototype,"_initializePromise",void 0),e([C()],ke.prototype,"_spatialIndex",void 0),e([C({readOnly:!0})],ke.prototype,"extentPadding",void 0),e([C()],ke.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([C()],ke.prototype,"_featureStore",void 0),e([C()],ke.prototype,"_objectStates",void 0),e([C()],ke.prototype,"_loadingSymbols",void 0),e([C({constructOnly:!0})],ke.prototype,"compressionTracker",void 0),e([C()],ke.prototype,"preferredUpdatePolicy",void 0),e([C()],ke.prototype,"_forcedUpdatePolicy",void 0),e([C({readOnly:!0})],ke.prototype,"effectiveUpdatePolicy",null),e([C({constructOnly:!0})],ke.prototype,"elevationFeatureExpressionEnabled",void 0),e([C({constructOnly:!0})],ke.prototype,"owner",void 0),e([C({constructOnly:!0})],ke.prototype,"layer",void 0),e([C({constructOnly:!0})],ke.prototype,"graphicSymbolSupported",void 0),e([C({constructOnly:!0})],ke.prototype,"getRenderingInfoWithoutRenderer",void 0),e([C({constructOnly:!0})],ke.prototype,"componentFactories",void 0),e([C({constructOnly:!0})],ke.prototype,"setUidToIdOnAdd",void 0),e([C()],ke.prototype,"featureStore",null),e([C()],ke.prototype,"initializePromise",null),e([C()],ke.prototype,"scaleVisibility",null),e([C()],ke.prototype,"elevationAlignment",null),e([C()],ke.prototype,"objectStates",null),e([C()],ke.prototype,"filterVisibility",null),e([C({readOnly:!0})],ke.prototype,"updating",null),e([C({readOnly:!0})],ke.prototype,"dataUpdating",null),e([C({readOnly:!0})],ke.prototype,"readyToRun",null),e([C({readOnly:!0})],ke.prototype,"suspendedOrOutsideOfView",null),e([C({readOnly:!0})],ke.prototype,"updatingRemaining",null),e([C({readOnly:!0})],ke.prototype,"displayFeatureLimit",null),e([C({readOnly:!0})],ke.prototype,"averageSymbolComplexity",null),e([C({constructOnly:!0})],ke.prototype,"hasZ",void 0),e([C({constructOnly:!0})],ke.prototype,"hasM",void 0),e([C()],ke.prototype,"_objectIdField",null),ke=Fe=e([S("esri.views.3d.layers.graphics.Graphics3DCore")],ke);class ze{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const We=10,He=D(),Be=D(),qe=new Map;export{ke as Graphics3DCore};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as n,result as o}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateNumberMemory as u,estimateStringMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as g,createResolver as p}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";let I=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=L,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new A(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise)},_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new F(e,()=>{t.remove(r)});return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await g(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:n}=t;if(null==n||null==i||0===this._attributeChangedObjectIds.size)return;const o=new Set;for(const d of n)o.add(d.index);for(const d of s)o.has(d.index)||(n.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:n},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:o,fieldNames:a}=s;if(0===o.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(o,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const n=new Set,o=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(n.add(r),o.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(n),fieldNames:Array.from(o)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:n}=s,o=[n,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=o,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:n},spatialReference:o}=this.view,a=1===n,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,E(i,o,this.view.viewingMode,0)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,E(i,o,this.view.viewingMode,0)),null;if(!(O(i,o)||a&&o.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,E(i,o,this.view.viewingMode,1)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:g,extractMesh:p}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:n}=e;if(null==t)continue;const o=g(s,t);for(const a of r){const e=p(a,n,i,s,o),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const o=C(e);t=[...t].sort((e,t)=>e-t);const a=s(t,o).map(t=>{const s=r.clone();return s.objectIds=t,n(w(e,s,{signal:i}))});return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const n=this._associatedLayer;if(null==n)return;const o=n.objectIdField,a=r.map(t=>(t in i||(i[t]=new Array(e.length)),i[t])),d=new Map(s.map(e=>[e.name,e.index])),c=r.map(e=>d.get(e)),h=new Map(Array.from(e,(e,t)=>[e,t]));for(const l of t){const e=l.attributes[o];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),n=l.attributes[r[t]];a[t][i]=n,this._cacheAttributeValue(e,s,n)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const n=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${n}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:n,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await o(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:G,signal:e}));if(!h.ok){const e=this.layer.title;c.getLogger(this).warn("extractChanges:unavailable",e,": could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.")}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],n=r?.updates??[],o=r?.deletes??[],d=[...i,...n,...o],c=a?[...i,...s??n,...o]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort((e,t)=>e-t);for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=p(),i=s.promise;for(const n of e)t.set(n,i);return d(()=>{for(const r of e)t.delete(r);s.resolve()})}get test(){}};e([b({constructOnly:!0})],I.prototype,"view",void 0),e([b({constructOnly:!0})],I.prototype,"layer",void 0),e([b({readOnly:!0})],I.prototype,"is3DOFL",null),e([b()],I.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],I.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],I.prototype,"geometryOverrides",void 0),e([b()],I.prototype,"_clientGeometryCache",void 0),e([b()],I.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],I.prototype,"memoryController",void 0),e([b()],I.prototype,"_attributeChangedObjectIds",void 0),e([b()],I.prototype,"_geometryChangedObjectIds",void 0),e([b()],I.prototype,"hasGeometryChanges",null),e([b()],I.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],I.prototype,"_pendingFetchAbortController",void 0),e([b()],I.prototype,"_applyGeometryOverridesTask",void 0),e([b()],I.prototype,"updating",null),e([b()],I.prototype,"isEmpty",null),I=e([v("esri.views.3d.layers.i3s.I3SOverrides")],I);class F{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class A{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new x(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class x{constructor(e){this.value=e,this.usedMemory="string"==typeof e?m(e):u}}const G=1e4,L=5e4;function E(e,t,r,s){return`Displaying the edits of a SceneLayer with a${0===s?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${1===s?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${0===s?"viewing mode":"view spatial reference"} to display edits.`}export{I as I3SOverrides};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as n,result as o}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateNumberMemory as u,estimateStringMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as g}from"../../../../core/promiseUtils.js";import p from"../../../../core/ReactiveSet.js";import{watch as y,sync as f}from"../../../../core/reactiveUtils.js";import{property as _,subclass as b}from"../../../../core/accessorSupport/decorators.js";import{equals as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as O}from"../../../../intl/number.js";import{getMaximumQuerySize as j,queryAllJSON as C}from"../../../../layers/support/featureQueryAll.js";let w=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=G,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new p,this._geometryChangedObjectIds=new p,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new F(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(y(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise)},f)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new I(e,()=>{t.remove(r)});return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await g(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:n}=t;if(null==n||null==i||0===this._attributeChangedObjectIds.size)return;const o=new Set;for(const d of n)o.add(d.index);for(const d of s)o.has(d.index)||(n.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:n},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:o,fieldNames:a}=s;if(0===o.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(o,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const n=new Set,o=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(n.add(r),o.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(n),fieldNames:Array.from(o)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:n}=s,o=[n,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=o,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:n},spatialReference:o}=this.view,a=1===n,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,L(i,o,this.view.viewingMode,0)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,L(i,o,this.view.viewingMode,0)),null;if(!(v(i,o)||a&&o.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,L(i,o,this.view.viewingMode,1)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:g,extractMesh:p}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:n}=e;if(null==t)continue;const o=g(s,t);for(const a of r){const e=p(a,n,i,s,o),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${O(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const o=j(e);t=[...t].sort((e,t)=>e-t);const a=s(t,o).map(t=>{const s=r.clone();return s.objectIds=t,n(C(e,s,{signal:i}))});return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const n=this._associatedLayer;if(null==n)return;const o=n.objectIdField,a=r.map(t=>(t in i||(i[t]=new Array(e.length)),i[t])),d=new Map(s.map(e=>[e.name,e.index])),c=r.map(e=>d.get(e)),h=new Map(Array.from(e,(e,t)=>[e,t]));for(const l of t){const e=l.attributes[o];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),n=l.attributes[r[t]];a[t][i]=n,this._cacheAttributeValue(e,s,n)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const n=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${n}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:n,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await o(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:x,signal:e}));if(!h.ok){const e=this.layer.title;c.getLogger(this).warn("extractChanges:unavailable",e,": could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.")}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],n=r?.updates??[],o=r?.deletes??[],d=[...i,...n,...o],c=a?[...i,...s??n,...o]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort((e,t)=>e-t);for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=Promise.withResolvers(),i=s.promise;for(const n of e)t.set(n,i);return d(()=>{for(const r of e)t.delete(r);s.resolve()})}get test(){}};e([_({constructOnly:!0})],w.prototype,"view",void 0),e([_({constructOnly:!0})],w.prototype,"layer",void 0),e([_({readOnly:!0})],w.prototype,"is3DOFL",null),e([_()],w.prototype,"_interactiveEditingSessions",void 0),e([_({readOnly:!0})],w.prototype,"sortedGeometryChangedObjectIds",null),e([_({readOnly:!0})],w.prototype,"geometryOverrides",void 0),e([_()],w.prototype,"_clientGeometryCache",void 0),e([_()],w.prototype,"_associatedLayer",null),e([_({constructOnly:!0})],w.prototype,"memoryController",void 0),e([_()],w.prototype,"_attributeChangedObjectIds",void 0),e([_()],w.prototype,"_geometryChangedObjectIds",void 0),e([_()],w.prototype,"hasGeometryChanges",null),e([_()],w.prototype,"_pendingFetchChangedObjectIds",void 0),e([_()],w.prototype,"_pendingFetchAbortController",void 0),e([_()],w.prototype,"_applyGeometryOverridesTask",void 0),e([_()],w.prototype,"updating",null),e([_()],w.prototype,"isEmpty",null),w=e([b("esri.views.3d.layers.i3s.I3SOverrides")],w);class I{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class F{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new A(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class A{constructor(e){this.value=e,this.usedMemory="string"==typeof e?m(e):u}}const x=1e4,G=5e4;function L(e,t,r,s){return`Displaying the edits of a SceneLayer with a${0===s?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${1===s?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${0===s?"viewing mode":"view spatial reference"} to display edits.`}export{w as I3SOverrides};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import t from"../../../../../core/PooledArray.js";import{isTypedArray as i}from"../../../../../core/typedArrayUtil.js";import{clone as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as r}from"../../../../../geometry/support/Indices.js";import{c as s}from"../../../../../chunks/vec3.js";import{c as a}from"../../../../../chunks/vec32.js";import{ComponentData as c}from"./ComponentData.js";import{defaultComponentParameters as l,ComponentDrawParametersImplementation as m}from"./ComponentDrawParameters.js";import{ComponentObject as h}from"./ComponentObject.js";import{IntersectionGeometry as p}from"./IntersectionGeometry.js";import{RenderableMeta as
|
|
2
|
+
import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import t from"../../../../../core/PooledArray.js";import{isTypedArray as i}from"../../../../../core/typedArrayUtil.js";import{clone as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as r}from"../../../../../geometry/support/Indices.js";import{c as s}from"../../../../../chunks/vec3.js";import{c as a}from"../../../../../chunks/vec32.js";import{ComponentData as c}from"./ComponentData.js";import{defaultComponentParameters as l,ComponentDrawParametersImplementation as m}from"./ComponentDrawParameters.js";import{ComponentObject as h}from"./ComponentObject.js";import{IntersectionGeometry as p}from"./IntersectionGeometry.js";import{RenderableMeta as g,Renderable as d}from"./Renderable.js";import{RenderGeometry as f}from"./RenderGeometry.js";import{RenderSubmitSystem as u}from"./RenderSubmitSystem.js";import{ComponentMaterialRepository as b}from"./Material/ComponentMaterialRepository.js";import{VertexArrayObject as v}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as _}from"../../lib/verticalOffsetUtils.js";import{BufferManager as y}from"../../lib/TextureBackedBuffer/BufferManager.js";import{getComponentDataLayout as C,IndexGlLayout as M}from"../../materials/DefaultLayouts.js";import{BufferObject as R}from"../../../../webgl/BufferObject.js";import{PrimitiveType as j}from"../../../../webgl/enums.js";import{VertexBuffer as w}from"../../../../webgl/VertexBuffer.js";const O=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class x{constructor(e,i,n){this._renderPassManager=e,this._viewingMode=i,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new t,this._hidden=new t,this._renderSubmit=new u(this),this._renderPassManager.register(this._renderSubmit);const{rctx:o,bind:r}=e;this._componentBufferManager=new y(o,C());const s=2===this._viewingMode?0:n?1:2;this.materialRepository=new b(r.hasFloatOit,s)}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e,t){const{geometry:i}=e,n=new c(this._componentBufferManager,r(i.componentOffsets)),o=this._createRenderable(e,t,n),s=new p(this._viewingMode,i.positions,n,e.elevationAlignable),a=new h(this,e.transform,e.obb.clone(),n,o,s);return(a.visible?this._visible:this._hidden).push(a),a}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._requestRender()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._requestRender())}preSubmit(e){const{camera:t}=e;this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}updateMaterial(e,t){e.updateMaterial(t)}getObjectOpacity(e){return e.renderable.drawParameters.opacity}updateObjectOpacity(e,t){const i=e;i.opacity!==t&&(i.updateOpacity(t),this._requestRender())}isSliceplaneEnabled(e){return e.renderable.material.slicePlaneEnabled}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._requestRender()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,{componentData:i}=t,n=i.visibility.componentCount;return{visible:n,invisible:i.count-n}}setComponentData(e,t){e.setComponentData(t,this._viewingMode),this._elevationRangeCacheVerticalOffset=NaN,this._requestRender()}getComponentAabb(e,t,i,n=!1){e.intersectionGeometry.getComponentAabb(t,i);const o=e,r=o.componentData.verticalOffsets;if(n||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=_(s);return a.localOrigin=o.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,n){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||n.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const o=e,{componentData:r}=o,s=r.count,{verticalOffsets:a}=r,{intersectionGeometry:c}=o,l=2===this._viewingMode,m=c.getComponentAabbs(),h=D;let p=1/0,g=-1/0;for(let d=0;d<s;d++){const e=6*d,r=a?.[d]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==r){const e=_(r);e.localOrigin=o.transform.position,e.applyToAabb(h)}const s=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),c=t+h[5]+i;n.expandElevationRangeValues(t+h[2],Math.sqrt(s*s+a*a+c*c)-i)}n.expandElevationRangeValues(s,c),p=Math.min(p,s),g=Math.max(g,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=p,this._elevationRangeCacheMax=g}intersect(e,t,i,n,o,r){const s=e,{transform:a,componentData:c,intersectionGeometry:l}=s;return null!=n&&(n.localOrigin=a.position),l.intersect(t,i,n,c.verticalOffsets,a,o,r)}addEdges(e,t,i,n,o){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,n,o)}async extractEdgeInformation(e,t,i){const o=e,r=o.componentData.visibility;if(r.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:c,positions:l}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),p=h.createBuffer(l.length/3);a(p.position.typedBuffer,l,p.position.typedBufferStride,3),s(p.position,p.position,o.transform.rotationScale),this._setComponentIndices(p.componentIndex,c,m);const g=p.count,d=this._computeVisibilityIndices(c,r,m,g);return{origin:n(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:d,indicesLength:d.length,skipDeduplicate:!0,data:p,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let n=0;for(let o=0;o<i.length-1;o++){const r=i[o],s=i[o+1];for(let i=r;i<s;i++){const o=t?t[i]:i;e.set(o,n)}n++}}_computeVisibilityIndices(e,t,n,o){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=n[t]-n[e],!0));const s=i(e)?2===e?.BYTES_PER_ELEMENT||o<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,i)=>{const o=n[t],r=n[i];for(let n=o;n<r;n++)s[a++]=e?e[n]:n;return!0}),s}addComponentHighlight(e,t,i){const n=e;{const e=this._activeHighlightOptions.get(i)??0;this._activeHighlightOptions.set(i,e+1)}n.addComponentHighlight(t,i)&&this._requestRender()}removeComponentHighlight(e,t,i){const n=e.removeComponentHighlight(t,i);"notfound"!==n&&(this._removeActiveHighlight(i),n&&this._requestRender())}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)O().warn(`Removing non-existing highlight "${e}".`);else{const n=i-t;n<0&&O().warn(`Removing non-existing highlight "${e}".`),n<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,n)}}clearHighlights(e){const t=e,{componentData:i}=t,{componentHighlights:n}=t.componentData;if(n.size>0){for(const e of n)this._removeActiveHighlight(e[0],e[1][i.count]);t.clearHighlights(),this._requestRender()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t,i){const n=this._renderPassManager.rctx,o=e.geometry,r=o.parameters.layout,{interleavedVertexData:s,indexData:a,vertexCount:c}=o.renderGeometryData,h=new w(n,r,s),p=a?R.createIndex(n,35044,a):null;let u=0;const b=[["geometry",h]];if(!t.isIntegratedMesh){const e=new Uint16Array(c);for(let n=0;n<i.count;n++){const t=i.offsets[n],o=i.offsets[n+1],r=i.materialDataIndices[n];if(null!=a)for(let i=t;i<o;i++){e[a[i]]=r}else for(let i=t;i<o;i++)e[i]=r}const t=new w(n,M,e.buffer);u+=t.usedMemory,b.push(["componentIndices",t])}const _=new v(n,new Map(b),p),y=new f(_,j.TRIANGLES,o.parameters,null!=p),C=this.materialRepository.acquireMaterial(t,y.parameters,l),O=new g(h.usedMemory+u+(p?.usedMemory??0)),x=new m(e,t);return new d(C,x,y,O)}_requestRender(){this._renderPassManager.requestRender()}}const D=o();export{x as ComponentObjectCollection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as r}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,t,r,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,r,i),this.materialPass=n(e,r),this._configuration=new s(i
|
|
2
|
+
import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as r}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,t,r,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,r,i),this.materialPass=n(e,r),this._configuration=new s(i),this._initializeMaterialConfiguration(e,t,r,i)}destroy(){}acquireTechnique(e,t,s,i){const o=this._updateConfiguration(t,s);return e.get(r,o,i.layout)}_initializeMaterialConfiguration(e,t,r,s){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=t.hasVertexColors,i.textureCoordinateType=t.textureCoordinateType,i.shadeNormals=t.shadeNormals,i.normalType=t.hasNormals?1:2,i.hasPolygonOffset=e.polygonOffsetEnabled,i.vertexPositionRotationType=t.vertexPositionRotationType,i.vertexNormalRotationType=t.vertexNormalRotationType,i.componentDataType=r.componentDataType,i.emissionSource=c(e,r,s)}_updateConfiguration(e,t){const r=this._configuration,{identifier:s,output:i}=e,a=0===s;r.output=i,r.hasEmission=t.hasEmission&&a,r.renderOccluded=10===t.slot,r.oitPass=a?t.oitPass:0,r.terrainDepthTest=a&&t.terrainDepthTest,r.cullAboveTerrain=!!a&&t.cullAboveTerrain;const n=this.isIntegratedMesh?d(t)?h(t)?3:2:1:0;r.integratedMeshMode=n,r.pbrMode=3===n?4:this.usePBR?this.hasParametersFromSource?0!==r.shadeNormals&&this.isIntegratedMesh?0:2:1:0,r.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,r.isGroundSlice=r.hasSlicePlane&&this.isGround;const{materialPass:l}=this;r.blendingEnabled=a&&(1===l||2===l&&e.transparent||4===l)||r.isGroundSlice,r.hasHighlightMixTexture=2===s&&null!=t.highlightMixTexture,r.snowCover=a&&t.snowCover>0,r.vertexDiscardMode=a&&2===l?e.transparent?2:1:0;const u=a&&o(i);return r.receiveAmbientOcclusion=u&&this.applySSAO&&!r.renderOccluded&&null!=t.ssao?.getTexture(),r.hasOccludees=u&&t.hasOccludees,r.receiveShadows=u&&t.shadowMap.ready,r.screenSpaceReflections=u&&null!=t.ssr.lastFrameColor,r.cloudReflections=u&&null!=t.clouds.data?.cubeMap?.colorTexture,r}}function n(e,t){const{alphaDiscardMode:r,isIntegratedMesh:s,slicePlaneEnabled:i}=e,{transparent:o,opaqueOverride:a}=t,n=e.opacity<1,l=e.baseColor[3]<1;if(s)return n||i?4:3;if(n)return 1;if(0===a)return 0;if(l||0===r||3===r)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(r){return null!=r.emissionTexture||!e(r.emissiveBaseColor,t)}function u(e,t,r){const s=l(e);return r.hasEmissionSupport&&2!==t.emissiveOverride&&(s||2!==t.emissiveSourceOverride)}function c(e,t,r){const s=null!=e.emissionTexture,{emissiveSourceOverride:i}=t,o=1===i,a=2===i,n=u(e,t,r),c=l(e);return n?c?a?s?4:2:o?s?5:7:6:o?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function d(e){return null!=e.overlay?.getTexture(1)}export{a as ComponentMaterial,c as calculateEmissionSource,u as calculateHasEmissions,l as calculateHasEmissiveBase,n as computeMaterialPass};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as t,calculateHasEmissions as r,calculateEmissionSource as a}from"./ComponentMaterial.js";class o{constructor(e,t){this._materialRepository=new Map
|
|
2
|
+
import has from"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as t,calculateHasEmissions as r,calculateEmissionSource as a}from"./ComponentMaterial.js";class o{constructor(e,t){this._materialRepository=new Map;const r=e||!has("disable-feature:oit8-emissive");this._globalMaterialParameters={hasFloatOit:e,hasEmissionSupport:r,sphericalSR:t}}acquireMaterial(t,r,a){const o=s(t,r,a,this._globalMaterialParameters),i=this._materialRepository.get(o);if(i)return i.count++,i.material.key,i.material;const l=new e(t,r,a,this._globalMaterialParameters,o);return this._materialRepository.set(o,{material:l,count:1}),l}releaseMaterial(e){const{key:t}=e,r=this._materialRepository.get(t);if(!r||r.count<1)throw new Error("Internal error in material repository");1===r.count?this._materialRepository.delete(t):r.count--}}function s(e,o,s,i){const l=t(e,s),n=r(e,s,i),u=a(e,s,i);return`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}|${+l}|${+s.componentDataType}|${+n}|${+u}|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}|${+e.cullFace}|${+e.alphaDiscardMode}|${+o.hasVertexColors}|${+o.textureCoordinateType}|${+o.shadeNormals}|${+o.hasNormals}|${+e.polygonOffsetEnabled}|${+o.vertexPositionRotationType}|${+o.vertexNormalRotationType}|`+ +(null!=e.baseColorTexture)+"|"+ +(null!=e.emissionTexture)+"|"+ +(null!=e.metallicRoughnessTexture)+"|"+ +(null!=e.occlusionTexture)+"|"+ +(null!=e.normalTexture)+"|"+ +s.emissiveOverride}export{o as ComponentMaterialRepository,s as makeMaterialKey};
|
package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isColorHighlightOrOLID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(t
|
|
2
|
+
import{__decorate as t}from"tslib";import{isColorHighlightOrOLID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(t){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=t.sphericalSR,this.hasFloatOit=t.hasFloatOit}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}t([o({count:10})],s.prototype,"output",void 0),t([o({count:3})],s.prototype,"textureCoordinateType",void 0),t([o({count:2})],s.prototype,"componentDataType",void 0),t([o({count:3})],s.prototype,"cullFace",void 0),t([o({count:3})],s.prototype,"vertexDiscardMode",void 0),t([o({count:3})],s.prototype,"doubleSidedMode",void 0),t([o({count:4})],s.prototype,"alphaDiscardMode",void 0),t([o({count:4})],s.prototype,"integratedMeshMode",void 0),t([o({count:3})],s.prototype,"oitPass",void 0),t([o({count:7})],s.prototype,"pbrMode",void 0),t([o({count:3})],s.prototype,"normalType",void 0),t([o({count:8})],s.prototype,"emissionSource",void 0),t([o({count:3})],s.prototype,"shadeNormals",void 0),t([o()],s.prototype,"hasEmission",void 0),t([o()],s.prototype,"hasVertexColors",void 0),t([o()],s.prototype,"hasSlicePlane",void 0),t([o()],s.prototype,"isGroundSlice",void 0),t([o()],s.prototype,"hasColorTexture",void 0),t([o()],s.prototype,"hasHighlightMixTexture",void 0),t([o()],s.prototype,"receiveAmbientOcclusion",void 0),t([o()],s.prototype,"receiveShadows",void 0),t([o()],s.prototype,"blendingEnabled",void 0),t([o()],s.prototype,"screenSpaceReflections",void 0),t([o()],s.prototype,"hasPolygonOffset",void 0),t([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),t([o()],s.prototype,"hasOcclusionTexture",void 0),t([o()],s.prototype,"hasNormalTexture",void 0),t([o()],s.prototype,"hasOccludees",void 0),t([o()],s.prototype,"terrainDepthTest",void 0),t([o()],s.prototype,"cullAboveTerrain",void 0),t([o()],s.prototype,"hasNormalTextureTransform",void 0),t([o()],s.prototype,"cloudReflections",void 0),t([o()],s.prototype,"snowCover",void 0),t([o()],s.prototype,"renderOccluded",void 0),t([o()],s.prototype,"sphereDepthInterpolate",void 0),t([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),t([o({count:2})],s.prototype,"vertexNormalRotationType",void 0);export{s as ComponentTechniqueConfiguration};
|