@arcgis/core 4.25.0-next.20220705 → 4.25.0-next.20220708
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/TimeExtent.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0703495557b0df6878c5.js +1 -0
- package/assets/esri/core/workers/chunks/1570676351a313f1841b.js +1 -0
- package/assets/esri/core/workers/chunks/{695f90305478f5024fa7.js → 1ecbf642debc2207b762.js} +1 -1
- package/assets/esri/core/workers/chunks/{30dbdf2aa1bc8e61cad4.js → 268e7b46202fc1decf9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47d78b4f7117554acecf.js → 357a27203f5d8fa152de.js} +1 -1
- package/assets/esri/core/workers/chunks/35dfba25a9077ab5dbaf.js +982 -0
- package/assets/esri/core/workers/chunks/377354a81e402edf3077.js +1 -0
- package/assets/esri/core/workers/chunks/3a42d96ea3b59d33bfe8.js +1 -0
- package/assets/esri/core/workers/chunks/3a61e4ab83183f5526a7.js +1 -0
- package/assets/esri/core/workers/chunks/{3790f0362b6f27ee798b.js → 3ee5e8d00cd3bc47a9fa.js} +1 -1
- package/assets/esri/core/workers/chunks/425d1fabc713a598139c.js +1 -0
- package/assets/esri/core/workers/chunks/425e16862feccb467191.js +1 -0
- package/assets/esri/core/workers/chunks/{bbe51b49fe7093e47306.js → 48c8ac9a22190c2b890c.js} +1 -1
- package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +1 -0
- package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +1 -0
- package/assets/esri/core/workers/chunks/{905130ff0118962c8140.js → 61b71b8e028eda10ccab.js} +1 -1
- package/assets/esri/core/workers/chunks/{b34cffd5c45d3a8134bc.js → 69f57ad2227e59b323e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{290899b47a52f8b28a9c.js → 791220164501a791b2cd.js} +1 -1
- package/assets/esri/core/workers/chunks/792b4b0a43b4bbbc14ab.js +1 -0
- package/assets/esri/core/workers/chunks/7b32b8e8ebe48ae0dae2.js +1 -0
- package/assets/esri/core/workers/chunks/7f00125b02bb7211de43.js +1 -0
- package/assets/esri/core/workers/chunks/81074accfce5f109f909.js +1 -0
- package/assets/esri/core/workers/chunks/{594d7fdb80ad9cdedb85.js → 823e25dbc70e71257b6e.js} +1 -1
- package/assets/esri/core/workers/chunks/92e43e05265dfc8173a0.js +1 -0
- package/assets/esri/core/workers/chunks/{40fa9b28ca882a70813a.js → 92f7415c2e40e320addc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9520b32d5d53ea9cd0d3.js → 9341e9e1fe0f6800aa44.js} +1 -1
- package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +1 -0
- package/assets/esri/core/workers/chunks/{910a2ffb4328f8ee7a0d.js → 95cb9cd08941c28ebd85.js} +1 -1
- package/assets/esri/core/workers/chunks/{97f32af5893c86f6444c.js → 9b9a40b84640f00a1dcb.js} +1 -1
- package/assets/esri/core/workers/chunks/{77c6ba5ea85915d9078c.js → ac07c732aca6e67232f8.js} +1 -1
- package/assets/esri/core/workers/chunks/ae8e87da97411cff3783.js +1 -0
- package/assets/esri/core/workers/chunks/{65161a874595b0a34aa1.js → b312dd3027492007d75e.js} +1 -1
- package/assets/esri/core/workers/chunks/{83c9da68d6dbc77f60e5.js → beead2b06c994b4e61af.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e20fd8b7c9497f2da1f.js → bfb08d3e2208c6178af9.js} +1 -1
- package/assets/esri/core/workers/chunks/{04e5486f0d8d4c6bd8a2.js → c3236a7058e64ea3b939.js} +1 -1
- package/assets/esri/core/workers/chunks/c4e9c71be6299c60c539.js +1 -0
- package/assets/esri/core/workers/chunks/c705f907ce60a646d9aa.js +1 -0
- package/assets/esri/core/workers/chunks/ce6abfafa0171b9c8d81.js +1 -0
- package/assets/esri/core/workers/chunks/{08a5c5a33a7c7c6852e5.js → d00b0f8236f1526099d4.js} +1 -1
- package/assets/esri/core/workers/chunks/d13951412a57e1af6208.js +1 -0
- package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +1 -0
- package/assets/esri/core/workers/chunks/f328a6cd4b7d8c653fc7.js +1 -0
- package/assets/esri/core/workers/chunks/f6a6178d4df029ff010d.js +1 -0
- package/assets/esri/core/workers/chunks/fde2301c6cd97a3cfb86.js +1 -0
- package/assets/esri/core/workers/chunks/fe84bcdfd9028b5e7ef6.js +1 -0
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +4 -0
- package/assets/esri/themes/base/widgets/_LayerList.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/CheckerBoard.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +9 -9
- package/chunks/ComponentShader.glsl.js +33 -33
- package/chunks/DefaultMaterial.glsl.js +35 -35
- package/chunks/HUDMaterial.glsl.js +11 -11
- package/chunks/ImageMaterial.glsl.js +5 -5
- package/chunks/LineMarker.glsl.js +17 -17
- package/chunks/NativeLine.glsl.js +3 -3
- package/chunks/Path.glsl.js +28 -28
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +4 -4
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/ShadedColorMaterial.glsl.js +1 -1
- package/chunks/SimpleAtmosphere.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +92 -92
- package/chunks/WaterSurface.glsl.js +22 -22
- package/chunks/common.js +1 -1
- package/chunks/mat2.js +1 -1
- package/chunks/mat2d.js +1 -1
- package/chunks/mat3.js +1 -1
- package/chunks/mat4.js +1 -1
- package/chunks/quat.js +1 -1
- package/chunks/quat2.js +1 -1
- package/chunks/vec2.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vec4.js +1 -1
- package/core/Message.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/libs/gl-matrix-2/math/common.js +1 -1
- package/core/libs/gl-matrix-2/math/vec2.js +1 -1
- package/core/pbf.js +1 -1
- package/core/quantity.js +0 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/identity/IdentityForm.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/identity/OAuthCredential.js +1 -1
- package/interfaces.d.ts +3347 -190
- package/intl/date.js +1 -1
- package/intl/duration.js +1 -1
- package/intl/messages.js +1 -1
- package/intl/substitute.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/ControlPointsGeoreference.d.ts +4 -0
- package/layers/support/ControlPointsGeoreference.js +5 -0
- package/layers/support/CornersGeoreference.js +1 -1
- package/layers/support/ElevationSamplerData.js +5 -0
- package/layers/support/ElevationTile.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/request.js +1 -1
- package/rest/route/utils.js +1 -1
- package/rest/serviceArea.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/ServiceAreaSolveResult.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/raster/renderers/uniqueValue.js +1 -1
- package/support/apiKeyUtils.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/navigation/actions/Pinch.js +1 -1
- package/views/2d/tiling/TileCache.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
- package/views/3d/environment/CloudsTechnique.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/StarsTechnique.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +5 -0
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainConst.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/tileUtils.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/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +55 -55
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BlurTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/EdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/TransparencyPassType.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingConstraint.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/support/viewUtils.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/support/geometry2dUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom/ZoomConditions3D.js +1 -1
- package/widgets/Zoom/ZoomViewModel.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/06a7f58260225f52f8e6.js +0 -1
- package/assets/esri/core/workers/chunks/0e00741d35cdbf48e72d.js +0 -1
- package/assets/esri/core/workers/chunks/1ebb29ceabc81509646c.js +0 -1
- package/assets/esri/core/workers/chunks/24f7a3df08c3a2d3795c.js +0 -1
- package/assets/esri/core/workers/chunks/39a754713a48d46618bd.js +0 -1
- package/assets/esri/core/workers/chunks/462163f31fa134b7b216.js +0 -1
- package/assets/esri/core/workers/chunks/4bfcb7350ca492767a45.js +0 -1
- package/assets/esri/core/workers/chunks/5470cb0c3f670957c22c.js +0 -1
- package/assets/esri/core/workers/chunks/6889d698a2c796ed1ce6.js +0 -1
- package/assets/esri/core/workers/chunks/869310ef4c98542bf9df.js +0 -1
- package/assets/esri/core/workers/chunks/8ebaad46e2fe8925e3b0.js +0 -1
- package/assets/esri/core/workers/chunks/98c519ac806cc55bc19b.js +0 -1
- package/assets/esri/core/workers/chunks/9d07969fbea13aa5b03c.js +0 -1
- package/assets/esri/core/workers/chunks/9e6ce879ec0da884b9b8.js +0 -1
- package/assets/esri/core/workers/chunks/abd1bd74ba571e39ab5a.js +0 -1
- package/assets/esri/core/workers/chunks/b26ea76e3f41b45756e0.js +0 -1
- package/assets/esri/core/workers/chunks/c2286d97539066c8549a.js +0 -1
- package/assets/esri/core/workers/chunks/c495a66978d67c7e17f3.js +0 -1
- package/assets/esri/core/workers/chunks/c7fa92daca3f6e91734e.js +0 -987
- package/assets/esri/core/workers/chunks/c9e890b4be9d01c13efe.js +0 -1
- package/assets/esri/core/workers/chunks/dda5ea7f8d35e257815c.js +0 -1
- package/assets/esri/core/workers/chunks/e153e89c8a15c2f036ef.js +0 -1
- package/assets/esri/core/workers/chunks/e201ffcca7321771ee20.js +0 -1
- package/assets/esri/core/workers/chunks/e5b5b93e707173a4c883.js +0 -1
- package/assets/esri/core/workers/chunks/f7d1f75b6aa3ef566d74.js +0 -1
- package/assets/esri/core/workers/chunks/fde9e9683335fa6c8236.js +0 -1
- package/core/queryUtils.js +0 -5
- package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +0 -5
- package/views/3d/layers/support/HeatmapFilterVisibility.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputOptions.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/HeaderComment.glsl.js +0 -10
- package/views/3d/webgl-engine/lib/RenderPass.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import"../../../../renderers/ClassBreaksRenderer.js";import"../../../../renderers/DictionaryRenderer.js";import"../../../../renderers/DotDensityRenderer.js";import"../../../../renderers/HeatmapRenderer.js";import"../../../../renderers/PieChartRenderer.js";import"../../../../renderers/Renderer.js";import"../../../../renderers/SimpleRenderer.js";import t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import"../../../../symbols.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Handles.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import n from"../../../../core/Logger.js";import{someMap as o,findInMap as l}from"../../../../core/MapUtils.js";import{isSome as h,unwrapOr as d,isNone as p,removeMaybe as c,destroyMaybe as y,get as m,unwrap as g}from"../../../../core/maybe.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as b,eachAlways as f,createDeferred as v,isAbortError as C}from"../../../../core/promiseUtils.js";import{watch as S,when as _,on as w,syncAndInitial as G,whenOnce as x}from"../../../../core/reactiveUtils.js";import{schedule as R}from"../../../../core/scheduling.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as D}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as E,isEmpty as I}from"../../../../core/accessorSupport/diffUtils.js";import{s as U,a as O,g as A}from"../../../../chunks/vec3.js";import{c as L}from"../../../../chunks/vec3f64.js";import{projectVectorToVector as j,projectXYZToVector as V,canProjectWithoutEngine as F,projectBuffer as T}from"../../../../geometry/projection.js";import{create as k,center as M,fromRect as W,equals as N}from"../../../../geometry/support/aaBoundingBox.js";import{create as z}from"../../../../geometry/support/aaBoundingRect.js";import{equals as B}from"../../../../geometry/support/spatialReferenceUtils.js";import q from"../../../../layers/Layer.js";import{getObjectId as H,computeAABB as Y,hasGeometry as $}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as Z}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as J,validateTo3D as Q}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as K}from"../../../../support/arcadeOnDemand.js";import{getDefaultSymbol3D as X}from"../../../../symbols/support/defaults3D.js";import{to3D as ee}from"../../../../symbols/support/symbolConversion.js";import{ViewElevationProvider as te}from"./ElevationQuery.js";import{VisibilityFlag as ie,VisibilityGroup as re}from"./enums.js";import{extractExpressionInfo as se,createContext as ae}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as ne}from"./Graphics3DFeatureStore.js";import oe from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as le}from"./Graphics3DSymbolCreationContext.js";import{make as he}from"./Graphics3DSymbolFactory.js";import de from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as pe}from"./GraphicStateTracking.js";import{computeCentroid as ce}from"./graphicUtils.js";import{ApplyRendererDiffResult as ye}from"./interfaces.js";import{LoadStatus as me}from"./Loadable.js";import{SpatialIndex2D as ge}from"./SpatialIndex2D.js";import{averageSymbolComplexities as ue,defaultSymbolComplexity as be}from"./symbolComplexity.js";import{StageLayerElevationProvider as fe}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as ve}from"../../support/extentUtils.js";import{PropertiesPool as Ce}from"../../support/PropertiesPool.js";import{UpdatePolicy as Se}from"../../webgl-engine/lib/basicInterfaces.js";import{GridLocalOriginFactory as _e}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{WebGLLayer as we}from"../../webgl-engine/lib/WebGLLayer.js";import{ImmediateTask as Ge,noBudget as xe,TaskPriority as Re}from"../../../support/Scheduler.js";import Pe from"../../../../geometry/Extent.js";import De from"../../../../geometry/Point.js";import Ee from"../../../../symbols/LabelSymbol3D.js";import Ie from"../../../../symbols/TextSymbol.js";import Ue from"../../../../symbols/WebStyleSymbol.js";var Oe;const Ae=L(),Le=k(),je="esri.views.3d.layers.graphics.Graphics3DCore",Ve=n.getLogger(je);let Fe=Oe=class extends i{constructor(e){super(e),this.propertiesPool=new Ce({computedExtent:Pe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new le(((e,t)=>this._frameTask.schedule(e,t))),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new s,this._frameTask=Ge,this.suspendSymbolCleanup=!1,this._viewSpatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this._loadingSymbols=0,this.pendingUpdatesPool=new u({allocator:e=>e||new ke,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=Se.SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ge({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 effectiveUpdatePolicy(){return h(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?Se.ASYNC:d(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){return!!(this.graphicsWaitingForSymbol.size>0||this.running||this.elevationAlignment?.updating||h(this.scaleVisibility)&&this.scaleVisibility.updating||h(this.filterVisibility)&&this.filterVisibility.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating||this._loadingSymbols>0)}get running(){return this.pendingUpdates.size>0||!!this._spatialIndex?.updating}get suspendedOrOutsideOfView(){return this.owner.suspended||this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return 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?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,r=e?e.graphics3D.maxTotalNumberOfPrimitives:0,s=this.averageSymbolComplexity,a=Math.max(1,h(s)?s.primitivesPerFeature:1),n=h(s)&&s.drawCallsPerFeature>0?i/s.drawCallsPerFeature*.3:i,o=Math.ceil(r/a),l=Math.max(t,Math.min(i,o,n)),d=this._get("displayFeatureLimit");return d&&d.minimumTotalNumberOfFeatures===t&&d.maximumTotalNumberOfFeatures===i&&d.maximumTotalNumberOfPrimitives===r&&d.averageSymbolComplexity===s&&d.maximumNumberOfFeatures===l?d:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:r,averageSymbolComplexity:s,maximumNumberOfFeatures:l}}get averageSymbolComplexity(){const e=ue(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||h(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get usedMemory(){const e=h(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(h(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(h(t))return t;const i=ee(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return p(r)&&i.error&&Ve.error(i.error.message),this.symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(p(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);h(s)&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);h(e)&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(p(e))return null;const t=this.symbols.get(e.id);if(h(t))return t.complexity;const i=this._getConvertedSymbol(e);return h(i)?be(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach((t=>{h(t)&&e.push(t.complexity)})),e}initialize(){this._viewSpatialReference=this.owner.view.spatialReference,this._set("featureStore",new ne({objectIdField:this.owner.layer&&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),toArray:()=>Array.from(this.graphics3DGraphics.values())}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new te(this._viewSpatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),h(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new _e(i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=se(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await ae(r,this._viewSpatialReference,Ve),b(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=i.basemapTerrain.overlayManager.registerGeometryDrapeSource(e),this._handles.add(a((()=>i.basemapTerrain.overlayManager.unregisterDrapeSource(e))))}this._handles.add([S((()=>this.suspendedOrOutsideOfView),(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),S((()=>[this.layer?.screenSizePerspectiveEnabled,this.owner.view.screenSizePerspectiveEnabled]),(()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this.labeler?.reset(),this.recreateAllGraphicsAndSymbols())})),S((()=>this.owner.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(!!e))),S((()=>this.owner.view.state?.pixelRatio),(()=>this._pixelRatioChange())),S((()=>this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled),(e=>this._physicalBasedRenderingChange(e))),_((()=>i.basemapTerrain?.tilingScheme),(e=>{if(!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&h(i.basemapTerrain.spatialReference)&&(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this._handles.add([w(e,"change",(e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}),{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}}),{initial:!0}),S((()=>this.effectiveUpdatePolicy),(e=>{h(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===Se.ASYNC,e===Se.SYNC&&this.runTask(xe)}),G)]),this._frameTask=i.resourceController.scheduler.registerTask(Re.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this._handles.add(S((()=>this.layer.featureReduction),(()=>this.deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}b(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=c(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=y(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=y(this._handles),this._frameTask.remove(),this._frameTask=Ge,this._viewSpatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=c(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=y(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=y(this._spatialIndex),this._set("featureStore",y(this.featureStore))}clear(){this.objectStates?.allGraphicsDeleted(),h(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(y),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new we({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",(e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid))),i.on("objectGeometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("objectGeometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("vertexAttrsUpdated",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)))}notifyGraphicGeometryChanged(e){if(p(this.graphicStateTracking)||p(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(p(this.graphicStateTracking)||p(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Me,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return H(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);h(s)&&t.set(s,i)})),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await f([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return o(this.symbols,((i,r)=>{if(h(i)){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this.graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);h(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return l(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(p(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(p(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag(ie.USER_SETTING,r,re.GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=v();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)=>T(e,r,t,e,i,t,s),n=(e,t,r)=>T(e,s,t,e,i,t,r),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:h(t)&&t.useViewElevation,minDemResolution:h(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,m(t,"signal"));if(!l)return null;const p=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){M(p,Ae);const t=d(e.getElevation(Ae[0],Ae[1],0,i,"ground"),0);p[2]=Math.min(p[2],t),p[5]=Math.max(p[5],t)}}return{boundingBox:p,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await x((()=>this.owner?.loadedGraphics));const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find((t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;U(We,0,0,0);let s=0;if(r.render.num>0){if(!j(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,Ne,t))return null;O(We,We,Ne),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=d(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(U(Ne,e,i,a),!j(Ne,this.viewElevationProvider.spatialReference,Ne,t))return null;O(We,We,Ne),s++}return s>1&&A(We,We,1/s),new De({x:We[0],y:We[1],z:We[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(p(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(!p(i)||!p(this.graphicsWithoutSymbol.get(t)))switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":break;case"transform":this._graphicUpdateTransformHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(p(i))return void this._recreateGraphic(t.graphic);if(p(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(h(t)&&t.loadStatus===me.LOADING)return}return void this._recreateGraphic(t.graphic)}const r=e.graphics3DSymbol;!p(t.newValue)&&r.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=h(e)?e.graphics3DSymbol:h(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(p(r)||p(t.newValue))return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(h(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=E(s,a);if(p(o))return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!I(l.diff))return void this._recreateGraphic(i);const d=this._getRenderingInfo(i);if(p(d))return void this._recreateGraphic(i);const c=r.extentPadding;for(const h of l.symbolStatePatches)h();if(c!==r.extentPadding&&this._recomputeExtentPadding(),h(e))for(const h of l.graphics3DGraphicPatches)h(e,d);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}_graphicUpdateTransformHandler(e,t){}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===Se.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach((t=>{h(t)&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Le,i=e.spatialReference;Y(e,t);const r=this._viewSpatialReference,s=Oe.tmpVec;if(B(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&&(!a||null==a.zmin||t[2]<a.zmin),h=o&&(!a||null==a.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const e=new AbortController;this.elevationInfoChangeAbortController=e;const t=se(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await ae(t,this._viewSpatialReference,Ve),b(e),this.elevationInfoChangeAbortController=null,this.labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelGraphics;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),this.elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new fe({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),h(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.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{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.graphicsBySymbol.set(e,new Map));const r=this.symbols.get(e);y(r),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){this.graphicsDrapedUids.delete(t),this.objectStates?.removeGraphic(e),this.labeler?.removeGraphic(e),this.deconflictor?.removeGraphic(e),h(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===Se.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ve.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===Se.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(h(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return Se.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ve),Se.SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==Te.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===Se.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===Te.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&Ve.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&this._spatialIndex?.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===Te.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==Te.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=Se.SYNC),i.add)switch(i.state){case Te.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this.pendingAdds--,e.madeProgress();break;case Te.REJECTED:i.add=null,this.pendingAdds--;case Te.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=Te.READY);const t=e.add.geometry;h(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=Te.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,C(t)?e.state=Te.NEW:e.state=Te.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(p(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ve),void(e.state=Te.READY);e.state=Te.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(C(i)?e.state=Te.NEW:e.state=Te.REJECTED)}p(t)||p(t.symbol)?(Ve&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=Te.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),p(t)||p(t.symbol)||!$(e))return;const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(p(s))return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new oe(e,t,this.layer);let o=!1;const l=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(l);const d=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(l);if(this.graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&h(t)&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()},c=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),o||(C(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};++this._loadingSymbols,i===Se.ASYNC?s.load((()=>this._frameTask.schedule(d)),(e=>this._frameTask.schedule((()=>c(e))))):s.load(d,c)}_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")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Ee||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 Ee&&!this._hasLabelingContext(e))||(Ve.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(p(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!F(i.spatialReference,this._viewSpatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&h(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Z(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||h(this.currentRenderer)))s=this.owner.getRenderingInfo(r,this.currentRenderer,g(this.arcadeOnDemand));else{s={symbol:r.symbol||X(r.geometry)}}return p(s)||p(s.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){const i=e.geometry;if(p(i))return Ve&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&h(e.symbol))return Ve&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Z(e,this.layer):e;return this.owner.getRenderingInfoAsync(r,g(this.currentRenderer),g(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(h(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=ee(t.backgroundFillSymbol,{ignoreDrivers:!0});h(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=he(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof Ue?new de(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),h(i)&&++i.referenced,i}trackGraphicState(e){return p(this.graphicStateTracking)&&(this.graphicStateTracking=new pe(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 i=t.graphic;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(p(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);r.isDraped&&this.graphicsDrapedUids.add(i.uid),r.centroid=null,h(i.geometry)&&"point"!==i.geometry.type&&(r.centroid=ce(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),h(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(r),h(this.filterVisibility)&&this.filterVisibility.updateVisibility(r),this.deconflictor?.addGraphic(r),this.labeler?.addGraphic(r),this.objectStates?.addGraphic(r),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,r),r.initialize(this.stage,this.stageLayer,this.owner),h(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(r);const a=this.whenGraphics3DGraphicRequests[i.uid];return a&&(delete this.whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),r}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),p(e)&&this._currentRendererChange(null,!1),J(e))if(h(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();b(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),b(t)),this.effectiveUpdatePolicy===Se.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,!0)),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===Se.ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return p(this.arcadeOnDemand)?(this.arcadeOnDemand=await K(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=g(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),p(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=E(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,p(r)||("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this.graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof q?this.layer:null,h=g(this.arcadeOnDemand);if(s===i.defaultSymbol&&i.getSymbol(Z(o,l),{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&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,s=e.diff.uniqueValueInfos;if(r||s){const a=s?s.added.map((e=>e.symbol)):[],n=s?s.removed.map((e=>e.symbol)):[];if(s)for(let e=0;e<s.changed.length;e++)a.push(s.changed[e].newValue.symbol),n.push(s.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&a.push(t.defaultSymbol)):i.defaultSymbol&&a.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(a,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||h(e)&&"partial"!==e.type)return[];const r=e=>h(e)?e.id:null,s=e&&e.diff,a=s&&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=h(t)&&t?"string"==typeof t?t:t.id:null;if(!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),h(s))){const e="string"==typeof t?null:t;h(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,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this.graphicsBySymbol){const r=this.symbols.get(t);if(h(r))switch(r.applyRendererDiff(e,i)){case ye.Recreate_Symbol:this._recreateSymbol(t);break;case ye.Recreate_Graphics:this._recreateGraphicsForSymbol(t);case ye.Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=R((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=z();return ve(e,r,t)?this.symbolCreationContext.clippingExtent=W(k(),r):this.symbolCreationContext.clippingExtent=null,!N(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(p(i))return;e(i,this.graphicsBySymbol.get(t)||ze,t)}}updateAllGraphicsVisibility(){h(this.filterVisibility)&&(this.filterVisibility.dirty=!0),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=h(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i}))}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(ie.USER_SETTING,!1,re.GRAPHIC)))}_validateRenderer(e){const t=Q(e);if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ve.warn(e,t.message)}}_volatileGraphicsUpdated(){this.labeler?.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach(((t,i)=>{if(p(t)||t.referenced>0)return;const r=this.graphicsBySymbol.get(i);r&&0!==r.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),y(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var Te;Fe.tmpVec=L(),e([P({readOnly:!0})],Fe.prototype,"computedExtent",void 0),e([P()],Fe.prototype,"currentRenderer",void 0),e([P()],Fe.prototype,"rendererHasGeometryOperations",void 0),e([P()],Fe.prototype,"_frameTask",void 0),e([P()],Fe.prototype,"rendererChangeAbortController",void 0),e([P()],Fe.prototype,"elevationInfoChangeAbortController",void 0),e([P()],Fe.prototype,"setupAbortController",void 0),e([P({readOnly:!0})],Fe.prototype,"elevationAlignment",void 0),e([P({readOnly:!0})],Fe.prototype,"scaleVisibility",void 0),e([P({readOnly:!0})],Fe.prototype,"filterVisibility",void 0),e([P()],Fe.prototype,"_spatialIndex",void 0),e([P({readOnly:!0})],Fe.prototype,"extentPadding",void 0),e([P()],Fe.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([P({readOnly:!0})],Fe.prototype,"featureStore",void 0),e([P({readOnly:!0})],Fe.prototype,"deconflictor",void 0),e([P({readOnly:!0})],Fe.prototype,"labeler",void 0),e([P({readOnly:!0})],Fe.prototype,"objectStates",void 0),e([P()],Fe.prototype,"_loadingSymbols",void 0),e([P()],Fe.prototype,"preferredUpdatePolicy",void 0),e([P()],Fe.prototype,"forcedUpdatePolicy",void 0),e([P({readOnly:!0})],Fe.prototype,"effectiveUpdatePolicy",null),e([P({constructOnly:!0})],Fe.prototype,"elevationFeatureExpressionEnabled",void 0),e([P({constructOnly:!0})],Fe.prototype,"owner",void 0),e([P({constructOnly:!0})],Fe.prototype,"layer",void 0),e([P({constructOnly:!0})],Fe.prototype,"graphicSymbolSupported",void 0),e([P({constructOnly:!0})],Fe.prototype,"getRenderingInfoWithoutRenderer",void 0),e([P({readOnly:!0})],Fe.prototype,"updating",null),e([P({readOnly:!0})],Fe.prototype,"running",null),e([P({readOnly:!0})],Fe.prototype,"suspendedOrOutsideOfView",null),e([P({readOnly:!0,dependsOn:[]})],Fe.prototype,"updatingRemaining",null),e([P({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Fe.prototype,"displayFeatureLimit",null),e([P({readOnly:!0,dependsOn:[]})],Fe.prototype,"averageSymbolComplexity",null),e([P({constructOnly:!0})],Fe.prototype,"hasZ",void 0),e([P({constructOnly:!0})],Fe.prototype,"hasM",void 0),Fe=Oe=e([D(je)],Fe),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(Te||(Te={}));class ke{constructor(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.abortController=null,this.remove=null}}const Me=10,We=L(),Ne=L(),ze=new Map;export{Fe as Graphics3DCore};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import"../../../../renderers/ClassBreaksRenderer.js";import"../../../../renderers/DictionaryRenderer.js";import"../../../../renderers/DotDensityRenderer.js";import"../../../../renderers/HeatmapRenderer.js";import"../../../../renderers/PieChartRenderer.js";import"../../../../renderers/Renderer.js";import"../../../../renderers/SimpleRenderer.js";import t from"../../../../renderers/UniqueValueRenderer.js";import"../../../../renderers/support/jsonUtils.js";import"../../../../symbols.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Handles.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import n from"../../../../core/Logger.js";import{someMap as o,findInMap as l}from"../../../../core/MapUtils.js";import{isSome as h,unwrapOr as d,isNone as p,removeMaybe as c,destroyMaybe as y,get as m,unwrap as g}from"../../../../core/maybe.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as b,eachAlways as f,createDeferred as v,isAbortError as C}from"../../../../core/promiseUtils.js";import{watch as S,when as _,on as w,syncAndInitial as G,whenOnce as x}from"../../../../core/reactiveUtils.js";import{schedule as R}from"../../../../core/scheduling.js";import{property as P}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as D}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as E,isEmpty as I}from"../../../../core/accessorSupport/diffUtils.js";import{s as U,a as O,g as A}from"../../../../chunks/vec3.js";import{c as j}from"../../../../chunks/vec3f64.js";import{projectVectorToVector as L,projectXYZToVector as V,canProjectWithoutEngine as F,projectBuffer as T}from"../../../../geometry/projection.js";import{create as k,center as M,fromRect as W,equals as N}from"../../../../geometry/support/aaBoundingBox.js";import{create as z}from"../../../../geometry/support/aaBoundingRect.js";import{equals as B}from"../../../../geometry/support/spatialReferenceUtils.js";import q from"../../../../layers/Layer.js";import{getObjectId as H,computeAABB as Y,hasGeometry as $}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as Z}from"../../../../layers/graphics/hydratedFeatures.js";import{isSupportedRenderer3D as J,validateTo3D as Q}from"../../../../renderers/support/rendererConversion.js";import{loadArcade as K}from"../../../../support/arcadeOnDemand.js";import{getDefaultSymbol3D as X}from"../../../../symbols/support/defaults3D.js";import{to3D as ee}from"../../../../symbols/support/symbolConversion.js";import{ViewElevationProvider as te}from"./ElevationQuery.js";import{VisibilityFlag as ie,VisibilityGroup as re}from"./enums.js";import{extractExpressionInfo as se,createContext as ae}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as ne}from"./Graphics3DFeatureStore.js";import oe from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as le}from"./Graphics3DSymbolCreationContext.js";import{make as he}from"./Graphics3DSymbolFactory.js";import de from"./Graphics3DWebStyleSymbol.js";import{GraphicStateTracking as pe}from"./GraphicStateTracking.js";import{computeCentroid as ce}from"./graphicUtils.js";import{ApplyRendererDiffResult as ye}from"./interfaces.js";import{LoadStatus as me}from"./Loadable.js";import{SpatialIndex2D as ge}from"./SpatialIndex2D.js";import{averageSymbolComplexities as ue,defaultSymbolComplexity as be}from"./symbolComplexity.js";import{StageLayerElevationProvider as fe}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as ve}from"../../support/extentUtils.js";import{PropertiesPool as Ce}from"../../support/PropertiesPool.js";import{UpdatePolicy as Se}from"../../webgl-engine/lib/basicInterfaces.js";import{GridLocalOriginFactory as _e}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{WebGLLayer as we}from"../../webgl-engine/lib/WebGLLayer.js";import{ImmediateTask as Ge,noBudget as xe,TaskPriority as Re}from"../../../support/Scheduler.js";import Pe from"../../../../geometry/Extent.js";import De from"../../../../geometry/Point.js";import Ee from"../../../../symbols/LabelSymbol3D.js";import Ie from"../../../../symbols/TextSymbol.js";import Ue from"../../../../symbols/WebStyleSymbol.js";var Oe;const Ae=j(),je=k(),Le="esri.views.3d.layers.graphics.Graphics3DCore",Ve=n.getLogger(Le);let Fe=Oe=class extends i{constructor(e){super(e),this.propertiesPool=new Ce({computedExtent:Pe},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new le(((e,t)=>this._frameTask.schedule(e,t))),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new s,this._frameTask=Ge,this.suspendSymbolCleanup=!1,this._viewSpatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this.filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this._loadingSymbols=0,this.pendingUpdatesPool=new u({allocator:e=>e||new ke,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=Se.SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ge({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 effectiveUpdatePolicy(){return h(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?Se.ASYNC:d(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){return!!(this.graphicsWaitingForSymbol.size>0||this.running||this.elevationAlignment?.updating||h(this.scaleVisibility)&&this.scaleVisibility.updating||h(this.filterVisibility)&&this.filterVisibility.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating||this._loadingSymbols>0)}get running(){return this.pendingUpdates.size>0||!!this._spatialIndex?.updating}get suspendedOrOutsideOfView(){return this.owner.suspended||this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return 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?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,r=e?e.graphics3D.maxTotalNumberOfPrimitives:0,s=this.averageSymbolComplexity,a=Math.max(1,h(s)?s.primitivesPerFeature:1),n=h(s)&&s.drawCallsPerFeature>0?i/s.drawCallsPerFeature*.3:i,o=Math.ceil(r/a),l=Math.max(t,Math.min(i,o,n)),d=this._get("displayFeatureLimit");return d&&d.minimumTotalNumberOfFeatures===t&&d.maximumTotalNumberOfFeatures===i&&d.maximumTotalNumberOfPrimitives===r&&d.averageSymbolComplexity===s&&d.maximumNumberOfFeatures===l?d:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:r,averageSymbolComplexity:s,maximumNumberOfFeatures:l}}get averageSymbolComplexity(){const e=ue(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||h(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get usedMemory(){const e=h(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(h(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(h(t))return t;const i=ee(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),r=i.symbol||null;return p(r)&&i.error&&Ve.error(i.error.message),this.symbolConversionCache.set(e.id,r),r}_getSymbolComplexitiesUsedOrRenderer(e){if(p(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);h(s)&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);h(e)&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(p(e))return null;const t=this.symbols.get(e.id);if(h(t))return t.complexity;const i=this._getConvertedSymbol(e);return h(i)?be(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach((t=>{h(t)&&e.push(t.complexity)})),e}get _objectIdField(){return this.layer.objectIdField}initialize(){this._viewSpatialReference=this.owner.view.spatialReference,this._set("featureStore",new ne({objectIdField:this.owner.layer&&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),toArray:()=>Array.from(this.graphics3DGraphics.values())}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new te(this._viewSpatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),h(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new _e(i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=se(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await ae(r,this._viewSpatialReference,Ve),b(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=i.basemapTerrain.overlayManager.registerGeometryDrapeSource(e),this._handles.add(a((()=>i.basemapTerrain.overlayManager.unregisterDrapeSource(e))))}this._handles.add([S((()=>this.suspendedOrOutsideOfView),(()=>this._frameTask.reschedule((()=>this._updateLayerVisibility())))),S((()=>[this.layer?.screenSizePerspectiveEnabled,this.owner.view.screenSizePerspectiveEnabled]),(()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this.labeler?.reset(),this.recreateAllGraphicsAndSymbols())})),S((()=>this.owner.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(!!e))),S((()=>this.owner.view.state?.pixelRatio),(()=>this._pixelRatioChange())),S((()=>this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled),(e=>this._physicalBasedRenderingChange(e))),_((()=>i.basemapTerrain?.tilingScheme),(e=>{if(!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&h(i.basemapTerrain.spatialReference)&&(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this._handles.add([w(e,"change",(e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}),{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}}),{initial:!0}),S((()=>this.effectiveUpdatePolicy),(e=>{h(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===Se.ASYNC,e===Se.SYNC&&this.runTask(xe)}),G)]),this._frameTask=i.resourceController.scheduler.registerTask(Re.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this._handles.add(S((()=>this.layer.featureReduction),(()=>this.deconflictor.featureReductionChange()))),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}b(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=c(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=y(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=y(this._handles),this._frameTask.remove(),this._frameTask=Ge,this._viewSpatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=c(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=y(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=y(this._spatialIndex),this._set("featureStore",y(this.featureStore))}clear(){this.objectStates?.allGraphicsDeleted(),h(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(y),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new we({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",(e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid))),i.on("visibilityChanged",(e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid))),i.on("objectGeometryAdded",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("objectGeometryRemoved",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))),i.on("vertexAttrsUpdated",(e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)))}notifyGraphicGeometryChanged(e){if(p(this.graphicStateTracking)||p(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(p(this.graphicStateTracking)||p(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Me,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return H(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach((i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);h(s)&&t.set(s,i)})),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await f([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return o(this.symbols,((i,r)=>{if(h(i)){const s=i.getFastUpdateStatus();if(s.loading>0)return!0;this.graphicsBySymbol.has(r)&&(t+=s.fast,e+=s.slow)}return!1}))?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);h(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return l(this.graphics3DGraphics,(t=>this._getGraphicObjectID(t.graphic)===e))}_updateUserVisibility(e){if(p(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&(p(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag(ie.USER_SETTING,r,re.GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=v();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)=>T(e,r,t,e,i,t,s),n=(e,t,r)=>T(e,s,t,e,i,t,r),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:h(t)&&t.useViewElevation,minDemResolution:h(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,m(t,"signal"));if(!l)return null;const p=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){M(p,Ae);const t=d(e.getElevation(Ae[0],Ae[1],0,i,"ground"),0);p[2]=Math.min(p[2],t),p[5]=Math.max(p[5],t)}}return{boundingBox:p,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await x((()=>this.owner?.loadedGraphics));const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find((t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]));if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;U(We,0,0,0);let s=0;if(r.render.num>0){if(!L(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,Ne,t))return null;O(We,We,Ne),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=d(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(U(Ne,e,i,a),!L(Ne,this.viewElevationProvider.spatialReference,Ne,t))return null;O(We,We,Ne),s++}return s>1&&A(We,We,1/s),new De({x:We[0],y:We[1],z:We[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(p(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(!p(i)||!p(this.graphicsWithoutSymbol.get(t)))switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":break;case"transform":this._graphicUpdateTransformHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(p(i))return void this._recreateGraphic(t.graphic);if(p(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(h(t)&&t.loadStatus===me.LOADING)return}return void this._recreateGraphic(t.graphic)}const r=e.graphics3DSymbol;!p(t.newValue)&&r.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=h(e)?e.graphics3DSymbol:h(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(p(r)||p(t.newValue))return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(h(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=E(s,a);if(p(o))return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!I(l.diff))return void this._recreateGraphic(i);const d=this._getRenderingInfo(i);if(p(d))return void this._recreateGraphic(i);const c=r.extentPadding;for(const h of l.symbolStatePatches)h();if(c!==r.extentPadding&&this._recomputeExtentPadding(),h(e))for(const h of l.graphics3DGraphicPatches)h(e,d);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}_graphicUpdateTransformHandler(e,t){}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===Se.SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach((t=>{h(t)&&(e=Math.max(e,t.extentPadding))})),this._set("extentPadding",e)}_expandComputedExtent(e){const t=je,i=e.spatialReference;Y(e,t);const r=this._viewSpatialReference,s=Oe.tmpVec;if(B(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&&(!a||null==a.zmin||t[2]<a.zmin),h=o&&(!a||null==a.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const e=new AbortController;this.elevationInfoChangeAbortController=e;const t=se(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await ae(t,this._viewSpatialReference,Ve),b(e),this.elevationInfoChangeAbortController=null,this.labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach((e=>{const t=e.graphic,i=e.labelGraphics;for(const r of i){r.graphics3DSymbolLayer.updateGraphicElevationContext(t,r)}})):this._recreateSymbol(i)})),this.updateStageLayerElevationProvider(),this.elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new fe({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),h(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.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach(((e,t)=>{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.graphicsBySymbol.set(e,new Map));const r=this.symbols.get(e);y(r),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach((t=>e.push(t.graphic))),this.recreateGraphics(e)}}_conditionalRemove(e,t){this.graphicsDrapedUids.delete(t),this.objectStates?.removeGraphic(e),this.labeler?.removeGraphic(e),this.deconflictor?.removeGraphic(e),h(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===Se.ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):Ve.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===Se.SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(h(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return Se.ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,Ve),Se.SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==Te.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===Se.ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===Te.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&Ve.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&this._spatialIndex?.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===Te.NEW&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==Te.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=Se.SYNC),i.add)switch(i.state){case Te.READY:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this.pendingAdds--,e.madeProgress();break;case Te.REJECTED:i.add=null,this.pendingAdds--;case Te.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=Te.READY);const t=e.add.geometry;h(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=Te.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,C(t)?e.state=Te.NEW:e.state=Te.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(p(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,Ve),void(e.state=Te.READY);e.state=Te.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(C(i)?e.state=Te.NEW:e.state=Te.REJECTED)}p(t)||p(t.symbol)?(Ve&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=Te.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),p(t)||p(t.symbol)||!$(e))return;const r=t.symbol,s=this.getOrCreateGraphics3DSymbol(r,t.renderer);if(p(s))return;this._expandComputedExtent(e.geometry);const a=this._beginGraphicUpdate(e),n=new oe(e,t,this.layer);let o=!1;const l=e=>{e===s.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(l);const d=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(l);if(this.graphicsWaitingForSymbol.get(e.uid)!==a||o||s.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==s.symbol.id)--s.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(s,n);this._spatialIndex&&h(t)&&this._spatialIndex.add(t),--s.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()},c=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),o||(C(t)?this.add([e]):s.destroyed||this._endGraphicUpdate(e)))};++this._loadingSymbols,i===Se.ASYNC?s.load((()=>this._frameTask.schedule(d)),(e=>this._frameTask.schedule((()=>c(e))))):s.load(d,c)}_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")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof Ee||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 Ee&&!this._hasLabelingContext(e))||(Ve.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(p(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!F(i.spatialReference,this._viewSpatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&h(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Z(e,this.layer):e;let s;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||h(this.currentRenderer)))s=this.owner.getRenderingInfo(r,this.currentRenderer,g(this.arcadeOnDemand));else{s={symbol:r.symbol||X(r.geometry)}}return p(s)||p(s.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):s}_getRenderingInfoAsync(e,t){const i=e.geometry;if(p(i))return Ve&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&h(e.symbol))return Ve&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,Ve.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?Z(e,this.layer):e;return this.owner.getRenderingInfoAsync(r,g(this.currentRenderer),g(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(h(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=ee(t.backgroundFillSymbol,{ignoreDrivers:!0});h(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(r=e.symbol.symbolLayers)}const s=he(i,this.symbolCreationContext,r);return s.load((()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")}),(()=>{})),s}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof Ue?new de(e,(e=>this._frameTask.schedule(e)),(e=>this._createGraphics3DSymbol(e,t))):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),h(i)&&++i.referenced,i}trackGraphicState(e){return p(this.graphicStateTracking)&&(this.graphicStateTracking=new pe(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 i=t.graphic;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(p(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,h(i.geometry)&&"point"!==i.geometry.type&&(r.centroid=ce(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),h(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(r),h(this.filterVisibility)){const{defaultVisibility:e}=this.filterVisibility;r.setVisibilityFlag(ie.FILTER,e,re.GRAPHIC),e||this.filterVisibility.reapply()}this.deconflictor?.addGraphic(r),this.labeler?.addGraphic(r),this.objectStates?.addGraphic(r),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,r),r.initialize(this.stage,this.stageLayer,this.owner),h(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(r);const a=this.whenGraphics3DGraphicRequests[i.uid];return a&&(delete this.whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),r}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),p(e)&&this._currentRendererChange(null,!1),J(e))if(h(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();b(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),b(t)),this.effectiveUpdatePolicy===Se.ASYNC?await this._frameTask.schedule((()=>this._currentRendererChange(e,!0)),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===Se.ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule((()=>this._currentRendererChange(e,!1)),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return p(this.arcadeOnDemand)?(this.arcadeOnDemand=await K(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=g(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),p(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=E(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,p(r)||("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this.graphicsBySymbol.get(s.id);t&&t.forEach(((a,n)=>{const o=a.graphic,l=this.layer instanceof q?this.layer:null,h=g(this.arcadeOnDemand);if(s===i.defaultSymbol&&i.getSymbol(Z(o,l),{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&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const r=e.diff.defaultSymbol,s=e.diff.uniqueValueInfos;if(r||s){const a=s?s.added.map((e=>e.symbol)):[],n=s?s.removed.map((e=>e.symbol)):[];if(s)for(let e=0;e<s.changed.length;e++)a.push(s.changed[e].newValue.symbol),n.push(s.changed[e].oldValue.symbol);return r?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&a.push(t.defaultSymbol)):i.defaultSymbol&&a.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(a,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||h(e)&&"partial"!==e.type)return[];const r=e=>h(e)?e.id:null,s=e&&e.diff,a=s&&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=h(t)&&t?"string"==typeof t?t:t.id:null;if(!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),h(s))){const e="string"==typeof t?null:t;h(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,i,r){if(this._diffHasSymbolChange(e))return!1;if(i instanceof t&&r instanceof t&&this._applyUniqueValueRendererDiff(e,i,r)&&0===Object.keys(e.diff).length)return!0;for(const[t]of this.graphicsBySymbol){const r=this.symbols.get(t);if(h(r))switch(r.applyRendererDiff(e,i)){case ye.Recreate_Symbol:this._recreateSymbol(t);break;case ye.Recreate_Graphics:this._recreateGraphicsForSymbol(t);case ye.Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("opacity",t))),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol(((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t))),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})))}_pixelRatioChange(){this.forEachGraphics3DSymbol(((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)}))}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=R((()=>{this._updatingPendingLoadedGraphicsChange=null}))}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=z();return ve(e,r,t)?this.symbolCreationContext.clippingExtent=W(k(),r):this.symbolCreationContext.clippingExtent=null,!N(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach((i=>{e(i)&&(t=!0)})),t&&(this.owner.view.labeler?.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(p(i))return;e(i,this.graphicsBySymbol.get(t)||ze,t)}}updateAllGraphicsVisibility(){h(this.filterVisibility)&&this.filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities((e=>{const t=this._updateUserVisibility(e),i=h(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i}))}setAllFeaturesVisibility(e){this.modifyGraphics3DGraphicVisibilities((t=>t.setVisibilityFlag(ie.FILTER,e,re.GRAPHIC)))}clearFeaturesVisibility(){this.modifyGraphics3DGraphicVisibilities((e=>e.clearVisibilityFlag(ie.FILTER)))}getObjectId(e){return H(e.graphic,this._objectIdField)}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities((e=>e.setVisibilityFlag(ie.USER_SETTING,!1,re.GRAPHIC)))}_validateRenderer(e){const t=Q(e);if(t){const e=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;Ve.warn(e,t.message)}}_volatileGraphicsUpdated(){this.labeler?.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach(((t,i)=>{if(p(t)||t.referenced>0)return;const r=this.graphicsBySymbol.get(i);r&&0!==r.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),y(t),e=!0)})),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map((e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()}))),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var Te;Fe.tmpVec=j(),e([P({readOnly:!0})],Fe.prototype,"computedExtent",void 0),e([P()],Fe.prototype,"currentRenderer",void 0),e([P()],Fe.prototype,"rendererHasGeometryOperations",void 0),e([P()],Fe.prototype,"_frameTask",void 0),e([P()],Fe.prototype,"rendererChangeAbortController",void 0),e([P()],Fe.prototype,"elevationInfoChangeAbortController",void 0),e([P()],Fe.prototype,"setupAbortController",void 0),e([P({readOnly:!0})],Fe.prototype,"elevationAlignment",void 0),e([P({readOnly:!0})],Fe.prototype,"scaleVisibility",void 0),e([P({readOnly:!0})],Fe.prototype,"filterVisibility",void 0),e([P()],Fe.prototype,"_spatialIndex",void 0),e([P({readOnly:!0})],Fe.prototype,"extentPadding",void 0),e([P()],Fe.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([P({readOnly:!0})],Fe.prototype,"featureStore",void 0),e([P({readOnly:!0})],Fe.prototype,"deconflictor",void 0),e([P({readOnly:!0})],Fe.prototype,"labeler",void 0),e([P({readOnly:!0})],Fe.prototype,"objectStates",void 0),e([P()],Fe.prototype,"_loadingSymbols",void 0),e([P()],Fe.prototype,"preferredUpdatePolicy",void 0),e([P()],Fe.prototype,"forcedUpdatePolicy",void 0),e([P({readOnly:!0})],Fe.prototype,"effectiveUpdatePolicy",null),e([P({constructOnly:!0})],Fe.prototype,"elevationFeatureExpressionEnabled",void 0),e([P({constructOnly:!0})],Fe.prototype,"owner",void 0),e([P({constructOnly:!0})],Fe.prototype,"layer",void 0),e([P({constructOnly:!0})],Fe.prototype,"graphicSymbolSupported",void 0),e([P({constructOnly:!0})],Fe.prototype,"getRenderingInfoWithoutRenderer",void 0),e([P({readOnly:!0})],Fe.prototype,"updating",null),e([P({readOnly:!0})],Fe.prototype,"running",null),e([P({readOnly:!0})],Fe.prototype,"suspendedOrOutsideOfView",null),e([P({readOnly:!0,dependsOn:[]})],Fe.prototype,"updatingRemaining",null),e([P({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Fe.prototype,"displayFeatureLimit",null),e([P({readOnly:!0,dependsOn:[]})],Fe.prototype,"averageSymbolComplexity",null),e([P({constructOnly:!0})],Fe.prototype,"hasZ",void 0),e([P({constructOnly:!0})],Fe.prototype,"hasM",void 0),e([P()],Fe.prototype,"_objectIdField",null),Fe=Oe=e([D(Le)],Fe),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}(Te||(Te={}));class ke{constructor(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=Te.NEW,this.abortController=null,this.remove=null}}const Me=10,We=j(),Ne=j(),ze=new Map;export{Fe as Graphics3DCore};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{neverReached as i}from"../../../../core/compilerUtils.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{isSome as r,destroyMaybe as n,isNone as a,unwrap as o}from"../../../../core/maybe.js";import{logOnError as l}from"../../../../core/promiseUtils.js";import{watch as p,initial as h,when as u}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as y}from"../../../../core/accessorSupport/diffUtils.js";import{canProject as m,project as g}from"../../../../geometry/support/webMercatorUtils.js";import{getRenderingInfo as f,getRenderingInfoAsync as b}from"../../../../renderers/support/renderingInfoUtils.js";import C from"../../../../rest/support/Query.js";import{DrapeSourceType as E}from"../interfaces.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as w}from"./constants.js";import{Graphics3DCore as x}from"./Graphics3DCore.js";import V from"./Graphics3DElevationAlignment.js";import{Graphics3DFilterVisibility as v}from"./Graphics3DFilterVisibility.js";import S from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as j}from"./Graphics3DObjectStates.js";import R from"./Graphics3DScaleVisibility.js";import{enlargeExtent as O}from"./graphicUtils.js";import{attributeLookup as G}from"../support/attributeUtils.js";import{UpdatePolicy as _,Object3DState as A}from"../../webgl-engine/lib/basicInterfaces.js";let F=class extends s{constructor(e){super(e),this.type="graphics-3d",this.elevationFeatureExpressionEnabled=!1,this.dataExtent=null,this.drapeSourceType=E.Features,this.preferredUpdatePolicy=_.ASYNC,this.suspendResumeExtent=null}normalizeCtorArgs(e){const t=e.frustumVisibilityEnabled?new S:null,i=e.scaleVisibilityEnabled?new R:null,s=(e.filterVisibilityEnabled||e.timeExtentEnabled)&&"multipatch"!==e.owner.layer.geometryType?new v:null,r=e.elevationAlignmentEnabled?new V:null,{owner:n,updateClippingExtent:a,dataExtent:o,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}=e;return{owner:n,updateClippingExtent:a,dataExtent:o,frustumVisibility:t,scaleVisibility:i,filterVisibility:s,elevationAlignment:r,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}}initialize(){const e=new x({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:this.owner.hasZ,hasM:this.owner.hasM});this._set("graphicsCore",e),this.scaleVisibility&&this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this.scaleVisibility.layerMinMaxScaleChangeHandler()));const t=this.filterVisibility;r(t)&&(this.updatingHandles.add((()=>"filter"in this.owner&&this.owner.filter),(()=>t.filterChanged())),this.updatingHandles.add((()=>"timeExtent"in this.owner&&this.owner.timeExtent),(()=>t.filterChanged())),this.updatingHandles.add((()=>"layerFilter"in this.owner&&this.owner.layerFilter),(()=>t.filterChanged()))),this.elevationAlignment&&this.updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{y(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this.updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this.updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{y(e,t)&&this.graphicsCore.updateLabelingInfo()})),this.updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",n(this.frustumVisibility)),this._set("scaleVisibility",n(this.scaleVisibility)),this._set("filterVisibility",n(this.filterVisibility)),this._set("elevationAlignment",n(this.elevationAlignment)),this._set("objectStates",n(this.objectStates)),this._set("graphicsCore",n(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){return this.scaleVisibility?.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return a(this.frustumVisibility)||!this.frustumVisibility.suspended}get suspendInfo(){const e={};return this.scaleVisibility?.suspended&&(e.outsideScaleRange=!0),r(this.frustumVisibility)&&this.frustumVisibility.suspended&&(e.outsideOfView=!0),e}get updating(){return!!(this.graphicsCore?.updating||r(this.frustumVisibility)&&this.frustumVisibility.updating||this.updatingHandles?.updating)}get updatingRemaining(){return this.graphicsCore?.updatingRemaining??0}get featureStore(){return this.graphicsCore?.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner?.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphicsCore?.symbolUpdateType}get displayFeatureLimit(){const e=this.view.resourceController.memoryController.memoryFactor,t=this.graphicsCore?.displayFeatureLimit;if(1===e)return t;const i=Math.ceil(t.maximumNumberOfFeatures*e),s=Math.ceil(t.maximumTotalNumberOfFeatures*e),r=Math.ceil(t.minimumTotalNumberOfFeatures*e);return{...t,maximumNumberOfFeatures:i,maximumTotalNumberOfFeatures:s,minimumTotalNumberOfFeatures:r}}get usedMemory(){return this.graphicsCore?.usedMemory??0}get usedMemoryPerFeature(){return this.graphicsCore?.usedMemoryPerGraphic??0}get unprocessedMemoryEstimate(){return this.graphicsCore?.unprocessedMemoryEstimate??0}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:a(this.frustumVisibility)||!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibility.suspended}}async setup(){r(this.frustumVisibility)&&this.frustumVisibility.setup(this);const e=this.owner,t=this.owner.view.basemapTerrain,i=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.scaleVisibility&&this.scaleVisibility.setup(this,this.layer,i,this.graphicsCore,t),r(this.filterVisibility)&&("filter"in e||"timeExtent"in e)&&this.filterVisibility.setup(e,this.graphicsCore),this.elevationAlignment){const t=e.view.elevationProvider;this.elevationAlignment.setup(this,i,this.graphicsCore,t)}this._set("objectStates",new j(this.graphicsCore)),this._set("labeling",this.owner.view.labeler.addGraphicsOwner(this.graphicsCore,this.scaleVisibility)),this._set("deconfliction",e.view.deconflictor.addGraphicsOwner(this.graphicsCore)),await l(this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,filterVisibility:this.filterVisibility,deconflictor:this.deconfliction,labeler:this.labeling,objectStates:this.objectStates})),this.updatingHandles.add((()=>this.layer.renderer),(e=>this.updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this.updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this.updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await l(this.graphicsCore.updateLabelingInfo())}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(A.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof C){const{set:t,handle:s}=this.objectStates.acquireSet(A.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==G(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(A.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>G(this.layer.fieldsIndex,e.attributes,i)))}if("number"==typeof e[0]||"string"==typeof e[0]){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(A.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return P}whenGraphicBounds(e,t){return this.graphicsCore?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsCore?.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=f(e,{renderer:t,arcade:i});if(r(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return b(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){return this.graphicsCore?.getSymbolLayerSize(e,t)}setObjectIdVisibility(e,t){this.graphicsCore?.setObjectIdVisibility(e,t)}notifyFilterChanged(){r(this.filterVisibility)&&this.filterVisibility.filterChanged()}refreshFilter(){r(this.filterVisibility)&&(this.filterVisibility.dirty=!0)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.handles.add(p((()=>this.suspendResumeExtentMode),(()=>{switch(this.handles.remove(M),this.suspendResumeExtentMode){case"computed":this.handles.add([p((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),h),p((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],M);break;case"data":this.handles.add([u((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),h),p((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(o(this.dataExtent))))],M);break;default:i(this.suspendResumeExtentMode)}}),h))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this.suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!m(e,i))return;e=g(e,i)}return O(e,t,w,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){r(this.frustumVisibility)&&this.frustumVisibility.setExtent(e),this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([d()],F.prototype,"type",void 0),e([d({constructOnly:!0})],F.prototype,"owner",void 0),e([d()],F.prototype,"layer",null),e([d({constructOnly:!0})],F.prototype,"updateClippingExtent",void 0),e([d({constructOnly:!0})],F.prototype,"elevationFeatureExpressionEnabled",void 0),e([d({constructOnly:!0})],F.prototype,"graphicsCore",void 0),e([d({constructOnly:!0})],F.prototype,"scaleVisibility",void 0),e([d({constructOnly:!0})],F.prototype,"filterVisibility",void 0),e([d({constructOnly:!0})],F.prototype,"elevationAlignment",void 0),e([d({constructOnly:!0})],F.prototype,"frustumVisibility",void 0),e([d({readOnly:!0})],F.prototype,"deconfliction",void 0),e([d({readOnly:!0})],F.prototype,"labeling",void 0),e([d({readOnly:!0})],F.prototype,"objectStates",void 0),e([d()],F.prototype,"suspendResumeExtentMode",null),e([d()],F.prototype,"dataExtent",void 0),e([d()],F.prototype,"scaleVisibilitySuspended",null),e([d()],F.prototype,"suspended",null),e([d()],F.prototype,"legendEnabled",null),e([d()],F.prototype,"suspendInfo",null),e([d()],F.prototype,"updating",null),e([d()],F.prototype,"updatingRemaining",null),e([d()],F.prototype,"featureStore",null),e([d()],F.prototype,"view",null),e([d()],F.prototype,"loadedGraphics",null),e([d()],F.prototype,"fullOpacity",null),e([d()],F.prototype,"filter",null),e([d()],F.prototype,"slicePlaneEnabled",null),e([d()],F.prototype,"drapeSourceType",void 0),e([d()],F.prototype,"updatePolicy",null),e([d()],F.prototype,"preferredUpdatePolicy",void 0),e([d()],F.prototype,"displayFeatureLimit",null),F=e([c("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],F);const I=F,M="suspendResumeExtentMode",P={remove(){},pause(){},resume(){}};export{I as default};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{neverReached as i}from"../../../../core/compilerUtils.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{isSome as r,destroyMaybe as n,isNone as a,unwrap as o}from"../../../../core/maybe.js";import{logOnError as l}from"../../../../core/promiseUtils.js";import{watch as p,initial as h,when as u}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as y}from"../../../../core/accessorSupport/diffUtils.js";import{canProject as m,project as g}from"../../../../geometry/support/webMercatorUtils.js";import{getRenderingInfo as f,getRenderingInfoAsync as b}from"../../../../renderers/support/renderingInfoUtils.js";import C from"../../../../rest/support/Query.js";import{DrapeSourceType as E}from"../interfaces.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as V}from"./constants.js";import{VisibilityFlag as x,VisibilityGroup as w}from"./enums.js";import{Graphics3DCore as v}from"./Graphics3DCore.js";import S from"./Graphics3DElevationAlignment.js";import j from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as R}from"./Graphics3DObjectStates.js";import O from"./Graphics3DScaleVisibility.js";import{enlargeExtent as F}from"./graphicUtils.js";import{attributeLookup as G}from"../support/attributeUtils.js";import{FeatureVisibilityFilter as A}from"../support/FeatureVisibilityFilter.js";import{UpdatePolicy as _,Object3DState as I}from"../../webgl-engine/lib/basicInterfaces.js";let P=class extends s{constructor(e){super(e),this.type="graphics-3d",this.elevationFeatureExpressionEnabled=!1,this.dataExtent=null,this.drapeSourceType=E.Features,this.preferredUpdatePolicy=_.ASYNC,this.suspendResumeExtent=null}normalizeCtorArgs(e){const{owner:t,updateClippingExtent:i,dataExtent:s,elevationFeatureExpressionEnabled:r,preferredUpdatePolicy:n}=e;return{owner:t,updateClippingExtent:i,dataExtent:s,frustumVisibility:e.frustumVisibilityEnabled?new j:null,scaleVisibility:e.scaleVisibilityEnabled?new O:null,filterVisibility:(e.filterVisibilityEnabled||e.timeExtentEnabled)&&"multipatch"!==e.owner.layer.geometryType?new A({context:{layerView:t,getFeatureCount:()=>this.graphics3DGraphics?.size??0,setAllFeaturesVisibility:e=>this.graphicsCore?.setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this.graphicsCore?.clearFeaturesVisibility(),updateFeatureVisibilities:e=>this.graphicsCore?.modifyGraphics3DGraphicVisibilities((t=>t.setVisibilityFlag(x.FILTER,e(this.graphicsCore.getObjectId(t)),w.GRAPHIC)))}}):null,elevationAlignment:e.elevationAlignmentEnabled?new S:null,elevationFeatureExpressionEnabled:r,preferredUpdatePolicy:n}}initialize(){const e=new v({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:this.owner.hasZ,hasM:this.owner.hasM});this._set("graphicsCore",e),this.scaleVisibility&&this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this.scaleVisibility.layerMinMaxScaleChangeHandler())),this.elevationAlignment&&this.updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{y(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this.updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this.updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{y(e,t)&&this.graphicsCore.updateLabelingInfo()})),this.updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e)),r(this.frustumVisibility)&&this.frustumVisibility.setup(this);const t=this.owner.view.basemapTerrain,i=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);this.scaleVisibility&&this.scaleVisibility.setup(this,this.layer,i,this.graphicsCore,t);const s=this.owner;if(this.elevationAlignment){const e=s.view.elevationProvider;this.elevationAlignment.setup(this,i,this.graphicsCore,e)}this._set("objectStates",new R(this.graphicsCore)),this._set("labeling",this.owner.view.labeler.addGraphicsOwner(this.graphicsCore,this.scaleVisibility)),this._set("deconfliction",s.view.deconflictor.addGraphicsOwner(this.graphicsCore)),this._set("initializePromise",this._initializeAsync())}async _initializeAsync(){await l(this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,filterVisibility:this.filterVisibility,deconflictor:this.deconfliction,labeler:this.labeling,objectStates:this.objectStates}));const e=this.owner;this.updatingHandles.add((()=>this.layer.renderer),(e=>this.updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this.updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this.updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await l(this.graphicsCore.updateLabelingInfo())}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",n(this.frustumVisibility)),this._set("scaleVisibility",n(this.scaleVisibility)),this._set("filterVisibility",n(this.filterVisibility)),this._set("elevationAlignment",n(this.elevationAlignment)),this._set("objectStates",n(this.objectStates)),this._set("graphicsCore",n(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){return this.scaleVisibility?.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return a(this.frustumVisibility)||!this.frustumVisibility.suspended}get suspendInfo(){const e={};return this.scaleVisibility?.suspended&&(e.outsideScaleRange=!0),r(this.frustumVisibility)&&this.frustumVisibility.suspended&&(e.outsideOfView=!0),e}get updating(){return!!(this.graphicsCore?.updating||r(this.frustumVisibility)&&this.frustumVisibility.updating||this.updatingHandles?.updating)}get updatingRemaining(){return this.graphicsCore?.updatingRemaining??0}get featureStore(){return this.graphicsCore?.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner?.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.graphicsCore?.symbolUpdateType}get displayFeatureLimit(){const e=this.view.resourceController.memoryController.memoryFactor,t=this.graphicsCore?.displayFeatureLimit;if(1===e)return t;const i=Math.ceil(t.maximumNumberOfFeatures*e),s=Math.ceil(t.maximumTotalNumberOfFeatures*e),r=Math.ceil(t.minimumTotalNumberOfFeatures*e);return{...t,maximumNumberOfFeatures:i,maximumTotalNumberOfFeatures:s,minimumTotalNumberOfFeatures:r}}get usedMemory(){return this.graphicsCore?.usedMemory??0}get usedMemoryPerFeature(){return this.graphicsCore?.usedMemoryPerGraphic??0}get unprocessedMemoryEstimate(){return this.graphicsCore?.unprocessedMemoryEstimate??0}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:a(this.frustumVisibility)||!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibility.suspended}}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(I.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof C){const{set:t,handle:s}=this.objectStates.acquireSet(I.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==G(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(I.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>G(this.layer.fieldsIndex,e.attributes,i)))}if("number"==typeof e[0]||"string"==typeof e[0]){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(I.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return H}whenGraphicBounds(e,t){return this.graphicsCore?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsCore?.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=f(e,{renderer:t,arcade:i});if(r(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return b(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){return this.graphicsCore?.getSymbolLayerSize(e,t)}setObjectIdVisibility(e,t){this.graphicsCore?.setObjectIdVisibility(e,t)}refreshFilter(){r(this.filterVisibility)&&this.filterVisibility.reapply()}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.handles.add(p((()=>this.suspendResumeExtentMode),(()=>{switch(this.handles.remove(U),this.suspendResumeExtentMode){case"computed":this.handles.add([p((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),h),p((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],U);break;case"data":this.handles.add([u((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),h),p((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(o(this.dataExtent))))],U);break;default:i(this.suspendResumeExtentMode)}}),h))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this.suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!m(e,i))return;e=g(e,i)}return F(e,t,V,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){r(this.frustumVisibility)&&this.frustumVisibility.setExtent(e),this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([d()],P.prototype,"type",void 0),e([d({constructOnly:!0})],P.prototype,"owner",void 0),e([d()],P.prototype,"layer",null),e([d({constructOnly:!0})],P.prototype,"updateClippingExtent",void 0),e([d({constructOnly:!0})],P.prototype,"elevationFeatureExpressionEnabled",void 0),e([d({constructOnly:!0})],P.prototype,"graphicsCore",void 0),e([d({constructOnly:!0})],P.prototype,"scaleVisibility",void 0),e([d({constructOnly:!0})],P.prototype,"filterVisibility",void 0),e([d({constructOnly:!0})],P.prototype,"elevationAlignment",void 0),e([d({constructOnly:!0})],P.prototype,"frustumVisibility",void 0),e([d({readOnly:!0})],P.prototype,"deconfliction",void 0),e([d({readOnly:!0})],P.prototype,"labeling",void 0),e([d({readOnly:!0})],P.prototype,"objectStates",void 0),e([d()],P.prototype,"initializePromise",void 0),e([d()],P.prototype,"suspendResumeExtentMode",null),e([d()],P.prototype,"dataExtent",void 0),e([d()],P.prototype,"scaleVisibilitySuspended",null),e([d()],P.prototype,"suspended",null),e([d()],P.prototype,"legendEnabled",null),e([d()],P.prototype,"suspendInfo",null),e([d()],P.prototype,"updating",null),e([d()],P.prototype,"updatingRemaining",null),e([d()],P.prototype,"featureStore",null),e([d()],P.prototype,"view",null),e([d()],P.prototype,"loadedGraphics",null),e([d()],P.prototype,"fullOpacity",null),e([d()],P.prototype,"filter",null),e([d()],P.prototype,"slicePlaneEnabled",null),e([d()],P.prototype,"drapeSourceType",void 0),e([d()],P.prototype,"updatePolicy",null),e([d()],P.prototype,"preferredUpdatePolicy",void 0),e([d()],P.prototype,"displayFeatureLimit",null),P=e([c("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],P);const M=P,U="suspendResumeExtentMode",H={remove(){},pause(){},resume(){}};export{M as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as
|
|
5
|
+
import{isSome as e,isNone as t,unwrap as s,disposeMaybe as i}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{b as n,l as o,g as a,o as h,e as l,p as c}from"../../../../chunks/vec3.js";import{c as d}from"../../../../chunks/vec3f64.js";import{s as u}from"../../../../chunks/vec4.js";import{create as p,offset as g,contains as m,containsPoint as _,set as f,POSITIVE_INFINITY as P,equals as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as S}from"../../../../geometry/support/plane.js";import{fromPoints as x}from"../../../../geometry/support/ray.js";import{PointHighlights as z}from"./PointHighlights.js";import{minimumDistancePlane as R,maximumDistancePlane as q,intersectLine as w,toAaBoundingBox as y}from"../../support/orientedBoundingBox.js";import{ShaderOutput as A}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{Default3D as j}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as I}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as F,StoreResults as v}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{VertexAttribute as C}from"../../webgl-engine/lib/VertexAttribute.js";import{P as E,a as H,g as N}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as O}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as T}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{BufferObject as L}from"../../../webgl/BufferObject.js";import{DataType as B,PrimitiveType as D,Usage as M}from"../../../webgl/enums.js";import{VertexArrayObject as U}from"../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as V}from"../../../webgl/VertexElementDescriptor.js";const W={positions:[new V(C.POSITION,3,B.FLOAT,0,12)],colors:[new V(C.COLOR,3,B.UNSIGNED_BYTE,0,3,!0)]};class k{constructor(e){this._params=e,this.type=F.PCL,this.isGround=!1,this._passParameters=new E,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.canRender=!0,this.layerUid="",this._slicePlaneEnabled=!1,this._techniqueConfig=new T,this._nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRepository,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const r=d(),f=d(),P=d(),b=d(),z=S(),A=e.camera.perScreenPixelRatio/2,j=e.camera.near;n(f,i,s);const F=1/o(f);a(f,f,F),h(P,f),u(z,f[0],f[1],f[2],-l(f,s));const C=new ee,E=new ee,H=new Array,N=p(),O=p(this._passParameters.clipBox);g(O,-s[0],-s[1],-s[2],O),this._nodes.forAll((o=>{const a=o.splatSize*this._passParameters.scaleFactor;let h=R(o.obb,z),d=q(o.obb,z);h-=K(a,h+j,this._passParameters,A,o.isLeaf),d-=K(a,d+j,this._passParameters,A,o.isLeaf);const u=d<0,p=null!=C.dist&&null!=E.dist&&C.dist<h*F&&E.dist>d*F;if(u||p)return;const S=J(a,d+j,this._passParameters,A,o.isLeaf);if(!w(o.obb,s,f,S))return;const x=S*S;y(o.obb,N),g(N,-s[0],-s[1],-s[2],N);const I=!m(O,N);n(b,o.origin,s);const T=o.coordinates.length/3;for(let n=0;n<T;n++){if(r[0]=b[0]+o.coordinates[3*n],r[1]=b[1]+o.coordinates[3*n+1],r[2]=b[2]+o.coordinates[3*n+2],I&&!_(O,r))continue;const h=l(r,f),d=c(r)-h*h;if(d>x)continue;let u=h+j;const p=K(a,u,this._passParameters,A,o.isLeaf);if(h-p<0)continue;u-=p;const g=J(a,u,this._passParameters,A,o.isLeaf);if(d>g*g)continue;const m=(h-p)*F,S=e=>(e.point=Q(o,n,e.point),e.dist=m,e.normal=P,e.node=o,e.pointId=n,e.layerUid=this.layerUid,e);if((null==C.dist||m<C.dist)&&(null==t||t(s,i,m))&&S(C),e.options.store!==v.MIN&&(null==E.dist||m>E.dist)&&(null==t||t(s,i,m))&&S(E),e.options.store===v.ALL&&(null==t||t(s,i,m))){const e=new ee;H.push(S(e))}}}));const T=e=>{const{layerUid:t,node:s,pointId:i}=e;return{point:e.point,layerUid:t,graphicUid:i,createGraphic:()=>this._params.createGraphic(s,i,e.point)}},L=(e,t)=>{const s=T(t);e.set(this.type,s,t.dist,t.normal)};if(te(C)){const t=e.results.min;(null==t.dist||C.dist<t.dist)&&L(t,C)}if(te(E)&&e.options.store!==v.MIN){const t=e.results.max;(null==t.dist||E.dist>t.dist)&&L(t,E)}if(e.options.store===v.ALL){const t=x(s,i);for(const s of H){const i=I(t);L(i,s),e.results.all.push(i)}}}prepareTechnique(e){return 0===this._nodes.length||e.output!==A.Color&&e.output!==A.Depth&&e.output!==A.Highlight?null:(this._nodes.forAll((t=>{null==t.vao&&this._initNode(e,t)})),this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace,this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes,this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled,this._techniqueConfig.hasOccludees=e.bindParameters.hasOccludees,this._techniqueConfig.clippingEnabled=this._clippingEnabled,this._techniqueConfig.output=e.output===A.Depth?A.Depth:e.output===A.Highlight?A.Highlight:A.Color,this._techniqueRep.releaseAndAcquire(O,this._techniqueConfig,this._technique))}render(e,t){const s=e.rctx,i=s.bindTechnique(t,this._passParameters,e.bindParameters),r=e.output===A.Highlight;this._nodes.forAll((t=>{0===t.coordinates.length||r&&!t.highlights||(i.bindDraw(t,e.bindParameters,this._passParameters),s.bindVAO(t.vao),r?this._renderHighlightFragments(s,t):s.drawArrays(D.POINTS,0,t.coordinates.length/3))}))}_renderHighlightFragments(e,i){const r=i.highlights;if(t(r))return;let n=s(r[0].component),o=n+1;for(let t=1;t<r.length;t++){const i=s(r[t].component);if(i!==o){const t=o-n;t>0&&e.drawArrays(D.POINTS,n,t),n=i}o=i+1}const a=o-n;a>0&&e.drawArrays(D.POINTS,n,a)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!b(this._passParameters.clipBox,P,((e,t)=>e===t))}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace((s=>s.id!==e||(t=s,s.vao=i(s.vao),this._highlights.nodeRemoved(s),!1))),this._requestRender(),t}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll((e=>e.vao=i(e.vao))),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,t,s){e.highlights=Z(e.highlights,t,s),this._requestRender()}_removeHighlight(e,t){e.highlights=$(e.highlights,t),this._requestRender()}_initNode(e,t){const s=e.rctx;t.vao=new U(s,j,W,{positions:L.createVertex(s,M.STATIC_DRAW,t.coordinates),colors:L.createVertex(s,M.STATIC_DRAW,t.rgb)})}_requestRender(){this._context&&this._context.requestRender()}}class G extends H{constructor(e,t,s,i,r,n,o,a,h=null,l=null){super(s,r,t),this.id=e,this.obb=i,this.coordinates=n,this.rgb=o,this.attributes=a,this.pointIdFilterMap=h,this.highlights=l}}function Y(e){return e.hasOwnProperty("splatSize")}function J(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=N(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function K(e,t,s,i,r){return s.drawScreenSpace?0:J(e,t,s,i,r)}function Q(e,s,i){return t(i)&&(i=d()),i[0]=e.origin[0]+e.coordinates[3*s],i[1]=e.origin[1]+e.coordinates[3*s+1],i[2]=e.origin[2]+e.coordinates[3*s+2],i}function X(t){return e(t.component)?t.component:-1}function Z(e,s,i){t(e)&&(e=[]);const r={component:s,id:i};e.push(r);const n=X(r);let o=e.length-1;for(;o>0&&n<X(e[o-1]);)[e[o-1],e[o]]=[e[o],e[o-1]],--o;return e}function $(e,s){if(t(e))return e;const i=e.filter((e=>e.id!==s));return 0===i.length?null:i}class ee{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function te(t){return e(t.dist)&&e(t.point)&&e(t.pointId)&&e(t.node)}export{k as PointRenderer,G as PointRendererNode,Y as isInstanceOfNode};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{HandleOwner as r}from"../../../../core/HandleOwner.js";import i from"../../../../core/Logger.js";import{isNone as s,abortMaybe as o,removeMaybe as a,destroyMaybe as l,isSome as u}from"../../../../core/maybe.js";import{throwIfAbortError as n}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as d}from"../../../../layers/support/floorFilterUtils.js";import{QueryEngine as y}from"../graphics/QueryEngine.js";import{TaskPriority as m}from"../../../support/Scheduler.js";let F=class extends r{constructor(e){super(e),this._updateTask=null,this._frameTask=null,this._queryEngine=null,this._updateRequested=!0,this._updateVisibility=async e=>{if(s(this._compositedFeatureFilter)&&s(this._sceneFilter)||0===this.context.getFeatureCount())return this._frameTask.schedule((()=>this.clear()),e);try{const t=await this._queryEngine.executeQueryForIdSet(this._compositedFeatureFilter,this._sceneFilter,e);return this._frameTask.schedule((()=>{this.context.updateFeatureVisibilities((e=>t.has(e)))}),e)}catch(t){return n(t),i.getLogger(this.declaredClass).warn(`FeatureFilter query failed: ${t}`,{error:t}),this._frameTask.schedule((()=>{this.context.setAllFeaturesVisibility(!0)}),e)}}}initialize(){const e=m.FILTER_VISIBILITY;this._queryEngine=new y({priority:e,layerView:this._layerView}),this._frameTask=this._layerView.view.resourceController.scheduler.registerTask(e,this),this.updatingHandles.add((()=>[this._compositedFeatureFilter,this._sceneFilter]),(()=>this.reapply()),p)}destroy(){this._updateRequested=!1,this.handles.removeAll(),this.updatingHandles.removeAll(),this.clear(),this._updateTask=o(this._updateTask),this._frameTask=a(this._frameTask),this._queryEngine=l(this._queryEngine),this._set("context",null)}get updating(){return this.running||this.updatingHandles.updating||u(this._updateTask)&&!this._updateTask.finished}get running(){return this._updateRequested||this._frameTask.updating}get defaultVisibility(){return s(this._compositedFeatureFilter)&&s(this._sceneFilter)}get _featureFilter(){return"filter"in this._layerView?this._layerView.filter:null}get _sceneFilter(){return"layerFilter"in this._layerView?this._layerView.layerFilter:null}get _floorFilter(){return d(this._layerView)}get _timeExtent(){return"timeExtent"in this._layerView?this._layerView.timeExtent:null}get _compositedFeatureFilter(){const{_featureFilter:e,_timeExtent:t,_floorFilter:r}=this;if(s(t)&&s(r))return e;const i=u(e)?e.clone():new _;if(u(t)&&(i.timeExtent=u(i.timeExtent)?i.timeExtent.intersection(t):t),u(r)){const e=s(i.where)||""===i.where;i.where=e?r:`(${i.where}) AND (${r})`}return i}get _layerView(){return this.context.layerView}reapply(){this._updateRequested=!0}clear(){this._queryEngine.clear(),this.context.clearFeaturesVisibility()}runTask(e){this._updateRequested&&(this._updateTask=o(this._updateTask),this._updateTask=t(this._updateVisibility),this._updateRequested=!1,e.madeProgress()),this._frameTask.processQueue(e)}};e([h({constructOnly:!0})],F.prototype,"context",void 0),e([h()],F.prototype,"updating",null),e([h()],F.prototype,"running",null),e([h()],F.prototype,"defaultVisibility",null),e([h()],F.prototype,"_featureFilter",null),e([h()],F.prototype,"_sceneFilter",null),e([h()],F.prototype,"_floorFilter",null),e([h()],F.prototype,"_timeExtent",null),e([h()],F.prototype,"_compositedFeatureFilter",null),e([h()],F.prototype,"_layerView",null),e([h()],F.prototype,"_updateTask",void 0),e([h()],F.prototype,"_updateRequested",void 0),F=e([c("esri.views.3d.layers.support.FeatureVisibilityFilter")],F);export{F as FeatureVisibilityFilter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{estimateAttributesObjectSize as t,estimateFixedArraySize as r,estimateNumberByteSize as i}from"../../../../core/byteSizeEstimations.js";import{HandleOwner as a}from"../../../../core/HandleOwner.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import o from"../../../../core/Logger.js";import{isSome as n,disposeMaybe as l,unwrap as d,isNone as p,applySome as m,mapSome as u}from"../../../../core/maybe.js";import{initial as h,sync as c,watch as y}from"../../../../core/reactiveUtils.js";import{pt2px as _}from"../../../../core/screenUtils.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as F}from"../../../../chunks/vec3.js";import{c as R}from"../../../../chunks/vec3f64.js";import{projectPointToVector as v}from"../../../../geometry/projection.js";import{getResolutionForScale as S}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as b}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as P}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as w}from"../../../../layers/graphics/OptimizedFeature.js";import j from"../../../../layers/graphics/OptimizedGeometry.js";import T from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as G}from"../../../../layers/support/fieldUtils.js";import{generateGradient as x}from"../../../../renderers/support/heatmapUtils.js";import{DrapeSourceType as M}from"../interfaces.js";import{HeatmapFilterVisibility as I}from"./HeatmapFilterVisibility.js";import{DRAPED_Z as N}from"../../terrain/OverlayRenderer.js";import{UpdatePolicy as V,PrimitiveType as A}from"../../webgl-engine/lib/basicInterfaces.js";import{DrapedHeatmapRenderer as O}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as E}from"../../webgl-engine/lib/Geometry.js";import{ModelDirty as H}from"../../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as C}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as U}from"../../webgl-engine/lib/VertexAttribute.js";import{HeatmapDensityMaterial as D}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{scaleBoundsPredicate as L,isScaleRangeActive as W}from"../../../support/layerViewUtils.js";import{PixelType as z,PixelFormat as B}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as Z}from"../../../webgl/heatmapTextureUtils.js";const $="esri.views.3d.layers.support.HeatmapFeatureProcessor",k=o.getLogger($),q=112;let Y=class extends a{constructor(e){super(e),this.type="heatmap",this.preferredUpdatePolicy=V.ASYNC,this.dataExtent=null,this.drapeSourceType=M.Features,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=z.HALF_FLOAT,this._pixelFormat=B.RGBA}initialize(){this._featureStore=new T({geometryType:"esriGeometryPoint",hasZ:this.hasZ,hasM:this.hasM});const{dataType:e,samplingMode:t,pixelFormat:r,internalFormat:i}=Z(this._renderView.renderingContext,k);this._dataType=e,this._pixelFormat=r;const a=e!==z.FLOAT;this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerDrapeSource(this,O,{...this._rendererParameters,dataType:e,samplingMode:t,pixelFormat:r,internalFormat:i}),this._material=new D({usesHalfFloats:a}),this._materialWithField=new D({usesHalfFloats:a,isAttributeDriven:!0}),this._set("filterVisibility",new I({context:{layerView:this.owner,featureStore:this._featureStore,forAllFeatures:e=>this._loadedPointGraphics.forEach(e),getHeatmapPointsCount:()=>this._loadedPointGraphics.length,updateFilteredFeatures:(e,t)=>this._updateFilteredFeatures(e,t),setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e)}})),this.updatingHandles.addOnCollectionChange((()=>this._loadedPointGraphics),(e=>this._onLoadedFeaturesChange(e)),h),this.updatingHandles.addWhen((()=>this._materialParameters),(e=>this._forEachMaterial((t=>t.setParameters(e)))),h),this.updatingHandles.add((()=>this._rendererParameters),(e=>this._drapeSourceRenderer.set(e))),this.updatingHandles.add((()=>this._heatmapRendererField),(()=>{this._recreate()}),c),this.updatingHandles.add((()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric})),(({fieldName:e,numeric:t})=>{if(n(e)&&t){let t=0;this._featureStore.forEach((r=>t+=r.attributes[e]??0)),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures}),h),this.handles.add([y((()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField})),(({fieldName:e,field:t})=>{e&&!t&&k.warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)})),y((()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric})),(({field:e,numeric:t})=>{n(e)&&!t&&k.warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)})),s((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this)))])}destroy(){this._renderGeometries.clear(),this._material=l(this._material),this._materialWithField=l(this._materialWithField),this._featureStore.clear(),this._featureStore=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this.updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get displayFeatureLimit(){const e=this.owner?.view?.resourceController?.memoryController?.memoryFactor??1,t=this.owner?.view?.qualitySettings,r=t?Math.ceil(t.heatmap.maxTotalNumberOfFeatures*e):0;return{minimumTotalNumberOfFeatures:0,maximumTotalNumberOfFeatures:r,maximumTotalNumberOfPrimitives:r*2,maximumNumberOfFeatures:r}}get hasZ(){return"hasZ"in this.layer&&this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:r}=this.view;return!L(r,e??0,t??0)}get usedMemory(){const e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=this._pixelFormat===B.RED?1:4,r=this._dataType===z.FLOAT?4:2,i=Math.ceil(this._overlayRenderer?.overlays[0]?.resolution*this._densityMapPixelRatio)??0;return i*i*t*r+e}get usedMemoryPerFeature(){if(0===this._featureStore.numFeatures)return 0;let e=0;this._featureStore.forEach((r=>e+=t(r.attributes))),e/=this._featureStore.numFeatures;const a=i(),s=6;return s*r([0,0,0],a)+s*r([0,0],a)+(this._heatmapRendererFieldIsNumeric?s*a:0)+e}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return{core:{visible:this._featureStore.numFeatures,missing:0,pending:0},elevationUpdating:!1,visibilityFrustum:!0,visibilityScale:!0}}get _overlayRenderer(){return this.view.basemapTerrain.overlayManager.renderer}get _overlaySpatialReference(){return d(this._overlayRenderer.spatialReference)}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const e=this._heatmapRenderer;if(p(e))return null;const{minDensity:t,maxDensity:r}=e;return{minDensity:t,maxDensity:r,fieldTotal:this._fieldTotal}}get _radiusParameter(){return m(this._heatmapRenderer,(({radius:e})=>({searchRadius:_(this._clampSearchRadius(e))})))}get _resolutionForScaleParameter(){return m(this._heatmapRenderer,(({referenceScale:e})=>({resolutionForScale:0===e?0:S(e,this.view.spatialReference)})))}get _colorRampParameter(){return m(this._heatmapRenderer,(e=>({colorRampData:x(e.colorStops)})))}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){const e=this.owner?.view?.resourceController?.memoryController?.memoryFactor??1;return(this.owner?.view?.qualitySettings.heatmap.pixelRatio??1)*Math.sqrt(e)}get _renderView(){return this.view._stage.renderView}get _featuresArePoints(){return"point"===this.layer.geometryType}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const e=this.layer.renderer;return"heatmap"===e?.type?e:null}get _heatmapRendererFieldName(){return m(this._heatmapRenderer,(e=>e.field))}get _heatmapRendererField(){return m(this._heatmapRendererFieldName,(e=>this.layer.fieldsIndex.get(e)))}get _heatmapRendererFieldIsNumeric(){const e=this._heatmapRendererField;return!p(e)&&G(e)}get _isScaleRangeActive(){const{layer:e}=this;if(!("effectiveScaleRange"in e))return!1;const{minScale:t,maxScale:r}=e.effectiveScaleRange;return W(t,r)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return J}maskOccludee(){return J}setObjectIdVisibility(){}async setup(){}notifyFilterChanged(){}refreshFilter(){this.filterVisibility.refreshFilter()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;const{objectIdField:t}=this.layer;this._featureStore.removeManyById(e.removed.map((e=>b(e,t)))),this._featureStore.addMany(e.added.map((e=>new w(P(new j,e.geometry),e.attributes,m(e.centroid,(e=>P(new j,e))),b(e,t)))));const r=e.added,i=e.removed;this._fieldTotal+=this._computeFieldTotalChange(r,i);const a=u(i,(({uid:e})=>{const t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t})),s=r.map((e=>{const t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t}));a.length>0&&this._drapeSourceRenderer.removeGeometries(a,H.Geometry.REMOVE),s.length>0&&this._drapeSourceRenderer.addGeometries(s,H.Geometry.ADD),(s.length>0||a.length>0)&&(this.filterVisibility.refreshFilter(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;const e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){const t=this._heatmapRendererFieldName,r=n(t)?this._materialWithField:this._material,i=R();v(e.geometry,i,this._overlaySpatialReference),i[2]=N;const a=[[U.POSITION,{data:i,size:i.length}]],s=this._heatmapRendererFieldIsNumeric;n(t)&&a.push([U.FEATUREATTRIBUTE,{data:[s?e.attributes[t]??0:0],size:1}]);const o=new C(new E(a,null,A.Point),r,{layerUid:this.layer.uid,graphicUid:e.uid});return F(o.boundingSphere,i),o.instanceParameters.visible=!this.filterVisibility.active,o}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(p(this._heatmapRendererFieldName)||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;const r=this._heatmapRendererFieldName,i=(e,t)=>e+(t.attributes[r]??0);return e.reduce(i,0)-t.reduce(i,0)}_clampSearchRadius(e){return e>q&&k.warnOnce(`SceneView supports a maximum radius of ${q} pt for HeatmapRenderer.`),Math.min(e,q)}_updateFilteredFeatures(e,t){const r=[];for(const{uid:i}of t){const e=this._renderGeometries.get(i);e.instanceParameters.visible&&(r.push(e),e.instanceParameters.visible=!1)}for(const{uid:i}of e){const e=this._renderGeometries.get(i);e.instanceParameters.visible||(r.push(e),e.instanceParameters.visible=!0)}this._drapeSourceRenderer.modifyGeometries(r,H.State.VISIBILITIES)}_setAllFeaturesVisibility(e){const t=[];for(const r of this._renderGeometries.values())r.instanceParameters.visible!==e&&(t.push(r),r.instanceParameters.visible=e);this._drapeSourceRenderer.modifyGeometries(t,H.State.VISIBILITIES)}get test(){return{visibleFeatureCount:this._loadedPointGraphics.toArray().filter((({uid:e})=>this._renderGeometries.get(e).instanceParameters.visible)).length}}};e([f()],Y.prototype,"type",void 0),e([f({constructOnly:!0})],Y.prototype,"owner",void 0),e([f()],Y.prototype,"layer",null),e([f()],Y.prototype,"featureStore",null),e([f()],Y.prototype,"updating",null),e([f()],Y.prototype,"updatingRemaining",null),e([f()],Y.prototype,"suspendInfo",null),e([f()],Y.prototype,"legendEnabled",null),e([f()],Y.prototype,"filterVisibility",void 0),e([f()],Y.prototype,"displayFeatureLimit",null),e([f()],Y.prototype,"preferredUpdatePolicy",void 0),e([f()],Y.prototype,"hasZ",null),e([f()],Y.prototype,"hasM",null),e([f()],Y.prototype,"dataExtent",void 0),e([f()],Y.prototype,"view",null),e([f()],Y.prototype,"fullOpacity",null),e([f()],Y.prototype,"updatePolicy",null),e([f()],Y.prototype,"drapeSourceType",void 0),e([f()],Y.prototype,"scaleVisibilitySuspended",null),e([f()],Y.prototype,"_featureStore",void 0),e([f()],Y.prototype,"_overlayRenderer",null),e([f()],Y.prototype,"_overlaySpatialReference",null),e([f()],Y.prototype,"_rendererParameters",null),e([f()],Y.prototype,"_materialParameters",null),e([f()],Y.prototype,"_densityParameters",null),e([f()],Y.prototype,"_radiusParameter",null),e([f()],Y.prototype,"_resolutionForScaleParameter",null),e([f()],Y.prototype,"_colorRampParameter",null),e([f()],Y.prototype,"_pixelRatioParameter",null),e([f()],Y.prototype,"_densityMapPixelRatio",null),e([f()],Y.prototype,"_renderGeometries",void 0),e([f()],Y.prototype,"_material",void 0),e([f()],Y.prototype,"_materialWithField",void 0),e([f()],Y.prototype,"_renderView",null),e([f()],Y.prototype,"_featuresArePoints",null),e([f()],Y.prototype,"_loadedPointGraphics",null),e([f()],Y.prototype,"_heatmapRenderer",null),e([f()],Y.prototype,"_heatmapRendererFieldName",null),e([f()],Y.prototype,"_heatmapRendererField",null),e([f()],Y.prototype,"_heatmapRendererFieldIsNumeric",null),e([f()],Y.prototype,"_fieldTotal",void 0),e([f()],Y.prototype,"_drapeSourceRenderer",void 0),e([f()],Y.prototype,"_isScaleRangeActive",null),Y=e([g($)],Y);const J=s();export{Y as HeatmapFeatureProcessor,q as MAX_RADIUS_PT};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{estimateAttributesObjectSize as t,estimateFixedArraySize as r,estimateNumberByteSize as i}from"../../../../core/byteSizeEstimations.js";import{HandleOwner as a}from"../../../../core/HandleOwner.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import o from"../../../../core/Logger.js";import{isSome as n,disposeMaybe as l,isNone as p,unwrap as d,applySome as m,mapSome as u}from"../../../../core/maybe.js";import{initial as h,sync as c,watch as y}from"../../../../core/reactiveUtils.js";import{pt2px as _}from"../../../../core/screenUtils.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as F}from"../../../../chunks/vec3.js";import{c as R}from"../../../../chunks/vec3f64.js";import{projectPointToVector as b}from"../../../../geometry/projection.js";import{getResolutionForScale as v}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as S}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as P}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as w}from"../../../../layers/graphics/OptimizedFeature.js";import j from"../../../../layers/graphics/OptimizedGeometry.js";import T from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as G}from"../../../../layers/support/fieldUtils.js";import{generateGradient as x}from"../../../../renderers/support/heatmapUtils.js";import{DrapeSourceType as I}from"../interfaces.js";import{FeatureVisibilityFilter as M}from"./FeatureVisibilityFilter.js";import{DRAPED_Z as V}from"../../terrain/OverlayRenderer.js";import{UpdatePolicy as N,PrimitiveType as O}from"../../webgl-engine/lib/basicInterfaces.js";import{DrapedHeatmapRenderer as A}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as E}from"../../webgl-engine/lib/Geometry.js";import{ModelDirty as U}from"../../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as C}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as H}from"../../webgl-engine/lib/VertexAttribute.js";import{HeatmapDensityMaterial as D}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{scaleBoundsPredicate as L,isScaleRangeActive as z}from"../../../support/layerViewUtils.js";import{PixelType as W,PixelFormat as B}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as Z}from"../../../webgl/heatmapTextureUtils.js";const $="esri.views.3d.layers.support.HeatmapFeatureProcessor",k=o.getLogger($),q=112;let Y=class extends a{constructor(e){super(e),this.type="heatmap",this.preferredUpdatePolicy=N.ASYNC,this.dataExtent=null,this.drapeSourceType=I.Features,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=W.HALF_FLOAT,this._pixelFormat=B.RGBA,this.initializePromise=Promise.resolve()}initialize(){this._featureStore=new T({geometryType:"esriGeometryPoint",hasZ:this.hasZ,hasM:this.hasM});const{dataType:e,samplingMode:t,pixelFormat:r,internalFormat:i}=Z(this._renderView.renderingContext,k);this._dataType=e,this._pixelFormat=r;const a=e!==W.FLOAT;this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerDrapeSource(this,A,{...this._rendererParameters,dataType:e,samplingMode:t,pixelFormat:r,internalFormat:i}),this._material=new D({usesHalfFloats:a}),this._materialWithField=new D({usesHalfFloats:a,isAttributeDriven:!0}),this._set("filterVisibility",new M({context:{layerView:this.owner,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}})),this.updatingHandles.addOnCollectionChange((()=>this._loadedPointGraphics),(e=>this._onLoadedFeaturesChange(e)),h),this.updatingHandles.addWhen((()=>this._materialParameters),(e=>this._forEachMaterial((t=>t.setParameters(e)))),h),this.updatingHandles.add((()=>this._rendererParameters),(e=>this._drapeSourceRenderer.set(e))),this.updatingHandles.add((()=>this._heatmapRendererField),(()=>{this._recreate()}),c),this.updatingHandles.add((()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric})),(({fieldName:e,numeric:t})=>{if(n(e)&&t){let t=0;this._featureStore.forEach((r=>t+=r.attributes[e]??0)),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures}),h),this.handles.add([y((()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField})),(({fieldName:e,field:t})=>{e&&!t&&k.warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)})),y((()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric})),(({field:e,numeric:t})=>{n(e)&&!t&&k.warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)})),s((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this)))])}destroy(){this._renderGeometries.clear(),this._material=l(this._material),this._materialWithField=l(this._materialWithField),this._featureStore.clear(),this._featureStore=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this.updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get displayFeatureLimit(){const e=this.owner?.view?.resourceController?.memoryController?.memoryFactor??1,t=this.owner?.view?.qualitySettings,r=t?Math.ceil(t.heatmap.maxTotalNumberOfFeatures*e):0;return{minimumTotalNumberOfFeatures:0,maximumTotalNumberOfFeatures:r,maximumTotalNumberOfPrimitives:r*2,maximumNumberOfFeatures:r}}get hasZ(){return"hasZ"in this.layer&&this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:r}=this.view;return!L(r,e??0,t??0)}get usedMemory(){const e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=this._pixelFormat===B.RED?1:4,r=this._dataType===W.FLOAT?4:2,i=Math.ceil(this._overlayRenderer?.overlays[0]?.resolution*this._densityMapPixelRatio)??0;return i*i*t*r+e}get usedMemoryPerFeature(){const e=this._loadedPointGraphics.find((()=>!0));if(p(e))return 0;const a=t(e),s=i(),o=6;return o*r([0,0,0],s)+o*r([0,0],s)+(this._heatmapRendererFieldIsNumeric?o*s:0)+a}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return{core:{visible:this._visibleFeatures,missing:0,pending:0},elevationUpdating:!1,visibilityFrustum:!0,visibilityScale:!0}}get _overlayRenderer(){return this.view.basemapTerrain.overlayManager.renderer}get _overlaySpatialReference(){return d(this._overlayRenderer.spatialReference)}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const e=this._heatmapRenderer;if(p(e))return null;const{minDensity:t,maxDensity:r}=e;return{minDensity:t,maxDensity:r,fieldTotal:this._fieldTotal}}get _radiusParameter(){return m(this._heatmapRenderer,(({radius:e})=>({searchRadius:_(this._clampSearchRadius(e))})))}get _resolutionForScaleParameter(){return m(this._heatmapRenderer,(({referenceScale:e})=>({resolutionForScale:0===e?0:v(e,this.view.spatialReference)})))}get _colorRampParameter(){return m(this._heatmapRenderer,(e=>({colorRampData:x(e.colorStops)})))}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){const e=this.owner?.view?.resourceController?.memoryController?.memoryFactor??1;return(this.owner?.view?.qualitySettings.heatmap.pixelRatio??1)*Math.sqrt(e)}get _renderView(){return this.view._stage.renderView}get _featuresArePoints(){return"point"===this.layer.geometryType}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const e=this.layer.renderer;return"heatmap"===e?.type?e:null}get _heatmapRendererFieldName(){return m(this._heatmapRenderer,(e=>e.field))}get _heatmapRendererField(){return m(this._heatmapRendererFieldName,(e=>this.layer.fieldsIndex.get(e)))}get _heatmapRendererFieldIsNumeric(){const e=this._heatmapRendererField;return!p(e)&&G(e)}get _isScaleRangeActive(){const{layer:e}=this;if(!("effectiveScaleRange"in e))return!1;const{minScale:t,maxScale:r}=e.effectiveScaleRange;return z(t,r)}get _visibleFeatures(){let e=0;return this._renderGeometries.forEach((t=>{t.instanceParameters.visible&&++e})),e}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return J}maskOccludee(){return J}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;const{objectIdField:t}=this.layer;this._featureStore.removeManyById(e.removed.map((e=>S(e,t)))),this._featureStore.addMany(e.added.map((e=>{const r=new w(P(new j,e.geometry),e.attributes,m(e.centroid,(e=>P(new j,e))),S(e,t));return r.displayId=e.uid,r})));const r=e.added,i=e.removed;this._fieldTotal+=this._computeFieldTotalChange(r,i);const a=u(i,(({uid:e})=>{const t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t})),s=r.map((e=>{const t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t}));a.length>0&&this._drapeSourceRenderer.removeGeometries(a,U.Geometry.REMOVE),s.length>0&&this._drapeSourceRenderer.addGeometries(s,U.Geometry.ADD),(s.length>0||a.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;const e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){const t=this._heatmapRendererFieldName,r=n(t)?this._materialWithField:this._material,i=R();b(e.geometry,i,this._overlaySpatialReference),i[2]=V;const a=[[H.POSITION,{data:i,size:i.length}]],s=this._heatmapRendererFieldIsNumeric;n(t)&&a.push([H.FEATUREATTRIBUTE,{data:[s?e.attributes[t]??0:0],size:1}]);const o=new C(new E(a,null,O.Point),r,{layerUid:this.layer.uid,graphicUid:e.uid});return F(o.boundingSphere,i),o.instanceParameters.visible=this.filterVisibility.defaultVisibility,o}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(p(this._heatmapRendererFieldName)||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;const r=this._heatmapRendererFieldName,i=(e,t)=>e+(t.attributes[r]??0);return e.reduce(i,0)-t.reduce(i,0)}_clampSearchRadius(e){return e>q&&k.warnOnce(`SceneView supports a maximum radius of ${q} pt for HeatmapRenderer.`),Math.min(e,q)}_updateFeatureVisibilities(e){const t=[];this._featureStore.forEach((({objectId:r,displayId:i})=>{const a=e(r),s=this._renderGeometries.get(i);s.instanceParameters.visible!==a&&(t.push(s),s.instanceParameters.visible=a)})),this._drapeSourceRenderer.modifyGeometries(t,U.State.VISIBILITIES)}_setAllFeaturesVisibility(e){const t=[];for(const r of this._renderGeometries.values())r.instanceParameters.visible!==e&&(t.push(r),r.instanceParameters.visible=e);this._drapeSourceRenderer.modifyGeometries(t,U.State.VISIBILITIES)}get test(){return{visibleFeatureCount:this._visibleFeatures}}};e([f()],Y.prototype,"type",void 0),e([f({constructOnly:!0})],Y.prototype,"owner",void 0),e([f()],Y.prototype,"layer",null),e([f()],Y.prototype,"featureStore",null),e([f()],Y.prototype,"updating",null),e([f()],Y.prototype,"updatingRemaining",null),e([f()],Y.prototype,"suspendInfo",null),e([f()],Y.prototype,"legendEnabled",null),e([f()],Y.prototype,"filterVisibility",void 0),e([f()],Y.prototype,"displayFeatureLimit",null),e([f()],Y.prototype,"preferredUpdatePolicy",void 0),e([f()],Y.prototype,"hasZ",null),e([f()],Y.prototype,"hasM",null),e([f()],Y.prototype,"dataExtent",void 0),e([f()],Y.prototype,"view",null),e([f()],Y.prototype,"fullOpacity",null),e([f()],Y.prototype,"updatePolicy",null),e([f()],Y.prototype,"drapeSourceType",void 0),e([f()],Y.prototype,"scaleVisibilitySuspended",null),e([f()],Y.prototype,"_featureStore",void 0),e([f()],Y.prototype,"_overlayRenderer",null),e([f()],Y.prototype,"_overlaySpatialReference",null),e([f()],Y.prototype,"_rendererParameters",null),e([f()],Y.prototype,"_materialParameters",null),e([f()],Y.prototype,"_densityParameters",null),e([f()],Y.prototype,"_radiusParameter",null),e([f()],Y.prototype,"_resolutionForScaleParameter",null),e([f()],Y.prototype,"_colorRampParameter",null),e([f()],Y.prototype,"_pixelRatioParameter",null),e([f()],Y.prototype,"_densityMapPixelRatio",null),e([f()],Y.prototype,"_renderGeometries",void 0),e([f()],Y.prototype,"_material",void 0),e([f()],Y.prototype,"_materialWithField",void 0),e([f()],Y.prototype,"_renderView",null),e([f()],Y.prototype,"_featuresArePoints",null),e([f()],Y.prototype,"_loadedPointGraphics",null),e([f()],Y.prototype,"_heatmapRenderer",null),e([f()],Y.prototype,"_heatmapRendererFieldName",null),e([f()],Y.prototype,"_heatmapRendererField",null),e([f()],Y.prototype,"_heatmapRendererFieldIsNumeric",null),e([f()],Y.prototype,"_fieldTotal",void 0),e([f()],Y.prototype,"_drapeSourceRenderer",void 0),e([f()],Y.prototype,"_isScaleRangeActive",null),Y=e([g($)],Y);const J=s();export{Y as HeatmapFeatureProcessor,q as MAX_RADIUS_PT};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Handles.js";import s from"../../../core/Logger.js";import{isNone as o,isSome as n}from"../../../core/maybe.js";import{watch as h,on as l,when as p}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as m}from"../../../core/screenUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../core/accessorSupport/decorators/subclass.js";import{d as u}from"../../../chunks/vec3.js";import{d as w}from"../../../chunks/vec3f64.js";import{s as g}from"../../../chunks/vec4.js";import{c as y}from"../../../chunks/vec4f64.js";import C from"../../../geometry/Extent.js";import f from"../../../geometry/Point.js";import{canProject as _}from"../../../geometry/support/webMercatorUtils.js";import{ViewingMode as x}from"../../ViewingMode.js";import{applyAll as R}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as P,surfaceElevationBelowRenderLocation as O}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as b}from"./Frustum.js";import{GoToOperation as S}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as j}from"./controllers/SurfaceCollisionCorrectionController.js";import{internalToExternal as M,externalToInternal as I,toExtent as B,distanceToScale as L,scaleToZoom as U,fromExtent as k,OrientationMode as z,getObserverForPointAtDistance as E,scaleToDistance as V,zoomToScale as A}from"../support/cameraUtils.js";import{PropertiesPool as D}from"../support/PropertiesPool.js";import{fromCamera as H,toCamera as N}from"../support/viewpointUtils.js";import{Camera as F,PaddingSide as G}from"../webgl-engine/lib/Camera.js";let q=class extends r{constructor(e){super(e),this.propertiesPool=new D({frustum:b},this),this.handles=new a,this.cameraSetByUser=!1,this.gotoOperation=null,this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._maximumPixelRatioOverride=null,this.test={contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,setMaximumPixelRatio:e=>this._maximumPixelRatioOverride=e}}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=M(this.view,this.view.state.camera);return t&&e&&t.equals(e)?e:t}set camera(e){this._updatePropertyBeforeReady("camera",e)||(this.view.elevationProvider.enableElevationCache(!0),this.setStateCamera(I(this.view,e),{applyConstraints:!1})||s.getLogger(this.declaredClass).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableElevationCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=M(this.view,this.view.state.contentCamera);return t&&e&&t.equals(e)?e:t}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=I(this.view,e);o(t)?this.view.state.contentCamera=null:(this._updateElevation(t),this.view.state.contentCamera=t)}installContentCameraReset(e){if(this.handles.remove("contentCameraReset"),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=w(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.handles.add([h((()=>this.contentCamera),(()=>{e.sticky||(this.handles.remove("contentCameraReset"),this.test.contentCameraResetState.clear())})),h((()=>this.zoom),(e=>{this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})),h((()=>this.view.state.camera),(e=>{const t=u(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)}))],"contentCameraReset"),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():s.getLogger(this.declaredClass).error("#center=","Invalid center",e):s.getLogger(this.declaredClass).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",e):s.getLogger(this.declaredClass).error("#center=","Center may not be null or undefined"))}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=B(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return n(t)?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||s.getLogger(this.declaredClass).error("#extent=","Invalid extent",e):s.getLogger(this.declaredClass).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",e):s.getLogger(this.declaredClass).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this.propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get hasInitialView(){return!!this.view.get("map.initialViewProperties.viewpoint")}get scale(){if(this.ready){const e=this.view.pointsOfInterest.centerOnContent;return L(this.view,e.distance,e.location.latitude)}return this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||s.getLogger(this.declaredClass).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[G.TOP]/i),s=Math.round(t[G.RIGHT]/i),o=Math.round(t[G.BOTTOM]/i),n=Math.round(t[G.LEFT]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===o&&r.left===n?r:{top:a,right:s,bottom:o,left:n}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Z),this.view.state.updateCamera((e=>e.padding=Z)))}_paddingToArray(e,t,i){e?g(i,e.top||0,e.right||0,e.bottom||0,e.left||0):g(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return m((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?H(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e)if(this.isCompatible(e))this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||s.getLogger(this.declaredClass).error("#viewpoint=","Invalid viewpoint",e);else{const t=n(e.camera)?e.camera.position:e.targetGeometry,i=n(t)&&t.spatialReference;s.getLogger(this.declaredClass).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",e)}else s.getLogger(this.declaredClass).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?U(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||s.getLogger(this.declaredClass).error("#zoom=","Invalid zoom",e)}get maximumPixelRatio(){if(n(this._maximumPixelRatioOverride))return this._maximumPixelRatioOverride;let e=1/0;const{maximumPixelRatio:t,maximumRenderResolution:i}=this.view.qualitySettings;if(null!=t&&(e=Math.min(e,t)),null!=i){const t=i/Math.max(this.view.width,this.view.height);e=Math.min(e,t)}return e}get _devicePixelRatio(){return o(this._devicePixelRatioOverride)?Math.min(this._windowDevicePixelRatio,this.maximumPixelRatio):this._devicePixelRatioOverride}initialize(){this.handles.add([l((()=>this.view.state.events),"before-camera-change",(e=>this._updateElevation(e.camera)))]),h((()=>this.view.state.camera),(e=>this._updateElevation(e)),{once:!0,sync:!0}),this.handles.add(c({prepare:()=>this._prepareFrame()})),this.handles.add(h((()=>this.view.state.cameraController),(()=>{this.cameraSetByUser=!0,this.handles.remove($)}))),this.handles.add(l((()=>this.view.state.events),"camera-projection-changed",(()=>this.notifyChange("scale"))))}destroy(){this.deinit(),this.handles&&(this.handles.destroy(),this.handles=null),this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)}init(){this.constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this.cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this.cameraSetByUser){const e=this.view.get("map.initialViewProperties.viewpoint")||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):this.view.state.viewingMode===x.Local&&this.handles.add(p((()=>this.view.basemapTerrain.ready),(()=>{this.handles.remove($),this._setInitialView(this.view.dataExtent)}),{once:!0,initial:!0}),$)}}deinit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this.cameraSetByUser=!1,this.handles.remove($),this.constraintsManager&&(this.constraintsManager.destroy(),this.constraintsManager=null))}async goTo(e,t){const i={animate:!0,...t};return n(this.gotoOperation)&&this.gotoOperation.abort(i.animate),this.gotoOperation=new S(e,i,this.view),this.view.resourceController.scheduler.stopFrame(),this.gotoOperation}debugSetCameraOnContent(){this.setStateCamera(P(this.view),{applyConstraints:!1})}step(e){const t=this.view.state,i=t&&this.view.state.cameraController;i&&(t.updateCamera((t=>{i.stepController(e,t)})),i.steppingFinished&&i.finishController())}_cancelGoToOperation(){n(this.gotoOperation)&&(this.gotoOperation.abort(),this.gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of K){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach((t=>e.add(t)))}return t}_setInitialView(e){if(o(e)||this.cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(I(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof C){const t=k(this.view,e.targetGeometry,0,.5,z.LOCKED);return void(n(t)&&this.setStateCamera(I(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=k(this.view,e,0,.5,z.LOCKED);n(r)&&this.setStateCamera(I(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&J.includes(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return!o(e)&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&_(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=Q){return this.cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=Y){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=E(this.view,r,a,e,t,z.ADJUST);return o(s)?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){const t=this.view.pointsOfInterest.centerOnContent;t.runTask();const i=t.distance;return this._centerPointAtDistanceToCamera(e,i)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=k(this.view,e,t,i,z.ADJUST,X);return n(r)?I(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view.pointsOfInterest.centerOnContent;t.runTask();const i=t.renderLocation,r=t.location.latitude,a=V(this.view,e,r);return this._centerPointAtDistanceToCamera(i,a)}_zoomToCamera(e){return this._scaleToCamera(A(this.view,e))}_viewpointToCamera(e){return I(this.view,N(this.view,e))}setStateCamera(e,t){return!(o(e)||!this.view.state.stopActiveCameraController())&&(this.cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera((i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up):i.copyFrom(e),t.applyConstraints&&R(this.view,i)})),t.applyConstraints||(this.view.state.cameraController=new j({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t}=this.view;if(!e||!t)return;this._windowDevicePixelRatio=window.devicePixelRatio;const i=this._devicePixelRatio,r=Math.round(e.clientWidth*i),a=Math.round(e.clientHeight*i);if(0!==r&&0!==a&&(t.width===r&&t.height===a||(t.width=r,t.height=a),this.view.state)){const e=this.view.state.camera;e.fullWidth===r&&e.fullHeight===a&&e.pixelRatio===i||(Y.copyFrom(e),Y.pixelRatio!==i&&(this._paddingToArray(this.padding,i,Z),Y.padding=Z),Y.fullWidth=r,Y.fullHeight=a,Y.pixelRatio=i,this.view.state.camera=Y)}}_updateElevation(e){const t=this.view.basemapTerrain&&this.view.basemapTerrain.spatialReference,i=this.view.renderCoordsHelper.getAltitude(e.eye),r=t?O(this.view,e.eye):0;e.relativeElevation=i-r}};e([d({type:t,dependsOn:["view.state.camera","ready"]})],q.prototype,"camera",null),e([d({type:t,dependsOn:["view.state.contentCamera","ready"]})],q.prototype,"contentCamera",null),e([d({type:f})],q.prototype,"center",null),e([d({type:C})],q.prototype,"extent",null),e([d({readOnly:!0})],q.prototype,"frustum",null),e([d({readOnly:!0})],q.prototype,"hasInitialView",null),e([d({readOnly:!0,type:Boolean})],q.prototype,"ready",void 0),e([d({type:Number})],q.prototype,"scale",null),e([d()],q.prototype,"padding",null),e([d({readOnly:!0})],q.prototype,"screenCenter",null),e([d({constructOnly:!0})],q.prototype,"view",void 0),e([d({type:i})],q.prototype,"viewpoint",null),e([d({type:Number})],q.prototype,"zoom",null),e([d()],q.prototype,"maximumPixelRatio",null),e([d()],q.prototype,"_devicePixelRatio",null),e([d()],q.prototype,"_windowDevicePixelRatio",void 0),e([d()],q.prototype,"_devicePixelRatioOverride",void 0),e([d()],q.prototype,"_maximumPixelRatioOverride",void 0),q=e([v("esri.views.3d.state.ViewStateManager")],q);const W=q,J=["camera","viewpoint","extent","scale","center","zoom"],K=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],Q={heading:0,tilt:0},X=new t,Y=new F,Z=y(),$="pending-initial-view";export{W as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Handles.js";import s from"../../../core/Logger.js";import{isNone as o,isSome as n}from"../../../core/maybe.js";import{watch as h,on as l,when as p}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as m}from"../../../core/screenUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../core/accessorSupport/decorators/subclass.js";import{d as u}from"../../../chunks/vec3.js";import{d as w}from"../../../chunks/vec3f64.js";import{s as g}from"../../../chunks/vec4.js";import{c as y}from"../../../chunks/vec4f64.js";import C from"../../../geometry/Extent.js";import f from"../../../geometry/Point.js";import{canProject as _}from"../../../geometry/support/webMercatorUtils.js";import{ViewingMode as x}from"../../ViewingMode.js";import{applyAll as R}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as P,surfaceElevationBelowRenderLocation as O}from"../camera/intersectionUtils.js";import{ConstraintsManager as T}from"./ConstraintsManager.js";import{Frustum as b}from"./Frustum.js";import{GoToOperation as S}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as j}from"./controllers/SurfaceCollisionCorrectionController.js";import{internalToExternal as M,externalToInternal as I,toExtent as B,distanceToScale as L,scaleToZoom as U,fromExtent as k,OrientationMode as z,getObserverForPointAtDistance as E,scaleToDistance as V,zoomToScale as A}from"../support/cameraUtils.js";import{PropertiesPool as D}from"../support/PropertiesPool.js";import{fromCamera as H,toCamera as N}from"../support/viewpointUtils.js";import{Camera as F,PaddingSide as G}from"../webgl-engine/lib/Camera.js";let q=class extends r{constructor(e){super(e),this.propertiesPool=new D({frustum:b},this),this.handles=new a,this.cameraSetByUser=!1,this.gotoOperation=null,this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._maximumPixelRatioOverride=null,this.test={contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,setMaximumPixelRatio:e=>this._maximumPixelRatioOverride=e}}get camera(){const e=this._get("camera");if(!this.ready)return e;const t=M(this.view,this.view.state.camera);return t&&e&&t.equals(e)?e:t}set camera(e){this._updatePropertyBeforeReady("camera",e)||(this.view.elevationProvider.enableElevationCache(!0),this.setStateCamera(I(this.view,e),{applyConstraints:!1})||s.getLogger(this.declaredClass).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableElevationCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const t=M(this.view,this.view.state.contentCamera);return t&&e&&t.equals(e)?e:t}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=I(this.view,e);o(t)?this.view.state.contentCamera=null:(this._updateElevation(t),this.view.state.contentCamera=t)}installContentCameraReset(e){if(this.handles.remove("contentCameraReset"),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=w(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.handles.add([h((()=>this.contentCamera),(()=>{e.sticky||(this.handles.remove("contentCameraReset"),this.test.contentCameraResetState.clear())})),h((()=>this.zoom),(e=>{this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})),h((()=>this.view.state.camera),(e=>{const t=u(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)}))],"contentCameraReset"),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():s.getLogger(this.declaredClass).error("#center=","Invalid center",e):s.getLogger(this.declaredClass).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",e):s.getLogger(this.declaredClass).error("#center=","Center may not be null or undefined"))}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=B(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return n(t)?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||s.getLogger(this.declaredClass).error("#extent=","Invalid extent",e):s.getLogger(this.declaredClass).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",e):s.getLogger(this.declaredClass).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this.propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get hasInitialView(){return!!this.view.get("map.initialViewProperties.viewpoint")}get scale(){if(this.ready){const e=this.view.pointsOfInterest.centerOnContent;return L(this.view,e.distance,e.location.latitude)}return this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||s.getLogger(this.declaredClass).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[G.TOP]/i),s=Math.round(t[G.RIGHT]/i),o=Math.round(t[G.BOTTOM]/i),n=Math.round(t[G.LEFT]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===o&&r.left===n?r:{top:a,right:s,bottom:o,left:n}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,Z),this.view.state.updateCamera((e=>e.padding=Z)))}_paddingToArray(e,t,i){e?g(i,e.top||0,e.right||0,e.bottom||0,e.left||0):g(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return m((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?H(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e)if(this.isCompatible(e))this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||s.getLogger(this.declaredClass).error("#viewpoint=","Invalid viewpoint",e);else{const t=n(e.camera)?e.camera.position:e.targetGeometry,i=n(t)&&t.spatialReference;s.getLogger(this.declaredClass).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference.wkid+")",e)}else s.getLogger(this.declaredClass).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?U(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||s.getLogger(this.declaredClass).error("#zoom=","Invalid zoom",e)}get maximumPixelRatio(){if(n(this._maximumPixelRatioOverride))return this._maximumPixelRatioOverride;let e=1/0;const{maximumPixelRatio:t,maximumRenderResolution:i}=this.view.qualitySettings;if(null!=t&&(e=Math.min(e,t)),null!=i){const t=i/Math.max(this.view.width,this.view.height);e=Math.min(e,t)}return e}get _devicePixelRatio(){return o(this._devicePixelRatioOverride)?Math.min(this._windowDevicePixelRatio,this.maximumPixelRatio):this._devicePixelRatioOverride}initialize(){this.handles.add([l((()=>this.view.state.events),"before-camera-change",(e=>this._updateElevation(e.camera)))]),h((()=>this.view.state.camera),(e=>this._updateElevation(e)),{once:!0,sync:!0}),this.handles.add(c({prepare:()=>this._prepareFrame()})),this.handles.add(h((()=>this.view.state.cameraController),(()=>{this.cameraSetByUser=!0,this.handles.remove($)}))),this.handles.add(l((()=>this.view.state.events),"camera-projection-changed",(()=>this.notifyChange("scale"))))}destroy(){this.deinit(),this.handles&&(this.handles.destroy(),this.handles=null),this.propertiesPool&&(this.propertiesPool.destroy(),this.propertiesPool=null)}init(){this.constraintsManager=new T({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this.cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this.cameraSetByUser){const e=this.view.get("map.initialViewProperties.viewpoint")||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):this.view.state.viewingMode===x.Local&&this.handles.add(p((()=>this.view.basemapTerrain.ready),(()=>{this.handles.remove($),this._setInitialView(this.view.dataExtent)}),{once:!0,initial:!0}),$)}}deinit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this.cameraSetByUser=!1,this.handles.remove($),this.constraintsManager&&(this.constraintsManager.destroy(),this.constraintsManager=null))}async goTo(e,t){const i={animate:!0,...t};return n(this.gotoOperation)&&this.gotoOperation.abort(i.animate),this.gotoOperation=new S(e,i,this.view),this.view.resourceController.scheduler.stopFrame(),this.gotoOperation}debugSetCameraOnContent(){this.setStateCamera(P(this.view),{applyConstraints:!1})}step(e){const t=this.view.state,i=t&&this.view.state.cameraController;i&&(t.updateCamera((t=>{i.stepController(e,t)})),i.steppingFinished&&i.finishController())}_cancelGoToOperation(){n(this.gotoOperation)&&(this.gotoOperation.abort(),this.gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of K){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach((t=>e.add(t)))}return t}_setInitialView(e){if(o(e)||this.cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(I(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof C){const t=k(this.view,e.targetGeometry,0,.5,z.LOCKED);return void(n(t)&&this.setStateCamera(I(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=k(this.view,e,0,.5,z.LOCKED);n(r)&&this.setStateCamera(I(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&J.includes(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return!o(e)&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&_(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=Q){return this.cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=Y){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=E(this.view,r,a,e,t,z.ADJUST);return o(s)?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){const t=this.view.pointsOfInterest.centerOnContent;t.runTask();const i=t.distance;return this._centerPointAtDistanceToCamera(e,i)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=k(this.view,e,t,i,z.ADJUST,X);return n(r)?I(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view.pointsOfInterest.centerOnContent;t.runTask();const i=t.renderLocation,r=t.location.latitude,a=V(this.view,e,r);return this._centerPointAtDistanceToCamera(i,a)}_zoomToCamera(e){return this._scaleToCamera(A(this.view,e))}_viewpointToCamera(e){return I(this.view,N(this.view,e))}setStateCamera(e,t){return!(o(e)||!this.view.state.stopActiveCameraController())&&(this.cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera((i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up):i.copyFrom(e),t.applyConstraints&&R(this.view,i)})),t.applyConstraints||(this.view.state.cameraController=new j({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:t}=this.view;if(!e||!t)return;this._windowDevicePixelRatio=window.devicePixelRatio;const i=this._devicePixelRatio,r=Math.round(e.clientWidth*i),a=Math.round(e.clientHeight*i);if(0!==r&&0!==a&&(t.width===r&&t.height===a||(t.width=r,t.height=a),this.view.state)){const e=this.view.state.camera;e.fullWidth===r&&e.fullHeight===a&&e.pixelRatio===i||(Y.copyFrom(e),Y.pixelRatio!==i&&(this._paddingToArray(this.padding,i,Z),Y.padding=Z),Y.fullWidth=r,Y.fullHeight=a,Y.pixelRatio=i,this.view.state.camera=Y)}}_updateElevation(e){const t=this.view.basemapTerrain&&this.view.basemapTerrain.spatialReference,i=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,r=t?O(this.view,e.eye):0;e.relativeElevation=i-r}};e([d({type:t,dependsOn:["view.state.camera","ready"]})],q.prototype,"camera",null),e([d({type:t,dependsOn:["view.state.contentCamera","ready"]})],q.prototype,"contentCamera",null),e([d({type:f})],q.prototype,"center",null),e([d({type:C})],q.prototype,"extent",null),e([d({readOnly:!0})],q.prototype,"frustum",null),e([d({readOnly:!0})],q.prototype,"hasInitialView",null),e([d({readOnly:!0,type:Boolean})],q.prototype,"ready",void 0),e([d({type:Number})],q.prototype,"scale",null),e([d()],q.prototype,"padding",null),e([d({readOnly:!0})],q.prototype,"screenCenter",null),e([d({constructOnly:!0})],q.prototype,"view",void 0),e([d({type:i})],q.prototype,"viewpoint",null),e([d({type:Number})],q.prototype,"zoom",null),e([d()],q.prototype,"maximumPixelRatio",null),e([d()],q.prototype,"_devicePixelRatio",null),e([d()],q.prototype,"_windowDevicePixelRatio",void 0),e([d()],q.prototype,"_devicePixelRatioOverride",void 0),e([d()],q.prototype,"_maximumPixelRatioOverride",void 0),q=e([v("esri.views.3d.state.ViewStateManager")],q);const W=q,J=["camera","viewpoint","extent","scale","center","zoom"],K=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],Q={heading:0,tilt:0},X=new t,Y=new F,Z=y(),$="pending-initial-view";export{W as default};
|