@arcgis/core 5.1.0-next.84 → 5.1.0-next.86
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/assets/components/assets/icon/gpsReceiver16.json +1 -0
- package/assets/components/assets/icon/gpsReceiver24.json +1 -0
- package/assets/components/assets/icon/gpsReceiver32.json +1 -0
- package/assets/components/assets/icon/totalStation16.json +1 -0
- package/assets/components/assets/icon/totalStation24.json +1 -0
- package/assets/components/assets/icon/totalStation32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e89dc473f46a5584d2ef.js → 004af103a94d21cb4889.js} +3 -3
- package/assets/esri/core/workers/chunks/{67abbe81c16de26f61d8.js → 1bad4331a43169f3cc34.js} +1 -1
- package/assets/esri/core/workers/chunks/27f67a3828b78d4c1413.js +1 -0
- package/assets/esri/core/workers/chunks/2c916b93d8a6e6b9c0d7.js +1 -0
- package/assets/esri/core/workers/chunks/{db86a1119e4e58ecfbda.js → 2f8b173d1dac73ba0d9e.js} +1 -1
- package/assets/esri/core/workers/chunks/49e8144effc299dfcd66.js +1 -0
- package/assets/esri/core/workers/chunks/5166f204fd078dced5db.js +1 -0
- package/assets/esri/core/workers/chunks/{45c83eb7c2a06166e3b0.js → 56717ff315c6ec874142.js} +1 -1
- package/assets/esri/core/workers/chunks/577cbc131b21c351fae5.js +2 -0
- package/assets/esri/core/workers/chunks/{72691fe14024e35f85d0.js → 618106f5fbdf88ef2278.js} +1 -1
- package/assets/esri/core/workers/chunks/61fada8942b65fa0b5e1.js +1 -0
- package/assets/esri/core/workers/chunks/{05c5f68e117fc58ae801.js → 701b823763e941b71f4f.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e2c0c6d724f7639d4c1.js → 713ab619060bd5087479.js} +13 -13
- package/assets/esri/core/workers/chunks/{a9b5ce00323cd5574bf7.js → 7160e3e7340beb7fdb42.js} +1 -1
- package/assets/esri/core/workers/chunks/{0219edb509e01270d42d.js → 99c6bd2125f4eb6796fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff713926985a284f5d81.js → a844547bf33a8527ee9f.js} +2 -2
- package/assets/esri/core/workers/chunks/aa6808146c76b2d49b64.js +1 -0
- package/assets/esri/core/workers/chunks/{9cac70164d8528c283af.js → add000f51c778114c028.js} +1 -1
- package/assets/esri/core/workers/chunks/b23e677c33db6f9bac8a.js +1 -0
- package/assets/esri/core/workers/chunks/{dfe1139124fda0d6c059.js → b575292013bceef9b015.js} +1 -1
- package/assets/esri/core/workers/chunks/bae8f2a5dfe0cfbc0688.js +1 -0
- package/assets/esri/core/workers/chunks/bb5f909a2f26fc6a21b0.js +2 -0
- package/assets/esri/core/workers/chunks/{28a45bd26eb5c9b3ec7c.js → ce66c551b7083913eee5.js} +1 -1
- package/assets/esri/core/workers/chunks/{22bdea4ca52970c29504.js → d0aee7c80c5c7e23d216.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4220b6eab0865318033.js → d8de7fe49dba9ed589df.js} +1 -1
- package/assets/esri/core/workers/chunks/ded2f19a1685db2137f4.js +2 -0
- package/assets/esri/core/workers/chunks/{f77d23ee60c876b01e4b.js → e9a42f0262fc44a79d4b.js} +1 -1
- package/assets/esri/core/workers/chunks/edbdee69440dbfc05644.js +1 -0
- package/assets/esri/core/workers/chunks/ee057c85cdf6beb5b012.js +2 -0
- package/assets/esri/core/workers/chunks/f9fe3c9867b0bdb2aec6.js +596 -0
- package/assets/esri/core/workers/chunks/ff57a071156d8a7e47be.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/EdgeShader.glsl.js +13 -9
- package/chunks/Fog.glsl.js +1 -1
- package/chunks/GlowBlur.glsl.js +9 -13
- package/chunks/GlowComposition.glsl.js +10 -10
- package/chunks/ShadowCastVisualize.glsl.js +10 -10
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/screenUtils.js +1 -1
- package/form/types.d.ts +1 -1
- package/geohash/GeohashCell.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/interfaces.d.ts +14 -14
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/ParquetLayer.d.ts +10 -10
- package/layers/ParquetLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/graphics/sources/connections/FabricKustoConnection.js +2 -0
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/graphics/sources/connections/createConnection.js +1 -1
- package/layers/graphics/sources/connections/websocketUils.js +2 -0
- package/layers/scene/ModelFileInfo.js +1 -1
- package/layers/scene/modelQuerySupport.js +1 -1
- package/layers/support/ClientSideConnection.js +1 -1
- package/layers/support/FabricKustoSource.js +2 -0
- package/layers/support/{ParquetGeometryEncodingLocation.d.ts → GeometryEncodingLocation.d.ts} +9 -9
- package/layers/support/{ParquetGeometryEncodingLocation.js → GeometryEncodingLocation.js} +1 -1
- package/layers/support/{ParquetGeometryEncodingWkb.d.ts → GeometryEncodingWkb.d.ts} +8 -9
- package/layers/support/GeometryEncodingWkb.js +2 -0
- package/layers/support/kustoUtils.js +2 -0
- package/layers/support/parquetEncodingUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/types.d.ts +3 -3
- package/package.json +2 -2
- package/popup/Features.d.ts +10 -0
- package/popup/Features.js +1 -1
- package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +4 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/views/2d/FrameTask.js +1 -1
- package/views/2d/LabelManager.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/DisplayObject.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/FlowContainer.js +1 -1
- package/views/2d/engine/flow/FlowView2D.js +1 -1
- package/views/2d/engine/flow/styles/AFlowResources.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Stack.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/FeatureTile.js +1 -1
- package/views/2d/engine/webgl/ResizableUint32Array.js +2 -0
- package/views/2d/engine/webgl/TileCpuState.js +2 -0
- package/views/2d/engine/webgl/TileGpuState.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +2 -0
- package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +2 -0
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.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/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/FeatureTilePresentStrategy.js +2 -0
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/aggregation/AAggregateSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
- package/views/2d/layers/features/aggregation/GridCell.js +1 -1
- package/views/2d/layers/features/aggregation/GridIndexCell.js +2 -0
- package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceMessage.js +1 -1
- package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
- package/views/2d/layers/features/support/Hashed.js +2 -0
- package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
- package/views/2d/tiling/TileCombinedCoverage.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +2 -0
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/environment/CloudyWeather.js +1 -1
- package/views/3d/environment/FoggyWeather.js +1 -1
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SnowyWeather.js +1 -1
- package/views/3d/environment/SunnyWeather.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/StreamController.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl/ManagedColorAttachment.js +1 -1
- package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.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/core/FBOCacheUsage.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +11 -11
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +2 -0
- package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/raymarching/{RayDistanceFalloff.glsl.js → DistanceFalloff.glsl.js} +2 -2
- package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/StencilUtils.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -7
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/support/rasterHitTestUtils.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/views/video/VideoOperationalDataView.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.d.ts +61 -0
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +2 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +9 -4
- package/widgets/BatchAttributeForm/templates/UtilityNetworkAssociationsElementTemplate.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.d.ts +17 -2
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GroupColumn.d.ts +7 -1
- package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +9 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +8 -0
- package/widgets/FeatureTable.js +1 -1
- package/assets/esri/core/workers/chunks/2171aaa147aa4d9fc5b5.js +0 -1
- package/assets/esri/core/workers/chunks/38f1a86b8dd9ee684ee5.js +0 -596
- package/assets/esri/core/workers/chunks/54d07eadf113f0e4e506.js +0 -1
- package/assets/esri/core/workers/chunks/5818f1f526577068d6ca.js +0 -2
- package/assets/esri/core/workers/chunks/5ec66e39e53c11e75179.js +0 -2
- package/assets/esri/core/workers/chunks/5f6fd20a7f4e80eafa25.js +0 -1
- package/assets/esri/core/workers/chunks/6d2abdb48e17b2b56599.js +0 -1
- package/assets/esri/core/workers/chunks/7cdd0492b2191df95102.js +0 -2
- package/assets/esri/core/workers/chunks/7e530e635325dba07864.js +0 -1
- package/assets/esri/core/workers/chunks/8f4cd30ce23e41c1a42c.js +0 -1
- package/assets/esri/core/workers/chunks/936f2b1332ece14d7c28.js +0 -2
- package/assets/esri/core/workers/chunks/983f6c8727fd9484718e.js +0 -1
- package/assets/esri/core/workers/chunks/bd8cb64b6e08839398f3.js +0 -1
- package/assets/esri/core/workers/chunks/cbf1a03f54bd8d2a2b47.js +0 -1
- package/layers/support/ParquetGeometryEncodingWkb.js +0 -2
- package/views/2d/engine/webgl/PooledUint32Array.js +0 -2
- package/views/2d/engine/webgl/cpuMapped/Buffer.js +0 -2
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +0 -2
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +0 -2
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DistanceFalloff.glsl.js +0 -4
- /package/assets/esri/core/workers/chunks/{5ec66e39e53c11e75179.js.LICENSE.txt → 577cbc131b21c351fae5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{ff713926985a284f5d81.js.LICENSE.txt → a844547bf33a8527ee9f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{5818f1f526577068d6ca.js.LICENSE.txt → bb5f909a2f26fc6a21b0.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{7cdd0492b2191df95102.js.LICENSE.txt → ded2f19a1685db2137f4.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{936f2b1332ece14d7c28.js.LICENSE.txt → ee057c85cdf6beb5b012.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{isAbortError as t}from"../../../../core/promiseUtils.js";import{projectBoundingSphere as i}from"../../../../geometry/projection/projectBoundingSphere.js";import{Sphere as s}from"../../../../geometry/support/sphere.js";import{NodeBoundingData as n,Node as o,NodeTraversalState as r}from"./I3SNode.js";import{addWraparound as d}from"./I3SUtil.js";import{ValidatedNode as a}from"./ValidatedNode.js";import{ElevationRange as l}from"../../support/ElevationRange.js";import{Obb as h}from"../../support/orientedBoundingBox.js";class u{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this._boundingData=s,this.node=n,this.parentIndex=-1,this.useAsHole=0,this.filterImpact=2,this.traversalState=null}get nodeBoundingData(){return this._boundingData}destroy(){this._boundingData=null,this.node=null,this.traversalState=null}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR(),this.nodeBoundingData?.invalidateServiceBVsInRenderSR()}}class c{constructor(e=new Array,t=new Array){this._nodeDescriptors=e,this._children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}destroy(){for(const e of this._nodeDescriptors)e.destroy();this._nodeDescriptors.length=0,this._children.length=0}get nodes(){return this._nodeDescriptors}addNode(e){return this._nodeDescriptors.push(e),this._nodeDescriptors.length-1}setNodes(e,t){this._nodeDescriptors=e,this._children=t}get children(){return this._children}}class g{get _useNodePages(){return this._pageSize>0}constructor(t,i,s,o,r,d,a,l,h,u,g,_,m,p,N){if(this.viewingMode=t,this._layer=i,this._requester=o,this._clientNodeLoader=r,this._viewportQueries=d,this._logger=a,this.holeFilling=l,this._isLoaded=h,this._isReloading=u,this._shouldLoadNode=g,this._enable=_,this._needsUpdate=m,this._computeVisibilityObb=p,this._computeNodeFiltering=N,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=0,this._lodConversion=e=>e,this._isEditable=!1,this.urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=v(0),this._visibilityCacheVersion=v(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._progressiveLoadPenaltyWeight=10,this._missingPagesAndNodes=new Set,this._prioritizedMissingNodeAndPageIds=new Array,this._prefetchNodes=new Set,this._prioritizedPrefetchNodes=new Array,this._updates=new f(this._missingPagesAndNodes),this._imModificationUncategorized=new e({deallocator:null}),this.ignoreServiceObb=!1,this._pageQueue=new Array,this._newPages=new Array,this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._traverseDescendantsQueue=[0],this._traverseDescendantsNestingLevel=0,this._isEditable=null!=i.associatedLayer?.infoFor3D,i.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${i.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,"page"===s.type){const e=s.rootPage;switch(this.urlPrefix=s.urlPrefix,this._pageSize=s.pageSize,s.lodMetric){case"maxScreenThreshold":this._lodMetric=1;break;case"maxScreenThresholdSQ":this._lodMetric=1,this._lodConversion=C}if(this._isEditable){this._rootIndex=-1;const t=P(s.rootIndex,s.pageSize),i=e.nodes[t],n={nodes:[{index:this._rootIndex,children:[s.rootIndex],mesh:void 0,obb:i.obb,lodThreshold:i.lodThreshold}]};this._addPage(y(this._rootIndex,this._pageSize),n),this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=s.rootIndex;this._addPage(y(s.rootIndex,this._pageSize),e),this._updateParentsAndLevel()}else if("node"===s.type){this.urlPrefix=s.urlPrefix;const e=new c;if(this._nodePages.set(0,e),this._isEditable){this._clientNodePage=new c;const e={id:"-1",version:null,mbs:s.rootNode.mbs,obb:s.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:s.rootNode.mbs,obb:s.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new n(e.id),-1);const t=this._validateNode(e.id,e);t&&this._addNode(t,this._rootIndex)}else this._rootIndex=this._makeRefNode(new n(s.rootNode.id),-1);const t=this._validateNode(s.rootNode.id,s.rootNode);t&&this._addNode(t,0)}}addClientNodeToIndex(e,t){const i=-1,s=new n(e,t),o=this._makeClientRefNode(s,i);return this._linkChildToParentNode(i,o),this.requestUpdate(),o}removeClientNodeFromIndex(e,t,i){this._destroyClientRefNode(e,t,i),this.requestUpdate()}_canRequest(e){return!this._requester.isFull(e)}_loadPage(e){if(this._nodePages.has(e))return void this._logger.error(`Requested load page [${e}] already loaded`);if(this._loadingPages.has(e))return void this._logger.error(`Requested load page [${e}] already loading`);this._loadingPages.add(e);const i=this.urlPrefix+e;this._requester.request(i,"json").then(t=>{this._nodePages.has(e)?this._logger.error(`Queued page [${e}] already loaded`):this._pageQueue.push({pageIndex:e,page:t})}).catch(i=>{this._loadingPages.delete(e),t(i)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,i))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loadingPages.delete(t),e.madeProgress(),this.needNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this.needNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const e=this._nodePages.get(this._newPages.shift());e?.nodes.forEach(e=>{let t=e.parentIndex;for(;null!=t&&t!==this._rootIndex;){const e=this.getNode(t);e?.elevationRangeValid&&(e.invalidateElevationRange(),this.invalidateBoundingVolumeCache(t)),t=this._getParentIndex(t)}})}}_addPage(e,t){if(this._nodePages.has(e))return void this._logger.error(`Page[${e}] reloaded`);const i=[],n=[],r=t.nodes.map((t,r)=>{const d=i.length,a=t.children?t.children.length:0;n.push(this._rootIndex);for(let e=0;e<a;e++)i.push(t.children[e]);const l=`${t.index}`,c=h.fromJSON(t.obb),g=new s(c.center,c.radius),_=t.mesh?.attribute,f=t.mesh?.geometry,v=t.mesh?.material,p={hasSharedResource:!1,isEmpty:null==f,attributes:null!=_?.resource?`${_.resource}`:void 0,geometry:null!=f?.resource?`${f.resource}`:void 0,texture:null!=v?.resource?`${v.resource}`:void 0,geometryDefinition:f?f.definition:-1,materialDefinition:v?v.definition:-1},N=new o(l,I(r,e,this._pageSize),g,a,0,p,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),f?.featureCount??null);return N.serviceObbInIndexSR=c,N.visibilityObbInRenderSR=this._computeVisibilityObb(N),N.vertexCount=f?f.vertexCount:0,new u(d,a,m(this._visibilityCacheVersion),null,N)}),d=new c(r,i);-1===e?this._clientNodePage=d:this._nodePages.set(e,d)}_updateParentsAndLevel(){const e=new Array,t=(t,i,s)=>{const n=this._getPage(t);if(null!=n){const o=P(t,this._pageSize),r=n.nodes[o];r.parentIndex=null!=i?i:-1;const d=r.node;null!=d&&(d.level=s,e.push(t))}};for(t(this._rootIndex,null,0);e.length;){const i=e.pop(),s=this.getNode(i);if(null!=s)for(let e=0;e<s.childCount;e++){t(this.getChildIndex(s.index,e),i,s.level+1),this._maxLevel=Math.max(this._maxLevel,s.level+1)}}}_getPage(e){const t=y(e,this._pageSize);return this._getPageFromPageIndex(t)}_getPageFromPageIndex(e){return e<0?this._clientNodePage:this._nodePages.get(e)}_getNodeDescriptor(e){const t=this._getPage(e);return null==t?null:(t.lastTraversed=this._frameNumber,t.nodes[P(e,this._pageSize)])}_addNode(e,t){e.children&&this.populateChildren(t,e.children);const i=this.getParent(t),s=null!=i?i.level+1:0;this._maxLevel=Math.max(this._maxLevel,e.children?s+1:s);const{lodMetric:n,maxError:r}=S(e.lodSelection),d=this._getNodeDescriptor(t);if(null!=d.node)return this._logger.error(`Loaded node[${t}] already in descriptor`),d.node;const a=new o(e.id,t,e.mbs,d.childCount,s,e.resources,e.version,n,r,e.numFeatures);d.node=a,e.obb&&(a.serviceObbInIndexSR=h.fromJSON(e.obb)),a.visibilityObbInRenderSR=this._computeVisibilityObb(a);const l=d.nodeBoundingData;return null!=l&&(null==l.serviceMbsInIndexSR&&(l.serviceMbsInIndexSR=e.mbs),a.shareServiceBVsInRenderSRWith(l),l.visibilityObbInRenderSR=a.visibilityObbInRenderSR),a}_makeRefNode(e,t){const i=this._nodePages.get(0);if(t<-1)return this._makeClientRefNode(e,t);if(null==i)return-1;const s=i.nodes.length,n=new u(0,0,m(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_makeClientRefNode(e,t){const i=this._clientNodePage;if(null==i)return-1;if(t>=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const s=-(i.nodes.length+1),n=new u(0,0,m(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_linkChildToParentNode(e,t){const i=this._clientNodePage;if(null==i||e>=0)return;const s=P(e,this._pageSize),n=P(t,this._pageSize),o=i.nodes[s],r=o.childOffset;i.children.splice(o.childOffset+o.childCount,0,t);const d=1;o.childCount+=d,null!=o.node&&(o.node.childCount+=d);for(const a of i.nodes)a.childOffset>r&&(a.childOffset+=d);i.nodes[n].parentIndex=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,i){const s=this._clientNodePage;if(null==s)return;const n=this._getParentIndex(e);if(null==n)return;const o=new Set,r=new Map,d=e=>{const i=P(e,this._pageSize),n=s.nodes[i];if(n.childCount>0)for(let t=n.childOffset;t<n.childOffset+n.childCount;++t)d(s.children[t]);const r=n.node?.id??n.nodeBoundingData?.id;if(null==r)throw new Error("Node has no id");t(r,e),o.add(n)};d(e);const a=s.nodes,l=s.children,h=s.nodes.map(()=>-1),u=[],c=[];for(let g=0;g<a.length;++g){const e=a[g];if(o.has(e))continue;const t=u.length,s=I(g,-1,this._pageSize),n=I(t,-1,this._pageSize);if(e.node&&(e.node.index=n),h[g]=n,u.push(e),s!==n){const t=e.node?.id??e.nodeBoundingData?.id;if(null==t)throw new Error("Node has no id");i(t,s,n),r.set(s,n)}}for(let g=0;g<u.length;++g){const e=I(g,-1,this._pageSize),t=u[g],i=c.length;for(let s=t.childOffset;s<t.childOffset+t.childCount;++s){const t=l[s];if(t>=0)c.push(t);else{const i=P(t,this._pageSize),s=a[i];if(o.has(s))continue;const n=h[i];c.push(n),s.parentIndex=e}}t.childOffset=i,t.childCount=c.length-i,t.node&&(t.node.childCount=t.childCount)}s.setNodes(u,c),this._updateParentBoundingInformation(h[P(n,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let e=null;const n=this._clientNodeLoader.indexSR,o=this._clientNodeLoader.renderSR,r=this._getNodeDescriptor(t);if(null==r)return;for(let s=0;s<r.childCount;s++){const r=this.getChildIndex(t,s),d=this._getNodeDescriptor(r),a=null!=d?d.nodeBoundingData||d.node:null;if(null!=a?.serviceMbsInIndexSR&&a.serviceMbsInIndexSR.radius>0)if(null==e)e=E.copyFrom(a.serviceMbsInIndexSR);else{const t=D;i(a.serviceMbsInIndexSR,n,t,o);const s=M;i(e,n,s,o),i(t.union(s),o,e,n)}}const d=t=>{null!=t&&(t.serviceObbInIndexSR=null,null!=e?(t.serviceMbsInIndexSR??=new s,t.serviceMbsInIndexSR.copyFrom(e)):t.serviceMbsInIndexSR?.invalidate(),t.invalidateServiceBVsInRenderSR(),t.geometryObbInRenderSR=null)};d(r.nodeBoundingData),d(r.node),this.invalidateNodeVisibilityCacheInternal(r),t=this._getParentIndex(t)}while(null!=t)}populateChildren(e,t){const i=this._getNodeDescriptor(e),s=this._getPage(e);i.childOffset=s.children.length,i.childCount=t.length;for(let n=0;n<t.length;n++){const i=this._makeRefNode(t[n],e);s.children.push(i)}}getNode(e){const t=this._getNodeDescriptor(e);return null!=t?t.node:null}getIndexById(e){let t;return this._forAllNodes((i,s)=>{(null!=i.node&&i.node.id===e||null!=i.nodeBoundingData&&i.nodeBoundingData.id===e)&&(t=s)}),t}getNodeById(e){const t=this.getIndexById(e);return null!=t&&t>=0?this.getNode(t):null}getChildIndex(e,t){const i=this._getPage(e);if(null==i)return-1;const s=i.nodes[P(e,this._pageSize)];return i.children[s.childOffset+t]}_getParentIndex(e){const t=this._getPage(e);return null!=t&&e!==this._rootIndex?t.nodes[P(e,this._pageSize)]?.parentIndex:null}getParent(e){const t=this._getParentIndex(e);return null!=t?this.getNode(t):null}isLeaf(e){const t=this._getNodeDescriptor(e);return null!=t&&0===t.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{null!=e.node&&(e.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=v(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeDescriptor(e);null!=t&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=m(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeDescriptor(e);null!=t&&(t?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeDescriptor(e);if(null==t)return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const i=null!=t.node?t.node:t.nodeBoundingData;null!=i&&i.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeDescriptor(e),i=t?.node;i&&(i.geometryObbInRenderSR=null,i.invalidateServiceBVsInRenderSR())}invalidateVisibilityObbs(){null!=this.rootNode&&this.traverse(this.rootNode,e=>(e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.geometryObbInRenderSR=null,!0))}_isElevationRangeUpToDate(e){if(!this.needNodeElevationRange)return!0;const t=e?.node??e?.nodeBoundingData;return!t||t.elevationRangeValid}_updateElevationRange(e,t){const i=this._getNodeDescriptor(e);if(!i)return!1;const s=i?.node??i?.nodeBoundingData;if(!s)return!1;if(s.elevationRangeValid)return t?.expandElevationRange(s),!0;const n=new l;let o=!1;for(let a=0;a<i.childCount;a++){const t=this.getChildIndex(e,a),i=this._updateElevationRange(t,n);o=o||!i}if(0===i.childCount||o){const e=!i.node?.resources.isEmpty;this._viewportQueries.expandElevationRange(s,e,n)}n.minElevation!==1/0&&n.maxElevation!==-1/0||n.expandElevationRangeValues(0,0);const{minElevation:r,maxElevation:d}=s;return r===n.minElevation&&d===n.maxElevation?(t?.expandElevationRange(s),!0):(i.node?.setElevationRange(n),i.nodeBoundingData?.setElevationRange(n),this.invalidateBoundingVolumeCache(e),t?.expandElevationRange(s),!0)}isNodeVisible(e){const t=this._getNodeDescriptor(e);if(null==t)return!0;const i=t.nodeBoundingData;if(null!=i&&!i.serviceMbsInIndexSR)return!0;if(this._isElevationRangeUpToDate(t)&&N(t.visibilityCache,this._visibilityCacheVersion))return b(t.visibilityCache);const s=t.node,n=this._viewportQueries;if(s){const e=n.ensureElevationAgnosticBoundingVolume(s),i=n.isElevationAgnosticBoundingVolumeVisible(e);let o=i;if(this.needNodeElevationRange&&i){const t=n.getNodeObbInRenderSRIndependentOfElevationOffset(s);null!=t&&(o=n.isObbVisibleIndependentOfElevation(e,t))}if(!o)return t.visibilityCache=p(!1,this._visibilityCacheVersion),!1}if(this._layerHasFilter&&this._computeNodeFiltering&&(null!=s||null!=i)&&2===t.filterImpact){const e=null!=s?s.serviceMbsInIndexSR:null!=i?i.serviceMbsInIndexSR:null;t.filterImpact=null!=e?this._computeNodeFiltering(e):0}const o=null!=s&&1===t.filterImpact;let r=!(null!=s&&2===s.imModificationImpact)&&!o;if(r){const t=!s||i&&!s.visibilityObbInRenderSR?i??null:s;if(null!=t){this.needNodeElevationRange&&this._updateElevationRange(e);r=n.isNodeVisible(t)}}return t.visibilityCache=p(r,this._visibilityCacheVersion),r}isGeometryVisible(e){if(!this.isNodeVisible(e))return!1;const t=this._getNodeDescriptor(e);return!!(null==t?.node?.geometryObbInRenderSR||this.layerHasModifications&&4===t.node.imModificationImpact)||this._viewportQueries.isGeometryVisible(t.node)}_traverseCoverage(e,t,i,s,n){const o=this._getPage(e);if(null==o||0===t.childCount)return;const r=t.childOffset+t.childCount,d=new Array;for(let a=t.childOffset;a<r;++a){const e=o.children[a],t=this._getNodeDescriptor(e);null!=t?.node&&this.isGeometryVisible(e)&&d.push(t)}s/=d.length;for(const a of d){const e=a.node.index;this._isLoaded(e)||this._isReloading(e)?(n.delta=Math.max(n.delta,i),n.coverage+=s):this._traverseCoverage(e,a,i+1,s,n)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const t=this._getNodeDescriptor(e);if(null==t)return!1;if("always"===this.holeFilling)return!0;if(N(t.useAsHole,this._version))return b(t.useAsHole);const i={delta:0,coverage:0};this._traverseCoverage(e,t,0,1,i);const s=i.delta*i.coverage<=.5;return t.useAsHole=p(s,this._version),s}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.destroy(),this._nodePages.clear(),this._clientNodePage=null,this._layer=null,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._imModificationUncategorized.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=v(this._version)}imModificationsChanged(e){this.layerHasModifications=e,this._forAllNodes(({node:e})=>{null!=e&&(e.imModificationImpact=4,e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.hasModifications&&this.invalidateGeometryVisibility(e.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(e=>{if(null!=e){e.filterImpact=2;const t=e.node;null!=t&&this.invalidateNodeVisibilityCache(t.index)}}),this.invalidateVisibilityCache()}update(e,t,i){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this.resetUpdateState(e);let s=!0;const n=new R,o=new w,r=this._imModificationUncategorized;r.clear();const d=new Set;let a=0;const l=(d,l,h)=>{const u=e=>{this._shouldLoadNode(e)&&e.childCount&&(s=!1)};if(!l){const e=y(d,this._pageSize);let t=this._getNodeLoadPriority(d);return t===1/0&&(t=this._getNodeLoadPriority(h)),_.set(e,Math.max(t,_.get(e)||0)),this._loadingPages.has(e)||this._failedPages.has(e)||(this._missingPagesAndNodes.add(e),++a),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,t))}const{node:c,childCount:g}=l;if(this._updateNodeFeatureEstimate(c,o),!c){const e=this._getNodeLoadPriority(d);return this._loadingNodes.has(d)||this._failedNodes.has(d)||(this._missingPagesAndNodes.add(d),_.set(d,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const f=this._getPage(d);if(!this._useNodePages&&0===this._missingPagesAndNodes.size)for(let e=0;e<g;e++){const t=f.children[l.childOffset+e],i=this._getNodeDescriptor(t);null!=i&&!i.node&&!this._loadingNodes.has(t)&&!this._failedNodes.has(t)&&t>=0&&(_.set(t,this._getNodeLoadPriority(t)),this._prefetchNodes.add(t))}if(c.failed||c.resources.isEmpty)return void u(c);if(this._isLoaded(d)){if(n.known+=c.memory,++n.knownNodes,u(c),this._shouldLoadNode(c)||(n.unremoved+=c.memory),this._needsUpdate(c)){const e=this._getNodeLoadPriority(d);_.set(d,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(d)}return}if(c.memory&&(n.known+=c.memory,++n.knownNodes),!this._shouldLoadNode(c))return void(this._isReloading(d)&&this._updates.remove.push(d));if(u(c),c.memory?(n.missing+=c.memory,n.known+=c.memory,++n.knownNodes):++n.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._getNodeLoadPriority(d)),void(this._updates.cancel=this._updates.cancel.filter(e=>e!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const m=this._getNodeLoadPriority(d);_.set(d,m),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,m),this._updates.add.push(d),this.layerHasModifications&&i&&null!=c&&4===c.imModificationImpact&&r.push(d)};this.traverseVisible(l,d),this._frameNumber++,this._prioritizeMissingNodesAndPages(),this._removeUnusedNodePages(d,a),this._handleModifications(i,r),this._updateUnloadedMemoryEstimate(n),this._featureEstimate.estimate=this._computeFeatureEstimate(o),this._featureEstimate.leavesReached=s,this._updates.add.filterInPlace(e=>_.get(e)>=this._maxUnloadedPrio).sort((e,t)=>_.get(e)-_.get(t)),this._updates.update.sort((e,t)=>_.get(e)-_.get(t)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.size,this._dirty=this._indexMissing>0,_.clear()}_updateUnloadedMemoryEstimate(e){this._unloadedMemoryEstimate=e.missing-e.unremoved,e.knownNodes>3&&e.missingNodes>0&&(this._unloadedMemoryEstimate+=e.known/e.knownNodes*e.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate)}resetUpdateState(e){this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),_.clear()}_prioritizeMissingNodesAndPages(){const e=this._prioritizedMissingNodeAndPageIds;e.length=0,this._missingPagesAndNodes.forEach(t=>e.push(t)),e.sort((e,t)=>_.get(e)-_.get(t)),e.length>0&&(this._maxUnloadedPrio=_.get(e[e.length-1]),this._prefetchNodes.clear())}_handleModifications(e,t){this.layerHasModifications&&0!==this._updates.add.length&&(t.length>0&&e?.(t),this._updates.add.filterInPlace(e=>{const t=this._getNodeDescriptor(e),i=null==t?.node||2!==t.node.imModificationImpact;return i||this.invalidateNodeVisibilityCache(e),i}))}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,o=i,r=10;for(;r--;){const i=new w;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===r)break;o=s,s=.5*(s+n)}else n=s,s=.5*(s+o)}return this._version=v(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_removeUnusedNodePages(e,t){if(!this._useNodePages)return;const i=e.size,s=this._nodePages,n=s.size+this._loadingPages.size+t;if(n>V&&n>i){const t=new Array;for(const[i,n]of s)0!==n.numNodesWithLoadedChildren||e.has(i)||t.push([n.lastTraversed,i]);t.sort((e,t)=>e[0]-t[0]).some(e=>{const t=e[1];return this._deleteNodePage(t),s.size<=V})}}_updateFeatureEstimate(e,t){this._version=v(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((e,i)=>this._updateNodeFeatureEstimate(i?.node,t))}_updateNodeFeatureEstimate(e,t){null!=e&&!e.failed&&this._shouldLoadNode(e)&&(null!=e.numFeatures?(t.numFeatures+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.numFeatures;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.numFeatures/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._prioritizedMissingNodeAndPageIds,this._missingPagesAndNodes)}prefetch(){const e=this._prioritizedPrefetchNodes;return this._prefetchNodes.forEach(t=>e.push(t)),e.sort((e,t)=>_.get(e)-_.get(t)),this._load(e,this._prefetchNodes)}_load(e,t){if(0===e.length||!this._canRequest(this.urlPrefix))return!1;for(;e.length>0&&this._canRequest(this.urlPrefix);){const i=e[e.length-1];e.length--,t.delete(i),this._useNodePages&&i>=0?this._loadPage(i):this._loadNode(i)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.size>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(null==e)return null;const t=e.index,i=this._getNodeDescriptor(t);if(!i)return null;let s=i?.traversalState;if(s&&N(s.version,this._version))return s;const n=this._viewportQueries.getLodLevel(e),o=this._viewportQueries.hasLOD(e);let d=!0;if(o){const e=this._getParentIndex(t);if(null!=e){const t=this._getNodeDescriptor(e),i=t?.traversalState;d=!!i&&n>i.lodLevel}else d=n>0}else d=0===e.childCount;return s?(s.lodLevel=n,s.isChosen=d,s.version=p(!0,this._version),s):(s=new r(o,d,n,p(!0,this._version)),i.traversalState=s,s)}_loadNode(e){if(this._loadingNodes.has(e))return void this._logger.error(`Node[${e}] already loading`);this._loadingNodes.add(e);const i=this._getNodeDescriptor(e);if(i.node)return void this._logger.error(`Node[${e}] already in descriptor`);const s=i.nodeBoundingData;if(null==s)return void this._failedNodes.add(e);const n=s.id,o=this.urlPrefix+n,r=()=>{this._loadingNodes.delete(e),0===this._missingPagesAndNodes.size&&0===this._loadingNodes.size&&this.requestUpdate()};(e>=0?this._requester.request(o,"json"):this._clientNodeLoader.loadNodeJSON(n)).then(t=>{r();const i=this._validateNode(n,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const s=this._addNode(i,e);this.nodeTraversalState(s)}).catch(i=>{r(),t(i)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+o),this._failedNodes.add(e))})}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const i=t.geometryData;null==i||Array.isArray(i)&&0===i.length||Array.isArray(i)&&1===i.length&&"./geometries/0"===i[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const o=t.attributeData,r=this._layer.attributeStorageInfo;null==o||Array.isArray(o)&&!o.some((e,t)=>e.href!==`./attributes/${r?.[t]?.key??`f_${t}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const d=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:void 0,l=1===t.featureData?.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,u=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;const o=new n(`${t.id}`,new s(t.mbs));return o.serviceObbInIndexSR=!this.ignoreServiceObb&&t.hasOwnProperty("obb")&&t.obb?h.fromJSON(t.obb):null,o.visibilityObbInRenderSR=this._computeVisibilityObb(o),o},c=Array.isArray(t.children)?t.children.map(u).filter(e=>null!=e):null,g=t.featureData?.length??!1,_=!0===t.isEmpty;return new a(e,new s(t.mbs),d,"string"==typeof t.version?t.version:null,{isEmpty:!g&&_,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:null!=t.geometryData?e:void 0},c,Array.isArray(t.lodSelection)?t.lodSelection:null,l)}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{null!=e.node&&(e.node.failed=!1)})}_getNodeLoadPriority(e){const t=this._getNodeDescriptor(e),i=this._getParentIndex(e);if(null==t||null==i&&null==t.node)return null==i?1/0:this._getNodeLoadPriority(i);let s=0;if(t.node&&null!=i){const e=this._getNodeDescriptor(i);s=e.traversalState?.lodLevel??0}const n=this._getHoleBonus(e);return-(this._viewportQueries.distToCameraPOIRay(t.nodeBoundingData??t.node)*(1+s)+s*this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI())+n}_getHoleBonus(e){return this._hasLoadedAncestor(e)?0:this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI()}_hasLoadedAncestor(e){let t=this._getParentIndex(e);for(;null!=t;){if(this._isLoaded(t))return!0;t=this._getParentIndex(t)}return!1}traverseVisible(e,t){const i=this._getNodeDescriptor(this._rootIndex);null!=i?this._traverseVisible(this._rootIndex,null,i,e,t):e(this._rootIndex,null,null)}_traverseVisible(e,t,i,s,n){const o=y(e,this._pageSize);if(n&&n.add(o),i.node&&0===i.childCount)return void(this.isGeometryVisible(e)&&s(e,i,t));if(!this.isNodeVisible(e))return;if(s(e,i,t),null==i.node)return;const r=this.nodeTraversalState(i.node);if(r?.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const d=this._getPageFromPageIndex(o);for(let a=0;a<i.childCount;a++){const t=d.children[i.childOffset+a],o=this._getNodeDescriptor(t);if(o)this._traverseVisible(t,e,o,s,n);else{if(n){const e=y(t,this._pageSize);n.add(e)}s(t,null,e)}}}traverse(e,t){t(e)&&this.traverseDescendants(e,t)}traverseDescendants(e,t){++this._traverseDescendantsNestingLevel;const i=e.index,s=this._pageSize,n=y(i,s),o=this._getPageFromPageIndex(n);if(null==o)return;const r=this._frameNumber,d=this._nodePages,a=P(i,s),l=o.nodes[a],h=l.childCount;if(o.lastTraversed=r,0===h)return;const u=new Array,c=1===this._traverseDescendantsNestingLevel?this._traverseDescendantsQueue:[0];let g=0;{const{childOffset:e,childCount:t}=l,{children:i}=o;c.length=2**Math.ceil(Math.log2(g+t));for(let s=e;s<e+t;++s){const e=i[s];e>=0?(c[g]=e,++g):u.push(e)}}if(u.length>0){const e=this._clientNodePage;if(e){const i=e.children;let s=0;for(;s<u.length;){const n=u[s];++s;const o=-n-1,r=e.nodes[o],d=r.node;if(!d||!t(d))continue;const{childCount:a}=r;if(0===a)continue;const{childOffset:l}=r,h=l+a;for(let e=l;e<h;++e)u.push(i[e])}}}if(g>0){let e=0;if(s>0){let i=n*s,a=o,l=a.nodes;for(;e<g;){const n=c[e];let o;if(++e,i<=n&&n<i+s)o=a;else{const e=n/s|0,t=d.get(e);if(void 0===t)continue;o=t,o.lastTraversed=r,a=o,l=a.nodes,i=s*e}const h=l[n-i],u=h.node;if(null==u||!1===t(u))continue;const{childCount:_}=h;if(0===_)continue;const f=g+_;for(c.length<f&&(c.length=2**Math.ceil(Math.log2(g+_)));c.length<g+_;)c.length+=c.length;const m=o.children,{childOffset:v}=h,p=v+_;for(let e=v;e<p;++e)c[g]=m[e],++g}}else{const i=d.get(0);if(i)for(;e<g;){const s=c[e++],n=i.nodes[s],o=n.node;if(!o||!t(o))continue;const{childCount:r}=n;if(0===r)continue;c.length=Math.max(c.length,2**Math.ceil(Math.log2(g+r)));const d=i.children,{childOffset:a}=n,l=a+r;for(let e=a;e<l;++e)c[g]=d[e],++g}}}--this._traverseDescendantsNestingLevel}updateChildrenLoaded(e,t){let i=this.getNode(e);for(;null!=i;){const e=i.childrenLoaded,s=e+t;i.childrenLoaded=s;const n=0===e?1:0===s?-1:0,o=i.index;if(0!==n){this._getPage(o).numNodesWithLoadedChildren+=n}i=this.getParent(o)}}checkChildrenLoadedInvariant(){return!0}updateElevationInfo(e,t){this.needNodeElevationRange=t&&!!e&&("relative-to-ground"===e.mode||"relative-to-scene"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{e?.invalidateBounds(),e.node?.invalidateElevationRange(),e.nodeBoundingData?.invalidateElevationRange()})}_forAllNodes(e){if(null!=this._clientNodePage){const t=this._clientNodePage;for(let i=0;i<t.nodes.length;i++)e(t.nodes[i],-(i+1))}for(const[t,i]of this._nodePages){const s=t*this._pageSize;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}clearCaches(){if(this._useNodePages){const e=this._nodePages,t=new Set;this.traverseVisible(e=>t.add(y(e,this._pageSize)));for(const[i,s]of e)if(0!==s.numNodesWithLoadedChildren||t.has(i))for(const e of s.nodes)e.traversalState=null;else this._deleteNodePage(i)}}_deleteNodePage(e){if(!this._nodePages.has(e))return void this._logger.error(`Destroying non-existent page ${e}`);const t=this._nodePages.get(e);this._nodePages.delete(e),t?.destroy()}get test(){}}const _=new Map;class f{constructor(t){this.missing=t,this.update=new e({deallocator:null}),this.add=new e({deallocator:null}),this.remove=new e({deallocator:null}),this.cancel=[]}destroy(){this.update.prune(),this.add.prune(),this.remove.prune(),this.cancel.length=0}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function m(e){return d(e,-2)}function v(e){return d(e,2)}function p(e,t){return t+(e?1:0)}function N(e,t){return(-2&e)===t}function b(e){return!(1&~e)}function y(e,t){return e<0?-1:t>0?e/t|0:0}function P(e,t){return e<0?-e-1:0===t?e:e%t}function I(e,t,i){return-1===t?-(e+1):0===i?e:t*i+e}const x=[["maxScreenThreshold",1],["screenSpaceRelative",2],["removedFeatureDiameter",3],["distanceRangeFromDefaultCamera",4]];function S(e){if(e)for(let t=0;t<e.length;t++)for(const i of x)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:0,maxError:0}}class R{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}class w{constructor(){this.numFeatures=0,this.knownNodes=0,this.missingNodes=0}}function C(e){return Math.sqrt(e*(4/Math.PI))}const E=new s,D=new s,M=new s,V=has("esri-mobile")?100:300;export{g as I3SIndex,S as selectErrorMetric};
|
|
2
|
+
import has from"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{isAbortError as t}from"../../../../core/promiseUtils.js";import{projectBoundingSphere as i}from"../../../../geometry/projection/projectBoundingSphere.js";import{Sphere as s}from"../../../../geometry/support/sphere.js";import{NodeBoundingData as n,Node as o,NodeTraversalState as r}from"./I3SNode.js";import{addWraparound as d}from"./I3SUtil.js";import{ValidatedNode as a}from"./ValidatedNode.js";import{ElevationRange as l}from"../../support/ElevationRange.js";import{Obb as h}from"../../support/orientedBoundingBox.js";class u{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this._boundingData=s,this.node=n,this.parentIndex=-1,this.useAsHole=0,this.filterImpact=2,this.traversalState=null}get nodeBoundingData(){return this._boundingData}destroy(){this._boundingData=null,this.node=null,this.traversalState=null}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR(),this.nodeBoundingData?.invalidateServiceBVsInRenderSR()}}class c{constructor(e=new Array,t=new Array){this._nodeDescriptors=e,this._children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}destroy(){for(const e of this._nodeDescriptors)e.destroy();this._nodeDescriptors.length=0,this._children.length=0}get nodes(){return this._nodeDescriptors}addNode(e){return this._nodeDescriptors.push(e),this._nodeDescriptors.length-1}setNodes(e,t){this._nodeDescriptors=e,this._children=t}get children(){return this._children}}class g{get _useNodePages(){return this._pageSize>0}constructor(t,i,s,o,r,d,a,l,h,u,g,_,m,p,N){if(this.viewingMode=t,this._layer=i,this._requester=o,this._clientNodeLoader=r,this._viewportQueries=d,this._logger=a,this.holeFilling=l,this._isLoaded=h,this._isReloading=u,this._shouldLoadNode=g,this._enable=_,this._needsUpdate=m,this._computeVisibilityObb=p,this._computeNodeFiltering=N,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=0,this._lodConversion=e=>e,this._isEditable=!1,this.urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=v(0),this._visibilityCacheVersion=v(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._progressiveLoadPenaltyWeight=10,this._missingPagesAndNodes=new Set,this._prioritizedMissingNodeAndPageIds=new Array,this._prefetchNodes=new Set,this._prioritizedPrefetchNodes=new Array,this._updates=new f(this._missingPagesAndNodes),this._imModificationUncategorized=new e({deallocator:null}),this.ignoreServiceObb=!1,this._pageQueue=new Array,this._newPages=new Array,this._needsNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._traverseDescendantsQueue=[0],this._traverseDescendantsNestingLevel=0,this._isEditable=null!=i.associatedLayer?.infoFor3D,i.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${i.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,"page"===s.type){const e=s.rootPage;switch(this.urlPrefix=s.urlPrefix,this._pageSize=s.pageSize,s.lodMetric){case"maxScreenThreshold":this._lodMetric=1;break;case"maxScreenThresholdSQ":this._lodMetric=1,this._lodConversion=C}if(this._isEditable){this._rootIndex=-1;const t=P(s.rootIndex,s.pageSize),i=e.nodes[t],n={nodes:[{index:this._rootIndex,children:[s.rootIndex],mesh:void 0,obb:i.obb,lodThreshold:i.lodThreshold}]};this._addPage(y(this._rootIndex,this._pageSize),n),this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=s.rootIndex;this._addPage(y(s.rootIndex,this._pageSize),e),this._updateParentsAndLevel()}else if("node"===s.type){this.urlPrefix=s.urlPrefix;const e=new c;if(this._nodePages.set(0,e),this._isEditable){this._clientNodePage=new c;const e={id:"-1",version:null,mbs:s.rootNode.mbs,obb:s.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:s.rootNode.mbs,obb:s.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new n(e.id),-1);const t=this._validateNode(e.id,e);t&&this._addNode(t,this._rootIndex)}else this._rootIndex=this._makeRefNode(new n(s.rootNode.id),-1);const t=this._validateNode(s.rootNode.id,s.rootNode);t&&this._addNode(t,0)}}addClientNodeToIndex(e,t){const i=-1,s=new n(e,t),o=this._makeClientRefNode(s,i);return this._linkChildToParentNode(i,o),this.requestUpdate(),o}removeClientNodeFromIndex(e,t,i){this._destroyClientRefNode(e,t,i),this.requestUpdate()}_canRequest(e){return!this._requester.isFull(e)}_loadPage(e){if(this._nodePages.has(e))return void this._logger.error(`Requested load page [${e}] already loaded`);if(this._loadingPages.has(e))return void this._logger.error(`Requested load page [${e}] already loading`);this._loadingPages.add(e);const i=this.urlPrefix+e;this._requester.request(i,"json").then(t=>{this._nodePages.has(e)?this._logger.error(`Queued page [${e}] already loaded`):this._pageQueue.push({pageIndex:e,page:t})}).catch(i=>{this._loadingPages.delete(e),t(i)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,i))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loadingPages.delete(t),e.madeProgress(),this._needsNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this._needsNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const e=this._nodePages.get(this._newPages.shift());e?.nodes.forEach(e=>{let t=e.parentIndex;for(;null!=t&&t!==this._rootIndex;){const e=this.getNode(t);e?.elevationRangeValid&&(e.invalidateElevationRange(),this.invalidateBoundingVolumeCache(t)),t=this._getParentIndex(t)}})}}_addPage(e,t){if(this._nodePages.has(e))return void this._logger.error(`Page[${e}] reloaded`);const i=[],n=[],r=t.nodes.map((t,r)=>{const d=i.length,a=t.children?t.children.length:0;n.push(this._rootIndex);for(let e=0;e<a;e++)i.push(t.children[e]);const l=`${t.index}`,c=h.fromJSON(t.obb),g=new s(c.center,c.radius),_=t.mesh?.attribute,f=t.mesh?.geometry,v=t.mesh?.material,p={hasSharedResource:!1,isEmpty:null==f,attributes:null!=_?.resource?`${_.resource}`:void 0,geometry:null!=f?.resource?`${f.resource}`:void 0,texture:null!=v?.resource?`${v.resource}`:void 0,geometryDefinition:f?f.definition:-1,materialDefinition:v?v.definition:-1},N=new o(l,I(r,e,this._pageSize),g,a,0,p,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),f?.featureCount??null);return N.serviceObbInIndexSR=c,N.visibilityObbInRenderSR=this._computeVisibilityObb(N),N.vertexCount=f?f.vertexCount:0,new u(d,a,m(this._visibilityCacheVersion),null,N)}),d=new c(r,i);-1===e?this._clientNodePage=d:this._nodePages.set(e,d)}_updateParentsAndLevel(){const e=new Array,t=(t,i,s)=>{const n=this._getPage(t);if(null!=n){const o=P(t,this._pageSize),r=n.nodes[o];r.parentIndex=null!=i?i:-1;const d=r.node;null!=d&&(d.level=s,e.push(t))}};for(t(this._rootIndex,null,0);e.length;){const i=e.pop(),s=this.getNode(i);if(null!=s)for(let e=0;e<s.childCount;e++){t(this.getChildIndex(s.index,e),i,s.level+1),this._maxLevel=Math.max(this._maxLevel,s.level+1)}}}_getPage(e){const t=y(e,this._pageSize);return this._getPageFromPageIndex(t)}_getPageFromPageIndex(e){return e<0?this._clientNodePage:this._nodePages.get(e)}_getNodeDescriptor(e){const t=this._getPage(e);return null==t?null:(t.lastTraversed=this._frameNumber,t.nodes[P(e,this._pageSize)])}_addNode(e,t){e.children&&this.populateChildren(t,e.children);const i=this.getParent(t),s=null!=i?i.level+1:0;this._maxLevel=Math.max(this._maxLevel,e.children?s+1:s);const{lodMetric:n,maxError:r}=S(e.lodSelection),d=this._getNodeDescriptor(t);if(null!=d.node)return this._logger.error(`Loaded node[${t}] already in descriptor`),d.node;const a=new o(e.id,t,e.mbs,d.childCount,s,e.resources,e.version,n,r,e.numFeatures);d.node=a,e.obb&&(a.serviceObbInIndexSR=h.fromJSON(e.obb)),a.visibilityObbInRenderSR=this._computeVisibilityObb(a);const l=d.nodeBoundingData;return null!=l&&(null==l.serviceMbsInIndexSR&&(l.serviceMbsInIndexSR=e.mbs),a.shareServiceBVsInRenderSRWith(l),l.visibilityObbInRenderSR=a.visibilityObbInRenderSR),a}_makeRefNode(e,t){const i=this._nodePages.get(0);if(t<-1)return this._makeClientRefNode(e,t);if(null==i)return-1;const s=i.nodes.length,n=new u(0,0,m(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_makeClientRefNode(e,t){const i=this._clientNodePage;if(null==i)return-1;if(t>=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const s=-(i.nodes.length+1),n=new u(0,0,m(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_linkChildToParentNode(e,t){const i=this._clientNodePage;if(null==i||e>=0)return;const s=P(e,this._pageSize),n=P(t,this._pageSize),o=i.nodes[s],r=o.childOffset;i.children.splice(o.childOffset+o.childCount,0,t);const d=1;o.childCount+=d,null!=o.node&&(o.node.childCount+=d);for(const a of i.nodes)a.childOffset>r&&(a.childOffset+=d);i.nodes[n].parentIndex=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,i){const s=this._clientNodePage;if(null==s)return;const n=this._getParentIndex(e);if(null==n)return;const o=new Set,r=new Map,d=e=>{const i=P(e,this._pageSize),n=s.nodes[i];if(n.childCount>0)for(let t=n.childOffset;t<n.childOffset+n.childCount;++t)d(s.children[t]);const r=n.node?.id??n.nodeBoundingData?.id;if(null==r)throw new Error("Node has no id");t(r,e),o.add(n)};d(e);const a=s.nodes,l=s.children,h=s.nodes.map(()=>-1),u=[],c=[];for(let g=0;g<a.length;++g){const e=a[g];if(o.has(e))continue;const t=u.length,s=I(g,-1,this._pageSize),n=I(t,-1,this._pageSize);if(e.node&&(e.node.index=n),h[g]=n,u.push(e),s!==n){const t=e.node?.id??e.nodeBoundingData?.id;if(null==t)throw new Error("Node has no id");i(t,s,n),r.set(s,n)}}for(let g=0;g<u.length;++g){const e=I(g,-1,this._pageSize),t=u[g],i=c.length;for(let s=t.childOffset;s<t.childOffset+t.childCount;++s){const t=l[s];if(t>=0)c.push(t);else{const i=P(t,this._pageSize),s=a[i];if(o.has(s))continue;const n=h[i];c.push(n),s.parentIndex=e}}t.childOffset=i,t.childCount=c.length-i,t.node&&(t.node.childCount=t.childCount)}s.setNodes(u,c),this._updateParentBoundingInformation(h[P(n,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let e=null;const n=this._clientNodeLoader.indexSR,o=this._clientNodeLoader.renderSR,r=this._getNodeDescriptor(t);if(null==r)return;for(let s=0;s<r.childCount;s++){const r=this.getChildIndex(t,s),d=this._getNodeDescriptor(r),a=null!=d?d.nodeBoundingData||d.node:null;if(null!=a?.serviceMbsInIndexSR&&a.serviceMbsInIndexSR.radius>0)if(null==e)e=E.copyFrom(a.serviceMbsInIndexSR);else{const t=D;i(a.serviceMbsInIndexSR,n,t,o);const s=M;i(e,n,s,o),i(t.union(s),o,e,n)}}const d=t=>{null!=t&&(t.serviceObbInIndexSR=null,null!=e?(t.serviceMbsInIndexSR??=new s,t.serviceMbsInIndexSR.copyFrom(e)):t.serviceMbsInIndexSR?.invalidate(),t.invalidateServiceBVsInRenderSR(),t.geometryObbInRenderSR=null)};d(r.nodeBoundingData),d(r.node),this.invalidateNodeVisibilityCacheInternal(r),t=this._getParentIndex(t)}while(null!=t)}populateChildren(e,t){const i=this._getNodeDescriptor(e),s=this._getPage(e);i.childOffset=s.children.length,i.childCount=t.length;for(let n=0;n<t.length;n++){const i=this._makeRefNode(t[n],e);s.children.push(i)}}getNode(e){const t=this._getNodeDescriptor(e);return null!=t?t.node:null}getIndexById(e){let t;return this._forAllNodes((i,s)=>{(null!=i.node&&i.node.id===e||null!=i.nodeBoundingData&&i.nodeBoundingData.id===e)&&(t=s)}),t}getNodeById(e){const t=this.getIndexById(e);return null!=t&&t>=0?this.getNode(t):null}getChildIndex(e,t){const i=this._getPage(e);if(null==i)return-1;const s=i.nodes[P(e,this._pageSize)];return i.children[s.childOffset+t]}_getParentIndex(e){const t=this._getPage(e);return null!=t&&e!==this._rootIndex?t.nodes[P(e,this._pageSize)]?.parentIndex:null}getParent(e){const t=this._getParentIndex(e);return null!=t?this.getNode(t):null}isLeaf(e){const t=this._getNodeDescriptor(e);return null!=t&&0===t.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{null!=e.node&&(e.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=v(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeDescriptor(e);null!=t&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=m(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeDescriptor(e);null!=t&&(t?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeDescriptor(e);if(null==t)return;if(!this._needsNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const i=null!=t.node?t.node:t.nodeBoundingData;null!=i&&i.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeDescriptor(e),i=t?.node;i&&(i.geometryObbInRenderSR=null,i.invalidateServiceBVsInRenderSR())}invalidateVisibilityObbs(){null!=this.rootNode&&this.traverse(this.rootNode,e=>(e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.geometryObbInRenderSR=null,!0))}_isElevationRangeValid(e){if(!this._needsNodeElevationRange)return!0;const t=e?.node??e?.nodeBoundingData;return!t||t.elevationRangeValid}_updateElevationRange(e,t){const i=this._getNodeDescriptor(e);if(!i)return!1;const s=i?.node??i?.nodeBoundingData;if(!s)return!1;if(s.elevationRangeValid)return t?.expandElevationRange(s),!0;const n=new l;let o=!1;for(let a=0;a<i.childCount;a++){const t=this.getChildIndex(e,a),i=this._updateElevationRange(t,n);o=o||!i}if(0===i.childCount||o){const e=!i.node?.resources.isEmpty;this._viewportQueries.expandElevationRange(s,e,n)}n.minElevation!==1/0&&n.maxElevation!==-1/0||n.expandElevationRangeValues(0,0);const{minElevation:r,maxElevation:d}=s;return r===n.minElevation&&d===n.maxElevation?(t?.expandElevationRange(s),!0):(i.node?.setElevationRange(n),i.nodeBoundingData?.setElevationRange(n),this.invalidateBoundingVolumeCache(e),t?.expandElevationRange(s),!0)}isNodeVisible(e){const t=this._getNodeDescriptor(e);if(null==t)return!0;const i=t.nodeBoundingData;if(null!=i&&!i.serviceMbsInIndexSR)return!0;if(this._isElevationRangeValid(t)&&N(t.visibilityCache,this._visibilityCacheVersion))return b(t.visibilityCache);const s=t.node,n=this._viewportQueries;if(s){const e=n.ensureElevationAgnosticBoundingVolume(s),i=n.isElevationAgnosticBoundingVolumeVisible(e);let o=i;if(this._needsNodeElevationRange&&i){const t=n.getNodeObbInRenderSRIndependentOfElevationOffset(s);null!=t&&(o=n.isObbVisibleIndependentOfElevation(e,t))}if(!o)return t.visibilityCache=p(!1,this._visibilityCacheVersion),!1}if(this._layerHasFilter&&this._computeNodeFiltering&&(null!=s||null!=i)&&2===t.filterImpact){const e=null!=s?s.serviceMbsInIndexSR:null!=i?i.serviceMbsInIndexSR:null;t.filterImpact=null!=e?this._computeNodeFiltering(e):0}const o=null!=s&&1===t.filterImpact;let r=!(null!=s&&2===s.imModificationImpact)&&!o;if(r){const t=!s||i&&!s.visibilityObbInRenderSR?i??null:s;if(null!=t){this._needsNodeElevationRange&&this._updateElevationRange(e);r=n.isNodeVisible(t)}}return t.visibilityCache=p(r,this._visibilityCacheVersion),r}isGeometryVisible(e){if(!this.isNodeVisible(e))return!1;const t=this._getNodeDescriptor(e);return!!(null==t?.node?.geometryObbInRenderSR||this.layerHasModifications&&4===t.node.imModificationImpact)||this._viewportQueries.isGeometryVisible(t.node)}_traverseCoverage(e,t,i,s,n){const o=this._getPage(e);if(null==o||0===t.childCount)return;const r=t.childOffset+t.childCount,d=new Array;for(let a=t.childOffset;a<r;++a){const e=o.children[a],t=this._getNodeDescriptor(e);null!=t?.node&&this.isGeometryVisible(e)&&d.push(t)}s/=d.length;for(const a of d){const e=a.node.index;this._isLoaded(e)||this._isReloading(e)?(n.delta=Math.max(n.delta,i),n.coverage+=s):this._traverseCoverage(e,a,i+1,s,n)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const t=this._getNodeDescriptor(e);if(null==t)return!1;if("always"===this.holeFilling)return!0;if(N(t.useAsHole,this._version))return b(t.useAsHole);const i={delta:0,coverage:0};this._traverseCoverage(e,t,0,1,i);const s=i.delta*i.coverage<=.5;return t.useAsHole=p(s,this._version),s}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.destroy(),this._nodePages.clear(),this._clientNodePage=null,this._layer=null,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._imModificationUncategorized.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=v(this._version)}imModificationsChanged(e){this.layerHasModifications=e,this._forAllNodes(({node:e})=>{null!=e&&(e.imModificationImpact=4,e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.hasModifications&&this.invalidateGeometryVisibility(e.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(e=>{if(null!=e){e.filterImpact=2;const t=e.node;null!=t&&this.invalidateNodeVisibilityCache(t.index)}}),this.invalidateVisibilityCache()}update(e,t,i){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this.resetUpdateState(e);let s=!0;const n=new R,o=new w,r=this._imModificationUncategorized;r.clear();const d=new Set;let a=0;const l=(d,l,h)=>{const u=e=>{this._shouldLoadNode(e)&&e.childCount&&(s=!1)};if(!l){const e=y(d,this._pageSize);let t=this._getNodeLoadPriority(d);return t===1/0&&(t=this._getNodeLoadPriority(h)),_.set(e,Math.max(t,_.get(e)||0)),this._loadingPages.has(e)||this._failedPages.has(e)||(this._missingPagesAndNodes.add(e),++a),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,t))}const{node:c,childCount:g}=l;if(this._updateNodeFeatureEstimate(c,o),!c){const e=this._getNodeLoadPriority(d);return this._loadingNodes.has(d)||this._failedNodes.has(d)||(this._missingPagesAndNodes.add(d),_.set(d,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const f=this._getPage(d);if(!this._useNodePages&&0===this._missingPagesAndNodes.size)for(let e=0;e<g;e++){const t=f.children[l.childOffset+e],i=this._getNodeDescriptor(t);null!=i&&!i.node&&!this._loadingNodes.has(t)&&!this._failedNodes.has(t)&&t>=0&&(_.set(t,this._getNodeLoadPriority(t)),this._prefetchNodes.add(t))}if(c.failed||c.resources.isEmpty)return void u(c);if(this._isLoaded(d)){if(n.known+=c.memory,++n.knownNodes,u(c),this._shouldLoadNode(c)||(n.unremoved+=c.memory),this._needsUpdate(c)){const e=this._getNodeLoadPriority(d);_.set(d,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(d)}return}if(c.memory&&(n.known+=c.memory,++n.knownNodes),!this._shouldLoadNode(c))return void(this._isReloading(d)&&this._updates.remove.push(d));if(u(c),c.memory?(n.missing+=c.memory,n.known+=c.memory,++n.knownNodes):++n.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._getNodeLoadPriority(d)),void(this._updates.cancel=this._updates.cancel.filter(e=>e!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const m=this._getNodeLoadPriority(d);_.set(d,m),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,m),this._updates.add.push(d),this.layerHasModifications&&i&&null!=c&&4===c.imModificationImpact&&r.push(d)};this.traverseVisible(l,d),this._frameNumber++,this._prioritizeMissingNodesAndPages(),this._removeUnusedNodePages(d,a),this._handleModifications(i,r),this._updateUnloadedMemoryEstimate(n),this._featureEstimate.estimate=this._computeFeatureEstimate(o),this._featureEstimate.leavesReached=s,this._updates.add.filterInPlace(e=>_.get(e)>=this._maxUnloadedPrio).sort((e,t)=>_.get(e)-_.get(t)),this._updates.update.sort((e,t)=>_.get(e)-_.get(t)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.size,this._dirty=this._indexMissing>0,_.clear()}_updateUnloadedMemoryEstimate(e){this._unloadedMemoryEstimate=e.missing-e.unremoved,e.knownNodes>3&&e.missingNodes>0&&(this._unloadedMemoryEstimate+=e.known/e.knownNodes*e.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate)}resetUpdateState(e){this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),_.clear()}_prioritizeMissingNodesAndPages(){const e=this._prioritizedMissingNodeAndPageIds;e.length=0,this._missingPagesAndNodes.forEach(t=>e.push(t)),e.sort((e,t)=>_.get(e)-_.get(t)),e.length>0&&(this._maxUnloadedPrio=_.get(e[e.length-1]),this._prefetchNodes.clear())}_handleModifications(e,t){this.layerHasModifications&&0!==this._updates.add.length&&(t.length>0&&e?.(t),this._updates.add.filterInPlace(e=>{const t=this._getNodeDescriptor(e),i=null==t?.node||2!==t.node.imModificationImpact;return i||this.invalidateNodeVisibilityCache(e),i}))}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,o=i,r=10;for(;r--;){const i=new w;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===r)break;o=s,s=.5*(s+n)}else n=s,s=.5*(s+o)}return this._version=v(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_removeUnusedNodePages(e,t){if(!this._useNodePages)return;const i=e.size,s=this._nodePages,n=s.size+this._loadingPages.size+t;if(n>V&&n>i){const t=new Array;for(const[i,n]of s)0!==n.numNodesWithLoadedChildren||e.has(i)||t.push([n.lastTraversed,i]);t.sort((e,t)=>e[0]-t[0]).some(e=>{const t=e[1];return this._deleteNodePage(t),s.size<=V})}}_updateFeatureEstimate(e,t){this._version=v(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((e,i)=>this._updateNodeFeatureEstimate(i?.node,t))}_updateNodeFeatureEstimate(e,t){null!=e&&!e.failed&&this._shouldLoadNode(e)&&(null!=e.numFeatures?(t.numFeatures+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.numFeatures;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.numFeatures/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._prioritizedMissingNodeAndPageIds,this._missingPagesAndNodes)}prefetch(){const e=this._prioritizedPrefetchNodes;return this._prefetchNodes.forEach(t=>e.push(t)),e.sort((e,t)=>_.get(e)-_.get(t)),this._load(e,this._prefetchNodes)}_load(e,t){if(0===e.length||!this._canRequest(this.urlPrefix))return!1;for(;e.length>0&&this._canRequest(this.urlPrefix);){const i=e[e.length-1];e.length--,t.delete(i),this._useNodePages&&i>=0?this._loadPage(i):this._loadNode(i)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.size>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(null==e)return null;const t=e.index,i=this._getNodeDescriptor(t);if(!i)return null;let s=i?.traversalState;if(s&&N(s.version,this._version))return s;const n=this._viewportQueries.getLodLevel(e),o=this._viewportQueries.hasLOD(e);let d=!0;if(o){const e=this._getParentIndex(t);if(null!=e){const t=this._getNodeDescriptor(e),i=t?.traversalState;d=!!i&&n>i.lodLevel}else d=n>0}else d=0===e.childCount;return s?(s.lodLevel=n,s.isChosen=d,s.version=p(!0,this._version),s):(s=new r(o,d,n,p(!0,this._version)),i.traversalState=s,s)}_loadNode(e){if(this._loadingNodes.has(e))return void this._logger.error(`Node[${e}] already loading`);this._loadingNodes.add(e);const i=this._getNodeDescriptor(e);if(i.node)return void this._logger.error(`Node[${e}] already in descriptor`);const s=i.nodeBoundingData;if(null==s)return void this._failedNodes.add(e);const n=s.id,o=this.urlPrefix+n,r=()=>{this._loadingNodes.delete(e),0===this._missingPagesAndNodes.size&&0===this._loadingNodes.size&&this.requestUpdate()};(e>=0?this._requester.request(o,"json"):this._clientNodeLoader.loadNodeJSON(n)).then(t=>{r();const i=this._validateNode(n,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const s=this._addNode(i,e);this.nodeTraversalState(s)}).catch(i=>{r(),t(i)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+o),this._failedNodes.add(e))})}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const i=t.geometryData;null==i||Array.isArray(i)&&0===i.length||Array.isArray(i)&&1===i.length&&"./geometries/0"===i[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const o=t.attributeData,r=this._layer.attributeStorageInfo;null==o||Array.isArray(o)&&!o.some((e,t)=>e.href!==`./attributes/${r?.[t]?.key??`f_${t}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const d=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:void 0,l=1===t.featureData?.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,u=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;const o=new n(`${t.id}`,new s(t.mbs));return o.serviceObbInIndexSR=!this.ignoreServiceObb&&t.hasOwnProperty("obb")&&t.obb?h.fromJSON(t.obb):null,o.visibilityObbInRenderSR=this._computeVisibilityObb(o),o},c=Array.isArray(t.children)?t.children.map(u).filter(e=>null!=e):null,g=t.featureData?.length??!1,_=!0===t.isEmpty;return new a(e,new s(t.mbs),d,"string"==typeof t.version?t.version:null,{isEmpty:!g&&_,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:null!=t.geometryData?e:void 0},c,Array.isArray(t.lodSelection)?t.lodSelection:null,l)}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{null!=e.node&&(e.node.failed=!1)})}_getNodeLoadPriority(e){const t=this._getNodeDescriptor(e),i=this._getParentIndex(e);if(null==t||null==i&&null==t.node)return null==i?1/0:this._getNodeLoadPriority(i);let s=0;if(t.node&&null!=i){const e=this._getNodeDescriptor(i);s=e.traversalState?.lodLevel??0}const n=this._getHoleBonus(e);return-(this._viewportQueries.distToCameraPOIRay(t.nodeBoundingData??t.node)*(1+s)+s*this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI())+n}_getHoleBonus(e){return this._hasLoadedAncestor(e)?0:this._progressiveLoadPenaltyWeight*this._viewportQueries.distCameraToPOI()}_hasLoadedAncestor(e){let t=this._getParentIndex(e);for(;null!=t;){if(this._isLoaded(t))return!0;t=this._getParentIndex(t)}return!1}traverseVisible(e,t){const i=this._getNodeDescriptor(this._rootIndex);null!=i?this._traverseVisible(this._rootIndex,null,i,e,t):e(this._rootIndex,null,null)}_traverseVisible(e,t,i,s,n){const o=y(e,this._pageSize);if(n&&n.add(o),i.node&&0===i.childCount)return void(this.isGeometryVisible(e)&&s(e,i,t));if(!this.isNodeVisible(e))return;if(s(e,i,t),null==i.node)return;const r=this.nodeTraversalState(i.node);if(r?.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const d=this._getPageFromPageIndex(o);for(let a=0;a<i.childCount;a++){const t=d.children[i.childOffset+a],o=this._getNodeDescriptor(t);if(o)this._traverseVisible(t,e,o,s,n);else{if(n){const e=y(t,this._pageSize);n.add(e)}s(t,null,e)}}}traverse(e,t){t(e)&&this.traverseDescendants(e,t)}traverseDescendants(e,t){++this._traverseDescendantsNestingLevel;const i=e.index,s=this._pageSize,n=y(i,s),o=this._getPageFromPageIndex(n);if(null==o)return;const r=this._frameNumber,d=this._nodePages,a=P(i,s),l=o.nodes[a],h=l.childCount;if(o.lastTraversed=r,0===h)return;const u=new Array,c=1===this._traverseDescendantsNestingLevel?this._traverseDescendantsQueue:[0];let g=0;{const{childOffset:e,childCount:t}=l,{children:i}=o;c.length=2**Math.ceil(Math.log2(g+t));for(let s=e;s<e+t;++s){const e=i[s];e>=0?(c[g]=e,++g):u.push(e)}}if(u.length>0){const e=this._clientNodePage;if(e){const i=e.children;let s=0;for(;s<u.length;){const n=u[s];++s;const o=-n-1,r=e.nodes[o],d=r.node;if(!d||!t(d))continue;const{childCount:a}=r;if(0===a)continue;const{childOffset:l}=r,h=l+a;for(let e=l;e<h;++e)u.push(i[e])}}}if(g>0){let e=0;if(s>0){let i=n*s,a=o,l=a.nodes;for(;e<g;){const n=c[e];let o;if(++e,i<=n&&n<i+s)o=a;else{const e=n/s|0,t=d.get(e);if(void 0===t)continue;o=t,o.lastTraversed=r,a=o,l=a.nodes,i=s*e}const h=l[n-i],u=h.node;if(null==u||!1===t(u))continue;const{childCount:_}=h;if(0===_)continue;const f=g+_;for(c.length<f&&(c.length=2**Math.ceil(Math.log2(g+_)));c.length<g+_;)c.length+=c.length;const m=o.children,{childOffset:v}=h,p=v+_;for(let e=v;e<p;++e)c[g]=m[e],++g}}else{const i=d.get(0);if(i)for(;e<g;){const s=c[e++],n=i.nodes[s],o=n.node;if(!o||!t(o))continue;const{childCount:r}=n;if(0===r)continue;c.length=Math.max(c.length,2**Math.ceil(Math.log2(g+r)));const d=i.children,{childOffset:a}=n,l=a+r;for(let e=a;e<l;++e)c[g]=d[e],++g}}}--this._traverseDescendantsNestingLevel}updateChildrenLoaded(e,t){let i=this.getNode(e);for(;null!=i;){const e=i.childrenLoaded,s=e+t;i.childrenLoaded=s;const n=0===e?1:0===s?-1:0,o=i.index;if(0!==n){this._getPage(o).numNodesWithLoadedChildren+=n}i=this.getParent(o)}}checkChildrenLoadedInvariant(){return!0}updateElevationInfo(e,t){this._needsNodeElevationRange=t&&!!e&&("relative-to-ground"===e.mode||"relative-to-scene"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{e?.invalidateBounds(),e.node?.invalidateElevationRange(),e.nodeBoundingData?.invalidateElevationRange()})}_forAllNodes(e){if(null!=this._clientNodePage){const t=this._clientNodePage;for(let i=0;i<t.nodes.length;i++)e(t.nodes[i],-(i+1))}for(const[t,i]of this._nodePages){const s=t*this._pageSize;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}clearCaches(){if(this._useNodePages){const e=this._nodePages,t=new Set;this.traverseVisible(e=>t.add(y(e,this._pageSize)));for(const[i,s]of e)if(0!==s.numNodesWithLoadedChildren||t.has(i))for(const e of s.nodes)e.traversalState=null;else this._deleteNodePage(i)}}_deleteNodePage(e){if(!this._nodePages.has(e))return void this._logger.error(`Destroying non-existent page ${e}`);const t=this._nodePages.get(e);this._nodePages.delete(e),t?.destroy()}get test(){}}const _=new Map;class f{constructor(t){this.missing=t,this.update=new e({deallocator:null}),this.add=new e({deallocator:null}),this.remove=new e({deallocator:null}),this.cancel=[]}destroy(){this.update.prune(),this.add.prune(),this.remove.prune(),this.cancel.length=0}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function m(e){return d(e,-2)}function v(e){return d(e,2)}function p(e,t){return t+(e?1:0)}function N(e,t){return(-2&e)===t}function b(e){return!(1&~e)}function y(e,t){return e<0?-1:t>0?e/t|0:0}function P(e,t){return e<0?-e-1:0===t?e:e%t}function I(e,t,i){return-1===t?-(e+1):0===i?e:t*i+e}const x=[["maxScreenThreshold",1],["screenSpaceRelative",2],["removedFeatureDiameter",3],["distanceRangeFromDefaultCamera",4]];function S(e){if(e)for(let t=0;t<e.length;t++)for(const i of x)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:0,maxError:0}}class R{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}class w{constructor(){this.numFeatures=0,this.knownNodes=0,this.missingNodes=0}}function C(e){return Math.sqrt(e*(4/Math.PI))}const E=new s,D=new s,M=new s,V=has("esri-mobile")?100:300;export{g as I3SIndex,S as selectErrorMetric};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,elementsPerSplatPage as a}from"./GaussianSplatAtlasPages.js";import{PixelType as i,SizedPixelFormat as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class p{constructor(t,r,a){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>t.dispose())}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=i.UNSIGNED_INT,e.internalFormat=l.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t);if(e*r>this._rctx.parameters.maxPreferredTexturePixels)return!1;const s=new o(this._rctx,this.texture),a=this._fboCache.acquire(r,e,"gaussian splat atlas resize",
|
|
2
|
+
import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import{initialSplatAtlasTextureHeight as e,GaussianSplatAtlasPages as s,splatAtlasTextureWidth as r,elementsPerSplatPage as a}from"./GaussianSplatAtlasPages.js";import{PixelType as i,SizedPixelFormat as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as o}from"../../../webgl/FramebufferObject.js";import h from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class p{constructor(t,r,a){this._splatAtlasTextureHeight=e,this.texture=null,this._rctx=t,this._fboCache=a,this.pageAllocator=new s,this._cache=r.newCache("gaussian texture cache",t=>t.dispose())}ensureTextureAtlas(){if(this.texture?.hasWebGLTextureObject)return;this.texture=null;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=r,e.pixelFormat=36249,e.dataType=i.UNSIGNED_INT,e.internalFormat=l.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new h(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const e=Math.floor(this._splatAtlasTextureHeight*t);if(e*r>this._rctx.parameters.maxPreferredTexturePixels)return!1;const s=new o(this._rctx,this.texture),a=this._fboCache.acquire(r,e,"gaussian splat atlas resize",12);return this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,r,this._splatAtlasTextureHeight,0,0,r,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=a.fbo?.detachColorTexture(),s.dispose(),a.dispose(),this._splatAtlasTextureHeight=e,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,s){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,a,1,s)}_updatePageAllocator(){const t=r*this._splatAtlasTextureHeight/a;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose(),this.texture=null}}export{p as GaussianSplatTextureAtlas};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{subclass as e}from"../../../core/accessorSupport/decorators.js";import o from"./ManagedFBOAttachment.js";let r=class extends o{constructor(t,e,o){super(t,e,o),this.attachment=e,this.type=
|
|
2
|
+
import{__decorate as t}from"tslib";import{subclass as e}from"../../../core/accessorSupport/decorators.js";import o from"./ManagedFBOAttachment.js";let r=class extends o{constructor(t,e,o){super(t,e,o),this.attachment=e,this.type=1}};r=t([e("esri.views.3d.webgl.ManagedColorAttachment")],r);const s=r;export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./ManagedFBOAttachment.js";let s=class extends r{constructor(){super(...arguments),this.type=
|
|
2
|
+
import{__decorate as t}from"tslib";import{subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./ManagedFBOAttachment.js";let s=class extends r{constructor(){super(...arguments),this.type=2}};s=t([e("esri.views.3d.webgl.ManagedDepthAttachment")],s);const o=s;export{o as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZeros as p,stencilWriteMaskOn as d,replaceBitWhenDepthTestPasses as m}from"../../../lib/StencilUtils.js";import{IndexGlLayout as u}from"../../../materials/DefaultLayouts.js";import{polygonOffset as c}from"../../../materials/PolygonOffset.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as g,premultipliedAlpha as b,cullingParams as j}from"../../../../../webgl/renderState.js";let P=class extends l{constructor(e,r,i){super(e,r,i.concat(u)),this.shader=new n(t,()=>import("./ComponentShader.glsl.js")),this.ignoreUnused=!0}getPipeline(e){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:n,transparent:l,cullFace:u,hasOccludees:P,renderOccluded:S}=e,w=0!==t,T=!i(n),O=o(n);let _=j(u);return r&&_&&(_={..._,mode:2304}),h({blending:S?b:l?a(n):null,culling:_,depthTest:S?null:s(n),depthWrite:S||!T&&!O?null:g,colorWrite:f,stencilWrite:!S&&w||P?d:null,stencilTest:w?m(1):P?p:null,polygonOffset:c(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as o}from"./FBOPool.js";import{DepthStencilAttachment as n,ColorAttachment0 as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as u}from"../../../webgl/FramebufferObject.js";import m from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new o(e.newCache,"FBOCache"),this.
|
|
2
|
+
import"../../../../core/has.js";import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as o}from"./FBOPool.js";import{DepthStencilAttachment as n,ColorAttachment0 as l}from"../../../webgl/enums.js";import{DisposableFramebufferObject as u}from"../../../webgl/FramebufferObject.js";import m from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new o(e.newCache,"FBOCache"),this._colorCache=new o(e.newCache,"ColorAttachmentCache"),this._depthCache=new o(e.newCache,"DepthAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&(this._usage.summarize(),this._acquired.forEach(t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.usedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(e,t,h,i=5){const s=p(i,e,t);let o=this._cache.pop(s);const{rctx:m}=this;if(o){o.retain(),o.setName(h);const e=o.getAttachment(n);e&&(e.name=C);const t=o.getAttachment(l);t&&(t.name=_(0)),m.unbindTexture(o.fbo.colorTexture)}else{const c=new u(m),d=(a,r,c)=>{r??=5;const h=this._acquireColor(r,e,t,c??_(a-l));return this.rctx.unbindTexture(h.attachment),o.attachColor(h,a),h.release(),o},p=a=>{a??=14;const r=this.acquireDepth(a,e,t,`${o.name} ${C}`);return o.attachDepth(r),r.release(),o},f=()=>{if(!o)return;this.debugCallback?.(o.name,o.fbo),this._acquired.delete(o);const e=r(i);e&&null!=o.getAttachment(n)||!e&&null!=o.getAttachment(l)?(e?(o.fbo?.invalidateAttachments([n]),o.detachAllColors()):(o.fbo?.invalidateAttachments([l]),o.detachAllButColor0()),this._trackRelease(o),this._cache.put(o)):o.dispose()};o=new a(s,h,c,d,p,f),r(i)?o.acquireDepth(i):o.acquireColor(l,i)}return this._trackAcquire(o,"f "+c(i),e,t),this._trackHandle(o)}acquireDepth(e,a,r,i){const s=p(e,a,r);let o=this._depthCache.pop(s);if(o)o.retain(),o.attachment.setShadowFiltering(!1);else{const c=new m(this.rctx,{...h[e],width:a,height:r});o=new t(s,c,()=>{this._trackRelease(o),this._depthCache.put(o)})}return o.name=i,this._trackAcquire(o,"d "+c(e),a,r),o}_acquireColor(t,a,r,h){const s=p(t,a,r);let o=this._colorCache.pop(s);if(o)o.retain();else{const c=new m(this.rctx,{...i[t],width:a,height:r,isImmutable:!0});o=new e(s,c,()=>{this._trackRelease(o),this._colorCache.put(o)})}return o.name=h,this._trackAcquire(o,"c "+c(t),a,r),o}_trackHandle(e){return this._acquired.add(e),e}_trackAcquire(e,t,a,r){this.debugCallback&&this._usage.add(e,t,a,r)}_trackRelease(e){this.debugCallback&&this._usage.remove(e)}get test(){return null}}function _(e=0){return`color${e}`}const C="depth";function p(e,t,a){return`${t}x${a}:${e}`}export{d as FBOCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{SizedPixelFormat as e,PixelType as
|
|
2
|
+
import{SizedPixelFormat as e,PixelType as n,SizedDepthStencilFormat as r,SizedDepthFormat as a}from"../../../webgl/enums.js";import{TextureDescriptor as t}from"../../../webgl/TextureDescriptor.js";import{isSizedDepthFormat as o}from"../../../webgl/textureUtils.js";function s(e){switch(e){case 0:return"R8UNORM";case 1:return"R8UINT";case 2:return"RG8UNORM";case 3:return"RG8UINT";case 4:return"RGBA4UNORM";case 5:return"RGBA8UNORM";case 6:return"RGBA8UNORM_MIPMAP";case 7:return"R16FLOAT";case 8:return"RGBA16FLOAT";case 9:return"RGBA16FLOAT_MIPMAP";case 10:return"R32FLOAT";case 11:return"RG32FLOAT";case 12:return"RGBA32UINT";case 13:return"COUNT"}}function p(e){switch(e){case 13:return"DEPTH16";case 14:return"DEPTH24_STENCIL8"}}function i(e){return T(e)?p(e):s(e)}function T(e){return e>=13}const m=new t;m.pixelFormat=6403,m.internalFormat=e.R8,m.wrapMode=33071;const F=new t;F.pixelFormat=36244,F.internalFormat=e.R8UI,F.wrapMode=33071,F.samplingMode=9728;const c=new t;c.pixelFormat=33319,c.internalFormat=e.RG8,c.wrapMode=33071;const l=new t;l.pixelFormat=33320,l.internalFormat=e.RG8UI,l.wrapMode=33071,l.samplingMode=9728;const N=new t;N.internalFormat=e.RGBA4,N.dataType=n.UNSIGNED_SHORT_4_4_4_4,N.wrapMode=33071;const M=new t;M.wrapMode=33071;const R=new t;R.wrapMode=33071,R.samplingMode=9987,R.hasMipmap=!0,R.maxAnisotropy=8;const w=new t;w.pixelFormat=6403,w.dataType=n.HALF_FLOAT,w.internalFormat=e.R16F,w.samplingMode=9728;const _=new t;_.dataType=n.HALF_FLOAT,_.internalFormat=e.RGBA16F,_.wrapMode=33071;const u=new t;u.dataType=n.HALF_FLOAT,u.internalFormat=e.RGBA16F,u.wrapMode=33071,u.samplingMode=9987,u.hasMipmap=!0,u.maxAnisotropy=8;const A=new t;A.pixelFormat=6403,A.dataType=n.FLOAT,A.internalFormat=e.R32F,A.samplingMode=9728;const d=new t;d.pixelFormat=33319,d.dataType=n.FLOAT,d.internalFormat=e.RG32F,d.samplingMode=9728;const O=new t;O.pixelFormat=36249,O.dataType=n.UNSIGNED_INT,O.internalFormat=e.RGBA32UI,O.samplingMode=9728,O.wrapMode=33071;const E={0:m,1:F,2:c,3:l,4:N,5:M,6:R,7:w,8:_,9:u,10:A,11:d,12:O,13:null},I={[a.DEPTH_COMPONENT16]:n.UNSIGNED_SHORT,[a.DEPTH_COMPONENT24]:n.UNSIGNED_INT,[a.DEPTH_COMPONENT32F]:n.FLOAT,[r.DEPTH24_STENCIL8]:n.UNSIGNED_INT_24_8,[r.DEPTH32F_STENCIL8]:n.FLOAT_32_UNSIGNED_INT_24_8_REV},G={14:L(r.DEPTH24_STENCIL8),13:L(a.DEPTH_COMPONENT16)};function L(e){const n=new t;return n.pixelFormat=o(e)?6402:34041,n.dataType=I[e],n.samplingMode=9728,n.wrapMode=33071,n.internalFormat=e,n.hasMipmap=!1,n.isImmutable=!0,n}export{E as ColorFormats,G as DepthTextureFormats,i as formatString,T as isDepthFormat};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
class
|
|
2
|
+
class e{constructor(){this._usage=new Map,this._pad=0}clear(){this._usage.clear()}add(e,s,t,r){const o=this._usage.get(e);o?(o[2]=!0,o[3].push(e.name)):this._usage.set(e,[s,`${t}x${r}`,!0,[e.name]]),this._pad=Math.max(this._pad,a(this._usage)),console.debug(Array.from(this._usage.values()).map(([e,a,s,t])=>(s?t[t.length-1]:"").padStart(this._pad," ")).join(" | "))}remove(e){const a=this._usage.get(e);a&&(a[2]=!1)}summarize(){const e=a(this._usage);console.debug(Array.from(this._usage.values()).map(([a,s])=>s.padStart(e," ")).join(" | ")),console.debug(Array.from(this._usage.keys()).map(({usedMemory:a})=>`${(a/1024/1024).toFixed(1)}MB`.padStart(e," ")).join(" | ")),console.debug(Array.from(this._usage.values()).map(([a])=>a.padStart(e," ")).join(" | ")),console.debug("Total",(Array.from(this._usage.keys()).reduce((e,{usedMemory:a})=>e+a,0)/1024/1024).toFixed(1),"MB")}}function a(e){return Array.from(e.values()).reduce((e,[a,s,t,r])=>Math.max(a.length,s.length,r.reduce((e,a)=>Math.max(e,a.length),e)),0)}export{e as FBOCacheUsage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as s}from"tslib";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{
|
|
2
|
+
import{__decorate as s}from"tslib";import{disposeMaybe as e}from"../../../../../core/maybe.js";import{subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as r,transpose as a,invert as i}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as n,copy as h}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as u,HighlightPassParameters as d,ViewshedShadowMapPassParameters as l,AllRenderPasses as _}from"./AllRenderPasses.js";import{TwoVectorPosition as p}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as w}from"../../effects/RenderPlugin.js";import{DepthRange as f}from"../../lib/DepthRange.js";import{SizedPixelFormat as P,DataType as g}from"../../../../webgl/enums.js";import x from"../../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../../webgl/TextureDescriptor.js";let T=class extends w{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[6,s=>this._produces(s,6)],[9,s=>this._produces(s,9)]]),this._drawParametersArray=new Array,this._drawParametersSet=new Set,this._materialPassParameters=new c,this._shadowPassParameters=new u,this._highlightPassParameters=new d,this._viewshedPassParameters=new l,this._systems=new Array}initializeRenderContext(s){this._context=s,this._passes=new _(s,this)}get rctx(){return this._context.renderContext.rctx}get bind(){return this._context.renderContext.bind}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.length=0,this._transformationTexture=e(this._transformationTexture),Object.values(this._passes).forEach(s=>s.destroy())}register(s){this._systems.push(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:t,_passes:r}=this;0!==t.length&&(this._drawParametersSet.clear(),this._drawParametersArray.length=0,this._transformationTexture=e(this._transformationTexture),Object.values(this._passes).forEach(s=>s.prepareSubmit()),t.forEach(e=>e.submit(r,s.bind)),this._updateTransformationTexture(),Object.values(this._passes).forEach(s=>s.finishSubmit()),this._context.techniques.frameUpdate())}acquireTechniques(s){if(0===this._systems.length)return null;const{output:e,bind:t}=s;return this._invoke(e,t.slot,(e,r)=>(this._updateParameters(t.camera,r,t.slot),r.transformationTexture=this._transformationTexture,e.acquire(r,s.bind)))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){switch(e){case 2:switch(s){case 0:case 1:case 2:case 3:case 4:case 11:return t(this._passes.opaque,this._materialPassParameters);case 10:return t(this._passes.highlight,this._highlightPassParameters);case 5:return t(this._passes.shadowMap,this._shadowPassParameters);case 6:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 7:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 8:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 3:case 4:case 11:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 3:case 4:case 11:case 9:return t(this._passes.integratedMesh,this._materialPassParameters);case 10:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 6:switch(s){case 0:case 1:case 2:return t(this._passes.transparentIntegratedMesh,this._materialPassParameters)}break;case 9:switch(s){case 0:case 1:case 2:case 3:case 4:case 11:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}requestRender(){this._context.requestRender()}queryDepthRange(s){return this._systems.reduce((e,t)=>e.union(t.queryDepthRange(s)),new f)}get hasEmissions(){return this._systems.some(s=>0!==s.hasEmissions)?3:0}_updateParameters(s,e,t){const o=s.viewInverseTransposeMatrix,m=4===t,c=9===t;n(y,o[3],o[7],o[11]),j.set(y),h(e.transformWorldFromViewTH,j.high),h(e.transformWorldFromViewTL,j.low),h(e.slicePlaneLocalOrigin,y),r(e.transformViewFromCameraRelativeRS,s.viewMatrix),0===e.identifier&&(this._materialPassParameters.transparent=m,this._materialPassParameters.occludedGround=c,a(v,e.transformViewFromCameraRelativeRS),i(e.transformNormalViewFromGlobal,v))}hasHighlight(s){return this._systems.some(e=>e.hasHighlight(s))}registerDrawParameters(s){if(!this._drawParametersSet.has(s)){this._drawParametersSet.add(s);const e=this._drawParametersArray.length;this._drawParametersArray.push(s),s.setTransformationDrawId(e)}}_updateTransformationTexture(){const s=this._drawParametersArray.length;if(0===s)return;const e=5,t=3*e,r=2**Math.ceil(Math.log2(s)),a=new Float32Array(r*t);for(let i=0;i<s;i++){const s=this._drawParametersArray[i];s.setTransformationDrawId(i);const e=i*t;a.set(s.transformationFloats,e)}if(this._transformationTexture&&this._transformationTexture.descriptor.height>=s)this._transformationTexture.updateData(0,0,0,e,s,a);else{this._transformationTexture?.dispose();const s=new b(e,r);s.internalFormat=P.RGB32F,s.dataType=g.FLOAT,s.hasMipmap=!1,s.isImmutable=!0,s.pixelFormat=6407,s.samplingMode=9728,this._transformationTexture=new x(this.rctx,s,a)}}};T=s([t("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],T);const y=m(),v=o(),j=new p;export{T as RenderPassManager};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as e}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{If as i,glsl as
|
|
2
|
+
import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as e}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{If as i,glsl as m}from"../../shaderModules/glsl.js";import{IntegerDrawUniform as s}from"../../shaderModules/IntegerDrawUniform.js";import{Matrix3DrawUniform as n}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as l}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DPassUniform as f}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as v}from"../../../../../webgl/NoParameters.js";function c(r,o){const{attributes:v,vertex:c,varyings:w,fragment:F}=r;c.include(e),v.add("position","vec3"),w.add("vPositionWorldCameraRelative","vec3"),w.add("vPosition_view","vec3",{invariant:!0}),c.uniforms.add(new a("transformWorldFromViewTH",r=>r.transformWorldFromViewTH),new a("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new d("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new l("transformProjFromView",r=>r.camera.projectionMatrix));const{vertexPositionRotationType:u,useTransformationTexture:W}=o,T=1===u;W?c.uniforms.add(new s("transformationDrawId",r=>r.transformationDrawId),new f("transformationTexture",r=>r.transformationTexture)):(c.uniforms.add(new t("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new t("transformWorldFromModelTL",r=>r.transformWorldFromModelTL)),T&&c.uniforms.add(new n("transformWorldFromModelRS",r=>r.transformWorldFromModelRS))),c.code.add(m`
|
|
3
3
|
mat3 modelTransformation() {
|
|
4
|
-
${i(W,
|
|
4
|
+
${i(W,m`
|
|
5
5
|
return mat3(
|
|
6
6
|
texelFetch(transformationTexture, ivec2(2, transformationDrawId), 0).xyz,
|
|
7
7
|
texelFetch(transformationTexture, ivec2(3, transformationDrawId), 0).xyz,
|
|
8
8
|
texelFetch(transformationTexture, ivec2(4, transformationDrawId), 0).xyz
|
|
9
|
-
);`,
|
|
9
|
+
);`,m`return transformWorldFromModelRS;`)}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
vec3 originL() {
|
|
13
|
-
return ${i(W,
|
|
13
|
+
return ${i(W,m`texelFetch(transformationTexture, ivec2(0, transformationDrawId), 0).xyz;`,m`transformWorldFromModelTL;`)}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
vec3 originH() {
|
|
17
|
-
return ${i(W,
|
|
17
|
+
return ${i(W,m`texelFetch(transformationTexture, ivec2(1, transformationDrawId), 0).xyz;`,m`transformWorldFromModelTH;`)};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
vec3 positionWorldCameraRelative() {
|
|
21
21
|
|
|
22
|
-
vec3 rotatedModelPosition = ${i(T,
|
|
22
|
+
vec3 rotatedModelPosition = ${i(T,m`modelTransformation() *`)} position;
|
|
23
23
|
|
|
24
24
|
vec3 transform_CameraRelativeFromModel = dpAdd(
|
|
25
25
|
originL(),
|
|
@@ -30,18 +30,18 @@ import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f6
|
|
|
30
30
|
|
|
31
31
|
return transform_CameraRelativeFromModel + rotatedModelPosition;
|
|
32
32
|
}
|
|
33
|
-
`),c.code.add(
|
|
33
|
+
`),c.code.add(m`
|
|
34
34
|
void forwardPosition(float fOffset) {
|
|
35
35
|
vPositionWorldCameraRelative = positionWorldCameraRelative();
|
|
36
36
|
if (fOffset != 0.0) {
|
|
37
|
-
vPositionWorldCameraRelative += fOffset * ${o.spherical?
|
|
37
|
+
vPositionWorldCameraRelative += fOffset * ${o.spherical?m`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:m`vec3(0.0, 0.0, 1.0)`};
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
|
|
41
41
|
gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
|
|
42
42
|
}
|
|
43
|
-
`),
|
|
43
|
+
`),F.uniforms.add(new a("transformWorldFromViewTL",r=>r.transformWorldFromViewTL)),c.code.add(m`vec3 positionWorld() {
|
|
44
44
|
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
45
|
-
}`),
|
|
45
|
+
}`),F.code.add(m`vec3 positionWorld() {
|
|
46
46
|
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
47
|
-
}`)}class w extends v{constructor(){super(...arguments),this.transformWorldFromViewTH=o(),this.transformWorldFromViewTL=o(),this.transformViewFromCameraRelativeRS=r()
|
|
47
|
+
}`)}class w extends v{constructor(){super(...arguments),this.transformWorldFromViewTH=o(),this.transformWorldFromViewTL=o(),this.transformViewFromCameraRelativeRS=r()}}class F extends v{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=o(),this.transformWorldFromModelTL=o(),this.transformationDrawId=0}}export{c as VertexPosition,F as VertexPositionDrawParameters,w as VertexPositionPassParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as s,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{RenderNodeOutput as r,InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as n}from"../../../../../chunks/FocusAreaMask.glsl.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{volumeToVao as c}from"./focusAreaMaskUtils.js";import{DepthStencilAttachment as h,PrimitiveType as l}from"../../../../webgl/enums.js";import{noParameters as u}from"../../../../webgl/NoParameters.js";let p=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[r.TRANSPARENT]},this.produces=i.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new n}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const s=this.techniques.getCompiled(a);if(!s||!this._vaos)return void this.requestRender(1);const t=e.find(({name:e})=>e===r.TRANSPARENT),o=this.renderingContext,n=this.bindParameters,c=n.camera,p=c.fullViewport[2],m=c.fullViewport[3],d=this.fboCache.acquire(p,m,i.FOCUSAREA,2);this.view.stage.renderer.occludedRequiresStencil?(d.acquireDepth(
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as s,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{RenderNodeOutput as r,InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{F as n}from"../../../../../chunks/FocusAreaMask.glsl.js";import{FocusAreaMaskTechnique as a}from"./FocusAreaMaskTechnique.js";import{volumeToVao as c}from"./focusAreaMaskUtils.js";import{DepthStencilAttachment as h,PrimitiveType as l}from"../../../../webgl/enums.js";import{noParameters as u}from"../../../../webgl/NoParameters.js";let p=class extends o{constructor(e){super({...e,view:e.focusAreasView.view}),this.consumes={required:[r.TRANSPARENT]},this.produces=i.FOCUSAREA,this._vaos=new Array,this._counts=new Array,this._origins=new Array,this._maskParameters=new n}initialize(){this.updateGeometries()}destroy(){this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0}precompile(){this.techniques.precompile(a)}render(e){const s=this.techniques.getCompiled(a);if(!s||!this._vaos)return void this.requestRender(1);const t=e.find(({name:e})=>e===r.TRANSPARENT),o=this.renderingContext,n=this.bindParameters,c=n.camera,p=c.fullViewport[2],m=c.fullViewport[3],d=this.fboCache.acquire(p,m,i.FOCUSAREA,2);this.view.stage.renderer.occludedRequiresStencil?(d.acquireDepth(14),o.blitFramebuffer(t.fbo,d.fbo,256)):d.attachDepth(t.getAttachment(h)),o.bindFramebuffer(d.fbo),o.setClearColor(0,0,0,1),o.clear(17408),o.setViewport(0,0,p,m);const f=o.bindTechnique(s,n);o.setFaceCullingEnabled(!1),o.setStencilTestEnabled(!0),o.setStencilOpSeparate(1028,7680,34055,7680),o.setStencilOpSeparate(1029,7680,34056,7680),o.setDepthWriteEnabled(!1);for(let r=0;r<this._vaos.length;r++){const e=this._vaos[r],s=this._counts[r];this._maskParameters.origin=this._origins[r],f.bindDraw(n,u,this._maskParameters),o.bindVAO(e),o.setDepthTestEnabled(!0),o.setStencilWriteMask(255),o.setStencilFunction(519,0,255),o.setColorMask(!1,!1,!1,!1),o.drawArrays(l.TRIANGLES,0,s),o.setDepthTestEnabled(!1),o.setStencilWriteMask(0),o.setStencilFunction(517,0,255),o.setColorMask(!0,!0,!0,!0),o.drawArrays(l.TRIANGLES,0,s)}return d}updateGeometries(){if(!this.view.stage)return;this._vaos.forEach(e=>e.dispose()),this._vaos.length=this._counts.length=this._origins.length=0;this.focusAreasView.volumes.forEach(e=>{const s=e.geometryVolume,{vao:t,vertexCount:r}=c(this.renderingContext,s);this._vaos.push(t),this._counts.push(r),this._origins.push(e.origin)}),this.requestRender(1)}};e([s()],p.prototype,"consumes",void 0),e([s()],p.prototype,"produces",void 0),e([s({constructOnly:!0})],p.prototype,"focusAreasView",void 0),p=e([t("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaMaskNode")],p);export{p as FocusAreaMaskNode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/
|
|
2
|
+
import"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/Float3PassUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/DistanceFalloff.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{F as FogPassParameters,b as build}from"../../../../../chunks/Fog.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as m,dot as h,scale as p,lerp as c,length as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as f}from"../../../webgl.js";import{heightLimit as g}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{F as w}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as b}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as y,ColorAttachment1 as F}from"../../../../webgl/enums.js";const j=.95,E=1;let R=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new w;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,t="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength=e.fogOpacity,this._newParameters.amount=t?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,N),"rainy"===e.type&&n(this._newParameters.color,C),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._parameters.amount>0&&(this._configuration.hasEmissive=this.bindParameters.hasEmission,this.techniques.precompile(b,this._configuration))}render(e){const t=e.find(({name:e})=>e===f.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;this._configuration.hasEmissive=this.bindParameters.hasEmission;const s=this.techniques.getCompiled(b,this._configuration);if(!s)return this.requestRender(1),t;const a=this.renderingContext,i=t.getAttachment(y);return this._passParameters.emission=t.obtainAttachment(F),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,F),this._passParameters.emission=r(this._passParameters.emission)),t}_update(){const e=this.bindParameters.camera;m(x,e.eye);const s=Math.max(0,h(x,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(T,r,.1),c(this._passParameters.color,T,r,s);const a=d(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(j*g,E*g,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class q{constructor(){this.color=_(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,t,r){this.amount=s(e.amount,t.amount,r),this.strength=s(e.strength,t.strength,r),c(this.color,e.color,t.color,r)}}const x=_(),T=_(),C=l(.5,.5,.5),N=l(1.5,1.5,1.5);export{R as Fog,q as FogParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import r from"../../../../../core/PooledArray.js";import{property as t,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{DepthStencilAttachment as d}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[i.OCCLUDED]},this.produces=i.OCCLUDED,this._blit=new c(e.view.stage.renderView.techniques,2)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forEach(r=>{e.precompileSlots(r,9,11),r.material&&e.precompileOccludedSlots(r,p)})}render(e){const r=e.find(({name:e})=>e===this.produces);return this._renderOccludedAndTransparentStencil(r),this._renderOccludedComposite(r),r}_renderOccludedAndTransparentStencil(e){const r=this.view.stage.renderer,t=a;this._acquirePlugins(t,8),0!==t.length&&(r.renderSlots(t,10),this._renderAndComposite(e,e.getAttachment(d),.5,()=>r.renderSlots(t,11),!1,!1),t.clear())}_renderOccludedComposite(e){const r=this.view.stage.renderer,t=a,s=this._acquirePlugins(t,u);if(0===t.length)return;const n=this._getDepthStencilAttachment(e);let i=n.clearStencil;for(const o of p)s&o&&(this._renderAndComposite(e,n.depth,16===o?1:.5,()=>r.renderOccludedSlots(t,o),!0,i),i=!1);n.release(),t.clear()}_acquirePlugins(e,r){const t=this.view.stage.renderer;e.clear();let s=0,n=!1;for(const i of t.plugins.plugins){const t=i.renderOccludedFlags&r;s|=t,t&&(e.push(i),n||=0!==i.testsTransparentRenderOrder)}return n&&e.sort((e,r)=>e.testsTransparentRenderOrder-r.testsTransparentRenderOrder),s}_renderAndComposite(e,r,t,s,i,o){const c=this.renderingContext,{width:d,height:l}=e.fbo,a=this.fboCache.acquire(d,l,"tmp color");a.attachDepth(r),c.bindFramebuffer(a.fbo),c.clearFramebuffer(n,i,o),s(),a.detachDepth(),this._blit.blend(c,a,e,this.bindParameters,t),a.release()}_getDepthStencilAttachment(e){const{width:r,height:t}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){const e=this.fboCache.acquireDepth(
|
|
2
|
+
import{__decorate as e}from"tslib";import r from"../../../../../core/PooledArray.js";import{property as t,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as i}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{DepthStencilAttachment as d}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[i.OCCLUDED]},this.produces=i.OCCLUDED,this._blit=new c(e.view.stage.renderView.techniques,2)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forEach(r=>{e.precompileSlots(r,9,11),r.material&&e.precompileOccludedSlots(r,p)})}render(e){const r=e.find(({name:e})=>e===this.produces);return this._renderOccludedAndTransparentStencil(r),this._renderOccludedComposite(r),r}_renderOccludedAndTransparentStencil(e){const r=this.view.stage.renderer,t=a;this._acquirePlugins(t,8),0!==t.length&&(r.renderSlots(t,10),this._renderAndComposite(e,e.getAttachment(d),.5,()=>r.renderSlots(t,11),!1,!1),t.clear())}_renderOccludedComposite(e){const r=this.view.stage.renderer,t=a,s=this._acquirePlugins(t,u);if(0===t.length)return;const n=this._getDepthStencilAttachment(e);let i=n.clearStencil;for(const o of p)s&o&&(this._renderAndComposite(e,n.depth,16===o?1:.5,()=>r.renderOccludedSlots(t,o),!0,i),i=!1);n.release(),t.clear()}_acquirePlugins(e,r){const t=this.view.stage.renderer;e.clear();let s=0,n=!1;for(const i of t.plugins.plugins){const t=i.renderOccludedFlags&r;s|=t,t&&(e.push(i),n||=0!==i.testsTransparentRenderOrder)}return n&&e.sort((e,r)=>e.testsTransparentRenderOrder-r.testsTransparentRenderOrder),s}_renderAndComposite(e,r,t,s,i,o){const c=this.renderingContext,{width:d,height:l}=e.fbo,a=this.fboCache.acquire(d,l,"tmp color");a.attachDepth(r),c.bindFramebuffer(a.fbo),c.clearFramebuffer(n,i,o),s(),a.detachDepth(),this._blit.blend(c,a,e,this.bindParameters,t),a.release()}_getDepthStencilAttachment(e){const{width:r,height:t}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){const e=this.fboCache.acquireDepth(14,r,t,"retained stencil");return{depth:e,release:()=>e.release(),clearStencil:!0}}const s=this.fboCache.acquire(r,t,"retained stencil",14);return this.renderingContext.blitFramebuffer(e.fbo,s.fbo,1024),{depth:s.getAttachment(d),release:()=>s.release(),clearStencil:!1}}};e([t()],l.prototype,"consumes",void 0),e([t()],l.prototype,"produces",void 0),l=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],l);const a=new r;function h(){a.prune()}const p=[4,2,16],u=p.reduce((e,r)=>e|r,0);export{l as RenderOccludedRenderNode,h as cleanupRenderOccluded};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{length as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{G as m}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as u}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as p}from"./GlowBlurTechniqueConfiguration.js";import{G as d,a as _,m as g}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as b}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as f}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as P}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as w,DepthStencilAttachment as C}from"../../../../webgl/enums.js";let F=class extends c{constructor(t){super(t),this.consumes={required:[l.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=l.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),maximumFog:new d([0,.27,.6,1.05,1.58,2.1],6),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new p,this._blurVerticalConfiguration=new p,this._compositionConfiguration=new f,this._compositionParameters=new _,this._blurParameters=new m,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([i(()=>this._updateFogParameters(),()=>{},r),i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}_updateFogParameters(){const{weather:t,weatherAvailable:e}=this.view.environment;this._compositionParameters.distanceModifier=e?t.fogOpacity:0,this._compositionParameters.maxDisperse=this._scatteringFactors.maximumFog,this.requestRender(1)}precompile(){this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.blurEnabled=2!==this._mode,this._compositionConfiguration.blurEnabled&&(this.techniques.precompile(u,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.glowStage=1,this.techniques.precompile(u,this._blurVerticalConfiguration)),this.techniques.precompile(b,this._compositionConfiguration)}render(t){const i=t.find(({name:t})=>t===l.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(w);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(C),n=this.fboCache,{fullWidth:h,fullHeight:c}=this.bindParameters.camera,m=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,2===this._mode){this._compositionConfiguration.blurEnabled=!1;const t=this.techniques.getCompiled(b,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=n.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,c),m.bindTechnique(t,this.bindParameters,this._compositionParameters),m.screen.draw(),e.attachDepth(o),e.attachColor(r,w),e}this._compositionConfiguration.blurEnabled=!0;const p=this.techniques.getCompiled(u,this._blurHorizontalConfiguration),d=this.techniques.getCompiled(u,this._blurVerticalConfiguration),_=this.techniques.getCompiled(b,this._compositionConfiguration);if(!p||!d||!_)return this.requestRender(1),i;const g=this.bindParameters.camera,f=a(g.eye);this._compositionParameters.atmosphereC=f**2-this._atmosphereRadius**2,this._renderGlowMipMap(p,d);const P=n.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(w,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,c,!0),m.bindTechnique(_,this.bindParameters,this._compositionParameters),m.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.bindParameters.camera,o=this.renderingContext;let a=Math.ceil(.5*r),n=Math.ceil(.5*s);const h=5;for(this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=P,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,this._compositionParameters.lodTexture=i.acquire(a,n,"glow mipmap",9);a>1&&n>1&&this._blurParameters.level<h;){const r=i.acquire(a,n,"glow horizontal",8);this._setupFBO(r,a,n),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),this._blurParameters.inputScale=1,this._blurParameters.input=r.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,a,n,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),r.release(),a=Math.ceil(.5*a),n=Math.ceil(.5*n),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level}this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?g(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):g(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,n)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],F.prototype,"consumes",void 0),t([s()],F.prototype,"produces",void 0),F=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],F);export{F as Glow};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../../core/mathUtils.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowBlurPassParameters,b as build}from"../../../../../chunks/GlowBlur.glsl.js";
|
|
2
|
+
import"../../../../../core/arrayUtils.js";import"../../../../../core/mathUtils.js";import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowBlurPassParameters,b as build}from"../../../../../chunks/GlowBlur.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/
|
|
2
|
+
import"../../../../../core/arrayUtils.js";import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/DistanceFalloff.glsl.js";import"../../shaders/ditherNoise.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{a as GlowCompositionPassParameters,G as GlowLodFactors,c as build,m as mixPreset}from"../../../../../chunks/GlowComposition.glsl.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{Float3BindUniform as e}from"../../core/shaderModules/Float3BindUniform.js";import{FloatPassUniform as r}from"../../core/shaderModules/FloatPassUniform.js";import{glsl as o}from"../../core/shaderModules/glsl.js";import{SphereIntersect as s}from"../../shaders/SphereIntersect.glsl.js";import{NoParameters as t}from"../../../../webgl/NoParameters.js";class a extends t{constructor(){super(...arguments),this.atmosphereC=1}}function i(t){t.include(s),t.uniforms.add(new r("atmosphereC",e=>e.atmosphereC),new e("cameraPosition",e=>e.camera.eye))
|
|
2
|
+
import{Float3BindUniform as e}from"../../core/shaderModules/Float3BindUniform.js";import{FloatPassUniform as r}from"../../core/shaderModules/FloatPassUniform.js";import{glsl as o}from"../../core/shaderModules/glsl.js";import{SphereIntersect as s}from"../../shaders/SphereIntersect.glsl.js";import{NoParameters as t}from"../../../../webgl/NoParameters.js";class a extends t{constructor(){super(...arguments),this.atmosphereC=1}}function i(t){t.include(s),t.uniforms.add(new r("atmosphereC",e=>e.atmosphereC),new e("cameraPosition",e=>e.camera.eye)).code.add(o`float getDistanceFalloff(float dist, vec3 rayDir, float weight) {
|
|
3
3
|
if(dist == -1.0){
|
|
4
4
|
dist = 0.055 * sphereIntersect(cameraPosition, rayDir, atmosphereC).y;
|
|
5
5
|
}
|
|
6
6
|
return (1.0 - exp(-dist * weight));
|
|
7
|
-
}`)}export{
|
|
7
|
+
}`)}export{a as DistanceFalloffPassParameters,i as getDistanceFalloff};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{nextPowerOfTwo as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as r}from"../../../../core/maybe.js";import{property as s,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{ortho as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UNIT_X as c,ZEROS as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as d,InternalRenderCategory as p}from"../../webgl.js";import{Frustum as _}from"../../state/Frustum.js";import{glLayout as f}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import g from"../../webgl/RenderCamera.js";import C from"../../webgl/RenderNode.js";import{ShaderOutputConfiguration as F}from"../core/shaderLibrary/ShaderOutputConfiguration.js";import{VertexArrayObject as R}from"./VertexArrayObject.js";import{C as w}from"../../../../chunks/CutFillDepth.glsl.js";import{CutFillDepthTechnique as x}from"../shaders/CutFillDepthTechnique.js";import{CutFillDepthTechniqueConfiguration as P}from"../shaders/CutFillDepthTechniqueConfiguration.js";import{C as T}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as y}from"../shaders/CutFillReductionTechnique.js";import{CutFillReductionTechniqueConfiguration as b}from"../shaders/CutFillReductionTechniqueConfiguration.js";import{C as B}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as D}from"../shaders/CutFillTargetDepthTechnique.js";import{ImmediateTask as j,TaskPriority as q}from"../../../support/Scheduler.js";import{Yield as E}from"../../../support/Yield.js";import{PrimitiveType as S,DataType as O}from"../../../webgl/enums.js";import{Sync as v}from"../../../webgl/Sync.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let A=class extends C{constructor(t){super(t),this.consumes={required:[d.TRANSPARENT]},this.produces=p.CUTFILL_COMPUTATION,this._cutFillTargetDepthConfiguration=new F,this._cutFillDepthConfiguration=new P,this._cutFillReductionConfiguration=new b,this._cutFillTargetDepthParameters=new B,this._cutFillDepthParameters=new w,this._cutFillReductionParameters=new T,this.needsRender=!1,this.readyToRun=!1,this.done=!0,this._frameTask=j,this._result=new k,this._localOrigin=a(),this._maxTextureSize=512,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=13,this._colorFormat=10,this._numChannels=2,this._targetGeometryVao=null,this._numReductions=3,this._reductionPasses=0,this._pixelBufferSize=0,this._pixelBufferOffset=0,this._perReductionPixelBufferSize=0}initialize(){this._frameTask=this.view.resourceController.scheduler.registerTask(q.VOLUME_MEASUREMENT,this),this.addHandles(this._frameTask),this._maxTextureSize=Math.min(this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._cutFillTargetDepthConfiguration.output=9,this._frustum=new _(this.view.renderCoordsHelper)}destroy(){this._targetGeometryVao=i(this._targetGeometryVao);const t=this.gl;this._sync=r(this._sync),this._pixelBuffer&&(t.deleteBuffer(this._pixelBuffer),this._pixelBuffer=null,this._pixelBufferSize=0)}precompile(){this.techniques.precompile(D,this._cutFillTargetDepthConfiguration),this._cutFillDepthConfiguration.preparePass=0,this.techniques.precompile(x,this._cutFillDepthConfiguration),this._cutFillDepthConfiguration.preparePass=1,this.techniques.precompile(x,this._cutFillDepthConfiguration),this._cutFillReductionConfiguration.reductionPass=0,this.techniques.precompile(y,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=1,this.techniques.precompile(y,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=2,this.techniques.precompile(y,this._cutFillReductionConfiguration),this.view.stage.renderer.precompileCutFillOrthographicReferenceDepth()}render(t){const e=t.find(({name:t})=>t===this.produces);if(!this._orthographicCamera||!this._targetGeometryVao||!this.needsRender||this._sync)return e;const i=this.techniques.getCompiled(D,this._cutFillTargetDepthConfiguration);this._cutFillDepthConfiguration.preparePass=0;const r=this.techniques.getCompiled(x,this._cutFillDepthConfiguration);this._cutFillDepthConfiguration.preparePass=1;const s=this.techniques.getCompiled(x,this._cutFillDepthConfiguration);this._cutFillReductionConfiguration.reductionPass=0;const h=this.techniques.getCompiled(y,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=1;const o=this.techniques.getCompiled(y,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=2;const n=this.techniques.getCompiled(y,this._cutFillReductionConfiguration);if(!(i&&r&&s&&h&&o&&n))return this.requestRender(1),e;this.needsRender=!1;const u=this.renderingContext,a=this.fboCache,d=this.gl,p=u.getViewport(),_=a.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);u.bindFramebuffer(_.fbo),u.setViewport(0,0,this._width,this._height),u.clear(1280),this.view.stage.renderer.renderCutFillOrthographicReferenceDepth(this._orthographicCamera);const f=a.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);u.bindFramebuffer(f.fbo),u.setViewport(0,0,this._width,this._height),u.setClearDepth(1),u.clear(256),this._cutFillTargetDepthParameters.origin=this._localOrigin,this._cutFillTargetDepthParameters.cutFillCamera=this._orthographicCamera,u.bindTechnique(i,this.bindParameters,this._cutFillTargetDepthParameters),u.bindVAO(this._targetGeometryVao),u.drawArrays(S.TRIANGLES,0,this._targetGeometryVao.vertexCount("geometry"));const m=a.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),g=a.acquire(this._width,this._height,"cutfill reduction odd",this._colorFormat);return this._cutFillDepthParameters.referenceDepthTexture=_.depthTexture,this._cutFillDepthParameters.targetDepthTexture=f.depthTexture,this._pixelBuffer||(this._pixelBuffer=d.createBuffer()),d.bindBuffer(d.PIXEL_PACK_BUFFER,this._pixelBuffer),d.bufferData(d.PIXEL_PACK_BUFFER,this._pixelBufferSize,d.STREAM_READ),this._prepareFBO(m,this.width,this.height),u.bindTechnique(r,this.bindParameters,this._cutFillDepthParameters),u.screen.draw(),this._runPyramidReduction(m,g,h),this._prepareFBO(m,this.width,this.height,c),u.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),u.screen.draw(),this._runPyramidReduction(m,g,o),this._prepareFBO(m,this.width,this.height,l),u.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),u.screen.draw(),this._runPyramidReduction(m,g,n),_.release(),f.release(),m.release(),g.release(),d.bindBuffer(d.PIXEL_PACK_BUFFER,null),u.setViewport(p.x,p.y,p.width,p.height),this._sync=new v(d),setTimeout(()=>this.readyToRun=!0,0),e}update(t,i){if(!this.done)return;this.done=!1;const r=this.renderingContext,{cameraDimensions:{width:s,height:h},localOriginRenderSpace:o}=t,n=this._maxTextureSize,u=h/s,a=s>h?n:n/u,c=s>h?n*u:n;this._width=e(a),this._height=e(c);const l=[this._width,this._height];this._orthographicCamera=this._createCamera(t,l),this._frustum?.update(this._orthographicCamera),this._updateTargetVao(r,i),this._localOrigin=o,this._reductionPasses=Math.ceil(Math.log2(Math.min(this._width,this._height))),this._reducedWidth=Math.ceil(this._width/2**this._reductionPasses),this._reducedHeight=Math.ceil(this._height/2**this._reductionPasses),this._perReductionPixelBufferSize=this._reducedWidth*this._reducedHeight*this._numChannels*4,this._pixelBufferSize=this._perReductionPixelBufferSize*this._numReductions,this._pixelBufferOffset=0,this.needsRender=!0,this.requestRender(1)}runTask(){if(!this._sync)return void(this.readyToRun=!1);try{if(!this._sync.poll())return E}catch(e){return this.readyToRun=!1,void(this._sync=r(this._sync))}this.readyToRun=!1,this._sync=r(this._sync);const t=this.gl;this._cpuBuffer=new Float32Array(this._pixelBufferSize/4),t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pixelBuffer),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._cpuBuffer),t.bindBuffer(t.PIXEL_PACK_BUFFER,null),this._updateResults(this._cpuBuffer),this.done=!0}getResult(){return this._result}get frustum(){return this._frustum}get width(){return this._width}get height(){return this._height}get updating(){return this.readyToRun||!this.done||this._frameTask.updating}_runPyramidReduction(t,e,i){const r=this.renderingContext,s=this.gl;let h=this._width,o=this._height;for(let n=0;n<this._reductionPasses;n++)h=Math.ceil(h/2),o=Math.ceil(o/2),this._cutFillReductionParameters.depthTexture=t.getTexture(),this._prepareFBO(e,h,o),r.bindTechnique(i,this.bindParameters,this._cutFillReductionParameters),r.screen.draw(),[t,e]=[e,t];s.readPixels(0,0,h,o,33319,O.FLOAT,this._pixelBufferOffset),this._pixelBufferOffset+=this._perReductionPixelBufferSize}_updateResults(t){const e=new U(0,1,u()),i=new U(0,0,u());for(let r=0;r<this._reducedWidth;r++)for(let s=0;s<this._reducedHeight;s++){let h=(r+s*this._reducedWidth)*this._numChannels;const o=this._reducedWidth*this._reducedHeight*this._numChannels;e.totalDepth+=t[h],i.totalDepth+=t[h+1],h+=o;const n=t[h];n<e.depthExtremum&&(e.depthExtremum=n,M(e.depthExtremumCoords,t[h+1],this._width)),h+=o;const u=t[h];u>i.depthExtremum&&(i.depthExtremum=u,M(i.depthExtremumCoords,t[h+1],this._width))}this._result=new k(this._width,this._height,e,i)}_prepareFBO(t,e,i,r=l){const s=this.renderingContext;s.bindFramebuffer(t.fbo),s.setViewport(0,0,e,i),s.setClearColor(r[0],r[1],r[2],r[3]),s.clear(16384)}_createCamera(t,e){const{cameraPositionRenderSpace:i,localOriginRenderSpace:r,northVector:s,cameraDimensions:{width:h,height:n},cameraNearFar:{near:u,far:a}}=t,c=new g({eye:i,center:r,up:s,near:u,far:a});return c.viewport=[0,0,e[0],e[1]],o(c.projectionMatrix,-h/2,h/2,-n/2,n/2,u,a),c}_updateTargetVao(t,e){this._targetGeometryVao=i(this._targetGeometryVao);const r=e.indices.length,s=z.createBuffer(r),h=s.position,{positions:o,indices:n}=e;for(let i=0;i<n.length;++i){const t=3*n[i];h.set(i,0,o[t]),h.set(i,1,o[t+1]),h.set(i,2,o[t+2])}const u=new V(t,f(z),s.buffer);this._targetGeometryVao=new R(t,u)}};t([s()],A.prototype,"consumes",void 0),t([s()],A.prototype,"produces",void 0),t([s()],A.prototype,"needsRender",void 0),t([s()],A.prototype,"readyToRun",void 0),t([s()],A.prototype,"done",void 0),t([s()],A.prototype,"updating",null),t([s()],A.prototype,"_frameTask",void 0),A=t([h("esri.views.3d.webgl-engine.lib.CutFillComputationRenderNode")],A);const z=m().vec3f("position").freeze();function M(t,e,i){const r=e%i,s=Math.floor(e/i);n(t,r,s)}class L{constructor(t,e){this.positions=t,this.indices=e}}class U{constructor(t,e,i){this.totalDepth=t,this.depthExtremum=e,this.depthExtremumCoords=i}}class k{constructor(t=0,e=0,i=new U(0,1,u()),r=new U(0,0,u())){this.width=t,this.height=e,this.cut=i,this.fill=r}}export{A as CutFillComputationRenderNode,k as CutFillComputationResult,U as CutFillDepthResult,L as TargetGeometryRenderInfo};
|
|
2
|
+
import{__decorate as t}from"tslib";import{nextPowerOfTwo as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as r}from"../../../../core/maybe.js";import{property as s,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{ortho as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UNIT_X as c,ZEROS as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as d,InternalRenderCategory as p}from"../../webgl.js";import{Frustum as _}from"../../state/Frustum.js";import{glLayout as f}from"../../support/buffer/glUtil.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import g from"../../webgl/RenderCamera.js";import C from"../../webgl/RenderNode.js";import{ShaderOutputConfiguration as F}from"../core/shaderLibrary/ShaderOutputConfiguration.js";import{VertexArrayObject as R}from"./VertexArrayObject.js";import{C as w}from"../../../../chunks/CutFillDepth.glsl.js";import{CutFillDepthTechnique as x}from"../shaders/CutFillDepthTechnique.js";import{CutFillDepthTechniqueConfiguration as P}from"../shaders/CutFillDepthTechniqueConfiguration.js";import{C as T}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as y}from"../shaders/CutFillReductionTechnique.js";import{CutFillReductionTechniqueConfiguration as b}from"../shaders/CutFillReductionTechniqueConfiguration.js";import{C as B}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as D}from"../shaders/CutFillTargetDepthTechnique.js";import{ImmediateTask as j,TaskPriority as q}from"../../../support/Scheduler.js";import{Yield as E}from"../../../support/Yield.js";import{PrimitiveType as S,DataType as O}from"../../../webgl/enums.js";import{Sync as v}from"../../../webgl/Sync.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let A=class extends C{constructor(t){super(t),this.consumes={required:[d.TRANSPARENT]},this.produces=p.CUTFILL_COMPUTATION,this._cutFillTargetDepthConfiguration=new F,this._cutFillDepthConfiguration=new P,this._cutFillReductionConfiguration=new b,this._cutFillTargetDepthParameters=new B,this._cutFillDepthParameters=new w,this._cutFillReductionParameters=new T,this.needsRender=!1,this.readyToRun=!1,this.done=!0,this._frameTask=j,this._result=new k,this._localOrigin=a(),this._maxTextureSize=512,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=14,this._colorFormat=11,this._numChannels=2,this._targetGeometryVao=null,this._numReductions=3,this._reductionPasses=0,this._pixelBufferSize=0,this._pixelBufferOffset=0,this._perReductionPixelBufferSize=0}initialize(){this._frameTask=this.view.resourceController.scheduler.registerTask(q.VOLUME_MEASUREMENT,this),this.addHandles(this._frameTask),this._maxTextureSize=Math.min(this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._cutFillTargetDepthConfiguration.output=9,this._frustum=new _(this.view.renderCoordsHelper)}destroy(){this._targetGeometryVao=i(this._targetGeometryVao);const t=this.gl;this._sync=r(this._sync),this._pixelBuffer&&(t.deleteBuffer(this._pixelBuffer),this._pixelBuffer=null,this._pixelBufferSize=0)}precompile(){this.techniques.precompile(D,this._cutFillTargetDepthConfiguration),this._cutFillDepthConfiguration.preparePass=0,this.techniques.precompile(x,this._cutFillDepthConfiguration),this._cutFillDepthConfiguration.preparePass=1,this.techniques.precompile(x,this._cutFillDepthConfiguration),this._cutFillReductionConfiguration.reductionPass=0,this.techniques.precompile(y,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=1,this.techniques.precompile(y,this._cutFillReductionConfiguration),this._cutFillReductionConfiguration.reductionPass=2,this.techniques.precompile(y,this._cutFillReductionConfiguration),this.view.stage.renderer.precompileCutFillOrthographicReferenceDepth()}render(t){const e=t.find(({name:t})=>t===this.produces);if(!this._orthographicCamera||!this._targetGeometryVao||!this.needsRender||this._sync)return e;const i=this.techniques.getCompiled(D,this._cutFillTargetDepthConfiguration);this._cutFillDepthConfiguration.preparePass=0;const r=this.techniques.getCompiled(x,this._cutFillDepthConfiguration);this._cutFillDepthConfiguration.preparePass=1;const s=this.techniques.getCompiled(x,this._cutFillDepthConfiguration);this._cutFillReductionConfiguration.reductionPass=0;const h=this.techniques.getCompiled(y,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=1;const o=this.techniques.getCompiled(y,this._cutFillReductionConfiguration);this._cutFillReductionConfiguration.reductionPass=2;const n=this.techniques.getCompiled(y,this._cutFillReductionConfiguration);if(!(i&&r&&s&&h&&o&&n))return this.requestRender(1),e;this.needsRender=!1;const u=this.renderingContext,a=this.fboCache,d=this.gl,p=u.getViewport(),_=a.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);u.bindFramebuffer(_.fbo),u.setViewport(0,0,this._width,this._height),u.clear(1280),this.view.stage.renderer.renderCutFillOrthographicReferenceDepth(this._orthographicCamera);const f=a.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);u.bindFramebuffer(f.fbo),u.setViewport(0,0,this._width,this._height),u.setClearDepth(1),u.clear(256),this._cutFillTargetDepthParameters.origin=this._localOrigin,this._cutFillTargetDepthParameters.cutFillCamera=this._orthographicCamera,u.bindTechnique(i,this.bindParameters,this._cutFillTargetDepthParameters),u.bindVAO(this._targetGeometryVao),u.drawArrays(S.TRIANGLES,0,this._targetGeometryVao.vertexCount("geometry"));const m=a.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),g=a.acquire(this._width,this._height,"cutfill reduction odd",this._colorFormat);return this._cutFillDepthParameters.referenceDepthTexture=_.depthTexture,this._cutFillDepthParameters.targetDepthTexture=f.depthTexture,this._pixelBuffer||(this._pixelBuffer=d.createBuffer()),d.bindBuffer(d.PIXEL_PACK_BUFFER,this._pixelBuffer),d.bufferData(d.PIXEL_PACK_BUFFER,this._pixelBufferSize,d.STREAM_READ),this._prepareFBO(m,this.width,this.height),u.bindTechnique(r,this.bindParameters,this._cutFillDepthParameters),u.screen.draw(),this._runPyramidReduction(m,g,h),this._prepareFBO(m,this.width,this.height,c),u.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),u.screen.draw(),this._runPyramidReduction(m,g,o),this._prepareFBO(m,this.width,this.height,l),u.bindTechnique(s,this.bindParameters,this._cutFillDepthParameters),u.screen.draw(),this._runPyramidReduction(m,g,n),_.release(),f.release(),m.release(),g.release(),d.bindBuffer(d.PIXEL_PACK_BUFFER,null),u.setViewport(p.x,p.y,p.width,p.height),this._sync=new v(d),setTimeout(()=>this.readyToRun=!0,0),e}update(t,i){if(!this.done)return;this.done=!1;const r=this.renderingContext,{cameraDimensions:{width:s,height:h},localOriginRenderSpace:o}=t,n=this._maxTextureSize,u=h/s,a=s>h?n:n/u,c=s>h?n*u:n;this._width=e(a),this._height=e(c);const l=[this._width,this._height];this._orthographicCamera=this._createCamera(t,l),this._frustum?.update(this._orthographicCamera),this._updateTargetVao(r,i),this._localOrigin=o,this._reductionPasses=Math.ceil(Math.log2(Math.min(this._width,this._height))),this._reducedWidth=Math.ceil(this._width/2**this._reductionPasses),this._reducedHeight=Math.ceil(this._height/2**this._reductionPasses),this._perReductionPixelBufferSize=this._reducedWidth*this._reducedHeight*this._numChannels*4,this._pixelBufferSize=this._perReductionPixelBufferSize*this._numReductions,this._pixelBufferOffset=0,this.needsRender=!0,this.requestRender(1)}runTask(){if(!this._sync)return void(this.readyToRun=!1);try{if(!this._sync.poll())return E}catch(e){return this.readyToRun=!1,void(this._sync=r(this._sync))}this.readyToRun=!1,this._sync=r(this._sync);const t=this.gl;this._cpuBuffer=new Float32Array(this._pixelBufferSize/4),t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pixelBuffer),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._cpuBuffer),t.bindBuffer(t.PIXEL_PACK_BUFFER,null),this._updateResults(this._cpuBuffer),this.done=!0}getResult(){return this._result}get frustum(){return this._frustum}get width(){return this._width}get height(){return this._height}get updating(){return this.readyToRun||!this.done||this._frameTask.updating}_runPyramidReduction(t,e,i){const r=this.renderingContext,s=this.gl;let h=this._width,o=this._height;for(let n=0;n<this._reductionPasses;n++)h=Math.ceil(h/2),o=Math.ceil(o/2),this._cutFillReductionParameters.depthTexture=t.getTexture(),this._prepareFBO(e,h,o),r.bindTechnique(i,this.bindParameters,this._cutFillReductionParameters),r.screen.draw(),[t,e]=[e,t];s.readPixels(0,0,h,o,33319,O.FLOAT,this._pixelBufferOffset),this._pixelBufferOffset+=this._perReductionPixelBufferSize}_updateResults(t){const e=new U(0,1,u()),i=new U(0,0,u());for(let r=0;r<this._reducedWidth;r++)for(let s=0;s<this._reducedHeight;s++){let h=(r+s*this._reducedWidth)*this._numChannels;const o=this._reducedWidth*this._reducedHeight*this._numChannels;e.totalDepth+=t[h],i.totalDepth+=t[h+1],h+=o;const n=t[h];n<e.depthExtremum&&(e.depthExtremum=n,M(e.depthExtremumCoords,t[h+1],this._width)),h+=o;const u=t[h];u>i.depthExtremum&&(i.depthExtremum=u,M(i.depthExtremumCoords,t[h+1],this._width))}this._result=new k(this._width,this._height,e,i)}_prepareFBO(t,e,i,r=l){const s=this.renderingContext;s.bindFramebuffer(t.fbo),s.setViewport(0,0,e,i),s.setClearColor(r[0],r[1],r[2],r[3]),s.clear(16384)}_createCamera(t,e){const{cameraPositionRenderSpace:i,localOriginRenderSpace:r,northVector:s,cameraDimensions:{width:h,height:n},cameraNearFar:{near:u,far:a}}=t,c=new g({eye:i,center:r,up:s,near:u,far:a});return c.viewport=[0,0,e[0],e[1]],o(c.projectionMatrix,-h/2,h/2,-n/2,n/2,u,a),c}_updateTargetVao(t,e){this._targetGeometryVao=i(this._targetGeometryVao);const r=e.indices.length,s=z.createBuffer(r),h=s.position,{positions:o,indices:n}=e;for(let i=0;i<n.length;++i){const t=3*n[i];h.set(i,0,o[t]),h.set(i,1,o[t+1]),h.set(i,2,o[t+2])}const u=new V(t,f(z),s.buffer);this._targetGeometryVao=new R(t,u)}};t([s()],A.prototype,"consumes",void 0),t([s()],A.prototype,"produces",void 0),t([s()],A.prototype,"needsRender",void 0),t([s()],A.prototype,"readyToRun",void 0),t([s()],A.prototype,"done",void 0),t([s()],A.prototype,"updating",null),t([s()],A.prototype,"_frameTask",void 0),A=t([h("esri.views.3d.webgl-engine.lib.CutFillComputationRenderNode")],A);const z=m().vec3f("position").freeze();function M(t,e,i){const r=e%i,s=Math.floor(e/i);n(t,r,s)}class L{constructor(t,e){this.positions=t,this.indices=e}}class U{constructor(t,e,i){this.totalDepth=t,this.depthExtremum=e,this.depthExtremumCoords=i}}class k{constructor(t=0,e=0,i=new U(0,1,u()),r=new U(0,0,u())){this.width=t,this.height=e,this.cut=i,this.fill=r}}export{A as CutFillComputationRenderNode,k as CutFillComputationResult,U as CutFillDepthResult,L as TargetGeometryRenderInfo};
|