@arcgis/core 4.34.0-next.65 → 4.34.0-next.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.js +1 -1
- package/WebDocument2D.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0814676e4bac81f96140.js +1 -0
- package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 09dbb3e200ef8d514eb3.js} +2 -2
- package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
- package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
- package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
- package/assets/esri/core/workers/chunks/144bfd64daf103a06734.js +1 -0
- package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → 170ec7fb070c63230c81.js} +1 -1
- package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
- package/assets/esri/core/workers/chunks/1ada9e6cdd6792e3847a.js +1 -0
- package/assets/esri/core/workers/chunks/1e86df439c564fe752e3.js +1 -0
- package/assets/esri/core/workers/chunks/{4459c8e495a37d4c4eb8.js → 25118304c9a914194e90.js} +1 -1
- package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
- package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
- package/assets/esri/core/workers/chunks/{d823277612f971a9c2f0.js → 3245663da75e168bf85c.js} +1 -1
- package/assets/esri/core/workers/chunks/37d7c249114994a7dfac.js +1 -0
- package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 39d69afc9da9db0c75ab.js} +1 -1
- package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
- package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbcef57073075e9cfdfe.js → 489fa17e60f25d5f33ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{19e5e011f929b6b940fe.js → 4bc091770bab38874848.js} +1 -1
- package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
- package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
- package/assets/esri/core/workers/chunks/5185c63fecc5f493e142.js +1 -0
- package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
- package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
- package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
- package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 5b84eba4a28e25b6d5c0.js} +1 -1
- package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
- package/assets/esri/core/workers/chunks/{497214e9e82b936fc94e.js → 5ed381a268855bcad072.js} +1 -1
- package/assets/esri/core/workers/chunks/{33718ea851645d9078d1.js → 605acf18cbeb89e4f29f.js} +1 -1
- package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
- package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
- package/assets/esri/core/workers/chunks/{4d7fcec769369c576847.js → 6e59ba2afd444eb4be18.js} +1 -1
- package/assets/esri/core/workers/chunks/{a700f57af6856cb5313c.js → 70dc7ec6474f0801bc04.js} +1 -1
- package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
- package/assets/esri/core/workers/chunks/80b0c88a76bd523a406a.js +1 -0
- package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
- package/assets/esri/core/workers/chunks/837830e1cf712d4243a5.js +1 -0
- package/assets/esri/core/workers/chunks/87fb5d755860057da164.js +1 -0
- package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 8a104b35708a492bd614.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
- package/assets/esri/core/workers/chunks/8e2558b14be70b273ce4.js +1 -0
- package/assets/esri/core/workers/chunks/{8e40c409a9b0a2a768a9.js → 8f02349602b072186a1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa0f94318173db2034de.js → 90491262b6d6a126c32f.js} +1 -1
- package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +1 -0
- package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
- package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e3c09c3524654830b14.js → a634764dec5404f4a1d7.js} +1 -1
- package/assets/esri/core/workers/chunks/a895da7fd64ebad3d5a4.js +1 -0
- package/assets/esri/core/workers/chunks/aa970a547c60c43d6c7f.js +1 -0
- package/assets/esri/core/workers/chunks/ab727ed4417b7dd94ce9.js +1 -0
- package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → ad3ebd4f05cc673140f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
- package/assets/esri/core/workers/chunks/b052d3ef5493eedb44a5.js +1 -0
- package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
- package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
- package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd1d9913b33d4e48baff.js → c35dad3d5ceaac6ad5a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1b573840ec1f7c3afd3.js → c4b2678dd46fa1e22f7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc931865a77fc48871d3.js → c94c797864a85342b105.js} +1 -1
- package/assets/esri/core/workers/chunks/{e97250ae8da4bd0d6bc9.js → cad03967e132a28512c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7a386ac90e58eb71935.js → da1a5537e2f2ca6cc247.js} +1 -1
- package/assets/esri/core/workers/chunks/dd447dfc50ee7f511b84.js +1 -0
- package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
- package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
- package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
- package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
- package/assets/esri/core/workers/chunks/ed1272e7681e561d843f.js +1 -0
- package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
- package/assets/esri/core/workers/chunks/efea3e82cec476d486e0.js +1 -0
- package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
- package/assets/esri/core/workers/chunks/{ff2614d96ca5228e9685.js → f4d4c1f13522f20b00d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → f9385d7fb5ff20f7b252.js} +1 -1
- package/assets/esri/core/workers/chunks/{b30de4936caa654d7817.js → fac020b6886ff2d75015.js} +1 -1
- package/assets/esri/core/workers/chunks/fe353a53968827bcd9cc.js +1 -0
- package/chunks/GlowComposition.glsl.js +3 -3
- package/chunks/RibbonLine.glsl.js +2 -2
- package/config.js +1 -1
- package/core/AsyncUpdate.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/support/centroid.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/graphic/AggregateGraphicOrigin.js +1 -1
- package/graphic/BuildingGraphicOrigin.js +1 -1
- package/graphic/CSVGraphicOrigin.js +1 -1
- package/graphic/CatalogGraphicOrigin.js +1 -1
- package/graphic/FeatureGraphicOrigin.js +1 -1
- package/graphic/GeoJSONGraphicOrigin.js +1 -1
- package/graphic/GeoRSSGraphicOrigin.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +1 -1
- package/graphic/ImageryTileGraphicOrigin.js +1 -1
- package/graphic/KMLGraphicOrigin.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
- package/graphic/LinkChartGraphicOrigin.js +1 -1
- package/graphic/MapImageGraphicOrigin.js +1 -1
- package/graphic/MapNotesGraphicOrigin.js +1 -1
- package/graphic/OGCFeatureGraphicOrigin.js +1 -1
- package/graphic/OrientedImageryGraphicOrigin.js +1 -1
- package/graphic/ParquetGraphicOrigin.js +1 -1
- package/graphic/PointCloudGraphicOrigin.js +1 -1
- package/graphic/SceneGraphicOrigin.js +1 -1
- package/graphic/StreamGraphicOrigin.js +1 -1
- package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
- package/graphic/TileGraphicOrigin.js +1 -1
- package/graphic/TrackGraphicOrigin.js +1 -1
- package/graphic/VectorTileGraphicOrigin.js +1 -1
- package/graphic/VoxelGraphicOrigin.js +1 -1
- package/graphic/WCSGraphicOrigin.js +1 -1
- package/graphic/WFSGraphicOrigin.js +1 -1
- package/graphic/getIdFieldsProvider.js +5 -0
- package/graphic/getSliceableContainer.js +5 -0
- package/graphic/graphicOrigins.d.ts +0 -2
- package/graphic/graphicOrigins.js +1 -1
- package/interfaces.d.ts +172 -244
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/mixins/TemporalLayer.js +1 -1
- package/layers/mixins/TemporalSceneLayer.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/FeatureFilter.js +1 -1
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/TrackInfo.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/IdentifyParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/ImageParameters.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/support/timeUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/renderUtils.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/time/TimeInterval.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PostProcessingShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +5 -0
- package/views/3d/analysis/VolumeMeasurement/volumeMeasurementGeometryUtils.js +5 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Intersector.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +5 -0
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
- package/views/draw/support/createUtils.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/webdoc/support/timeProperties.js +1 -1
- package/webdoc/widgets/TimeSlider.js +1 -1
- package/webmap/InitialViewProperties.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
- package/TimeExtent.d.ts +0 -4
- package/TimeExtent.js +0 -5
- package/TimeInterval.d.ts +0 -4
- package/TimeInterval.js +0 -5
- package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
- package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
- package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +0 -1
- package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +0 -1
- package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
- package/assets/esri/core/workers/chunks/0d82cc6905b105b3568a.js +0 -1
- package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
- package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
- package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
- package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
- package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
- package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
- package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
- package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
- package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
- package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
- package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
- package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
- package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
- package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
- package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
- package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
- package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
- package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
- package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
- package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
- package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
- package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
- package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
- package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
- package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
- package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
- package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
- package/assets/esri/core/workers/chunks/eadac757f74470b89a36.js +0 -1
- package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
- package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
- package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
- package/chunks/TimeExtent.js +0 -5
- package/chunks/TimeInterval.js +0 -5
- package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
- package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
- package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
- package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
- package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
- package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Bloom.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Blur.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Colorize.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Opacity.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import t from"../../../core/Error.js";import{handlesGroup as s}from"../../../core/handleUtils.js";import o from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{abortMaybe as l}from"../../../core/maybe.js";import{isAbortError as a,allSettledValues as u,throwIfAborted as p,createResolver as h}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as y}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{isBuildingGraphicOrigin as f}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{isGraphic as m}from"../../../support/guards.js";import w from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{LayerView3D as V}from"./LayerView3D.js";import{parseFilterMode as j}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as S}from"./i3s/I3SUtil.js";import{normalizeHighlightTarget as _,emptyHighlightHandle as C}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as v}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as B}from"../support/updatingProperties.js";import M from"../../layers/BuildingSceneLayerView.js";import{isInEffectiveScaleRange as E}from"../../support/layerViewUtils.js";const F=b(r);let P=class extends(V(M)){constructor(e){super(e),this.type="building-scene-3d",this.sublayerViews=new i,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get filterExpression(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find(r=>r.id===e):null,i=null!=r?r.filterBlocks?.find(e=>"solid"===e.filterMode.type):null;return i?i.filterExpression:null}get filterExpressions(){const e=this.layer.activeFilterId,r=null!=e?this.layer.filters.find(r=>r.id===e):null;return r?.filterBlocks?r.filterBlocks.toArray().map(e=>[e.filterExpression??"",j(e)]):[]}get updatingProgressValue(){const e=this.sublayerViews,r=this._loadingComponents+(e?e.length:0);return e.reduce((e,r)=>e+r.updatingProgress,0)/r}get visibleAtCurrentScale(){return E(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){S(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach(e=>e.destroy()),this.sublayerViews=null),this._rejectedSublayerViews=null,this._abortController=l(this._abortController)}_initializeSublayerViews(e,r){const i=this,s=this.view;e.forEach(e=>{if(!e.isEmpty)if("building-group"===e.type){const i=new F({sublayer:e,view:s,parent:r});this._initializeSublayerViews(e.sublayers,i)}else"mesh"===e.geometryType?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{const t=new w({sublayer:e,layerView:i,view:s,parent:r});this.sublayerViews.push(t);const o=this._pendingWhenSublayerViews.get(e);if(o){for(const e of o)e.resolve(t);this._pendingWhenSublayerViews.delete(e)}this.addHandles([c(()=>t.updating,()=>this.notifyChange("updating"),y),c(()=>t.updatingProgress,()=>this.notifyChange("updatingProgressValue"),y)])}).catch(r=>{a(r)||o.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,r),this._rejectWhenSublayerView(e,r)}).then(()=>{this._loadingComponents--,this.notifyChange("updating"),this.notifyChange("updatingProgressValue")})):this._rejectWhenSublayerView(e,new t("view:no-layerview-for-sublayer",`No layerview created for sublayer ${e.id}`))})}getGraphicFromIntersectorTarget(e,r){for(const i of this.sublayerViews.items)if(i.sublayer.id===e.sublayerId)return i.getGraphicFromIntersectorTarget(e,r);return null}async fetchPopupFeaturesFromGraphics(e,r){if(0===e.length)return[];const i=I(e,e=>f(e.origin)?e.origin.sublayer:e.sourceLayer),t=[];for(const[o,n]of i){const e=this._findComponent(o);null!=e&&t.push(e.fetchPopupFeaturesFromGraphics(n,r))}const s=await u(t);return p(r),s.flat()}whenGraphicBounds(e){const r=this._findComponent(f(e.origin)?e.origin.sublayer:e.sourceLayer);return null==r?Promise.reject():r.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(const r of this.sublayerViews.items)if(r.sublayer.id===e.sublayerId)return r.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){const r=this._findComponent(e);if(null!=r)return r;const i=this._rejectedSublayerViews.get(e);if(null!=i)throw i;const t=this._pendingWhenSublayerViews.get(e),s=h();return t?t.push(s):this._pendingWhenSublayerViews.set(e,[s]),s.promise}_rejectWhenSublayerView(e,r){this._rejectedSublayerViews.set(e,r);const i=this._pendingWhenSublayerViews.get(e);if(i){for(const e of i)e.reject(r);this._pendingWhenSublayerViews.delete(e)}}_findComponent(e){return this.sublayerViews.find(r=>e===r.sublayer)}highlight(e,r){const i=_(e);if(0===i.length)return C;if(m(i[0])){const e=i,t=new Map;for(const r of e)n(t,f(r.origin)?r.origin.sublayer:r.sourceLayer,()=>[]).push(r);const o=[];return this.sublayerViews.forEach(e=>{const i=t.get(e.sublayer);i&&o.push(e.highlight(i,r))}),s(o)}return C}get usedMemory(){return this.sublayerViews.reduce((e,r)=>e+r.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,r)=>e+r.unloadedMemory,0)}get performanceInfo(){return new v(this.usedMemory)}};function I(e,r){const i=new Map,t=e.length;for(let s=0;s<t;s++){const t=e[s],o=r(t,s,e),n=i.get(o);n?n.push(t):i.set(o,[t])}return i}e([d()],P.prototype,"sublayerViews",void 0),e([d()],P.prototype,"_rejectedSublayerViews",void 0),e([d({readOnly:!0})],P.prototype,"filterExpression",null),e([d({readOnly:!0})],P.prototype,"filterExpressions",null),e([d(B)],P.prototype,"updatingProgress",void 0),e([d({readOnly:!0,dependsOn:[]})],P.prototype,"updatingProgressValue",null),e([d({readOnly:!0})],P.prototype,"visibleAtCurrentScale",null),P=e([g("esri.views.3d.layers.BuildingSceneLayerView3D")],P);const L=P;export{L as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Error.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Error.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as l}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as h}from"../../../layers/support/timeSupport.js";import a from"../../../rest/support/AttributeBinsQuery.js";import p from"../../../rest/support/Query.js";import{isGraphic as u}from"../../../support/guards.js";import{attributeLookup as g}from"./support/attributeUtils.js";import{normalizeHighlightTarget as c,emptyHighlightHandle as y,isObjectId as d}from"./support/highlightUtils.js";import{getHighlightName as m}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as f,hasLayerBasedScaleVisibility as P}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as b}from"../../support/projectionUtils.js";const v=v=>{const I=v;let w=class extends I{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new Map,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new i("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await b(this.layer.fullExtent,this.view.spatialReference):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=s(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return P()?f(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return h(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){if(has("feature-pipeline-3d-test"))return this._getHitMock(e);const i=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==i)return null;const r=l(i,this.layer,this.layer.graphicOrigin);return{type:"graphic",graphic:r,layer:r.layer}}_getHitMock(e){const i=this.layer,r={};r[this.layer.objectIdField]=e;const s=new t({layer:i,sourceLayer:i,origin:this.graphicOrigin,visible:!0,symbol:null,attributes:r,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}async queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():p.from(e)}_ensureAttributeBinsQuery(e){const t=a.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_addHighlightIds(e){for(const t of e){const e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}this.notifyChange("highlightIds")}_removeHighlightIds(e){for(const t of e){let e=this._highlightCounter.get(t);null!=e&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}this.notifyChange("highlightIds")}highlight(e,t){const i=m(t),s=this.layer.objectIdField,n=c(e);if(0===n.length)return y;if(u(n[0])){const e=n;if(null!=g(this.layer.fieldsIndex,e[0].attributes,s)){const t=e.map(e=>g(this.layer.fieldsIndex,e.attributes,s)),n=this.graphicsPipeline.highlightByObjectIds(t,i);return this._addHighlightIds(t),r(()=>{this._removeHighlightIds(t),n.remove()})}return this.graphicsPipeline.highlightByGraphics(e,i)}if(d(n[0])){const e=n;this._addHighlightIds(e);const t=this.graphicsPipeline.highlightByObjectIds(e,i);return r(()=>{t.remove(),this._removeHighlightIds(e)})}return y}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new i("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAggregates(){throw new Error("Not implemented")}};return e([n()],w.prototype,"graphicsPipeline",void 0),e([n({readOnly:!0})],w.prototype,"dataUpdating",null),e([n()],w.prototype,"highlightOptions",void 0),e([n()],w.prototype,"suspended",void 0),e([n({readOnly:!0})],w.prototype,"legendEnabled",null),e([n({readOnly:!0})],w.prototype,"visibleAtCurrentScale",null),e([n()],w.prototype,"updating",void 0),e([n({readOnly:!0})],w.prototype,"updatePolicy",void 0),e([n({type:Boolean})],w.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],w.prototype,"suspendInfo",void 0),e([n()],w.prototype,"symbologySnappingSupported",null),e([n({readOnly:!0})],w.prototype,"hasAllFeatures",null),e([n({readOnly:!0})],w.prototype,"hasAllFeaturesInView",null),e([n({readOnly:!0})],w.prototype,"hasFullGeometries",null),e([n({readOnly:!0})],w.prototype,"timeExtent",null),e([n()],w.prototype,"highlightIds",null),e([n()],w.prototype,"hasHighlight",null),w=e([o("esri.views.3d.layers.FeatureLikeLayerView3D")],w),w};export{v as FeatureLikeLayerView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s,isSome as r}from"../../../core/arrayUtils.js";import has from"../../../core/has.js";import o from"../../../core/Logger.js";import{equals as n}from"../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import l from"../../../core/PooledArray.js";import{ignoreAbortErrors as d,isAbortError as h,throwIfAborted as c,createResolver as u}from"../../../core/promiseUtils.js";import{initial as _,watch as g}from"../../../core/reactiveUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{equals as f}from"../../../core/SetUtils.js";import{isArrayBuffer as p}from"../../../core/typedArrayUtil.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as v,invert as I}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as C}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as M,getTranslation as w}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as x,create as R}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as S}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as O,t as j,o as E,a as F,f as V,g as D,d as T,H as A}from"../../../chunks/vec32.js";import{create as H}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as N}from"../../../chunks/vec42.js";import{fromValues as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as k}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as U}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as L}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as G}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as B}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as q}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as z}from"../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as W,create as $,toRect as K}from"../../../geometry/support/aaBoundingBox.js";import{create as Q,intersects as Y}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as J,ensurePackedMat4f64 as X}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as Z}from"../../../geometry/support/FloatArray.js";import{compactIndices as ee}from"../../../geometry/support/Indices.js";import{a as te,f as ie,n as se,g as re}from"../../../chunks/sphere.js";import{newUByteArray as oe}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as ne}from"../../../layers/LayerConstants.js";import ae from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as le}from"../../../layers/support/fieldUtils.js";import de from"../../../layers/support/SceneModification.js";import{getColor as he,getOpacity as ce}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{isBasemapLayerView as ue}from"../../../support/basemapUtils.js";import{getElevationOffset as _e}from"../../../support/elevationInfoUtils.js";import{loadArcade as ge}from"../../../support/loadArcade.js";import me from"../../../symbols/MeshSymbol3D.js";import fe from"../../../symbols/SimpleFillSymbol.js";import{ContentGeometryUpdateEvent as pe}from"./ContentGeometryLayerView.js";import ye from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as be}from"./I3SMeshViewPerformanceInfo.js";import{I3SMeshWorkerHandle as ve,toWasmModification as Ie}from"./I3SMeshWorkerHandle.js";import{initialize as Ce,setModificationsSync as Me,filterObbsForModificationsSync as we,interpretObbModificationResults as xe}from"./SceneLayerWorker.js";import{overrideColor as Re}from"./graphics/graphicUtils.js";import{areLabelsVisible as Se}from"./graphics/Labeler.js";import Oe from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as je}from"./i3s/I3SAsyncElevationUpdater.js";import{getCachedAttributeValue as Ee}from"./i3s/I3SBinaryReader.js";import{I3SCrossfadeHelper as Fe,NodeCrossfadeMetaData as Ve}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as De}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Te}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ae,selectEncoding as He,defaultMaterial as Ne,createTexture as Pe,configureMaterial as ke}from"./i3s/I3SMaterialUtil.js";import{I3SOverrides as Ue}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as Le}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ge,checkSceneLayerValid as Be,checkSceneLayerCompatibleWithView as qe,whenGraphicAttributes as ze,computeVisibilityObb as We,filterInPlace as $e,intersectBoundingRectWithMbs as Ke,addWraparound as Qe,getSymbolInfo as Ye,transparentEdgeMaterial as Je,getClipRect as Xe}from"./i3s/I3SUtil.js";import{IDBCache as Ze}from"./i3s/IDBCache.js";import{IDBMockCache as et}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as tt}from"./i3s/LayerElevationProvider.js";import{SymbologyInfo as it}from"./i3s/SymbologyInfo.js";import{attributeLookup as st}from"./support/attributeUtils.js";import{normalizeHighlightTarget as rt,emptyHighlightHandle as ot}from"./support/highlightUtils.js";import{makeScheduleFunction as nt}from"./support/makeScheduleFunction.js";import{debugFlags as at}from"../support/debugFlags.js";import{ElevationRange as lt}from"../support/ElevationRange.js";import{toBoundingRect as dt}from"../support/extentUtils.js";import{Obb as ht,ensurePackedObbData as ct}from"../support/orientedBoundingBox.js";import{updatingProgress as ut}from"../support/updatingProperties.js";import{glLayout as _t}from"../support/buffer/glUtil.js";import{ObjectParameters as gt}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as mt,GeometryParameters as ft}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as pt}from"../webgl-engine/collections/Component/Transform.js";import{emissiveStrengthDefault as yt}from"../webgl-engine/core/shaderLibrary/output/Emissions.glsl.js";import{loadBasisTranscoder as bt}from"../webgl-engine/lib/BasisUtil.js";import{getHighlightName as vt}from"../../support/highlightOptionsUtils.js";import{TextureCompressionTracker as It}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as Ct}from"../../../webscene/support/AlphaCutoff.js";const Mt=[1,1,1,1];class wt extends Ve{constructor(e,t,i,s,r,o,n,a,l){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=n,this.anchorIds=a,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbologyStride=5}get cachedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(Number.POSITIVE_INFINITY),this._featureExtents}}const xt=26,Rt=104857600,St=t=>{const p=t;let A=class extends p{constructor(){super(...arguments),this._applySSAO=!0,this._shadeNormals=!0,this._updatingHandles=new k,this._highlights=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._compressionTracker=new It,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this.ignoresMemoryFactor=!1,this._layerUrl="",this._cacheKeySuffix=null,this._planetRadiusInGlobalMode=0,this._elevationTask=null,this._needFilterResolve=!1,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i,this._crossfadeHelper=new Fe(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerViewUid(){return this.uid}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get _isIntegratedMesh(){return"integrated-mesh"===this.i3slayer.type}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible&&this.fullOpacity>Ct}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ge(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?63:37:this._usePBR||this._hasLoadedPBRTextures?44:36}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=e&&"absolute-height"===e.mode?_e(e,this.i3slayer.spatialReference):0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return new Lt(0,0);const t=_e(e,this.i3slayer.spatialReference);switch(e.mode){case"absolute-height":return new Lt(0,t);case"relative-to-ground":return new Lt(1,t);case"on-the-ground":return new Lt(2,0);default:return new Lt(0,0)}}get supportedTextureEncodings(){return Ae(this.view.stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta,t=new lt;for(const i of e.values()){if(null==i)continue;const{node:{serviceMbsInIndexSR:e}}=i,[s,r,o,n]=e;t.expandElevationRangeValues(o-n,o+n)}return t.elevationRangeValid?t:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){const e=has("enable-feature:idb-mock-cache");this._idbCache=e?new et(this.view,e):new Ze("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,i=t.memoryController;this.i3sOverrides=new Ue({view:this.view,layer:this.i3slayer,memoryController:i}),this._workerHandle=new ve(nt(t)),this.addResolvingPromise(this._workerHandle.promise);const s=this.i3slayer.store;this.addResolvingPromise(this._workerHandle.setLegacySchema(this.uid,s.defaultGeometrySchema).catch(d)),Be(this.i3slayer),qe(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new ae({layerView:this,worker:this._workerHandle}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view.stage,this._collection=this._stage.renderView.componentObjectCollection;const r=s.defaultGeometrySchema;if(this._isIntegratedMesh||!r)this._hasComponentData=!1;else{const e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(r?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;const n=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,e=>this._deleteComponentObject(e));this._memCache=n;const l=this._controller,h=this._nodeId2Meta,c=this._nodeId2MetaReloading,u=e=>{const t=l.index;if(!t)return;const i=t.rootNode;if(!i)return;const s=t=>{const i=t.index,s=h.get(i)||c.get(i);return e(t,s?.objectHandle??null)};t.traverse(i,s)};this._intersectionHandler=new Te({layerViewUid:this.layerViewUid,sublayerId:this.sublayerId,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:u}),this._elevationProvider=new tt({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),_),this._updatingHandles.add(()=>this.fullOpacity,e=>this._opacityChange(e)),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this.elevationOffset,(e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()}),this._updatingHandles.add(()=>this.elevationInfo,(e,t)=>this._elevationInfoChanged(e,t),_),this._updatingHandles.add(()=>!this.suspended&&0!==this.elevationInfo.mode,(e,t)=>{e?this.addHandles(this.view.basemapTerrain.on("elevation-change",({extent:e})=>this._ensureElevationTask().addExtent(e)),qt):t&&this.removeHandles(qt)},_),this._updatingHandles.add(()=>this._usePBR,e=>this._updatePBR(e));const m=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add(()=>this.rendererTextureUsage,m),this._updatingHandles.add(()=>this.contentVisible,e=>this._contentVisibleChanged(e),_),this._updatingHandles.add(()=>this.i3slayer.labelsVisible,()=>this._labelingChanged(),_),this._updatingHandles.add(()=>this.i3slayer.labelingInfo,()=>this._labelingChanged(),_),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),_),this.addHandles([g(()=>at.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&at.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||at.I3S_TREE_SHOW_TILES||(this._treeDebugger=a(this._treeDebugger))},_),g(()=>at.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),_)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch(e=>o.getLogger(this).warn(`Failed to initialize IndexedDB cache: ${e}`));const{view:f}=this,{viewingMode:p,renderCoordsHelper:y}=f;this._planetRadiusInGlobalMode="local"===p?0:y.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=a(this._elevationTask),this.i3sOverrides=a(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.notifyObjectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._workerHandle;e&&(e.destroyContextAndSelf(this.uid),this._workerHandle=null),this._removeAllNodeDataFromStage(),this._memCache=a(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=a(this._labeler),this._treeDebugger=a(this._treeDebugger),this._controller=a(this._controller),this._highlights=a(this._highlights),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=a(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=a(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(null!=e){const t=e.usedMemory;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}get usedMemory(){let e=null!=this._labeler?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach(t=>e+=null!=t?t.node.memory:0),this._nodeId2MetaReloading.forEach(t=>e+=null!=t?t.node.memory:0),e}get unloadedMemory(){return(null!=this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(Se(this.i3slayer)&&this._supportsLabeling))return void(null!=this._labeler&&(this._labeler.destroy(),this._labeler=null));if(null!=this._labeler)return;const e=new ye({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides,layerViewUid:this.uid});this._nodeId2Meta.forEach(t=>null!=t&&this._addMetaToLabeler(e,t)),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then(e=>(--this._asyncModuleLoading,e),e=>{throw--this._asyncModuleLoading,e})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=Ce().then(()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()}),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=e=>o.getLogger(this).error("set-modifications-error","Error when setting modifications:",e),t=this.uid,i=this.i3slayer.spatialReference,s=i.isGeographic,r=Ie(this._layerClippingArea,this._modifications,i);this._workerHandle.setModifications(t,r,s).catch(e);try{Me({context:t,modifications:r,isGeodetic:s})}catch(a){e(a)}this._controller.modificationsChanged();const n=this.hasModifications?new l:null;this._nodeId2Meta.forEach((e,t)=>{null==e?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._updateFeatureIdCounts(e,-1),this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):null!=n&&n.push(e.node)}),this.notifyChange("elevationRange"),null!=n&&this._nodeId2MetaReloading.forEach(e=>n.push(e.node)),null!=n&&n.length>0&&(this.updateNodeModificationStatus(n),n.forAll(e=>{if(2!==e.imModificationImpact){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),null!=t?(this._updateFeatureIdCounts(t,-1),this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange("elevationRange")):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}})),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!at.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o=new fe({...t,color:e[s.type]});this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,(e,t)=>this._createAttributes(e,t))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);null!=i?.attributeInfo&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);null!=s&&(await this.i3sOverrides.applyAttributeOverrides(s.featureIds,t,i,this._controller.requiredAttributes),s.attributeInfo=t,this._controller.reschedule(()=>{this._nodeId2Meta.get(e)===s&&this._attributeValuesChanged(s)},i).catch(e=>{h(e)||o.getLogger(this).warn("Error while updating attribute values. Layer might not display correctly.",e)}))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.appliedFilters=null,null!=this._labeler&&this._labeler.setNodeMetaAttributes(e,(e,t)=>this._createAttributes(e,t)),this._updateEngineObject(e)}clearMemCache(){null!=this._memCache&&this._memCache.clear(),this._addTasks.forEach(e=>e.allowMemCache=!1)}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach(t=>null!=t&&e.push(t.node)),e}getVisibleObbs(){const e=new Array;return this._nodeId2Meta.forEach(t=>t&&e.push(this._collection.getComponentObb(t.objectHandle))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach((t,i)=>e.push(i)),this._nodeId2MetaReloading.forEach((t,i)=>e.push(i))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&2&this.supportedTextureEncodings&&this.i3slayer.textureSetDefinitions?.some(e=>e.formats.some(e=>"basis"===e.format||"ktx2"===e.format))&&bt()}_getVertexBufferLayout(e,t){return _t(mt(this._getGeometryParameters({hasTexture:Tt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.i3slayer.objectIdField||ne}_getGlobalIdField(){return this.i3slayer.globalIdField}_findGraphicNodeAndIndex(e){const t=st(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());for(const i of this._nodeId2Meta.values()){const e=i?.featureIds.indexOf(t);if(null!=e&&e>=0)return{node:i.node,index:e}}return null}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(null==i)return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const n of t){const e=st(o,n.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this.getAABB(t.node.index,t.index);return null==i?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this.getAABB(e.nodeIndex,e.componentIndex)}getAABB(e,t){const i=this._nodeId2Meta.get(e);if(null==i?.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=De(t,this._collection,s,J(24),0),o=this.view.renderSpatialReference,n=this.view.spatialReference;return B(r,o,0,r,n,0)?W(r):null}whenGraphicAttributes(e,t){return ze(this.i3slayer,e,this._getObjectIdField(),t,()=>[...this._nodeId2Meta.values()].filter(r))}getGraphicFromIntersectorTarget(e,t){if(null==e.nodeIndex||null==e.componentIndex)return null;const i=this._nodeId2Meta.get(e.nodeIndex);if(null==i?.featureIds||e.componentIndex>=i.featureIds.length)return null;const s=this._createLayerGraphic(this._createAttributes(e.componentIndex,i));return t.defer?(t.defer(async()=>(s.geometry=(await import("./i3s/meshUtils.js")).createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),s)),null):s}_getCacheKey(e){return`${this._layerUrl}/v${xt}/${e}${this._cacheKeySuffix}`}_getCacheKeySuffix(){const e=this.view.renderSpatialReference;if(null==e)return Wt;if(e===U(e))return $t;return this.i3slayer.spatialReference.equals(e)?zt:null!=e.wkid?`@${e.wkid}`:null}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return null!=this._memCache?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){null!=e&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(null==this._memCache)return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,i)}loadMissingTextures(e,t,i,s){const r=e?.filter((e,i)=>{if(0===(e.usage&this.rendererTextureUsage))return!1;if(null==t)return!0;const s=He(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(null==r?.data||s&&r.encoding!==s.encoding)})??[];return 0===r.length?Promise.resolve(!1):i(r,s).then(i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0})}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e.id),t).then(s=>null==s?null:(s.globalTrafo=X(s.globalTrafo),s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(0===this.elevationInfo.mode&&(e.geometryObbInRenderSR=ht.fromData(s.geometryObbData)),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then(i=>(i&&this._idbCache.initialized&&null!=s.textureData&&(s.byteSize=Nt(s.transformedGeometry,s.textureData),s.textureData.every(Ht)&&this._indexedDbSizeCheck(e,s)&&this._idbCache.put(this._getCacheKey(e.id),s).catch(t=>o.getLogger(this).warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`))),c(t),s))))):Promise.resolve(null)}addNode(e,t,i){return At(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,()=>this._transformNode(e,t,i).then(s=>this._safeReschedule(()=>{if(null==s)return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:n,featureIds:a,anchorIds:l,anchors:d,transformedGeometry:h}=s,c=X(s.globalTrafo),u=O(Gt,r.center.x,r.center.y,r.center.z);j(u,u,c);const _=new ht(u,[r.extents.x,r.extents.y,r.extents.z],S(r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w));0===this.elevationInfo.mode&&(e.geometryObbInRenderSR=_),t.geometryData.componentOffsets=n,a&&(t.geometryData.featureIds=Array.from(a)),t.geometryData.anchorIds=l,t.geometryData.anchors=d;const g={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:h,globalTrafo:c,geometryObbData:_.data,byteSize:Nt(h,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&this._indexedDbSizeCheck(e,g)){const t=null!=g.textureData?g.textureData.map(e=>Ht(e)?e:null):null;this._idbCache.put(this._getCacheKey(e.id),{...g,textureData:t}).catch(t=>o.getLogger(this).warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`))}return this._addCachedNodeData(e,g,i)},i))):Promise.reject()}getElevationRange(e){const t=new lt,i=this._controller,{index:s}=i;if(!s)return t;const{rootNode:r}=s;if(!r)return t;const o=this._nodeId2Meta,n=e[3],a=i.viewportQueries,l=this._planetRadiusInGlobalMode,{view:d}=this,{renderCoordsHelper:h}=d,c=h.referenceEllipsoid.radius,u=this._collection,_=i=>{const{childrenLoaded:s}=i;if(0===s)return!1;const r=a.getAndUpdateVisibilityObbInRenderSR(i);let d=null,_=-1;if(r){if(_=r.radius,!r.intersectSphereWithMBS(e,_))return!1}else d=a.getServiceMbsInRenderSR(i),d&&(_=d[3]);if(_>=0&&n>=1*_)return null!=r?Yt(t,r,l):null!=d&&d[3]>=0&&Jt(t,d,l),!1;const g=Qt;if(g.elevationRangeMin=1/0,g.elevationRangeMax=-1/0,(null!=r||null!=d)&&(null!=r?Yt(g,r,l):null!=d&&Jt(g,d,l),g.elevationRangeMin>=t.elevationRangeMin&&g.elevationRangeMax<=t.elevationRangeMax))return!1;const m=o.get(i.index);if(m){const{geometryObbInRenderSR:s}=i;if(!s||s.intersectSphereWithMBS(e)){if(s){if(n>0*s.radius)return Yt(t,s,l),!1}const{objectHandle:e}=m,i=u.getObjectTransform(e),r=h.getAltitude(i.position);u.expandRangeWithComponentObjectElevationRange(e,r,c,t)}}return s-(m?1:0)>0};return s.traverse(r,_),t}computeVisibilityObb(e){return We(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,i){const s=t.geometryData.geometries??[],r=new Array(s.length);for(let f=0;f<s.length;++f)r[f]=this._getVertexBufferLayout(s[f],t.geometryDescriptor);const o=this.i3slayer.normalReferenceFrame,n=t.normalReferenceFrame??o??"none",a=e.serviceMbsInIndexSR,l=this.elevationOffset,d=this._controller.crsIndex,h=this._controller.crsVertex,c=this.view.renderSpatialReference,u=Le(a,l,n,d,c),_=q(d,h),g=q(h,c);if(null==_||null==g)return Promise.resolve(null);const m={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,globalTrafo:u,mbs:a,obbData:e.serviceObbInIndexSR?.data,elevationOffset:l,needNormals:this._controller.isMeshPyramid,normalReferenceFrame:n,indexToVertexProjector:_,vertexToRenderProjector:g};return this._workerHandle.invoke(m,i)}get _supportsNodeCrossFading(){return!this.view?.stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(0===this.elevationInfo.mode&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);null!=this._labeler&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateMaterial(t),this._setNewNodeOpacity(t),0!==this.elevationInfo.mode&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights?.objectCreated(t),null!=this._treeDebugger&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,()=>this._addCachedNodeData(e,t,s))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,i){if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(null==t)return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:n}=t;await this.i3sOverrides.applyAttributeOverrides(r.featureIds,s.attributeInfo,i,this._controller.requiredAttributes);const a=null!=t.textureData?t.textureData.filter(e=>null!=e&&0!==(e.usage&this.rendererTextureUsage)):[];!has("disable-feature:i3s-basis")&&a.some(e=>null!=e&&(2===e.encoding||1===e.encoding))&&await bt(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:h,anchorIds:c,anchors:u}=r,_=this._collection,g=d[0],{layout:m,indices:f,interleavedVertexData:p,positionData:y,hasColors:b}=n,{material:S,geometryParameters:O}=this._materialParameters(g,m),j=l||new Uint32Array([0,f?f.length:p.byteLength/m[0].stride]),V={vertices:{data:p,count:p.byteLength/m[0].stride,layoutParameters:O},positionData:{positions:Z(y.data),indices:ee(y.indices)},indices:f,componentOffsets:j},D=g.transformation?x(g.transformation):R(),T=X(t.globalTrafo);M(D,T,D);const A=w(H(),D),N=v(C(),D),k=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,G=ht.fromData(ct(t.geometryObbData)).center,B=[1,1,1];L(G,k,B,U)||o.getLogger(this).errorOnce("Unsupported coordinate system for IM overlay");const q=H();z(G,k,q,U);const W=C();I(W,N);const $=H();E($,F($,G,A),W);const K=q[0]-$[0]*B[0],Q=q[1]-$[1]*B[1],Y=_.createObject(new gt(P(K,Q,B[0],B[1]),new pt(A,N),ht.fromData(ct(t.geometryObbData)),V)),J=2===O.textureCoordinateType,{textures:te,texturePromise:ie}=this._initMaterialAndTextures(Y,S,a,J,e);e.memory+=this._memEstimateGeometryAdded(Y),e.memory+=te.reduce((e,t)=>e+(null!=t?this._memEstimateTextureAdded(t):0),0);const se=!!S.hasParametersFromSource,re="blend"!==S.alphaMode&&S.metallicRoughness.baseColorFactor[3]>=1,oe=new wt(e,h,Y,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:se,isOpaque:re},te,c,u);s.meta=oe,this._hasTextures||=t.requiredTextures?.some(({usage:e})=>!!(19&e))||!!e.resources.texture,this._hasData=!0,this._hasColors||=b,this.notifyChange("hasTexturesOrVertexColors");const ne=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(oe),ie]).then(([t,s])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(oe.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),this._safeReschedule(()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,oe),i.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(Y,!0),t?.updateObjectVisibility(oe.objectHandle,!0).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),oe.attributeInfo=i.attributeInfo;const s=oe.cachedRendererVersion!==this._rendererVersion,r=ne!==this.slicePlaneEnabled;this._updateElevationOffsets(oe);const o=oe.elevationOffsets;this._updateComponentData(oe);const n=this._applyFiltersToNode(oe);(s||null!=t&&(r||n||o))&&this._addOrUpdateEdgeRendering(oe),null!=this._labeler&&this._addMetaToLabeler(this._labeler,oe),this._visibleGeometryChanged(oe,0),this._highlights?.objectCreated(oe),this._updateMaterial(oe),this._setNewNodeOpacity(oe),null!=this._treeDebugger&&this._treeDebugger.update()},i))).catch(e=>{const{meta:t,allowMemCache:i}=s;throw s.meta=null,t&&i?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e})}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){o.getLogger(this).error("Removing duplicated node");const t=this._nodeId2Meta.get(e);t&&(this._deleteComponentObject(t),this._updateFeatureIdCounts(t,-1))}else this._controller.updateLoadStatus(e,!0);t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Ut(t.cachedEdgeMaterials,0),this._updateFeatureIdCounts(t,1)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this._controller.crsIndex,s=this.elevationInfo,r=this.view.basemapTerrain,o=r.spatialReference,n=s.mode;if(null==t||null==o||0===n)return void(e.elevationOffsets=null);const a=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const l=Gt,d=Bt,h=2===n,c=this.view.renderCoordsHelper,u=e.featureIds.length,_=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const s=J(3*u);e.cachedElevationAnchors=s;for(let r=0;r<u;r++){const n=3*r,h=e.anchorIds?.indexOf(r)??-1;e.anchors&&h>=0?(O(l,e.anchors[3*h],e.anchors[3*h+1],e.anchors[3*h+2]),V(l,l,te(e.node.serviceMbsInIndexSR)),z(l,i,l,o),s[n]=l[0],s[n+1]=l[1],s[n+2]=c.getAltitude(l)):(this._collection.getComponentAabb(e.objectHandle,r,d,!0),O(l,(d[0]+d[3])/2,(d[1]+d[4])/2,d[2]),E(l,l,a.rotationScale),V(l,l,a.position),s[n+2]=c.getAltitude(l),z(l,t,l,o),s[n]=l[0],s[n+1]=l[1])}return s})(),g=s.offset,m=e.elevationOffsets,f=(e,t)=>{const i=h?_[3*e+2]:0;m[e]=g+(t??0)-i};r.getElevations(_,u,f)}_ensureElevationTask(){return null!=this._elevationTask||(this._elevationTask=new je(this.view.resourceController.scheduler,e=>this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference)?.filterInPlace(e=>null!=this._nodeId2Meta.get(e)),e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e)),()=>this.elevationInfo?.mode)),this._elevationTask}_elevationInfoChanged(e,t){const i=0!==e.mode,s=!!t&&t!==e&&0!==t.mode;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach(e=>this._nodeElevationAlignmentChanged(e))}_nodeElevationAlignmentChanged(e){null!=e&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),null!=this._labeler&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,2),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return c(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=null!=e.params.material?e.params.material:Ne(),s=t.some(e=>"uvRegion"===e.name),r=t.some(e=>"normalCompressed"===e.name),o=Tt(i);return{geometryParameters:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s,r){const o=this._stage.renderView,n=e=>{this._gpuMemoryEstimate-=e,this._texMemoryEstimate-=e,r.memory-=e},a=i.map(e=>Pe(e,t,s,o,this._compressionTracker,n));this._stage.addTextures(a);let l=null;return this._collection.updateMaterial(e,e=>{l=ke(e,t,a,i,this.view.stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)}),{textures:a,texturePromise:l}}_getGeometryParameters(e){return new ft(this._hasVertexColors,e.hasTexture?e.hasRegions?2:1:0,e.hasNormals,this._shadeNormals,this._applySSAO)}_addData(e,t,i){let s=this._addTasks.get(e.index);if(s)s.attributeInfo=t;else{const r=u();s=new kt(t,null,r.promise),this._addTasks.set(e.index,s),i().then(r.resolve,r.reject).then(()=>this._addTasks.delete(e.index)).catch(t=>{throw this._addTasks.delete(e.index),t})}return s.promise}_clearAddTasks(){this._addTasks.forEach(e=>{null!=e.meta&&(this._cacheGPUData(e.meta),e.meta=null)}),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=Q();this._renderClippingArea=dt(this.view.clippingArea,i,e)?i:null;const s=Q();this._layerClippingArea=dt(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e),this._assertFeatureIdNodeCounts(e)}_assertFeatureIdNodeCounts(e){e&&!this._featureIdCounts?(this._featureIdCounts=ti(this._nodeId2Meta.values()),this._filteredIdCounts=ti(this._nodeId2Meta.values(),1),this._weaklyRemovedIdCounts=ti(this._nodeId2Meta.values(),2),this.addHandles(g(()=>this._controller.updating,e=>{!e&&this._needFilterResolve&&(this.multiGeometryFilterResolve(),this._needFilterResolve=!1,this.notifyUpdate())},{sync:!0}),"updateFinished")):!e&&this._featureIdCounts&&(this._featureIdCounts=null,this._filteredIdCounts=null,this._weaklyRemovedIdCounts=null,this._mismatchShow=null,this._mismatchHide=null,this.removeHandles("updateFinished"),this._needFilterResolve=!1,this.notifyUpdate())}_updateFeatureIdCounts(e,t){this._featureIdCounts&&(this._needFilterResolve=!0,ei(this._featureIdCounts,e.featureIds,t),ei(this._filteredIdCounts,e.filteredIds,t),ei(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,t))}_updateFilteredIdCounts(e,t,i){this._filteredIdCounts&&(this._needFilterResolve=!0,ei(this._filteredIdCounts,t,-1),ei(this._filteredIdCounts,e.filteredIds,1),ei(this._weaklyRemovedIdCounts,i,-1),ei(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,1))}_checkFeatureIdNodeCountInvariant(){const e=null!=this._featureIdCounts;if(this.hasGeometryFilter!==e&&o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","LayerView should have feature id node counts if and only if it has a geometry filter",{layerView:this,hasNodeCounts:e}),!this._featureIdCounts||!this._filteredIdCounts)return;const t=ti(this._nodeId2Meta.values());n(this._featureIdCounts,t)||o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _featureIdCounts",{layerView:this,counts:this._featureIdCounts,expected:t});const i=ti(this._nodeId2Meta.values(),1);n(this._filteredIdCounts,i)||o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _filteredIdCounts",{layerView:this,counts:this._filteredIdCounts,expected:i});const s=ti(this._nodeId2Meta.values(),2);n(this._weaklyRemovedIdCounts,s)||o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _weaklyRemovedIdCounts",{layerView:this,counts:this._weaklyRemovedIdCounts,expected:i})}multiGeometryFilterResolve(){if(!this._featureIdCounts||!this._filteredIdCounts)return;let e=null,t=null;for(const[i,s]of this._filteredIdCounts){const r=this._featureIdCounts.get(i);if(r!==s){s+(this._weaklyRemovedIdCounts?.get(i)??0)===r?(e??=new Set,e.add(i)):(t??=new Set,t.add(i))}}f(e,this._mismatchShow)&&f(t,this._mismatchHide)||(this._mismatchShow=e,this._mismatchHide=t,this._nodeId2Meta.forEach(e=>{if(!e?.filteredIds)return;const t=Zt(e,this._mismatchShow,this._mismatchHide);this._collection.setAllComponentVisibilities(e.objectHandle,t),this._visibleGeometryChanged(e,2)}))}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(e=>{e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,2))})}getFilters(){const e=[],t=this._renderClippingArea;return null!=t&&e.push((e,i)=>this._boundingRectFilter(e,i,t)),e}addSqlFilter(e,t,i){if(null!=t){const s=t.fieldNames;e.push((e,r)=>this._sqlFilter(e,r,t,s,i))}}_sqlFilter(e,t,i,s,r){const o={},n=this._createLayerGraphic(o),a=this.i3slayer.objectIdField,l=t.featureIds,d=t.attributeInfo?.attributeData;s.every(e=>e===a||null!=d?.[e])&&$e(e,l,e=>{o[a]=l[e];for(const i of s)i!==a&&(o[i]=d?Ee(d[i],e):null);try{return i.testFeature(n)}catch(t){return r(t),!1}})}_boundingRectNodeTest(e,t){return G(e.node.serviceMbsInIndexSR,this._controller.crsIndex,Dt,this.view.renderSpatialReference),Ke(t,Dt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,Ot),K(Ot,jt),Y(i,jt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(3===r)return;if(0===r)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const n=this._transformClippingArea(Et,i,t.objectHandle);$e(e,t.featureIds,e=>this._boundingRectFeatureTest(t,e,n))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}async _addOrUpdateEdgeRendering(e,t=!0){const i=e.objectHandle,{hasEdges:s,perFeatureEdgeMaterials:r}=this._getFilteredEdgeMaterials(e);s&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const o=this._edgeView;if(!o)return null;const n=o.hasObject(i);if(s){if(n){if(this.nodeCrossfadingEnabled){Ut(r,this.getNodeOpacity(e))}return o.updateAllComponentMaterials(i,r,this.slicePlaneEnabled,t).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),o.updateObjectVisibility(i,!0).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),o.updateAllVerticalOffsets(i,e.elevationOffsets).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),o}const s=await this._collection.addEdges(i,o,r,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=s,e.node.memory+=s,o}return n&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,o.removeObject(i)),null}_applyFiltersToNode(e){const{filteredIds:t,weaklyRemovedIds:i}=e,s=this._applyFiltersToNodeComponents(e);return this._updateFilteredIdCounts(e,t,i),s&&this._labeler?.applyFilterChange(e),s}_applyFiltersToNodeComponents(e){const t=this._collection,i=t.getComponentCount(e.objectHandle),s=null!=e.filteredIds,r=0===i.invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!r;if(null!=e.filteredIds&&e.appliedFilters===this._filters||(e.weaklyRemovedIds=null,e.filteredIds=Xt(e,this._filters),e.appliedFilters=this._filters),s&&e.filteredIds===e.featureIds&&(!this._mismatchHide||e.filteredIds.every(e=>!this._mismatchHide?.has(e))))return!r;const o=Zt(e,this._mismatchShow,this._mismatchHide);return t.setAllComponentVisibilities(e.objectHandle,o),!0}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach((t,i)=>this._removeNodeStageData(i,e)),this._nodeId2MetaReloading.forEach((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading)),this._elevationTask=a(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),null!=this._elevationTask&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);null!=s?(this._collection.setObjectVisibility(s.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),this._visibleGeometryChanged(s,1),null!=this._labeler&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights?.objectDeleted(s),i===this._nodeId2Meta?(this._updateFeatureIdCounts(s,-1),this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),null!=this._treeDebugger&&this._treeDebugger.update()):i.delete(e)}_deleteComponentObject(e){if(null!=this._edgeView&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.removeTexture(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._collection.updateMaterial(i.objectHandle,e=>e.polygonOffsetEnabled=0===t)}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const i=this._nodeId2MetaReloading.get(e);i&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,i))}_invalidateAllSymbols(){this._rendererVersion=Qe(this._rendererVersion,1),this._controller?.requestUpdate()}_getInvalidRendererVersion(){return Qe(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Qe(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await ge()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:o.getLogger(this).warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.symbols)"mesh-3d"!==t.type&&o.getLogger(this).error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=i*e.cachedSymbologyStride;N(s.externalColor,t[r]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255);const o=this._stage.renderView.olidRenderHelper;if(o){const t=e.featureIds[i],r=this.sublayerId?`${this.layerViewUid}_${this.sublayerId}`:this.layerViewUid,n=ue(this.view,this.uid);o.setUidToObjectAndLayerId(t,t,this.layerId,r,this.layerPopupEnabledAndHasTemplate&&!n,e.node.resources.attributes,i,this.sublayerId),s.olidColor=o.getObjectAndLayerIdColor({graphicUid:t,layerViewUid:r})}s.externalColorMixMode=15&t[r+4],s.castShadows=!!(16&t[r+4]),s.pickable=!!(32&t[r+4]),s.elevationOffset=e.elevationOffsets?.[i]??0,s.emissiveStrength=e.emissiveStrengths?.[i]??1,s.emissiveSource=e.emissiveSources?.[i]??0}}_getSymbolInfo(e,t){const i=e?.getSymbol(t,{arcade:this._arcade});if(!(i instanceof me))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=Ye(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=null!=this._symbologyOverrideFields&&this._symbologyOverrideFields.length>0?null!=this._rendererFields&&this._rendererFields.length>0?le(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=e.attributeInfo?.attributeData,o=e.featureIds?this.i3slayer.objectIdField:null,n=null!=r&&null!=this._symbologyFields&&this._symbologyFields.length>0;let a=null,l=null;if(n&&null!=this._symbologyFields){a=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(a.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=oe(e.featureIds.length*e.cachedSymbologyStride));const d=new it,h=this.fullOpacity,c=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):h;let u=null,_=1,g=Je,m=0;for(let f=0;f<e.featureIds.length;f++){if(null!=o&&(i[o]=e.featureIds[f]),n&&a)for(let e=0;e<a.length;e++)i[a[e]]=Ee(l[e],f);const r=s?this._getSymbolInfo(s,t):null;let h,p;if(d.pickable=!0,s&&"visualVariables"in s){if(this._colorVariable){const e=he(this._colorVariable,t,{color:Vt,arcade:this._arcade});e&&(h=d.color,h[0]=e.r/255,h[1]=e.g/255,h[2]=e.b/255,h[3]=e.a??1,this._opacityVariable||null===e.a||(p=e.a))}this._opacityVariable&&(p=ce(this._opacityVariable,t,{arcade:this._arcade}))}if(r?.material){const e=r.material;h=null==h||null==p?Re(h,p,e.color,e.alpha,Mt,d.color):Re(h,p,null,null,Mt,d.color)}h??=N(d.color,1,1,1,1);const y=r?.material;if(d.colorMixMode=y?.colorMixMode??1,d.edgeMaterial=r?.edgeMaterial,this._symbologyOverride?.(t,d),null!=this._nodeColorOverride&&(this._nodeColorOverride(e.node,h),d.colorMixMode=3),d.pickable&&=h[3]>=Ct,d.castShadows=r?r.castShadows:d.pickable,null!=d.edgeMaterial){const t=h[3]>=1&&(e.material.isOpaque||3===d.colorMixMode)?1:0;d.edgeMaterial===u&&t===_||(g={...d.edgeMaterial,opacity:c,objectTransparency:t},u=d.edgeMaterial,_=t),e.cachedEdgeMaterials[f]=g}else e.cachedEdgeMaterials[f]=Je;e.cachedSymbology[m++]=Math.round(255*h[0]),e.cachedSymbology[m++]=Math.round(255*h[1]),e.cachedSymbology[m++]=Math.round(255*h[2]),e.cachedSymbology[m++]=Math.round(255*h[3]),e.cachedSymbology[m++]=d.colorMixMode|+d.castShadows<<4|+d.pickable<<5;const b=y?.emissive?.strength??yt;b===yt||e.emissiveStrengths||(e.emissiveStrengths=new Array(e.featureIds.length).fill(yt)),e.emissiveStrengths&&(e.emissiveStrengths[f]=b);const v=y?.emissive?.source||0;0===v||e.emissiveSources||(e.emissiveSources=new Array(e.featureIds.length).fill(0)),e.emissiveSources&&(e.emissiveSources[f]=v)}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Ut(t,this.fullOpacity);const i=e.filteredIds;if(null==i){return{hasEdges:t.some(e=>e!==Je),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map((t,o)=>e.featureIds[o]!==i[s]?Je:(r=r||t!==Je,s++,t));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach(t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,t=>t.objectOpacity=e),Ut(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))})}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)})}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,2)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),null!=this._labeler&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach(t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,t=>t.commonMaterialParameters.hasSlicePlane=e),this._updateEdgeRendering(t,!1))})}_updatePBR(e){this._nodeId2Meta.forEach(t=>{null!=t&&this._collection.updateMaterial(t.objectHandle,t=>t.usePBR=e)}),this._hasLoadedPBRTextures=!0}get _usePBR(){return this._shadeNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){null!=this._edgeView&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,i,s)=>s.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?1:e(t,i,s):e}_forAllFeatures(e,t,i){for(const s of this._nodeId2Meta.values()){if(null==s)continue;if(null!=t){switch(t(s.node.serviceMbsInIndexSR)){case 0:return;case 2:continue}}let r=1;switch(i){case 1:r=this._forAllFeaturesOfNode(s,e);break;case 0:r=this._forAllVisibleFeaturesOfNode(s,e);break;case 2:r=this._forAllQueryableFeaturesOfNode(s,e)}if(0===r)return}}_forAllFeaturesOfNode(e,t){let i=1;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),0===i)return i;return i}_forAllVisibleFeaturesOfNode(e,t){let i=1;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,r=>(i=t(s[r],r,e),1===i)),i}_forAllQueryableFeaturesOfNode(e,t){const i=this._ignoreClientNodeOverriddenFeatures(t);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(e,i);const s=this._boundingRectNodeTest(e,this._renderClippingArea);if(0===s)return 1;if(3===s)return this._forAllFeaturesOfNode(e,i);const r=1,o=e.featureIds,n=e.objectHandle,a=Xe(this._renderClippingArea,this._collection.getObjectTransform(n));for(let l=0;l<o.length;l++){if(!this._boundingRectFeatureTest(e,l,a))continue;const t=i(o[l],l,e);if(0===t)return t}return r}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=t.attributeInfo?.attributeData;if(null!=s)for(const r of Object.keys(s))i[r]=Ee(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){const s=rt(e);if(0===s.length)return ot;const r=vt(t),o=s[0]instanceof i?this._featureIdsFromGraphics(s):"number"==typeof s[0]?s:null;if(!o)return ot;const n=this._ensureHighlights(),{set:a,handle:l}=n.acquireSet(r);return n.setFeatureIds(a,o),l}_featureIdsFromGraphics(e){const t=this.i3slayer.fieldsIndex,i=this._getObjectIdField();return e.map(e=>st(t,e.attributes,i))}_ensureHighlights(){let e=this._highlights;return e||(e=new Oe({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,1),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._highlights=e),e}resetHighlights(){this._highlights=a(this._highlights)}_visibleGeometryChanged(e,t){this._elevationProvider&&(null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=m(()=>{const{node:t}=e,i=t.visibilityObbInRenderSR??t.geometryObbInRenderSR??t.serviceObbInRenderSR;if(null!=i){const e=$();i.toAaBoundingBox(e),this.emit("visible-geometry-changed",new pe(e))}else this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle=null})),this._updateSnappingSources(e,t),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new be(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}checkInvariants(){}get test(){}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return null!=e?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}getNodeComponentHandle(e){return this._nodeId2Meta.get(e)?.objectHandle}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(e)}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);null!=s&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,e=>e.objectOpacity=t),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(null==this._edgeView||!e.cachedEdgeMaterials)return;Ut(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch(e=>this._logEdgeViewError(e,this.i3slayer.title))}get hasModifications(){return this._isIntegratedMesh&&null!=this._layerClippingArea||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.uid,s=Pt(e);if(s){const t={context:i,buffer:s.buffer};we(t);const r=new Float64Array(s.buffer);e.forAll((e,t)=>{const i=r[t],s=xe(i);e.imModificationImpact=s,0!==s&&this._controller.invalidateGeometryVisibility(e.index)})}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||null!=this._elevationTask&&this._elevationTask.readyToRun||this._needFilterResolve||this._compressionTracker.compressing}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(null==s)throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>s(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach((t,i)=>{if(null==t)return;const s=this._controller.getRenderMbs(t.node);s&&e.add(i,s)}),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||0===this.elevationInfo.mode)return;const s=t.position0,r=t.position1,o=t.componentIndex,n=H(),a=H(),l=(e,t)=>{V(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,a),V(e,e,D(a,a,t)),T(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,n),l(n,t),s.setVec(d,n),r.getVec(d,n),l(n,t),r.setVec(d,n)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(null!=s)for(const r of this._snappingSourcesTrackers)1!==t&&2!==t||r.events.remove(i),0!==t&&2!==t||r.events.add(i,s)}_logEdgeViewError(e,t){h(e)||o.getLogger(this).warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}_indexedDbSizeCheck(e,t){return t.byteSize>Rt?(o.getLogger(this).warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}};return e([y()],A.prototype,"_hasLoadedPBRTextures",void 0),e([y()],A.prototype,"_asyncModuleLoading",void 0),e([y()],A.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([y()],A.prototype,"view",void 0),e([y()],A.prototype,"i3slayer",void 0),e([y()],A.prototype,"_controller",void 0),e([y()],A.prototype,"_labeler",void 0),e([y()],A.prototype,"updating",void 0),e([y()],A.prototype,"suspended",void 0),e([y()],A.prototype,"contentVisible",null),e([y({readOnly:!0})],A.prototype,"legendEnabled",null),e([y(ut)],A.prototype,"updatingProgress",void 0),e([y()],A.prototype,"updatingProgressValue",null),e([y()],A.prototype,"hasTexturesOrVertexColors",null),e([y()],A.prototype,"rendererTextureUsage",null),e([y()],A.prototype,"elevationOffset",null),e([y()],A.prototype,"elevationInfo",null),e([y({type:Boolean})],A.prototype,"slicePlaneEnabled",void 0),e([y()],A.prototype,"supportedTextureEncodings",null),e([y({type:[de]})],A.prototype,"_modifications",void 0),e([y({readOnly:!0})],A.prototype,"clientGeometry",null),e([y()],A.prototype,"elevationRange",null),e([y()],A.prototype,"fullExtent",null),e([y()],A.prototype,"_elevationTask",void 0),e([y({readOnly:!0})],A.prototype,"_usePBR",null),A=e([b("esri.views.3d.layers.I3SMeshView3D")],A),A},Ot=$(),jt=Q(),Et=Q(),Ft=new ht,Vt=new t([0,0,0,0]),Dt=ie(0,0,0,0);function Tt(e){if(null==e)return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function At(e){return"geometryData"in e}function Ht(e){return null!=e&&p(e.data)}function Nt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(null!=t)for(const s of t)null!=s&&p(s.data)&&(i+=s.data.byteLength);return i}function Pt(e){if(0===e.length)return;const t=10*e.length,i=new Float64Array(t);let s=0;return e.forAll(e=>{let t=e.serviceObbInIndexSR;null==t&&(t=Ft,t.center=se(e.serviceMbsInIndexSR,H()),t.halfSize=[e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3]]);const r=t.data;i[s++]=r[0],i[s++]=r[1],i[s++]=r[2],i[s++]=r[3],i[s++]=r[4],i[s++]=r[5],i[s++]=r[6],i[s++]=r[7],i[s++]=r[8],i[s++]=r[9]}),i}class kt{constructor(e,t,i){this.attributeInfo=e,this.meta=t,this.promise=i,this.allowMemCache=!0}}function Ut(e,t){e.forEach(e=>e.opacity=t)}class Lt{constructor(e,t){this.mode=e,this.offset=t}}const Gt=H(),Bt=$(),qt="elevation-change",zt="",Wt="@null",$t="@ECEF",Kt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Qt=new lt;function Yt(e,t,i){let s=e.elevationRangeMin,r=e.elevationRangeMax;const o=i;if(o>0){t.getCorners(Kt);for(const e of Kt){const t=A(e)-o;s=Math.min(s,t),r=Math.max(r,t)}}else{t.getCorners(Kt);for(const e of Kt){const t=e[2];s=Math.min(s,t),r=Math.max(r,t)}}e.expandElevationRangeValues(s,r)}function Jt(e,t,i){const s=te(t),r=i>0?A(s)-i:s[2],o=re(t);e.expandElevationRangeValues(r-o,r+o)}function Xt(e,t){const i=e.featureIds.slice();for(const s of t)if(s(i,e),0===i.length)break;return i.length===e.featureIds.length?e.featureIds:i}function Zt(e,t,i){const s=new Array,r=e.filteredIds;if(null==r||t?.size||i?.size){if(null!=r){let o=0;e.featureIds.forEach((e,n)=>{if(r[o]===e)++o;else if(!t?.has(e))return;i?.has(e)||s.push(n)})}}else e.featureIds.forEach((e,t)=>{r[s.length]===e&&s.push(t)});return s}function ei(e,t,i){if(e&&t)for(const s of t){const t=(e.get(s)??0)+i;t>0?e.set(s,t):e.delete(s)}}function ti(e,t=0){const i=new Map;for(const s of e){ei(i,0===t?s?.featureIds:1===t?s?.filteredIds:s?.weaklyRemovedIds,1)}return i}export{St as I3SMeshView3D};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s,isSome as r}from"../../../core/arrayUtils.js";import has from"../../../core/has.js";import o from"../../../core/Logger.js";import{equals as n}from"../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import l from"../../../core/PooledArray.js";import{ignoreAbortErrors as d,isAbortError as h,throwIfAborted as c,createResolver as u}from"../../../core/promiseUtils.js";import{initial as _,watch as g}from"../../../core/reactiveUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{equals as f}from"../../../core/SetUtils.js";import{isArrayBuffer as p}from"../../../core/typedArrayUtil.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as v,invert as I}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as C}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as M,getTranslation as w}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as x,create as R}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as S}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as O,t as j,o as E,a as F,f as V,g as D,d as T,H as A}from"../../../chunks/vec32.js";import{create as H}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as N}from"../../../chunks/vec42.js";import{fromValues as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as k}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as U}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as L}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as G}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as B}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as q}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as z}from"../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as W,create as $,toRect as K}from"../../../geometry/support/aaBoundingBox.js";import{create as Q,intersects as Y}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as J,ensurePackedMat4f64 as X}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as Z}from"../../../geometry/support/FloatArray.js";import{compactIndices as ee}from"../../../geometry/support/Indices.js";import{a as te,f as ie,n as se,g as re}from"../../../chunks/sphere.js";import{newUByteArray as oe}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as ne}from"../../../layers/LayerConstants.js";import ae from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as le}from"../../../layers/support/fieldUtils.js";import de from"../../../layers/support/SceneModification.js";import{getColor as he,getOpacity as ce}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{isBasemapLayerView as ue}from"../../../support/basemapUtils.js";import{getElevationOffset as _e}from"../../../support/elevationInfoUtils.js";import{loadArcade as ge}from"../../../support/loadArcade.js";import me from"../../../symbols/MeshSymbol3D.js";import fe from"../../../symbols/SimpleFillSymbol.js";import{ContentGeometryUpdateEvent as pe}from"./ContentGeometryLayerView.js";import ye from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as be}from"./I3SMeshViewPerformanceInfo.js";import{I3SMeshWorkerHandle as ve,toWasmModification as Ie}from"./I3SMeshWorkerHandle.js";import{initialize as Ce,setModificationsSync as Me,filterObbsForModificationsSync as we,interpretObbModificationResults as xe}from"./SceneLayerWorker.js";import{overrideColor as Re}from"./graphics/graphicUtils.js";import{areLabelsVisible as Se}from"./graphics/Labeler.js";import Oe from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as je}from"./i3s/I3SAsyncElevationUpdater.js";import{getCachedAttributeValue as Ee}from"./i3s/I3SBinaryReader.js";import{I3SCrossfadeHelper as Fe,NodeCrossfadeMetaData as Ve}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as De}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Te}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ae,selectEncoding as He,defaultMaterial as Ne,createTexture as Pe,configureMaterial as ke}from"./i3s/I3SMaterialUtil.js";import{I3SOverrides as Ue}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as Le}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ge,checkSceneLayerValid as Be,checkSceneLayerCompatibleWithView as qe,whenGraphicAttributes as ze,computeVisibilityObb as We,filterInPlace as $e,intersectBoundingRectWithMbs as Ke,addWraparound as Qe,getSymbolInfo as Ye,transparentEdgeMaterial as Je,getClipRect as Xe}from"./i3s/I3SUtil.js";import{IDBCache as Ze}from"./i3s/IDBCache.js";import{IDBMockCache as et}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as tt}from"./i3s/LayerElevationProvider.js";import{SymbologyInfo as it}from"./i3s/SymbologyInfo.js";import{attributeLookup as st}from"./support/attributeUtils.js";import{normalizeHighlightTarget as rt,emptyHighlightHandle as ot}from"./support/highlightUtils.js";import{makeScheduleFunction as nt}from"./support/makeScheduleFunction.js";import{debugFlags as at}from"../support/debugFlags.js";import{ElevationRange as lt}from"../support/ElevationRange.js";import{toBoundingRect as dt}from"../support/extentUtils.js";import{Obb as ht,ensurePackedObbData as ct}from"../support/orientedBoundingBox.js";import{updatingProgress as ut}from"../support/updatingProperties.js";import{glLayout as _t}from"../support/buffer/glUtil.js";import{ObjectParameters as gt}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as mt,GeometryParameters as ft}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as pt}from"../webgl-engine/collections/Component/Transform.js";import{emissiveStrengthDefault as yt}from"../webgl-engine/core/shaderLibrary/output/Emissions.glsl.js";import{loadBasisTranscoder as bt}from"../webgl-engine/lib/BasisUtil.js";import{getHighlightName as vt}from"../../support/highlightOptionsUtils.js";import{TextureCompressionTracker as It}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as Ct}from"../../../webscene/support/AlphaCutoff.js";const Mt=[1,1,1,1];class wt extends Ve{constructor(e,t,i,s,r,o,n,a,l){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=n,this.anchorIds=a,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbologyStride=5}get cachedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(Number.POSITIVE_INFINITY),this._featureExtents}}const xt=26,Rt=104857600,St=t=>{const p=t;let A=class extends p{constructor(){super(...arguments),this._applySSAO=!0,this._shadeNormals=!0,this._updatingHandles=new k,this._highlights=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._compressionTracker=new It,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this.ignoresMemoryFactor=!1,this._layerUrl="",this._cacheKeySuffix=null,this._planetRadiusInGlobalMode=0,this._elevationTask=null,this._needFilterResolve=!1,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i,this._crossfadeHelper=new Fe(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerViewUid(){return this.uid}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get _isIntegratedMesh(){return"integrated-mesh"===this.i3slayer.type}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible&&this.fullOpacity>Ct}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ge(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?63:37:this._usePBR||this._hasLoadedPBRTextures?44:36}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=e&&"absolute-height"===e.mode?_e(e,this.i3slayer.spatialReference):0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return new Lt(0,0);const t=_e(e,this.i3slayer.spatialReference);switch(e.mode){case"absolute-height":return new Lt(0,t);case"relative-to-ground":return new Lt(1,t);case"on-the-ground":return new Lt(2,0);default:return new Lt(0,0)}}get supportedTextureEncodings(){return Ae(this.view.stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta,t=new lt;for(const i of e.values()){if(null==i)continue;const{node:{serviceMbsInIndexSR:e}}=i,[s,r,o,n]=e;t.expandElevationRangeValues(o-n,o+n)}return t.elevationRangeValid?t:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){const e=has("enable-feature:idb-mock-cache");this._idbCache=e?new et(this.view,e):new Ze("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,i=t.memoryController;this.i3sOverrides=new Ue({view:this.view,layer:this.i3slayer,memoryController:i}),this._workerHandle=new ve(nt(t)),this.addResolvingPromise(this._workerHandle.promise);const s=this.i3slayer.store;this.addResolvingPromise(this._workerHandle.setLegacySchema(this.uid,s.defaultGeometrySchema).catch(d)),Be(this.i3slayer),qe(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new ae({layerView:this,worker:this._workerHandle}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view.stage,this._collection=this._stage.renderView.componentObjectCollection;const r=s.defaultGeometrySchema;if(this._isIntegratedMesh||!r)this._hasComponentData=!1;else{const e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(r?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;const n=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,e=>this._deleteComponentObject(e));this._memCache=n;const l=this._controller,h=this._nodeId2Meta,c=this._nodeId2MetaReloading,u=e=>{const t=l.index;if(!t)return;const i=t.rootNode;if(!i)return;const s=t=>{const i=t.index,s=h.get(i)||c.get(i);return e(t,s?.objectHandle??null)};t.traverse(i,s)};this._intersectionHandler=new Te({layerViewUid:this.layerViewUid,sublayerId:this.sublayerId,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:u}),this._elevationProvider=new tt({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),_),this._updatingHandles.add(()=>this.fullOpacity,e=>this._opacityChange(e)),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this.elevationOffset,(e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()}),this._updatingHandles.add(()=>this.elevationInfo,(e,t)=>this._elevationInfoChanged(e,t),_),this._updatingHandles.add(()=>!this.suspended&&0!==this.elevationInfo.mode,(e,t)=>{e?this.addHandles(this.view.basemapTerrain.on("elevation-change",({extent:e})=>this._ensureElevationTask().addExtent(e)),qt):t&&this.removeHandles(qt)},_),this._updatingHandles.add(()=>this._usePBR,e=>this._updatePBR(e));const m=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add(()=>this.rendererTextureUsage,m),this._updatingHandles.add(()=>this.contentVisible,e=>this._contentVisibleChanged(e),_),this._updatingHandles.add(()=>this.i3slayer.labelsVisible,()=>this._labelingChanged(),_),this._updatingHandles.add(()=>this.i3slayer.labelingInfo,()=>this._labelingChanged(),_),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),_),this.addHandles([g(()=>at.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&at.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||at.I3S_TREE_SHOW_TILES||(this._treeDebugger=a(this._treeDebugger))},_),g(()=>at.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),_)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch(e=>o.getLogger(this).warn(`Failed to initialize IndexedDB cache: ${e}`));const{view:f}=this,{viewingMode:p,renderCoordsHelper:y}=f;this._planetRadiusInGlobalMode="local"===p?0:y.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=a(this._elevationTask),this.i3sOverrides=a(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.notifyObjectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._workerHandle;e&&(e.destroyContextAndSelf(this.uid),this._workerHandle=null),this._removeAllNodeDataFromStage(),this._memCache=a(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=a(this._labeler),this._treeDebugger=a(this._treeDebugger),this._controller=a(this._controller),this._highlights=a(this._highlights),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=a(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=a(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(null!=e){const t=e.usedMemory;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}get usedMemory(){let e=null!=this._labeler?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach(t=>e+=null!=t?t.node.memory:0),this._nodeId2MetaReloading.forEach(t=>e+=null!=t?t.node.memory:0),e}get unloadedMemory(){return(null!=this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(Se(this.i3slayer)&&this._supportsLabeling))return void(null!=this._labeler&&(this._labeler.destroy(),this._labeler=null));if(null!=this._labeler)return;const e=new ye({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides,layerViewUid:this.uid});this._nodeId2Meta.forEach(t=>null!=t&&this._addMetaToLabeler(e,t)),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then(e=>(--this._asyncModuleLoading,e),e=>{throw--this._asyncModuleLoading,e})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=Ce().then(()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()}),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=e=>o.getLogger(this).error("set-modifications-error","Error when setting modifications:",e),t=this.uid,i=this.i3slayer.spatialReference,s=i.isGeographic,r=Ie(this._layerClippingArea,this._modifications,i);this._workerHandle.setModifications(t,r,s).catch(e);try{Me({context:t,modifications:r,isGeodetic:s})}catch(a){e(a)}this._controller.modificationsChanged();const n=this.hasModifications?new l:null;this._nodeId2Meta.forEach((e,t)=>{null==e?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._updateFeatureIdCounts(e,-1),this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):null!=n&&n.push(e.node)}),this.notifyChange("elevationRange"),null!=n&&this._nodeId2MetaReloading.forEach(e=>n.push(e.node)),null!=n&&n.length>0&&(this.updateNodeModificationStatus(n),n.forAll(e=>{if(2!==e.imModificationImpact){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),null!=t?(this._updateFeatureIdCounts(t,-1),this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange("elevationRange")):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}})),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!at.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o=new fe({...t,color:e[s.type]});this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,(e,t)=>this._createAttributes(e,t))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);null!=i?.attributeInfo&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);null!=s&&(await this.i3sOverrides.applyAttributeOverrides(s.featureIds,t,i,this._controller.requiredAttributes),s.attributeInfo=t,this._controller.reschedule(()=>{this._nodeId2Meta.get(e)===s&&this._attributeValuesChanged(s)},i).catch(e=>{h(e)||o.getLogger(this).warn("Error while updating attribute values. Layer might not display correctly.",e)}))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.appliedFilters=null,null!=this._labeler&&this._labeler.setNodeMetaAttributes(e,(e,t)=>this._createAttributes(e,t)),this._updateEngineObject(e)}clearMemCache(){null!=this._memCache&&this._memCache.clear(),this._addTasks.forEach(e=>e.allowMemCache=!1)}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach(t=>null!=t&&e.push(t.node)),e}getVisibleObbs(){const e=new Array;return this._nodeId2Meta.forEach(t=>t&&e.push(this._collection.getComponentObb(t.objectHandle))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach((t,i)=>e.push(i)),this._nodeId2MetaReloading.forEach((t,i)=>e.push(i))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&2&this.supportedTextureEncodings&&this.i3slayer.textureSetDefinitions?.some(e=>e.formats.some(e=>"basis"===e.format||"ktx2"===e.format))&&bt()}_getVertexBufferLayout(e,t){return _t(mt(this._getGeometryParameters({hasTexture:Tt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.i3slayer.objectIdField||ne}_getGlobalIdField(){return this.i3slayer.globalIdField}_findGraphicNodeAndIndex(e){const t=st(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());for(const i of this._nodeId2Meta.values()){const e=i?.featureIds.indexOf(t);if(null!=e&&e>=0)return{node:i.node,index:e}}return null}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(null==i)return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const n of t){const e=st(o,n.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this.getAABB(t.node.index,t.index);return null==i?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this.getAABB(e.nodeIndex,e.componentIndex)}getAABB(e,t){const i=this._nodeId2Meta.get(e);if(null==i?.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=De(t,this._collection,s,J(24),0),o=this.view.renderSpatialReference,n=this.view.spatialReference;return B(r,o,0,r,n,0)?W(r):null}whenGraphicAttributes(e,t){return ze(this.i3slayer,e,this._getObjectIdField(),t,()=>[...this._nodeId2Meta.values()].filter(r))}getGraphicFromIntersectorTarget(e,t){if(null==e.nodeIndex||null==e.componentIndex)return null;const i=this._nodeId2Meta.get(e.nodeIndex);if(null==i?.featureIds||e.componentIndex>=i.featureIds.length)return null;const s=this._createLayerGraphic(this._createAttributes(e.componentIndex,i));return s?t.defer?(t.defer(async()=>(s.geometry=(await import("./i3s/meshUtils.js")).createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),s)),null):s:null}_getCacheKey(e){return`${this._layerUrl}/v${xt}/${e}${this._cacheKeySuffix}`}_getCacheKeySuffix(){const e=this.view.renderSpatialReference;if(null==e)return Wt;if(e===U(e))return $t;return this.i3slayer.spatialReference.equals(e)?zt:null!=e.wkid?`@${e.wkid}`:null}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return null!=this._memCache?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){null!=e&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(null==this._memCache)return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,i)}loadMissingTextures(e,t,i,s){const r=e?.filter((e,i)=>{if(0===(e.usage&this.rendererTextureUsage))return!1;if(null==t)return!0;const s=He(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(null==r?.data||s&&r.encoding!==s.encoding)})??[];return 0===r.length?Promise.resolve(!1):i(r,s).then(i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0})}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e.id),t).then(s=>null==s?null:(s.globalTrafo=X(s.globalTrafo),s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(0===this.elevationInfo.mode&&(e.geometryObbInRenderSR=ht.fromData(s.geometryObbData)),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then(i=>(i&&this._idbCache.initialized&&null!=s.textureData&&(s.byteSize=Nt(s.transformedGeometry,s.textureData),s.textureData.every(Ht)&&this._indexedDbSizeCheck(e,s)&&this._idbCache.put(this._getCacheKey(e.id),s).catch(t=>o.getLogger(this).warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`))),c(t),s))))):Promise.resolve(null)}addNode(e,t,i){return At(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,()=>this._transformNode(e,t,i).then(s=>this._safeReschedule(()=>{if(null==s)return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:n,featureIds:a,anchorIds:l,anchors:d,transformedGeometry:h}=s,c=X(s.globalTrafo),u=O(Gt,r.center.x,r.center.y,r.center.z);j(u,u,c);const _=new ht(u,[r.extents.x,r.extents.y,r.extents.z],S(r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w));0===this.elevationInfo.mode&&(e.geometryObbInRenderSR=_),t.geometryData.componentOffsets=n,a&&(t.geometryData.featureIds=Array.from(a)),t.geometryData.anchorIds=l,t.geometryData.anchors=d;const g={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:h,globalTrafo:c,geometryObbData:_.data,byteSize:Nt(h,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&this._indexedDbSizeCheck(e,g)){const t=null!=g.textureData?g.textureData.map(e=>Ht(e)?e:null):null;this._idbCache.put(this._getCacheKey(e.id),{...g,textureData:t}).catch(t=>o.getLogger(this).warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`))}return this._addCachedNodeData(e,g,i)},i))):Promise.reject()}getElevationRange(e){const t=new lt,i=this._controller,{index:s}=i;if(!s)return t;const{rootNode:r}=s;if(!r)return t;const o=this._nodeId2Meta,n=e[3],a=i.viewportQueries,l=this._planetRadiusInGlobalMode,{view:d}=this,{renderCoordsHelper:h}=d,c=h.referenceEllipsoid.radius,u=this._collection,_=i=>{const{childrenLoaded:s}=i;if(0===s)return!1;const r=a.getAndUpdateVisibilityObbInRenderSR(i);let d=null,_=-1;if(r){if(_=r.radius,!r.intersectSphereWithMBS(e,_))return!1}else d=a.getServiceMbsInRenderSR(i),d&&(_=d[3]);if(_>=0&&n>=1*_)return null!=r?Yt(t,r,l):null!=d&&d[3]>=0&&Jt(t,d,l),!1;const g=Qt;if(g.elevationRangeMin=1/0,g.elevationRangeMax=-1/0,(null!=r||null!=d)&&(null!=r?Yt(g,r,l):null!=d&&Jt(g,d,l),g.elevationRangeMin>=t.elevationRangeMin&&g.elevationRangeMax<=t.elevationRangeMax))return!1;const m=o.get(i.index);if(m){const{geometryObbInRenderSR:s}=i;if(!s||s.intersectSphereWithMBS(e)){if(s){if(n>0*s.radius)return Yt(t,s,l),!1}const{objectHandle:e}=m,i=u.getObjectTransform(e),r=h.getAltitude(i.position);u.expandRangeWithComponentObjectElevationRange(e,r,c,t)}}return s-(m?1:0)>0};return s.traverse(r,_),t}computeVisibilityObb(e){return We(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,i){const s=t.geometryData.geometries??[],r=new Array(s.length);for(let f=0;f<s.length;++f)r[f]=this._getVertexBufferLayout(s[f],t.geometryDescriptor);const o=this.i3slayer.normalReferenceFrame,n=t.normalReferenceFrame??o??"none",a=e.serviceMbsInIndexSR,l=this.elevationOffset,d=this._controller.crsIndex,h=this._controller.crsVertex,c=this.view.renderSpatialReference,u=Le(a,l,n,d,c),_=q(d,h),g=q(h,c);if(null==_||null==g)return Promise.resolve(null);const m={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,globalTrafo:u,mbs:a,obbData:e.serviceObbInIndexSR?.data,elevationOffset:l,needNormals:this._controller.isMeshPyramid,normalReferenceFrame:n,indexToVertexProjector:_,vertexToRenderProjector:g};return this._workerHandle.invoke(m,i)}get _supportsNodeCrossFading(){return!this.view?.stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(0===this.elevationInfo.mode&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);null!=this._labeler&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateMaterial(t),this._setNewNodeOpacity(t),0!==this.elevationInfo.mode&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights?.objectCreated(t),null!=this._treeDebugger&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,()=>this._addCachedNodeData(e,t,s))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,i){if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(null==t)return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:n}=t;await this.i3sOverrides.applyAttributeOverrides(r.featureIds,s.attributeInfo,i,this._controller.requiredAttributes);const a=null!=t.textureData?t.textureData.filter(e=>null!=e&&0!==(e.usage&this.rendererTextureUsage)):[];!has("disable-feature:i3s-basis")&&a.some(e=>null!=e&&(2===e.encoding||1===e.encoding))&&await bt(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:h,anchorIds:c,anchors:u}=r,_=this._collection,g=d[0],{layout:m,indices:f,interleavedVertexData:p,positionData:y,hasColors:b}=n,{material:S,geometryParameters:O}=this._materialParameters(g,m),j=l||new Uint32Array([0,f?f.length:p.byteLength/m[0].stride]),V={vertices:{data:p,count:p.byteLength/m[0].stride,layoutParameters:O},positionData:{positions:Z(y.data),indices:ee(y.indices)},indices:f,componentOffsets:j},D=g.transformation?x(g.transformation):R(),T=X(t.globalTrafo);M(D,T,D);const A=w(H(),D),N=v(C(),D),k=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,G=ht.fromData(ct(t.geometryObbData)).center,B=[1,1,1];L(G,k,B,U)||o.getLogger(this).errorOnce("Unsupported coordinate system for IM overlay");const q=H();z(G,k,q,U);const W=C();I(W,N);const $=H();E($,F($,G,A),W);const K=q[0]-$[0]*B[0],Q=q[1]-$[1]*B[1],Y=_.createObject(new gt(P(K,Q,B[0],B[1]),new pt(A,N),ht.fromData(ct(t.geometryObbData)),V)),J=2===O.textureCoordinateType,{textures:te,texturePromise:ie}=this._initMaterialAndTextures(Y,S,a,J,e);e.memory+=this._memEstimateGeometryAdded(Y),e.memory+=te.reduce((e,t)=>e+(null!=t?this._memEstimateTextureAdded(t):0),0);const se=!!S.hasParametersFromSource,re="blend"!==S.alphaMode&&S.metallicRoughness.baseColorFactor[3]>=1,oe=new wt(e,h,Y,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:se,isOpaque:re},te,c,u);s.meta=oe,this._hasTextures||=t.requiredTextures?.some(({usage:e})=>!!(19&e))||!!e.resources.texture,this._hasData=!0,this._hasColors||=b,this.notifyChange("hasTexturesOrVertexColors");const ne=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(oe),ie]).then(([t,s])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(oe.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),this._safeReschedule(()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,oe),i.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(Y,!0),t?.updateObjectVisibility(oe.objectHandle,!0).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),oe.attributeInfo=i.attributeInfo;const s=oe.cachedRendererVersion!==this._rendererVersion,r=ne!==this.slicePlaneEnabled;this._updateElevationOffsets(oe);const o=oe.elevationOffsets;this._updateComponentData(oe);const n=this._applyFiltersToNode(oe);(s||null!=t&&(r||n||o))&&this._addOrUpdateEdgeRendering(oe),null!=this._labeler&&this._addMetaToLabeler(this._labeler,oe),this._visibleGeometryChanged(oe,0),this._highlights?.objectCreated(oe),this._updateMaterial(oe),this._setNewNodeOpacity(oe),null!=this._treeDebugger&&this._treeDebugger.update()},i))).catch(e=>{const{meta:t,allowMemCache:i}=s;throw s.meta=null,t&&i?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e})}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){o.getLogger(this).error("Removing duplicated node");const t=this._nodeId2Meta.get(e);t&&(this._deleteComponentObject(t),this._updateFeatureIdCounts(t,-1))}else this._controller.updateLoadStatus(e,!0);t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Ut(t.cachedEdgeMaterials,0),this._updateFeatureIdCounts(t,1)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this._controller.crsIndex,s=this.elevationInfo,r=this.view.basemapTerrain,o=r.spatialReference,n=s.mode;if(null==t||null==o||0===n)return void(e.elevationOffsets=null);const a=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const l=Gt,d=Bt,h=2===n,c=this.view.renderCoordsHelper,u=e.featureIds.length,_=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const s=J(3*u);e.cachedElevationAnchors=s;for(let r=0;r<u;r++){const n=3*r,h=e.anchorIds?.indexOf(r)??-1;e.anchors&&h>=0?(O(l,e.anchors[3*h],e.anchors[3*h+1],e.anchors[3*h+2]),V(l,l,te(e.node.serviceMbsInIndexSR)),z(l,i,l,o),s[n]=l[0],s[n+1]=l[1],s[n+2]=c.getAltitude(l)):(this._collection.getComponentAabb(e.objectHandle,r,d,!0),O(l,(d[0]+d[3])/2,(d[1]+d[4])/2,d[2]),E(l,l,a.rotationScale),V(l,l,a.position),s[n+2]=c.getAltitude(l),z(l,t,l,o),s[n]=l[0],s[n+1]=l[1])}return s})(),g=s.offset,m=e.elevationOffsets,f=(e,t)=>{const i=h?_[3*e+2]:0;m[e]=g+(t??0)-i};r.getElevations(_,u,f)}_ensureElevationTask(){return null!=this._elevationTask||(this._elevationTask=new je(this.view.resourceController.scheduler,e=>this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference)?.filterInPlace(e=>null!=this._nodeId2Meta.get(e)),e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e)),()=>this.elevationInfo?.mode)),this._elevationTask}_elevationInfoChanged(e,t){const i=0!==e.mode,s=!!t&&t!==e&&0!==t.mode;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach(e=>this._nodeElevationAlignmentChanged(e))}_nodeElevationAlignmentChanged(e){null!=e&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),null!=this._labeler&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,2),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return c(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=null!=e.params.material?e.params.material:Ne(),s=t.some(e=>"uvRegion"===e.name),r=t.some(e=>"normalCompressed"===e.name),o=Tt(i);return{geometryParameters:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s,r){const o=this._stage.renderView,n=e=>{this._gpuMemoryEstimate-=e,this._texMemoryEstimate-=e,r.memory-=e},a=i.map(e=>Pe(e,t,s,o,this._compressionTracker,n));this._stage.addTextures(a);let l=null;return this._collection.updateMaterial(e,e=>{l=ke(e,t,a,i,this.view.stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)}),{textures:a,texturePromise:l}}_getGeometryParameters(e){return new ft(this._hasVertexColors,e.hasTexture?e.hasRegions?2:1:0,e.hasNormals,this._shadeNormals,this._applySSAO)}_addData(e,t,i){let s=this._addTasks.get(e.index);if(s)s.attributeInfo=t;else{const r=u();s=new kt(t,null,r.promise),this._addTasks.set(e.index,s),i().then(r.resolve,r.reject).then(()=>this._addTasks.delete(e.index)).catch(t=>{throw this._addTasks.delete(e.index),t})}return s.promise}_clearAddTasks(){this._addTasks.forEach(e=>{null!=e.meta&&(this._cacheGPUData(e.meta),e.meta=null)}),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=Q();this._renderClippingArea=dt(this.view.clippingArea,i,e)?i:null;const s=Q();this._layerClippingArea=dt(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e),this._assertFeatureIdNodeCounts(e)}_assertFeatureIdNodeCounts(e){e&&!this._featureIdCounts?(this._featureIdCounts=ti(this._nodeId2Meta.values()),this._filteredIdCounts=ti(this._nodeId2Meta.values(),1),this._weaklyRemovedIdCounts=ti(this._nodeId2Meta.values(),2),this.addHandles(g(()=>this._controller.updating,e=>{!e&&this._needFilterResolve&&(this.multiGeometryFilterResolve(),this._needFilterResolve=!1,this.notifyUpdate())},{sync:!0}),"updateFinished")):!e&&this._featureIdCounts&&(this._featureIdCounts=null,this._filteredIdCounts=null,this._weaklyRemovedIdCounts=null,this._mismatchShow=null,this._mismatchHide=null,this.removeHandles("updateFinished"),this._needFilterResolve=!1,this.notifyUpdate())}_updateFeatureIdCounts(e,t){this._featureIdCounts&&(this._needFilterResolve=!0,ei(this._featureIdCounts,e.featureIds,t),ei(this._filteredIdCounts,e.filteredIds,t),ei(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,t))}_updateFilteredIdCounts(e,t,i){this._filteredIdCounts&&(this._needFilterResolve=!0,ei(this._filteredIdCounts,t,-1),ei(this._filteredIdCounts,e.filteredIds,1),ei(this._weaklyRemovedIdCounts,i,-1),ei(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,1))}_checkFeatureIdNodeCountInvariant(){const e=null!=this._featureIdCounts;if(this.hasGeometryFilter!==e&&o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","LayerView should have feature id node counts if and only if it has a geometry filter",{layerView:this,hasNodeCounts:e}),!this._featureIdCounts||!this._filteredIdCounts)return;const t=ti(this._nodeId2Meta.values());n(this._featureIdCounts,t)||o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _featureIdCounts",{layerView:this,counts:this._featureIdCounts,expected:t});const i=ti(this._nodeId2Meta.values(),1);n(this._filteredIdCounts,i)||o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _filteredIdCounts",{layerView:this,counts:this._filteredIdCounts,expected:i});const s=ti(this._nodeId2Meta.values(),2);n(this._weaklyRemovedIdCounts,s)||o.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _weaklyRemovedIdCounts",{layerView:this,counts:this._weaklyRemovedIdCounts,expected:i})}multiGeometryFilterResolve(){if(!this._featureIdCounts||!this._filteredIdCounts)return;let e=null,t=null;for(const[i,s]of this._filteredIdCounts){const r=this._featureIdCounts.get(i);if(r!==s){s+(this._weaklyRemovedIdCounts?.get(i)??0)===r?(e??=new Set,e.add(i)):(t??=new Set,t.add(i))}}f(e,this._mismatchShow)&&f(t,this._mismatchHide)||(this._mismatchShow=e,this._mismatchHide=t,this._nodeId2Meta.forEach(e=>{if(!e?.filteredIds)return;const t=Zt(e,this._mismatchShow,this._mismatchHide);this._collection.setAllComponentVisibilities(e.objectHandle,t),this._visibleGeometryChanged(e,2)}))}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(e=>{e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,2))})}getFilters(){const e=[],t=this._renderClippingArea;return null!=t&&e.push((e,i)=>this._boundingRectFilter(e,i,t)),e}addSqlFilter(e,t,i){if(null!=t){const s=t.fieldNames;e.push((e,r)=>this._sqlFilter(e,r,t,s,i))}}_sqlFilter(e,t,i,s,r){const o={},n=this._createLayerGraphic(o);if(!n)return;const a=this.i3slayer.objectIdField,l=t.featureIds,d=t.attributeInfo?.attributeData;s.every(e=>e===a||null!=d?.[e])&&$e(e,l,e=>{o[a]=l[e];for(const i of s)i!==a&&(o[i]=d?Ee(d[i],e):null);try{return i.testFeature(n)}catch(t){return r(t),!1}})}_boundingRectNodeTest(e,t){return G(e.node.serviceMbsInIndexSR,this._controller.crsIndex,Dt,this.view.renderSpatialReference),Ke(t,Dt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,Ot),K(Ot,jt),Y(i,jt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(3===r)return;if(0===r)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const n=this._transformClippingArea(Et,i,t.objectHandle);$e(e,t.featureIds,e=>this._boundingRectFeatureTest(t,e,n))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}async _addOrUpdateEdgeRendering(e,t=!0){const i=e.objectHandle,{hasEdges:s,perFeatureEdgeMaterials:r}=this._getFilteredEdgeMaterials(e);s&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const o=this._edgeView;if(!o)return null;const n=o.hasObject(i);if(s){if(n){if(this.nodeCrossfadingEnabled){Ut(r,this.getNodeOpacity(e))}return o.updateAllComponentMaterials(i,r,this.slicePlaneEnabled,t).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),o.updateObjectVisibility(i,!0).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),o.updateAllVerticalOffsets(i,e.elevationOffsets).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),o}const s=await this._collection.addEdges(i,o,r,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=s,e.node.memory+=s,o}return n&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,o.removeObject(i)),null}_applyFiltersToNode(e){const{filteredIds:t,weaklyRemovedIds:i}=e,s=this._applyFiltersToNodeComponents(e);return this._updateFilteredIdCounts(e,t,i),s&&this._labeler?.applyFilterChange(e),s}_applyFiltersToNodeComponents(e){const t=this._collection,i=t.getComponentCount(e.objectHandle),s=null!=e.filteredIds,r=0===i.invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!r;if(null!=e.filteredIds&&e.appliedFilters===this._filters||(e.weaklyRemovedIds=null,e.filteredIds=Xt(e,this._filters),e.appliedFilters=this._filters),s&&e.filteredIds===e.featureIds&&(!this._mismatchHide||e.filteredIds.every(e=>!this._mismatchHide?.has(e))))return!r;const o=Zt(e,this._mismatchShow,this._mismatchHide);return t.setAllComponentVisibilities(e.objectHandle,o),!0}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach((t,i)=>this._removeNodeStageData(i,e)),this._nodeId2MetaReloading.forEach((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading)),this._elevationTask=a(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),null!=this._elevationTask&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);null!=s?(this._collection.setObjectVisibility(s.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch(e=>this._logEdgeViewError(e,this.i3slayer.title)),this._visibleGeometryChanged(s,1),null!=this._labeler&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights?.objectDeleted(s),i===this._nodeId2Meta?(this._updateFeatureIdCounts(s,-1),this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),null!=this._treeDebugger&&this._treeDebugger.update()):i.delete(e)}_deleteComponentObject(e){if(null!=this._edgeView&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.removeTexture(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._collection.updateMaterial(i.objectHandle,e=>e.polygonOffsetEnabled=0===t)}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const i=this._nodeId2MetaReloading.get(e);i&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,i))}_invalidateAllSymbols(){this._rendererVersion=Qe(this._rendererVersion,1),this._controller?.requestUpdate()}_getInvalidRendererVersion(){return Qe(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Qe(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await ge()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:o.getLogger(this).warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.symbols)"mesh-3d"!==t.type&&o.getLogger(this).error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=i*e.cachedSymbologyStride;N(s.externalColor,t[r]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255);const o=this._stage.renderView.olidRenderHelper;if(o){const t=e.featureIds[i],r=this.sublayerId?`${this.layerViewUid}_${this.sublayerId}`:this.layerViewUid,n=ue(this.view,this.uid);o.setUidToObjectAndLayerId(t,t,this.layerId,r,this.layerPopupEnabledAndHasTemplate&&!n,e.node.resources.attributes,i,this.sublayerId),s.olidColor=o.getObjectAndLayerIdColor({graphicUid:t,layerViewUid:r})}s.externalColorMixMode=15&t[r+4],s.castShadows=!!(16&t[r+4]),s.pickable=!!(32&t[r+4]),s.elevationOffset=e.elevationOffsets?.[i]??0,s.emissiveStrength=e.emissiveStrengths?.[i]??1,s.emissiveSource=e.emissiveSources?.[i]??0}}_getSymbolInfo(e,t){const i=e?.getSymbol(t,{arcade:this._arcade});if(!(i instanceof me))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=Ye(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=null!=this._symbologyOverrideFields&&this._symbologyOverrideFields.length>0?null!=this._rendererFields&&this._rendererFields.length>0?le(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=e.attributeInfo?.attributeData,o=e.featureIds?this.i3slayer.objectIdField:null,n=null!=r&&null!=this._symbologyFields&&this._symbologyFields.length>0;let a=null,l=null;if(n&&null!=this._symbologyFields){a=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(a.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=oe(e.featureIds.length*e.cachedSymbologyStride));const d=new it,h=this.fullOpacity,c=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):h;let u=null,_=1,g=Je,m=0;for(let f=0;f<e.featureIds.length;f++){if(null!=o&&(i[o]=e.featureIds[f]),n&&a)for(let e=0;e<a.length;e++)i[a[e]]=Ee(l[e],f);const r=s?this._getSymbolInfo(s,t):null;let h,p;if(d.pickable=!0,s&&"visualVariables"in s){if(this._colorVariable){const e=he(this._colorVariable,t,{color:Vt,arcade:this._arcade});e&&(h=d.color,h[0]=e.r/255,h[1]=e.g/255,h[2]=e.b/255,h[3]=e.a??1,this._opacityVariable||null===e.a||(p=e.a))}this._opacityVariable&&(p=ce(this._opacityVariable,t,{arcade:this._arcade}))}if(r?.material){const e=r.material;h=null==h||null==p?Re(h,p,e.color,e.alpha,Mt,d.color):Re(h,p,null,null,Mt,d.color)}h??=N(d.color,1,1,1,1);const y=r?.material;if(d.colorMixMode=y?.colorMixMode??1,d.edgeMaterial=r?.edgeMaterial,this._symbologyOverride?.(t,d),null!=this._nodeColorOverride&&(this._nodeColorOverride(e.node,h),d.colorMixMode=3),d.pickable&&=h[3]>=Ct,d.castShadows=r?r.castShadows:d.pickable,null!=d.edgeMaterial){const t=h[3]>=1&&(e.material.isOpaque||3===d.colorMixMode)?1:0;d.edgeMaterial===u&&t===_||(g={...d.edgeMaterial,opacity:c,objectTransparency:t},u=d.edgeMaterial,_=t),e.cachedEdgeMaterials[f]=g}else e.cachedEdgeMaterials[f]=Je;e.cachedSymbology[m++]=Math.round(255*h[0]),e.cachedSymbology[m++]=Math.round(255*h[1]),e.cachedSymbology[m++]=Math.round(255*h[2]),e.cachedSymbology[m++]=Math.round(255*h[3]),e.cachedSymbology[m++]=d.colorMixMode|+d.castShadows<<4|+d.pickable<<5;const b=y?.emissive?.strength??yt;b===yt||e.emissiveStrengths||(e.emissiveStrengths=new Array(e.featureIds.length).fill(yt)),e.emissiveStrengths&&(e.emissiveStrengths[f]=b);const v=y?.emissive?.source||0;0===v||e.emissiveSources||(e.emissiveSources=new Array(e.featureIds.length).fill(0)),e.emissiveSources&&(e.emissiveSources[f]=v)}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Ut(t,this.fullOpacity);const i=e.filteredIds;if(null==i){return{hasEdges:t.some(e=>e!==Je),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map((t,o)=>e.featureIds[o]!==i[s]?Je:(r=r||t!==Je,s++,t));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach(t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,t=>t.objectOpacity=e),Ut(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))})}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)})}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,2)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),null!=this._labeler&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach(t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,t=>t.commonMaterialParameters.hasSlicePlane=e),this._updateEdgeRendering(t,!1))})}_updatePBR(e){this._nodeId2Meta.forEach(t=>{null!=t&&this._collection.updateMaterial(t.objectHandle,t=>t.usePBR=e)}),this._hasLoadedPBRTextures=!0}get _usePBR(){return this._shadeNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){null!=this._edgeView&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,i,s)=>s.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?1:e(t,i,s):e}_forAllFeatures(e,t,i){for(const s of this._nodeId2Meta.values()){if(null==s)continue;if(null!=t){switch(t(s.node.serviceMbsInIndexSR)){case 0:return;case 2:continue}}let r=1;switch(i){case 1:r=this._forAllFeaturesOfNode(s,e);break;case 0:r=this._forAllVisibleFeaturesOfNode(s,e);break;case 2:r=this._forAllQueryableFeaturesOfNode(s,e)}if(0===r)return}}_forAllFeaturesOfNode(e,t){let i=1;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),0===i)return i;return i}_forAllVisibleFeaturesOfNode(e,t){let i=1;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,r=>(i=t(s[r],r,e),1===i)),i}_forAllQueryableFeaturesOfNode(e,t){const i=this._ignoreClientNodeOverriddenFeatures(t);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(e,i);const s=this._boundingRectNodeTest(e,this._renderClippingArea);if(0===s)return 1;if(3===s)return this._forAllFeaturesOfNode(e,i);const r=1,o=e.featureIds,n=e.objectHandle,a=Xe(this._renderClippingArea,this._collection.getObjectTransform(n));for(let l=0;l<o.length;l++){if(!this._boundingRectFeatureTest(e,l,a))continue;const t=i(o[l],l,e);if(0===t)return t}return r}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=t.attributeInfo?.attributeData;if(null!=s)for(const r of Object.keys(s))i[r]=Ee(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){const s=rt(e);if(0===s.length)return ot;const r=vt(t),o=s[0]instanceof i?this._featureIdsFromGraphics(s):"number"==typeof s[0]?s:null;if(!o)return ot;const n=this._ensureHighlights(),{set:a,handle:l}=n.acquireSet(r);return n.setFeatureIds(a,o),l}_featureIdsFromGraphics(e){const t=this.i3slayer.fieldsIndex,i=this._getObjectIdField();return e.map(e=>st(t,e.attributes,i))}_ensureHighlights(){let e=this._highlights;return e||(e=new Oe({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,1),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._highlights=e),e}resetHighlights(){this._highlights=a(this._highlights)}_visibleGeometryChanged(e,t){this._elevationProvider&&(null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=m(()=>{const{node:t}=e,i=t.visibilityObbInRenderSR??t.geometryObbInRenderSR??t.serviceObbInRenderSR;if(null!=i){const e=$();i.toAaBoundingBox(e),this.emit("visible-geometry-changed",new pe(e))}else this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle=null})),this._updateSnappingSources(e,t),this._elevationProvider.notifyObjectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new be(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}checkInvariants(){}get test(){}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return null!=e?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}getNodeComponentHandle(e){return this._nodeId2Meta.get(e)?.objectHandle}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(e)}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);null!=s&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,e=>e.objectOpacity=t),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(null==this._edgeView||!e.cachedEdgeMaterials)return;Ut(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch(e=>this._logEdgeViewError(e,this.i3slayer.title))}get hasModifications(){return this._isIntegratedMesh&&null!=this._layerClippingArea||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.uid,s=Pt(e);if(s){const t={context:i,buffer:s.buffer};we(t);const r=new Float64Array(s.buffer);e.forAll((e,t)=>{const i=r[t],s=xe(i);e.imModificationImpact=s,0!==s&&this._controller.invalidateGeometryVisibility(e.index)})}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||null!=this._elevationTask&&this._elevationTask.readyToRun||this._needFilterResolve||this._compressionTracker.compressing}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(null==s)throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>s(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach((t,i)=>{if(null==t)return;const s=this._controller.getRenderMbs(t.node);s&&e.add(i,s)}),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||0===this.elevationInfo.mode)return;const s=t.position0,r=t.position1,o=t.componentIndex,n=H(),a=H(),l=(e,t)=>{V(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,a),V(e,e,D(a,a,t)),T(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,n),l(n,t),s.setVec(d,n),r.getVec(d,n),l(n,t),r.setVec(d,n)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(null!=s)for(const r of this._snappingSourcesTrackers)1!==t&&2!==t||r.events.remove(i),0!==t&&2!==t||r.events.add(i,s)}_logEdgeViewError(e,t){h(e)||o.getLogger(this).warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}_indexedDbSizeCheck(e,t){return t.byteSize>Rt?(o.getLogger(this).warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}};return e([y()],A.prototype,"_hasLoadedPBRTextures",void 0),e([y()],A.prototype,"_asyncModuleLoading",void 0),e([y()],A.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([y()],A.prototype,"view",void 0),e([y()],A.prototype,"i3slayer",void 0),e([y()],A.prototype,"_controller",void 0),e([y()],A.prototype,"_labeler",void 0),e([y()],A.prototype,"updating",void 0),e([y()],A.prototype,"suspended",void 0),e([y()],A.prototype,"contentVisible",null),e([y({readOnly:!0})],A.prototype,"legendEnabled",null),e([y(ut)],A.prototype,"updatingProgress",void 0),e([y()],A.prototype,"updatingProgressValue",null),e([y()],A.prototype,"hasTexturesOrVertexColors",null),e([y()],A.prototype,"rendererTextureUsage",null),e([y()],A.prototype,"elevationOffset",null),e([y()],A.prototype,"elevationInfo",null),e([y({type:Boolean})],A.prototype,"slicePlaneEnabled",void 0),e([y()],A.prototype,"supportedTextureEncodings",null),e([y({type:[de]})],A.prototype,"_modifications",void 0),e([y({readOnly:!0})],A.prototype,"clientGeometry",null),e([y()],A.prototype,"elevationRange",null),e([y()],A.prototype,"fullExtent",null),e([y()],A.prototype,"_elevationTask",void 0),e([y({readOnly:!0})],A.prototype,"_usePBR",null),A=e([b("esri.views.3d.layers.I3SMeshView3D")],A),A},Ot=$(),jt=Q(),Et=Q(),Ft=new ht,Vt=new t([0,0,0,0]),Dt=ie(0,0,0,0);function Tt(e){if(null==e)return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function At(e){return"geometryData"in e}function Ht(e){return null!=e&&p(e.data)}function Nt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(null!=t)for(const s of t)null!=s&&p(s.data)&&(i+=s.data.byteLength);return i}function Pt(e){if(0===e.length)return;const t=10*e.length,i=new Float64Array(t);let s=0;return e.forAll(e=>{let t=e.serviceObbInIndexSR;null==t&&(t=Ft,t.center=se(e.serviceMbsInIndexSR,H()),t.halfSize=[e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3]]);const r=t.data;i[s++]=r[0],i[s++]=r[1],i[s++]=r[2],i[s++]=r[3],i[s++]=r[4],i[s++]=r[5],i[s++]=r[6],i[s++]=r[7],i[s++]=r[8],i[s++]=r[9]}),i}class kt{constructor(e,t,i){this.attributeInfo=e,this.meta=t,this.promise=i,this.allowMemCache=!0}}function Ut(e,t){e.forEach(e=>e.opacity=t)}class Lt{constructor(e,t){this.mode=e,this.offset=t}}const Gt=H(),Bt=$(),qt="elevation-change",zt="",Wt="@null",$t="@ECEF",Kt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Qt=new lt;function Yt(e,t,i){let s=e.elevationRangeMin,r=e.elevationRangeMax;const o=i;if(o>0){t.getCorners(Kt);for(const e of Kt){const t=A(e)-o;s=Math.min(s,t),r=Math.max(r,t)}}else{t.getCorners(Kt);for(const e of Kt){const t=e[2];s=Math.min(s,t),r=Math.max(r,t)}}e.expandElevationRangeValues(s,r)}function Jt(e,t,i){const s=te(t),r=i>0?A(s)-i:s[2],o=re(t);e.expandElevationRangeValues(r-o,r+o)}function Xt(e,t){const i=e.featureIds.slice();for(const s of t)if(s(i,e),0===i.length)break;return i.length===e.featureIds.length?e.featureIds:i}function Zt(e,t,i){const s=new Array,r=e.filteredIds;if(null==r||t?.size||i?.size){if(null!=r){let o=0;e.featureIds.forEach((e,n)=>{if(r[o]===e)++o;else if(!t?.has(e))return;i?.has(e)||s.push(n)})}}else e.featureIds.forEach((e,t)=>{r[s.length]===e&&s.push(t)});return s}function ei(e,t,i){if(e&&t)for(const s of t){const t=(e.get(s)??0)+i;t>0?e.set(s,t):e.delete(s)}}function ti(e,t=0){const i=new Map;for(const s of e){ei(i,0===t?s?.featureIds:1===t?s?.filteredIds:s?.weaklyRemovedIds,1)}return i}export{St as I3SMeshView3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import
|
|
5
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{initial as r}from"../../../core/reactiveUtils.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{I3SMeshView3D as o}from"./I3SMeshView3D.js";import{LayerView3D as s}from"./LayerView3D.js";import{updatingProgress as a}from"../support/updatingProperties.js";import l from"../../layers/LayerView.js";import{isInEffectiveScaleRange as n}from"../../support/layerViewUtils.js";const p=.2;let d=class extends(o(s(l))){constructor(){super(...arguments),this.type="integrated-mesh-3d",this._elevationContext="im",this._supportsLabeling=!1,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this.drapeTargetType=1}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??0}get lodFactor(){return this.view?.qualitySettings?.sceneService?.integratedMesh?.lodFactor??1}get progressiveLoadFactor(){return this.lodFactor>=1?p:1}get visibleAtCurrentScale(){return n(this.i3slayer.effectiveScaleRange,this.view.scale)}get layerPopupEnabledAndHasTemplate(){return!1}initialize(){this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),r),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this)}destroy(){this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this)}_createLayerGraphic(){}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),r),"modifications")}};e([t()],d.prototype,"layer",void 0),e([t()],d.prototype,"i3slayer",null),e([t(a)],d.prototype,"updatingProgress",void 0),e([t()],d.prototype,"updatingProgressValue",null),e([t()],d.prototype,"lodFactor",null),e([t({readOnly:!0})],d.prototype,"progressiveLoadFactor",null),e([t({readOnly:!0})],d.prototype,"visibleAtCurrentScale",null),d=e([i("esri.views.3d.layers.IntegratedMeshLayerView3D")],d);const c=d;export{c 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveSet.js";import{initial as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../core/sql/WhereClause.js";import u from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as p}from"../../../layers/support/floorFilterUtils.js";import h from"../../../rest/support/Query.js";import{isNumber as c}from"../../../support/guards.js";import{I3SMeshView3D as y}from"./I3SMeshView3D.js";import{LayerView3D as g}from"./LayerView3D.js";import{createInteractiveEditSession as f,normalizeEditResultsEvent as m,processGeometryEdits as _,processAttributeEdits as F}from"./i3s/featureEditing.js";import{createGetFeatureExtent as v}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SOverrides as b}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as j}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as I,I3SQueryFeature as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as E}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as O,getIndexCrs as H,objectIdFilter as x}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as C}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{PopupSceneLayerView as V}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as R}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as q}from"./support/TemporalSceneLayerView.js";import{updatingProgress as L}from"../support/updatingProperties.js";import A from"../../layers/SceneLayerView.js";import{hasPopupTemplate as D}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as G}from"../../support/layerViewUtils.js";import{TaskPriority as U}from"../../support/Scheduler.js";const P=Q();let M=class extends(y(q(C(V(g(A)))))){constructor(){super(...arguments),this.type="scene-layer-3d",this.viewFilter=null,this._setVisibilityHiddenObjectIds=new l,this.progressiveLoadFactor=1,this._elevationContext="scene",this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),O(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this.i3sOverrides=new b({view:this.view,layer:e,memoryController:i}),this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&D(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",w.checkSupport(e)?e:null)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const e=p(this);return null!=e?d.create(e,{fieldsIndex:this.layer.fieldsIndex}):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((e,t)=>e-t):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.object?.lodFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return G(this.i3slayer.effectiveScaleRange,this.view.scale)}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){this._fieldsHelper=new R({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),n),this._updatingHandles.add(()=>this.layer.renderer,e=>this._updatingHandles.addPromise(this._rendererChange(e)),n);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>({layerViewFilter:this.mergedFilter,layerFilter:this.layerFilter}),({layerViewFilter:e,layerFilter:t})=>{if(null==e&&null==t)return void this._set("viewFilter",null);const i=this.viewFilter;if(i)return i.viewFilter=e,i.layerFilter=t,void this._filterChange();this._set("viewFilter",new w({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}))},n),this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles(this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!0,returnZ:!0,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new h(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;const t=this.layer,i=this._graphicOrigin;for(const r of e.features)r.layer=t,r.sourceLayer=t,r.origin=i;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(c)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){const e=v(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new j({layerView:this,priority:U.FEATURE_QUERY_ENGINE,spatialIndex:new E({featureAdapter:new I({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,i,r)=>e(new S(t,i,r)),t,2),getFeatureExtent:e,sourceSpatialReference:H(this.layer),viewSpatialReference:this.view.spatialReference})})}createInteractiveEditSession(e){return f(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}getFilters(){const e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((e,t)=>{t.node.index>=0&&x(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)});const t=this._setVisibilityHiddenObjectIdsSorted;null!=t&&e.push(e=>x(t,!1,e));const i=this._excludeObjectIdsSorted;return null!=i&&e.push(e=>x(i,!1,e)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),null!=this.viewFilter&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(e){return this._validateQuery(this._addDefinitionExpressionToQuery(null==e?this.createQuery():h.from(e)))}_validateQuery(e){return e.outSpatialReference&&!e.outSpatialReference.equals(this.view.spatialReference)&&(i.getLogger(this).warn("query: outSpatialReference different from the view's spatial reference is not supported"),e.outSpatialReference=this.view.spatialReference),e.returnGeometry&&(e.returnZ=!0),e.returnCentroid=!1,e}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>null!=t?e(t.node,t.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=this._attributeEditingContext,i=await m(t,e);_(t,i),F(t,i)}get hasGeometryFilter(){return null!=this.viewFilter?.parsedGeometry}computeNodeFiltering(e){const t=this.viewFilter;return null==t||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?0:1}};e([o()],M.prototype,"i3slayer",null),e([o(L)],M.prototype,"updatingProgress",void 0),e([o({type:u})],M.prototype,"filter",null),e([o({readOnly:!0})],M.prototype,"viewFilter",void 0),e([o(P.requiredFields)],M.prototype,"requiredFields",null),e([o(P.availableFields)],M.prototype,"availableFields",void 0),e([o()],M.prototype,"_fieldsHelper",void 0),e([o()],M.prototype,"_floorFilterClause",null),e([o()],M.prototype,"_excludeObjectIdsSorted",null),e([o()],M.prototype,"_setVisibilityHiddenObjectIds",void 0),e([o()],M.prototype,"_setVisibilityHiddenObjectIdsSorted",null),e([o()],M.prototype,"lodFactor",null),e([o()],M.prototype,"updatingProgressValue",null),e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),e([o()],M.prototype,"_graphicOrigin",null),M=e([a("esri.views.3d.layers.SceneLayerView3D")],M);const T=M;export{T as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveSet.js";import{initial as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../core/sql/WhereClause.js";import u from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as p}from"../../../layers/support/floorFilterUtils.js";import h from"../../../rest/support/Query.js";import{isNumber as c}from"../../../support/guards.js";import{I3SMeshView3D as y}from"./I3SMeshView3D.js";import{LayerView3D as g}from"./LayerView3D.js";import{createInteractiveEditSession as f,normalizeEditResultsEvent as m,processGeometryEdits as _,processAttributeEdits as F}from"./i3s/featureEditing.js";import{createGetFeatureExtent as v}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SOverrides as b}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as j}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as I,I3SQueryFeature as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as E}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as O,getIndexCrs as H,objectIdFilter as x}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as C}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{PopupSceneLayerView as V}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as R}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as q}from"./support/TemporalSceneLayerView.js";import{updatingProgress as L}from"../support/updatingProperties.js";import A from"../../layers/SceneLayerView.js";import{hasPopupTemplate as D}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as G}from"../../support/layerViewUtils.js";import{TaskPriority as U}from"../../support/Scheduler.js";const P=Q();let M=class extends(y(q(C(V(g(A)))))){constructor(){super(...arguments),this.type="scene-layer-3d",this.viewFilter=null,this._setVisibilityHiddenObjectIds=new l,this.progressiveLoadFactor=1,this._elevationContext="scene",this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),O(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this.i3sOverrides=new b({view:this.view,layer:e,memoryController:i}),this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&D(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",w.checkSupport(e)?e:null)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const e=p(this);return null!=e?d.create(e,{fieldsIndex:this.layer.fieldsIndex}):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((e,t)=>e-t):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.object?.lodFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return G(this.i3slayer.effectiveScaleRange,this.view.scale)}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){this._fieldsHelper=new R({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),n),this._updatingHandles.add(()=>this.layer.renderer,e=>this._updatingHandles.addPromise(this._rendererChange(e)),n);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>({layerViewFilter:this.mergedFilter,layerFilter:this.layerFilter}),({layerViewFilter:e,layerFilter:t})=>{if(null==e&&null==t)return void this._set("viewFilter",null);const i=this.viewFilter;if(i)return i.viewFilter=e,i.layerFilter=t,void this._filterChange();this._set("viewFilter",new w({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}))},n),this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles(this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!0,returnZ:!0,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new h(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;const t=this.layer,i=this._graphicOrigin;for(const r of e.features)r.layer=t,r.sourceLayer=t,r.origin=i;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(c)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){const e=v(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new j({layerView:this,priority:U.FEATURE_QUERY_ENGINE,spatialIndex:new E({featureAdapter:new I({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,i,r)=>e(new S(t,i,r)),t,2),getFeatureExtent:e,sourceSpatialReference:H(this.layer),viewSpatialReference:this.view.spatialReference})})}createInteractiveEditSession(e){return f(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}getFilters(){const e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((e,t)=>{t.node.index>=0&&x(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)});const t=this._setVisibilityHiddenObjectIdsSorted;null!=t&&e.push(e=>x(t,!1,e));const i=this._excludeObjectIdsSorted;return null!=i&&e.push(e=>x(i,!1,e)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),null!=this.viewFilter&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||!!this._fieldsHelper?.updating||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(e){return this._validateQuery(this._addDefinitionExpressionToQuery(null==e?this.createQuery():h.from(e)))}_validateQuery(e){return e.outSpatialReference&&!e.outSpatialReference.equals(this.view.spatialReference)&&(i.getLogger(this).warn("query: outSpatialReference different from the view's spatial reference is not supported"),e.outSpatialReference=this.view.spatialReference),e.returnGeometry&&(e.returnZ=!0),e.returnCentroid=!1,e}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>null!=t?e(t.node,t.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=this._attributeEditingContext,i=await m(t,e);_(t,i),F(t,i)}get hasGeometryFilter(){return null!=this.viewFilter?.parsedGeometry}computeNodeFiltering(e){const t=this.viewFilter;return null==t||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?0:1}};e([o()],M.prototype,"i3slayer",null),e([o(L)],M.prototype,"updatingProgress",void 0),e([o({type:u})],M.prototype,"filter",null),e([o({readOnly:!0})],M.prototype,"viewFilter",void 0),e([o(P.requiredFields)],M.prototype,"requiredFields",null),e([o(P.availableFields)],M.prototype,"availableFields",void 0),e([o()],M.prototype,"_fieldsHelper",void 0),e([o()],M.prototype,"_floorFilterClause",null),e([o()],M.prototype,"_excludeObjectIdsSorted",null),e([o()],M.prototype,"_setVisibilityHiddenObjectIds",void 0),e([o()],M.prototype,"_setVisibilityHiddenObjectIdsSorted",null),e([o()],M.prototype,"lodFactor",null),e([o()],M.prototype,"updatingProgressValue",null),e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),e([o()],M.prototype,"_graphicOrigin",null),M=e([a("esri.views.3d.layers.SceneLayerView3D")],M);const T=M;export{T 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{EsriPromise as i}from"../../../../core/Promise.js";import{initial as s,watch as o,sync as n,whenOnce as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{EsriPromise as i}from"../../../../core/Promise.js";import{initial as s,watch as o,sync as n,whenOnce as l}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{FeatureTileController3D as u}from"../../../../layers/graphics/controllers/FeatureTileController3D.js";import{symbolHasExtrudeSymbolLayer as d}from"../../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as c}from"./elevationAlignPointsInFeatures.js";import{Graphics3DFeatureProcessor as y}from"./Graphics3DFeatureProcessor.js";import{QueryEngine as g}from"./QueryEngine.js";import{QueryEngineContext as m}from"./QueryEngineContext.js";import{queryForSymbologySnapping as f}from"./queryForSymbologySnapping.js";import{HeatmapFeatureProcessor as w}from"../support/HeatmapFeatureProcessor.js";import{LayerViewPerformanceInfo as E}from"../support/LayerViewPerformanceInfo.js";import{hasLayerBasedScaleVisibility as b}from"../../../support/layerViewUtils.js";import{TaskPriority as F}from"../../../support/Scheduler.js";let V=class extends i{constructor(e){super(e),this._dataUpdatingState=0,this.graphicsQuery={queryForSymbologySnapping:async(e,t)=>this.symbologySnappingSupported?f(this.graphics3DProcessor,e,t):{candidates:[],sourceCandidateIndices:[]},executeQuery:(e,t)=>this.queryEngine.executeQuery(e,t),executeQueryForIds:(e,t)=>this.queryEngine.executeQueryForIds(e,t),executeQueryForCount:(e,t)=>this.queryEngine.executeQueryForCount(e,t),executeQueryForExtent:(e,t)=>this.queryEngine.executeQueryForExtent(e,t),executeQueryForLatestObservations:(e,t)=>this.queryEngine.executeQueryForLatestObservations(e,t),executeAttributeBinsQuery:(e,t)=>this.queryEngine.executeAttributeBinsQuery(e,t)},this.controller=null,this.updatingHandles=new h,this._controllerCreated=!1,this._pendingController=null}initialize(){this.addResolvingPromise(this._initializeController()),this.updatingHandles.add(()=>this.layer.renderer,e=>this._recreateProcessor(e),s),this.updatingHandles.add(()=>this.updatePolicy,e=>this.processor.preferredUpdatePolicy=e);const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:o,resourceController:n}=t,l=new m(o,e,n,()=>this.processor.featureStore,i,r);this.queryEngine=new g({context:l,priority:F.FEATURE_QUERY_ENGINE})}destroy(){this.removeAllHandles(),this.updatingHandles.destroy(),this._destroyPendingController(),this.controller=r(this.controller),this.processor=r(this.processor),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=r(this._pendingController)}get updating(){return this.updatingHandles.updating||!this._controllerCreated||this.controller?.updating||this.processor?.updating}get legendEnabled(){return this.processor.legendEnabled}get layer(){return this.layerView.layer}get layerViewUid(){return this.layerView.uid}get view(){return this.layerView.view}get hasZ(){return this.layerView.hasZ}get hasM(){return this.layerView.hasM}get fullOpacity(){return this.layerView.fullOpacity}get suspended(){return this.layerView.suspended}get filter(){return"filter"in this.layerView?this.layerView.filter:null}get effectiveDisplayFilter(){return"effectiveDisplayFilter"in this.layerView?this.layerView.effectiveDisplayFilter:null}get highlightIds(){return"highlightIds"in this.layerView?this.layerView.highlightIds:null}get slicePlaneEnabled(){return this.layerView.slicePlaneEnabled}get featureSpatialReference(){return"featureSpatialReference"in this.layerView?this.layerView.featureSpatialReference:null}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get hasAllFeatures(){return!(!this.controller||!("hasAllFeatures"in this.controller))&&this.controller.hasAllFeatures}get hasAllFeaturesInView(){return!(!this.controller||!("hasAllFeaturesInView"in this.controller))&&this.controller.hasAllFeaturesInView}get hasFullGeometries(){return!(!this.controller||!("hasFullGeometries"in this.controller))&&this.controller.hasFullGeometries}get symbologySnappingSupported(){return this.layer?.renderer?.symbols?.some(d)??!1}get updatePolicy(){return 1}get scaleVisibilitySuspended(){return this.processor?.scaleVisibilitySuspended}get timeExtent(){return"timeExtent"in this.layerView?this.layerView.timeExtent:null}get dataUpdating(){return 0!==this._dataUpdatingState}get suspendInfo(){return this.processor?.suspendInfo??{}}forEachGraphic(e){this.loadedGraphics.forEach(e)}findGraphic(e){return this.loadedGraphics.find(e)}queryObjectIds(e,t){return this.layerView.queryObjectIds(e,t)}whenGraphicBounds(e,t){return this.processor?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,r){const i=this.graphics3DProcessor;if(null==i)throw new t("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return c(this.view,this.layer,e=>i.getGraphics3DGraphicByObjectId(e),e,r)}highlightByGraphics(e,t){return this.processor.highlightByGraphics(e,t)}highlightByObjectIds(e,t){return this.processor.highlightByObjectIds(e,this.layer.objectIdField,t)}maskOccludee(e){return this.processor.maskOccludee(e)}notifyContentGeometryUpdate(){this.layerView.emit("visible-geometry-changed")}async _initializeController(){const e=this.createController();this._pendingController=e,this._setupDataUpdating(e),await e.when(),this._setControllerWhenInitialized(e)}_setupDataUpdating(e){"dataUpdating"in e&&this.addHandles([o(()=>e.dataUpdating,e=>{e&&0===this._dataUpdatingState?this._dataUpdatingState=1:e||1!==this._dataUpdatingState||(this._dataUpdatingState=0)},n),o(()=>!!this.graphics3DProcessor?.dataUpdating,t=>{t&&1===this._dataUpdatingState?this._dataUpdatingState=2:t||2!==this._dataUpdatingState||(this._dataUpdatingState=e.dataUpdating?1:0)},n)])}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.isResolved()&&!this.destroyed?(await l(()=>this.view?.basemapTerrain?.ready),this.beforeSetController(e),this._pendingController=null,this.controller=e,this.loadedGraphics=e.graphics):this._destroyPendingController()}_recreateProcessor(e){const t="heatmap"===e?.type,r="heatmap"===this.processor?.type,i=this.processor;if(i&&t===r)return;const s=t?new w({owner:this}):new y({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!b(),filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this.processor=s,i?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(s.when())}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}get usedMemory(){return this.processor?.usedMemory??0}get performanceInfo(){const e=this.controller instanceof u?this.controller:null;return new E(this.usedMemory,this.loadedGraphics?.length,e?.serviceDataCount??-1,e?.maximumNumberOfFeatures??-1,0,this.processor.performanceInfo)}};e([a()],V.prototype,"updating",null),e([a()],V.prototype,"legendEnabled",null),e([a()],V.prototype,"layerView",void 0),e([a()],V.prototype,"layer",null),e([a()],V.prototype,"layerViewUid",null),e([a()],V.prototype,"view",null),e([a()],V.prototype,"hasZ",null),e([a()],V.prototype,"hasM",null),e([a()],V.prototype,"fullOpacity",null),e([a()],V.prototype,"suspended",null),e([a()],V.prototype,"filter",null),e([a()],V.prototype,"effectiveDisplayFilter",null),e([a()],V.prototype,"highlightIds",null),e([a()],V.prototype,"slicePlaneEnabled",null),e([a()],V.prototype,"featureSpatialReference",null),e([a()],V.prototype,"loadedGraphics",void 0),e([a()],V.prototype,"graphics3DProcessor",null),e([a()],V.prototype,"heatmapProcessor",null),e([a()],V.prototype,"hasAllFeatures",null),e([a()],V.prototype,"hasAllFeaturesInView",null),e([a()],V.prototype,"hasFullGeometries",null),e([a()],V.prototype,"symbologySnappingSupported",null),e([a()],V.prototype,"updatePolicy",null),e([a()],V.prototype,"scaleVisibilitySuspended",null),e([a()],V.prototype,"timeExtent",null),e([a()],V.prototype,"_dataUpdatingState",void 0),e([a({readOnly:!0})],V.prototype,"dataUpdating",null),e([a()],V.prototype,"controller",void 0),e([a()],V.prototype,"processor",void 0),e([a()],V.prototype,"updatingHandles",void 0),e([a()],V.prototype,"_controllerCreated",void 0),V=e([p("esri.views.3d.layers.graphics.Graphics3DGraphicsPipeline")],V);export{V as Graphics3DGraphicsPipeline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as i}from"../../../../geometry/support/typeUtils.js";import{QueryEngine as a}from"../../../../layers/graphics/data/QueryEngine.js";import o from"../../../../layers/support/FieldsIndex.js";import u from"../../../../rest/support/AttributeBinsFeatureSet.js";import y from"../../../../rest/support/FeatureSet.js";import c from"../../../../rest/support/Query.js";import{createFeatureIdInfo as p}from"../../../2d/layers/features/layerAdapters/featureServiceUtils.js";import{QueryEngineCache as l}from"./QueryEngineCache.js";const h=a;let m=class extends t{constructor(e){super(e),this._dataQueryEngineInstance=null}destroy(){this.clear()}get layer(){return this.context.layer}get spatialReference(){return this.context.spatialReference}get _queryGeometryType(){switch(this.layer.geometryType){case"multipoint":case"point":case"polygon":case"polyline":return this.layer.geometryType;case"mesh":return"polygon";default:return}}get defaultQueryJSON(){return new c({outSpatialReference:this.spatialReference}).toJSON()}clear(){return!!this._dataQueryEngineInstance&&(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0)}async executeQueryForIdSet(e,t,r){return this._dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(e,t),r)}async executeQueryForCount(e,t){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),t)}async executeQueryForExtent(e,t){const{count:r,extent:n}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),t);return{count:r,extent:s.fromJSON(n)}}async executeQueryForIds(e,t){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),t)}async executeQueryForLatestObservations(e,t){const r=await this._dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(e),t),n=y.fromJSON(r);return n.features.forEach(e=>{e.layer=this.layer,e.sourceLayer=this.layer,"graphicOrigin"in this.layer&&(e.origin=this.layer.graphicOrigin)}),n}async executeAttributeBinsQuery(e,t){const r=await this._dataQueryEngine.executeAttributeBinsQuery(e.toJSON(),t);return u.fromJSON(r)}async executeQuery(e,t){const r=await this._dataQueryEngine.executeQuery(this._ensureQueryJSON(e),t),n=y.fromJSON(r);return n.features.forEach(e=>{e.layer=this.layer,e.sourceLayer=this.layer,"graphicOrigin"in this.layer&&(e.origin=this.layer.graphicOrigin)}),n}_ensureQueryJSON(e,t){let r=this.defaultQueryJSON;if(null!=e&&("outSpatialReference"in e&&!e.outSpatialReference&&(e.outSpatialReference=this.spatialReference),r=e.toJSON(),r.cacheHint=!0),null!=t){const e=t.geometries.map(e=>e.toJSON()).reduce((e,t)=>(e.rings=e.rings.concat(t.rings),e));r={...r,cacheHint:!0,sceneFilter:{...t,geometry:e}}}return r}get _dataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const{priority:e,layer:t}=this,r="timeInfo"in t&&t.timeInfo?.toJSON()||null,n=p(t),s=i.toJSON(this._queryGeometryType),a=t.fieldsIndex?.toJSON()||new o([]),u=this.spatialReference.toJSON(),{hasZ:y,hasM:c,featureStore:m,scheduler:g,memoryController:f}=this.context,d=new l(f);return this._dataQueryEngineInstance=new h({hasZ:y,hasM:c,geometryType:s,fieldsIndex:a,timeInfo:r,spatialReference:u,featureIdInfo:n,featureStore:m,scheduler:g,cache:d,priority:e}),this._dataQueryEngineInstance}};e([r({constructOnly:!0})],m.prototype,"context",void 0),e([r({constructOnly:!0})],m.prototype,"priority",void 0),e([r()],m.prototype,"layer",null),e([r()],m.prototype,"spatialReference",null),e([r()],m.prototype,"_queryGeometryType",null),e([r()],m.prototype,"defaultQueryJSON",null),m=e([n("esri.views.3d.layers.graphics.QueryEngine")],m);export{m as QueryEngine};
|