@arcgis/core 4.33.0-next.20250326 → 4.33.0-next.20250328

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.
Files changed (319) hide show
  1. package/applications/Components/viewUtils.d.ts +3 -0
  2. package/applications/Components/viewUtils.js +5 -0
  3. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +1 -0
  4. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  5. package/arcade/arcadeAsyncRuntime.js +1 -1
  6. package/arcade/arcadeCompiler.js +1 -1
  7. package/arcade/arcadeRuntime.js +1 -1
  8. package/arcade/functions/date.js +1 -1
  9. package/arcade/functions/feature.js +1 -1
  10. package/arcade/functions/featuresetbase.js +1 -1
  11. package/arcade/functions/featuresetgeom.js +1 -1
  12. package/arcade/functions/featuresetstats.js +1 -1
  13. package/arcade/functions/featuresetstring.js +1 -1
  14. package/arcade/functions/geomasync.js +1 -1
  15. package/arcade/functions/geometry.js +1 -1
  16. package/arcade/functions/geomsync.js +1 -1
  17. package/arcade/functions/knowledgegraph.js +1 -1
  18. package/arcade/functions/maths.js +1 -1
  19. package/arcade/functions/stats.js +1 -1
  20. package/arcade/functions/string.js +1 -1
  21. package/arcade/geometry/functions.js +1 -1
  22. package/arcade/languageUtils.js +1 -1
  23. package/assets/esri/core/workers/RemoteClient.js +1 -1
  24. package/assets/esri/core/workers/chunks/08ea652b7896c1da022d.js +1 -0
  25. package/assets/esri/core/workers/chunks/{66cae76da0582cfa8656.js → 0943695a1dcd21c45e83.js} +1 -1
  26. package/assets/esri/core/workers/chunks/09ca64184bed6abafcd9.js +1 -0
  27. package/assets/esri/core/workers/chunks/{c6bcfa99fb222894fa0e.js → 0a0e5d699ddb7052c5c0.js} +1 -1
  28. package/assets/esri/core/workers/chunks/0a675f9f69b8b13b7443.js +1 -0
  29. package/assets/esri/core/workers/chunks/0eed612e82a279ac8d1e.js +1 -0
  30. package/assets/esri/core/workers/chunks/{cbe22c58b3230b12b31a.js → 13ad4ee2e064d13ca34d.js} +1 -1
  31. package/assets/esri/core/workers/chunks/176e7c7c2a871bcb512e.js +1 -0
  32. package/assets/esri/core/workers/chunks/18d0fe269531b951e309.js +1 -0
  33. package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +1 -0
  34. package/assets/esri/core/workers/chunks/213e82a7e3fa5b253ec1.js +1 -0
  35. package/assets/esri/core/workers/chunks/{22618753349eb9d8b3df.js → 222446da9cb58c3c3b7e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/277b61af8982092a4c81.js +1 -0
  37. package/assets/esri/core/workers/chunks/2b07bdb6c4c4a5b2f968.js +1 -0
  38. package/assets/esri/core/workers/chunks/2bda2cfc6e81818d7d33.js +1 -0
  39. package/assets/esri/core/workers/chunks/2cbab0c078d0b844934c.js +1 -0
  40. package/assets/esri/core/workers/chunks/{a68b48fd1a529f69705e.js → 2fcfc21ba38d9919730a.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{193b4fecdfee927d6200.js → 37e4f588a6896f98bce3.js} +1 -1
  42. package/assets/esri/core/workers/chunks/392e64a573f67817db02.js +1 -0
  43. package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +1 -0
  44. package/assets/esri/core/workers/chunks/3be007f32ea1e18b8b3b.js +1 -0
  45. package/assets/esri/core/workers/chunks/451555af283b32a10fef.js +1 -0
  46. package/assets/esri/core/workers/chunks/{835fa4484c58d9b31c78.js → 460afde071df9f35182d.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{26bedec014488e1fc5e4.js → 4816cf647eca2f4cecc2.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{09c9e4e94f09ba9f4c22.js → 4aa0a58ded4465ea28bd.js} +1 -1
  49. package/assets/esri/core/workers/chunks/4d02e211967384994e5e.js +1 -0
  50. package/assets/esri/core/workers/chunks/4d798da25a726f179089.js +319 -0
  51. package/assets/esri/core/workers/chunks/51339193abddfe37745d.js +1 -0
  52. package/assets/esri/core/workers/chunks/{0a98dc3ea67ce97a6e7b.js → 5269793822e41dd07fe1.js} +1 -1
  53. package/assets/esri/core/workers/chunks/52d160cb7921ae7a4f57.js +1 -0
  54. package/assets/esri/core/workers/chunks/{630a9afdf0523c27ddb6.js → 555c95b149e3a82a4460.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{eab1e3c101158675abba.js → 5660f479c005149bce8d.js} +1 -1
  56. package/assets/esri/core/workers/chunks/5a51c75a2932d9da001a.js +1 -0
  57. package/assets/esri/core/workers/chunks/{37a3533f004bf2e888da.js → 5d01f0b86566d08ba29d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{0576b035c1654a43ad5c.js → 5de3aee547113bfd59df.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{45eee326f7a649c5a15b.js → 626db8488f9d931cf55c.js} +2 -2
  60. package/assets/esri/core/workers/chunks/{5a6f7360183693f8490d.js → 6339a24874c698594101.js} +1 -1
  61. package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +1 -0
  62. package/assets/esri/core/workers/chunks/6c378e7a6ca29d530880.js +1 -0
  63. package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +1 -0
  64. package/assets/esri/core/workers/chunks/{c591527543fd75a917d4.js → 72c7126dbd27fa48fcdb.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{d459c790a3b89ac53d2d.js → 759c12b0715279e3c0f6.js} +1 -1
  66. package/assets/esri/core/workers/chunks/75a04b073231da70c18d.js +1 -0
  67. package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +1 -0
  68. package/assets/esri/core/workers/chunks/7655be1470ce39f0e494.js +1 -0
  69. package/assets/esri/core/workers/chunks/796cf1c2ca9955595836.js +1 -0
  70. package/assets/esri/core/workers/chunks/79c4f10da8360ee60cd2.js +1 -0
  71. package/assets/esri/core/workers/chunks/{49c346d2fb8538990f45.js → 7d1c39c2a80e20a0595f.js} +1 -1
  72. package/assets/esri/core/workers/chunks/7f36cffc6ed984b7e467.js +1 -0
  73. package/assets/esri/core/workers/chunks/{fa3eeb40e2d732c184d8.js → 7f8c7e3e41e51ab4d612.js} +1 -1
  74. package/assets/esri/core/workers/chunks/80aaf31c8eec3cff2add.js +1 -0
  75. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +1 -0
  76. package/assets/esri/core/workers/chunks/84d301e1b6b0d0b48f51.js +1 -0
  77. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +1 -0
  78. package/assets/esri/core/workers/chunks/86ee278919038260696e.js +39 -0
  79. package/assets/esri/core/workers/chunks/{4496ef270c700078df0c.js → 8752f807c05d1ec215e8.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{59e4e780dcdfed555ca5.js → 8ef5e6f1c606e5e41002.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{55c7c51e56d72f507c22.js → 90afead317186b31b2f9.js} +1 -1
  82. package/assets/esri/core/workers/chunks/90c893959145827961ac.js +1 -0
  83. package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +1 -0
  84. package/assets/esri/core/workers/chunks/{7e0e9ca84490a0c67197.js → 98da74243df03e0cc70d.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{354117429b3a0a0794c9.js → 999e8dbe6f4d0665b3ab.js} +1 -1
  86. package/assets/esri/core/workers/chunks/9c59fc2df8081e65a128.js +1 -0
  87. package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +1 -0
  88. package/assets/esri/core/workers/chunks/a53e9f5092de715da025.js +1 -0
  89. package/assets/esri/core/workers/chunks/a9b6377f1fef5826f28d.js +1 -0
  90. package/assets/esri/core/workers/chunks/{8063e35dacf8f99471d8.js → aa404aaec843a4f46ab6.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{21016d58428b15f7427c.js → aa712f850fd129ca5ed8.js} +1 -1
  92. package/assets/esri/core/workers/chunks/ab0113d1269675dcd520.js +1 -0
  93. package/assets/esri/core/workers/chunks/aff7c4477e1f0c31fffa.js +1 -0
  94. package/assets/esri/core/workers/chunks/{726e3f413824f02fe689.js → bd2dcc55ac3418421ee5.js} +1 -1
  95. package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +1 -0
  96. package/assets/esri/core/workers/chunks/c2f38c66fae2cdb57445.js +1 -0
  97. package/assets/esri/core/workers/chunks/c7aa4a8263e21f631004.js +1 -0
  98. package/assets/esri/core/workers/chunks/{b8a4352f83502449ff95.js → cbbbaccc0d3683e1c0fe.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{e4290719c8afc2a4ee8c.js → cc441051a52bfbda9caf.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{3be465c653236d6d8c1f.js → d2c7067bb6654c0e2793.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{bc3f42401131a12fce9b.js → d2eb3802fa003c2d497e.js} +1 -1
  102. package/assets/esri/core/workers/chunks/d3912886ac2910290f43.js +1 -0
  103. package/assets/esri/core/workers/chunks/da7c14ae1a25fc7163ce.js +1 -0
  104. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +1 -0
  105. package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +1 -0
  106. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +1 -0
  107. package/assets/esri/core/workers/chunks/{d5d2a4e8e19898d86c6d.js → e2029267cddb8e2effab.js} +1 -1
  108. package/assets/esri/core/workers/chunks/e3ef0451dcdc2e966628.js +1 -0
  109. package/assets/esri/core/workers/chunks/e7e987558cf017c62458.js +1 -0
  110. package/assets/esri/core/workers/chunks/{042771b4e56355924140.js → e9993d4f2bfdc434fbcc.js} +1 -1
  111. package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +1 -0
  112. package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +1 -0
  113. package/assets/esri/core/workers/chunks/{4dc1e7d7ac2a4b0144c4.js → f128d3431da86e484117.js} +28 -29
  114. package/assets/esri/core/workers/chunks/{ed4afafbcb31491c2049.js → f452ca61842dbe8de9af.js} +1 -1
  115. package/assets/esri/core/workers/chunks/f54546c155fba2fd3a7e.js +1 -0
  116. package/assets/esri/core/workers/chunks/{4c8164955f8d844c09ee.js → f8d1c7df671733c3325c.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{e45404a982e173459990.js → f92d521ed3df3c9f737b.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{b2289c18c02c868a2939.js → f9bedb421d4e115a888f.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{55f7b1de8882569861c0.js → faed301a25252c619cff.js} +1 -1
  120. package/assets/esri/core/workers/chunks/fb22b2e4988ecf4d6376.js +1 -0
  121. package/assets/esri/core/workers/chunks/fb455fd89b74b70a6a2b.js +1 -0
  122. package/assets/esri/core/workers/chunks/{6d77c7e9dec323fc4145.js → fb603edd374e24f366ff.js} +1 -1
  123. package/chunks/ComponentShader.glsl.js +25 -25
  124. package/chunks/HUDMaterial.glsl.js +2 -2
  125. package/chunks/LineMarker.glsl.js +26 -26
  126. package/chunks/Point2D.js +1 -1
  127. package/chunks/ProjectionTransformation.js +1 -1
  128. package/chunks/QuadraticBezier.js +1 -1
  129. package/chunks/RibbonLine.glsl.js +35 -33
  130. package/chunks/Terrain.glsl.js +33 -33
  131. package/chunks/aiServices.js +1 -1
  132. package/chunks/array.js +1 -1
  133. package/chunks/languageUtils.js +1 -1
  134. package/core/Accessor.js +1 -1
  135. package/core/accessorSupport/utils.js +1 -1
  136. package/core/workers/registry.js +1 -1
  137. package/geometry/operators/projectOperator.js +1 -1
  138. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  139. package/geometry/support/meshUtils/elevation.js +1 -1
  140. package/geometry/support/meshUtils.js +1 -1
  141. package/interfaces.d.ts +284 -10
  142. package/intl/locale.js +1 -1
  143. package/layers/LinkChartLayer.js +1 -1
  144. package/layers/MapImageLayer.js +1 -1
  145. package/layers/TileLayer.js +1 -1
  146. package/layers/support/RasterWorker.js +1 -1
  147. package/layers/support/VideoElement.js +1 -1
  148. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  149. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  150. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  151. package/package.json +2 -2
  152. package/rest/networks/queryAssociations.js +1 -1
  153. package/support/revision.js +1 -1
  154. package/symbols/WebStyleSymbol.js +1 -1
  155. package/symbols/support/symbolUtils.js +1 -1
  156. package/views/2d/LabelManager.js +1 -1
  157. package/views/2d/engine/webgl/Overlay.js +1 -1
  158. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  159. package/views/2d/layers/TileLayerView2D.js +1 -1
  160. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  161. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  162. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  163. package/views/2d/layers/support/util.js +1 -1
  164. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  165. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  166. package/views/3d/layers/DrapedSubView3D.js +1 -1
  167. package/views/3d/layers/GraphicsView3D.js +1 -1
  168. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  169. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  170. package/views/3d/layers/MediaLayerView3D.js +1 -1
  171. package/views/3d/layers/TileLayerView3D.js +1 -1
  172. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  173. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  174. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  175. package/views/3d/layers/support/ImageHighlightHelper3D.js +5 -0
  176. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +5 -0
  177. package/views/3d/terrain/Overlay.js +1 -1
  178. package/views/3d/terrain/OverlayRenderer.js +1 -1
  179. package/views/3d/terrain/RasterTile.js +1 -1
  180. package/views/3d/terrain/TerrainRenderer.js +1 -1
  181. package/views/3d/terrain/TerrainSurface.js +1 -1
  182. package/views/3d/terrain/TileCompositor.js +1 -1
  183. package/views/3d/terrain/TileRenderer.js +1 -1
  184. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  185. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  186. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  187. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +9 -10
  188. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js +11 -0
  189. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +3 -3
  190. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +3 -6
  191. package/views/3d/webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput.js +1 -1
  192. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +1 -1
  193. package/views/3d/webgl-engine/lib/Material.js +1 -1
  194. package/views/3d/webgl-engine/lib/Program.js +1 -1
  195. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  196. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  197. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  198. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  199. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  200. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  202. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  203. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  204. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  205. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  207. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  208. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  211. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  216. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  217. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  218. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  219. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  220. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  221. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  222. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  223. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  224. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  225. package/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration.js +1 -1
  226. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  227. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  228. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  229. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  230. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  231. package/views/DOMContainer.js +1 -1
  232. package/views/FocusArea.js +1 -1
  233. package/views/GroundView.js +1 -1
  234. package/views/PopupView.js +1 -1
  235. package/views/SceneView.js +1 -1
  236. package/views/VideoView.d.ts +4 -0
  237. package/views/VideoView.js +1 -1
  238. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  239. package/views/layers/support/highlightUtils.js +5 -0
  240. package/views/support/GroundViewElevationSampler.js +1 -1
  241. package/views/support/TextureCompressionHandle.js +5 -0
  242. package/views/support/TextureCompressionHelper.js +1 -1
  243. package/views/support/TextureCompressionWorker.js +5 -0
  244. package/views/support/TextureCompressionWorkerHandle.js +5 -0
  245. package/views/support/imageReprojection.js +1 -1
  246. package/views/webgl/ShaderBuilder.js +1 -1
  247. package/views/webgl/Texture.js +1 -1
  248. package/views/webgl/TextureDescriptor.js +1 -1
  249. package/webscene/Slide.js +1 -1
  250. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  251. package/widgets/CatalogLayerList.js +1 -1
  252. package/widgets/Directions.js +1 -1
  253. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  254. package/widgets/Features/FeaturesViewModel.js +1 -1
  255. package/widgets/LayerList/ListItem.js +1 -1
  256. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  257. package/widgets/Legend.js +1 -1
  258. package/widgets/TableList/ListItem.js +1 -1
  259. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  260. package/widgets/UtilityNetworkTrace.js +1 -1
  261. package/widgets/ValuePicker.js +1 -1
  262. package/widgets/support/uriUtils.js +1 -1
  263. package/assets/esri/core/workers/chunks/0059295780fa4a090f30.js +0 -319
  264. package/assets/esri/core/workers/chunks/07910d16d1efae41d4bc.js +0 -1
  265. package/assets/esri/core/workers/chunks/0a3c1642cfabf9acd5c5.js +0 -1
  266. package/assets/esri/core/workers/chunks/0b7331613f91a3258352.js +0 -1
  267. package/assets/esri/core/workers/chunks/1a09dfb2c9fd7cd84cd4.js +0 -1
  268. package/assets/esri/core/workers/chunks/1dd6d68d23ba07587ae4.js +0 -1
  269. package/assets/esri/core/workers/chunks/2079f9d28e4199714f22.js +0 -1
  270. package/assets/esri/core/workers/chunks/29ba2022c2978e9bd53e.js +0 -1
  271. package/assets/esri/core/workers/chunks/29fe3e9a0ecab74bb729.js +0 -1
  272. package/assets/esri/core/workers/chunks/35f3eef81fac7924a487.js +0 -1
  273. package/assets/esri/core/workers/chunks/3fc18638f8799b85001d.js +0 -1
  274. package/assets/esri/core/workers/chunks/4539a802cba77a7a7cc7.js +0 -1
  275. package/assets/esri/core/workers/chunks/4d7bd2bbe9045a2fee7a.js +0 -1
  276. package/assets/esri/core/workers/chunks/50b6be13c270d7ac80d3.js +0 -1
  277. package/assets/esri/core/workers/chunks/54ace3e4802934f3f9f2.js +0 -1
  278. package/assets/esri/core/workers/chunks/5656cc44e3d4547668db.js +0 -1
  279. package/assets/esri/core/workers/chunks/597f450a57750637cb4d.js +0 -1
  280. package/assets/esri/core/workers/chunks/6e7577cb6378ff34e722.js +0 -1
  281. package/assets/esri/core/workers/chunks/6eb8d7edafeafeb10cae.js +0 -1
  282. package/assets/esri/core/workers/chunks/6ff981ec0c725efe5525.js +0 -1
  283. package/assets/esri/core/workers/chunks/71bd94cc789a55910f92.js +0 -1
  284. package/assets/esri/core/workers/chunks/762567124623f6d11e67.js +0 -1
  285. package/assets/esri/core/workers/chunks/77845cd5d824c1004bfa.js +0 -1
  286. package/assets/esri/core/workers/chunks/78683f1aadc1377be5fd.js +0 -1
  287. package/assets/esri/core/workers/chunks/7a4413a188a8f1affb2f.js +0 -1
  288. package/assets/esri/core/workers/chunks/7d3b2bdc75525d47389c.js +0 -1
  289. package/assets/esri/core/workers/chunks/81bf362ec0d23ffdc90c.js +0 -39
  290. package/assets/esri/core/workers/chunks/81f2f1614ea27f4c2e65.js +0 -1
  291. package/assets/esri/core/workers/chunks/901c957c049f53318e87.js +0 -1
  292. package/assets/esri/core/workers/chunks/94f41ef15f6c61562e5e.js +0 -1
  293. package/assets/esri/core/workers/chunks/95f23bd17ce9e07fc8ef.js +0 -1
  294. package/assets/esri/core/workers/chunks/96d7f47ea8fbf345101c.js +0 -1
  295. package/assets/esri/core/workers/chunks/9f312f7284e506a84ed7.js +0 -1
  296. package/assets/esri/core/workers/chunks/a59ad50d932da1e28c8f.js +0 -1
  297. package/assets/esri/core/workers/chunks/ac86d0b31f6368bd1fb1.js +0 -1
  298. package/assets/esri/core/workers/chunks/ad9b3b83aa96db7b79ea.js +0 -1
  299. package/assets/esri/core/workers/chunks/afe94e351b4a50d7bc53.js +0 -1
  300. package/assets/esri/core/workers/chunks/b02ac03503bfff1ff922.js +0 -1
  301. package/assets/esri/core/workers/chunks/b8416f2560710258c239.js +0 -1
  302. package/assets/esri/core/workers/chunks/b948fe33b4d650eea796.js +0 -1
  303. package/assets/esri/core/workers/chunks/ba47e43ef039fe4b8c5c.js +0 -1
  304. package/assets/esri/core/workers/chunks/be002f24beb832a369ce.js +0 -1
  305. package/assets/esri/core/workers/chunks/bf3c4c1bff8b71bc0b13.js +0 -1
  306. package/assets/esri/core/workers/chunks/d45ff061bf71b73e9f26.js +0 -1
  307. package/assets/esri/core/workers/chunks/d8ddff920725acb99200.js +0 -1
  308. package/assets/esri/core/workers/chunks/db4c110ab4c26c4b768c.js +0 -1
  309. package/assets/esri/core/workers/chunks/dfa4be2e07cc4c0938b0.js +0 -1
  310. package/assets/esri/core/workers/chunks/e088edb9ffbaa1ed12eb.js +0 -1
  311. package/assets/esri/core/workers/chunks/e0ac90b4ad8c36fb7d70.js +0 -1
  312. package/assets/esri/core/workers/chunks/e491daf73ab1264aa1b9.js +0 -1
  313. package/assets/esri/core/workers/chunks/f2a6287c8d28be24f71e.js +0 -1
  314. package/assets/esri/core/workers/chunks/f454e773505c0eef2f9d.js +0 -1
  315. package/assets/esri/core/workers/chunks/f4861d73c62096f73e48.js +0 -1
  316. package/assets/esri/core/workers/chunks/f70dd16f14279bb7e60d.js +0 -1
  317. package/assets/esri/core/workers/chunks/fa011ad649c05201e92a.js +0 -1
  318. package/views/3d/webgl-engine/lib/TextureCompressionWorker.js +0 -5
  319. package/views/3d/webgl-engine/lib/TextureCompressionWorkerHandle.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as o,onAbort as n,isAborted as l,createAbortError as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import{whenOnce as g}from"../../../core/reactiveUtils.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as u,equals as p,width as f,height as w,copy as x,intersection as y}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as _}from"./interfaces.js";import b from"./SubView3D.js";import{computeImageExportSize as E,createGeometryForExtent as R,createOuterImageGeometry as v}from"./support/overlayImageUtils.js";import{debugFlags as j}from"../support/debugFlags.js";import{OverlayIndex as S}from"../terrain/interfaces.js";import{DirtyOperation as A}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as M}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as D}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as G}from"../webgl-engine/materials/ImageMaterial.js";import{TextureWrapMode as T}from"../../webgl/enums.js";let P=class extends b{constructor(e){super(e),this.drapeSourceType=_.RasterImage,this.updatePolicy=D.SYNC,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}destroy(){}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,O);if(null==r)return;const i=E(e.extent,r,e.resolution);let s=e.pixelRatio*this.view.state.pixelRatio;const{layer:n}=this;if("imageMaxWidth"in n&&null!=n.imageMaxWidth||"imageMaxHeight"in n&&null!=n.imageMaxHeight){const e=n.imageMaxWidth,t=n.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,s*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,s*=e}}const l=this._extents[t];l&&p(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:u(r),imageSize:i,pixelRatio:s},this.suspended||this._fetch(t).catch((e=>{o(e)||a.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new c(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=f(e)/this.maximumDataResolution.x,a=w(e)/this.maximumDataResolution.y,s=i/t.width,o=a/t.height,n=i/r.width,l=a/r.height,m=Math.abs(s-n),h=Math.abs(o-l),g=j.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return m<=g&&h<=g}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:u(i)});const g=this._images[e];g.loadingAbortController=s(g.loadingAbortController);const d=new c(i[0],i[1],i[2],i[3],this._spatialReference);if(0===d.width||0===d.height)return void this._clearImage(e);const p=new AbortController;g.loadingAbortController=p,n(t,(()=>p.abort()));const f=p.signal,w=this._waitFetchReady(f).then((async()=>{const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:f},{height:i,width:a}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(d,a,i,t):this.layer.fetchImage(d,a,i,t):null})).then((e=>{if(l(f))throw a.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),m();return this.processResult(g,e)})).then((()=>{x(g.renderExtent,i)}));g.loadingPromise=w,await this.updatingHandles.addPromise(w.then((async()=>{h(f),await this._createStageObjects(e,g.image,f)})).catch((e=>{throw e&&!o(e)&&a.getLogger(this).error(e),e})).finally((()=>{w===g.loadingPromise&&(g.loadingPromise=null,g.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],A.UPDATE),t.renderGeometry=null);const e=this.view.stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const a=this.view.stage,s=this._images[e],o=()=>{s.texture?.unload(),a.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],A.UPDATE),s.renderGeometry=null)};if(t){const n=new M(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:T.CLAMP_TO_EDGE,t:T.CLAMP_TO_EDGE}});if(await r(this._images[e===S.INNER?S.OUTER:S.INNER].loadingPromise),h(i),o(),await a.schedule((()=>n.load(a.renderView.renderingContext)),i),!n.loaded)return void o();let l;if(a.add(n),s.texture=n,s.material??=new G({texture:n}),s.material.setParameters({texture:n}),e===S.INNER)l=R(s.material,s.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();l=v(s.material,e,s.renderExtent)}s.renderGeometry=new I(l),s.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],A.UPDATE)}else o(),a.remove(s.material),s.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?y(e,r.extent,t):x(t,e)}async _waitFetchReady(e){await g((()=>this.view.stationary),e),h(e)}};P=e([d("esri.views.3d.layers.DrapedSubView3D")],P);const C=P,O=u();export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as o,onAbort as n,isAborted as l,createAbortError as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import{whenOnce as g}from"../../../core/reactiveUtils.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as u,equals as p,width as f,height as w,copy as x,intersection as y}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as _}from"./interfaces.js";import b from"./SubView3D.js";import{computeImageExportSize as E,createGeometryForExtent as R,createOuterImageGeometry as v}from"./support/overlayImageUtils.js";import{debugFlags as j}from"../support/debugFlags.js";import{OverlayIndex as S}from"../terrain/interfaces.js";import{DirtyOperation as A}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as M}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as D}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as G}from"../webgl-engine/materials/ImageMaterial.js";import{TextureWrapMode as T}from"../../webgl/enums.js";let P=class extends b{constructor(e){super(e),this.drapeSourceType=_.RasterImage,this.updatePolicy=D.SYNC,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}destroy(){}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,O);if(null==r)return;const i=E(e.extent,r,e.resolution);let s=e.pixelRatio*this.view.state.pixelRatio;const{layer:n}=this;if("imageMaxWidth"in n&&null!=n.imageMaxWidth||"imageMaxHeight"in n&&null!=n.imageMaxHeight){const e=n.imageMaxWidth,t=n.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,s*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,s*=e}}const l=this._extents[t];l&&p(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:u(r),imageSize:i,pixelRatio:s},this.suspended||this._fetch(t).catch((e=>{o(e)||a.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new c(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=f(e)/this.maximumDataResolution.x,a=w(e)/this.maximumDataResolution.y,s=i/t.width,o=a/t.height,n=i/r.width,l=a/r.height,m=Math.abs(s-n),h=Math.abs(o-l),g=j.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return m<=g&&h<=g}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:u(i)});const g=this._images[e];g.loadingAbortController=s(g.loadingAbortController);const d=new c(i[0],i[1],i[2],i[3],this._spatialReference);if(0===d.width||0===d.height)return void this._clearImage(e);const p=new AbortController;g.loadingAbortController=p,n(t,(()=>p.abort()));const f=p.signal,w=this._waitFetchReady(f).then((async()=>{const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:f},{height:i,width:a}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(d,a,i,t):this.layer.fetchImage(d,a,i,t):null})).then((e=>{if(l(f))throw a.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),m();return this.processResult(g,e)})).then((()=>{x(g.renderExtent,i)}));g.loadingPromise=w,await this.updatingHandles.addPromise(w.then((async()=>{h(f),await this._createStageObjects(e,g.image,f)})).catch((e=>{throw e&&!o(e)&&a.getLogger(this).error(e),e})).finally((()=>{w===g.loadingPromise&&(g.loadingPromise=null,g.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],A.UPDATE),t.renderGeometry=null);const e=this.view.stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const a=this.view.stage,s=this._images[e],o=()=>{s.texture?.unload(),a.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],A.UPDATE),s.renderGeometry=null)};if(t){const n=new M(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:T.CLAMP_TO_EDGE,t:T.CLAMP_TO_EDGE}});if(await r(this._images[e===S.INNER?S.OUTER:S.INNER].loadingPromise),h(i),o(),await a.schedule((()=>n.load(a.renderView.renderingContext)),i),!n.loaded)return void o();let l;if(a.add(n),s.texture=n,s.material??=new G({draped:!0,texture:n}),s.material.setParameters({texture:n}),e===S.INNER)l=R(s.material,s.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();l=v(s.material,e,s.renderExtent)}s.renderGeometry=new I(l),s.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],A.UPDATE)}else o(),a.remove(s.material),s.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?y(e,r.extent,t):x(t,e)}async _waitFetchReady(e){await g((()=>this.view.stationary),e),h(e)}};P=e([d("esri.views.3d.layers.DrapedSubView3D")],P);const C=P,O=u();export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import e from"../../../core/Identifiable.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsProcessor as p}from"./graphics/GraphicsProcessor.js";import{defaultHighlightName as c}from"../../support/HighlightDefaults.js";let a=class extends(e.IdentifiableMixin(s)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.layer=new h,this.suspended=!1}initialize(){this._set("processor",new p({owner:this}))}destroy(){this._set("processor",t(this.processor))}get graphics(){return this.view?.graphics}get loadedGraphics(){return this.graphics}get updating(){return!!this.processor?.updating}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r){return this.processor.getHit(r)}async getHitAsync(r){return this.processor.getHitAsync(r)}whenGraphicBounds(r,s){return this.processor.whenGraphicBounds(r,s)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}highlight(r,s){return this.processor.highlight(r,s?.name??c)}maskOccludee(r){return this.processor.maskOccludee(r)}get test(){return{graphics3DProcessor:this.processor}}};r([o({readOnly:!0})],a.prototype,"graphics",null),r([o()],a.prototype,"loadedGraphics",null),r([o({readOnly:!0})],a.prototype,"updating",null),r([o({constructOnly:!0})],a.prototype,"view",void 0),r([o()],a.prototype,"processor",void 0),r([o({type:Boolean})],a.prototype,"slicePlaneEnabled",void 0),r([o()],a.prototype,"layer",void 0),r([o()],a.prototype,"suspended",void 0),a=r([i("esri.views.3d.layers.GraphicsView3D")],a);class h extends e{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const n=a;export{n as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import s from"../../../core/Identifiable.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsProcessor as p}from"./graphics/GraphicsProcessor.js";import{defaultHighlightName as c}from"../../support/HighlightDefaults.js";let a=class extends(s.IdentifiableMixin(e)){constructor(r){super(r),this.drapeSourcePriorityOffset=0,this.processor=null,this.slicePlaneEnabled=!1,this.layer=new h,this.suspended=!1}initialize(){this._set("processor",new p({owner:this,drapeSourcePriorityOffset:this.drapeSourcePriorityOffset}))}destroy(){this._set("processor",t(this.processor))}get loadedGraphics(){return this.getGraphics()}get updating(){return!!this.processor?.updating}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r){return this.processor.getHit(r)}async getHitAsync(r){return this.processor.getHitAsync(r)}whenGraphicBounds(r,e){return this.processor.whenGraphicBounds(r,e)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}highlight(r,e){return this.processor.highlight(r,e?.name??c)}maskOccludee(r){return this.processor.maskOccludee(r)}get test(){return{graphics3DProcessor:this.processor}}};r([o({constructOnly:!0})],a.prototype,"getGraphics",void 0),r([o()],a.prototype,"loadedGraphics",null),r([o()],a.prototype,"drapeSourcePriorityOffset",void 0),r([o({readOnly:!0})],a.prototype,"updating",null),r([o({constructOnly:!0})],a.prototype,"view",void 0),r([o()],a.prototype,"processor",void 0),r([o({type:Boolean})],a.prototype,"slicePlaneEnabled",void 0),r([o()],a.prototype,"layer",void 0),r([o()],a.prototype,"suspended",void 0),a=r([i("esri.views.3d.layers.GraphicsView3D")],a);class h extends s{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const n=a;export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"./DynamicLayerView3D.js";import s from"./ImagerySubView3D.js";import o from"../../layers/ImageryLayerView.js";let a=class extends(o(i)){constructor(){super(...arguments),this.type="imagery-3d"}_initSubView(){this.subView=new s({layerView:this})}get highlightOptions(){return null}get pixelData(){return null}initialize(){const e=()=>this._updatingHandles.addPromise(this.refreshDebounced());this._updatingHandles.add((()=>this.layer?.exportImageServiceParameters?.version),e),this._updatingHandles.add((()=>this.layer?.renderer),e),this._updatingHandles.add((()=>this.timeExtent),e)}getFetchOptions(){return{timeExtent:this.timeExtent}}highlight(e){throw new Error("Not implemented")}};e([t()],a.prototype,"highlightOptions",null),e([t()],a.prototype,"pixelData",null),a=e([r("esri.views.3d.layers.ImageryLayerView3D")],a);const n=a;export{n as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyHandle as t}from"../../../core/handleUtils.js";import{watch as i,syncAndInitial as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import a from"./DynamicLayerView3D.js";import h from"./ImagerySubView3D.js";import{ImageHighlightHelper3D as l}from"./support/ImageHighlightHelper3D.js";import p from"../../layers/ImageryLayerView.js";let n=class extends(p(a)){constructor(){super(...arguments),this.type="imagery-3d"}_initSubView(){this.subView=new h({layerView:this})}get highlightOptions(){return null}get pixelData(){return null}initialize(){const e=()=>this._updatingHandles.addPromise(this.refreshDebounced());this._updatingHandles.add((()=>this.layer?.exportImageServiceParameters?.version),e),this._updatingHandles.add((()=>this.layer?.renderer),e),this._updatingHandles.add((()=>this.timeExtent),e),this._highlightHelper=new l({view:this.view,layer:this.layer,updatingHandles:this._updatingHandles}),this.addHandles([t(this._highlightHelper),i((()=>this.suspended),(e=>this._highlightHelper.suspended=e),r)])}getFetchOptions(){return{timeExtent:this.timeExtent}}highlight(e,t){return this._highlightHelper.highlight(e,t)}};e([s()],n.prototype,"highlightOptions",null),e([s()],n.prototype,"pixelData",null),n=e([o("esri.views.3d.layers.ImageryLayerView3D")],n);const d=n;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import r from"./DynamicLayerView3D.js";import s from"../../layers/MapImageLayerView.js";import{MapServiceLayerViewHelper as i}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as o}from"../../support/drapedUtils.js";let p=class extends(s(r)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add((()=>this.exportImageVersion),(()=>this._updatingHandles.addPromise(this.refreshDebounced()))),this._popupHighlightHelper=new i({createFetchPopupFeaturesQueryGeometry:(e,t)=>o(e,t,this.view),layerView:this,updatingHandles:this._updatingHandles})}destroy(){this._popupHighlightHelper?.destroy()}fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t)}getFetchOptions(){return{timeExtent:this.timeExtent}}};p=e([t("esri.views.3d.layers.MapImageLayerView3D")],p);const a=p;export{a as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyHandle as t}from"../../../core/handleUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import r from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as s}from"./support/SublayerPopupHighlightHelper3D.js";import o from"../../layers/MapImageLayerView.js";let p=class extends(o(r)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add((()=>this.exportImageVersion),(()=>this._updatingHandles.addPromise(this.refreshDebounced()))),this._popupHighlightHelper=new s({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(t(this._popupHighlightHelper))}fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t)}highlight(e,t){return this._popupHighlightHelper.highlight(e,t)}getFetchOptions(){return{timeExtent:this.timeExtent}}};p=e([i("esri.views.3d.layers.MapImageLayerView3D")],p);const a=p;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import{isIterable as s}from"../../../core/iteratorUtils.js";import{getProjectiveTransform as a}from"../../../core/perspectiveUtils.js";import{debounce as o,isPromiseLike as d}from"../../../core/promiseUtils.js";import{watch as l,on as m,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toExtent as u}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as y}from"../../../layers/support/MediaElementView.js";import{DrapeSourceType as _}from"./interfaces.js";import{LayerView3D as f}from"./LayerView3D.js";import{MediaLayerInteraction as E}from"./support/MediaLayerInteraction.js";import{drapedZ as w}from"../terrain/OverlayRenderer.js";import{Attribute as v}from"../webgl-engine/lib/Attribute.js";import{ContentObjectType as D}from"../webgl-engine/lib/ContentObjectType.js";import{Geometry as b}from"../webgl-engine/lib/Geometry.js";import{DirtyState as R,DirtyOperation as j}from"../webgl-engine/lib/ModelDirtyTypes.js";import{Object3DHighlightStateID as H}from"../webgl-engine/lib/Object3DStateID.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as G}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as A}from"../webgl-engine/lib/UpdatePolicy.js";import{VertexAttribute as M}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as T}from"../webgl-engine/materials/ImageMaterial.js";import x from"../../layers/LayerView.js";import P from"../../layers/MediaLayerView.js";import{defaultHighlightName as S}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as L}from"../../support/layerViewUtils.js";import{TextureWrapMode as V}from"../../webgl/enums.js";let O=class extends(f(P(x))){get interactive(){return this._interaction.enabled}set interactive(e){this._interaction&&(this._interaction.enabled=e)}get selectedElement(){return this._interaction.selectedElement}set selectedElement(e){this._interaction&&(this._interaction.selectedElement=e)}get visibleAtCurrentScale(){return L(this.layer.effectiveScaleRange,this.view.scale)}get usedMemory(){return Array.from(this._renderElements.values()).reduce(((e,t)=>e+(t.getRenderData()?.texture.usedMemory??0)),0)}constructor(e){super(e),this.type="media-3d",this.drapeSourceType=_.Features,this.updatePolicy=A.SYNC,this.ignoresMemoryFactor=!0,this.unloadedMemory=0,this._uidToElement=new Map,this._highlightedElements=new Map,this._elementsInHighlightedId=new Map,this._renderElements=new Map,this._lastDrapingExtent=null,this._update=o((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0);const{view:t,layer:r}=e;this._interaction=new E({view:t,layer:r}),this.addHandles(l((()=>this.interactionOptions),(e=>this._interaction.options=e),h))}initialize(){const{view:e,layer:t}=this;this._renderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const i=()=>this._updateWithLastDrapingExtent();this.addHandles([r((()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(this))),m((()=>t.effectiveSource),"change",i),m((()=>t.effectiveSource),"refresh",i)]),this._updatingHandles.add((()=>this.suspended),i)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}highlight(e,t){const i=new H(t?.name??S),n=s(e)?Array.from(e):[e];this._elementsInHighlightedId.set(i,n);for(const r of n){const e=this._highlightedElements.get(r);e?e.add(i):this._highlightedElements.set(r,new Set([i]));const t=this._renderElements.get(r)?.getRenderData();t&&(t.renderGeometry.geometry.addHighlight(i),this._renderer.modifyGeometries([t.renderGeometry],R.HIGHLIGHT))}return r((()=>{const e=this._elementsInHighlightedId.get(i);if(e){for(const t of e){const e=this._highlightedElements.get(t);if(!e)continue;e.delete(i);const r=this._renderElements.get(t)?.getRenderData();r&&(r.renderGeometry.geometry.removeHighlight(i),this._renderer.modifyGeometries([r.renderGeometry],R.HIGHLIGHT)),0===e.size&&this._highlightedElements.delete(t)}this._elementsInHighlightedId.delete(i)}}))}isUpdating(){return super.isUpdating()||this._interaction.updating}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map((e=>i.queryElements(u(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){this._renderElements.forEach(((t,r)=>{e.has(r)||(this._removeElement(r,t),this.emit("element-render-changed",{element:r}))}))}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderElements.has(t)||this._createRenderElement(t)}_removeElement(e,t){this._destroyRenderData(e,t),this._renderElements.delete(e),this._uidToElement.delete(e.uid),t.handle.remove()}_createRenderElement(e){const t=new y({spatialReference:this.view.spatialReference,element:e}),r=new U(i([this._updatingHandles.add((()=>e.opacity),(e=>r.getRenderData()?.material.setParameters({opacity:e}))),this._updatingHandles.add((()=>t.coords),(()=>{r.data?this._updateGeometry(t,r):this._initializeRenderData(t,r)})),this._updatingHandles.add((()=>e.content),(()=>this._initializeRenderData(t,r))),n(t)]));this._renderElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e,{contentWidth:n,contentHeight:s}=i;if(null==r||null==i.content)return void this._destroyRenderData(i,t);if(t.data)return;const a=this._createTexture(i.content),o=a.load(this.view.stage.renderView.renderingContext),l=()=>{if(!a.loaded)return;this.view.stage.add(a);const e=new T({texture:a,opacity:i.opacity,perspectiveInterpolation:!0}),o=this._getPositionAttributeArray(r),d=[0,0,1,0,1,1,0,1],l=this._getPerspectiveDivideAttributeArray(o,n,s),m=[0,1,2,0,2,3],h=new b(e,[[M.POSITION,new v(o,m,3,!0)],[M.UV0,new v(d,m,2,!0)],[M.PERSPECTIVEDIVIDE,new v(l,m,1,!0)]]),c=new I(h,{layerViewUid:this.uid,graphicUid:i.uid}),p=this._highlightedElements.get(i);p?.forEach((e=>c.geometry.addHighlight(e))),this._renderer.addGeometries([c],j.ADD),t.data=new C(c,a,e),this.emit("element-render-changed",{element:i})};d(o)?(t.data=a,this._updatingHandles.addPromise(o),o.then(l).catch((()=>a.dispose()))):l()}_updateGeometry(e,t){const{coords:r,element:i}=e;if(null==r||null==i.content)return void this._destroyRenderData(i,t);const n=t.getRenderData();if(!n)return;const s=this._getPositionAttributeArray(r);n.renderGeometry.geometry.setAttributeData(M.POSITION,s);const a=this._getPerspectiveDivideAttributeArray(s,i.contentWidth,i.contentHeight);n.renderGeometry.geometry.setAttributeData(M.PERSPECTIVEDIVIDE,a),n.renderGeometry.geometry.invalidateBoundingInfo(),this._renderer.modifyGeometries([n.renderGeometry],R.GEOMETRY),this.emit("element-render-changed",{element:i})}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],w,n[0],n[1],w,i[0],i[1],w,r[0],r[1],w]}_getPerspectiveDivideAttributeArray(e,t,r){a(z,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=z[6]/z[8]*t,n=z[7]/z[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e,t){const r=t.data;if(null==r)return;if(t.data=null,r?.type===D.Texture)return void r.dispose();const i=r.texture;i.unload(),this.view.stage.remove(i),this._renderer.removeGeometries([r.renderGeometry],j.REMOVE),this.emit("element-render-changed",{element:e})}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new G(e,{wrap:{s:V.CLAMP_TO_EDGE,t:V.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.requestRender()})}get test(){}};e([c({readOnly:!0})],O.prototype,"type",void 0),e([c()],O.prototype,"layer",void 0),e([c()],O.prototype,"interactive",null),e([c()],O.prototype,"selectedElement",null),e([c({readOnly:!0})],O.prototype,"visibleAtCurrentScale",null),O=e([p("esri.views.3d.layers.MediaLayerView3D")],O);const z=g();class U{constructor(e){this.handle=e}getRenderData(){return this.data?.type===D.Texture?null:this.data}}class C{constructor(e,t,r){this.renderGeometry=e,this.texture=t,this.material=r,this.type="RenderData"}}const W=O;export{W as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import{isIterable as s}from"../../../core/iteratorUtils.js";import{getProjectiveTransform as a}from"../../../core/perspectiveUtils.js";import{debounce as o,isPromiseLike as d}from"../../../core/promiseUtils.js";import{watch as l,on as m,syncAndInitial as h}from"../../../core/reactiveUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toExtent as u}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as y}from"../../../layers/support/MediaElementView.js";import{DrapeSourceType as _}from"./interfaces.js";import{LayerView3D as f}from"./LayerView3D.js";import{MediaLayerInteraction as E}from"./support/MediaLayerInteraction.js";import{drapedZ as w}from"../terrain/OverlayRenderer.js";import{Attribute as v}from"../webgl-engine/lib/Attribute.js";import{ContentObjectType as D}from"../webgl-engine/lib/ContentObjectType.js";import{Geometry as b}from"../webgl-engine/lib/Geometry.js";import{DirtyState as R,DirtyOperation as j}from"../webgl-engine/lib/ModelDirtyTypes.js";import{Object3DHighlightStateID as H}from"../webgl-engine/lib/Object3DStateID.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as G}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as A}from"../webgl-engine/lib/UpdatePolicy.js";import{VertexAttribute as M}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as T}from"../webgl-engine/materials/ImageMaterial.js";import x from"../../layers/LayerView.js";import P from"../../layers/MediaLayerView.js";import{defaultHighlightName as S}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as L}from"../../support/layerViewUtils.js";import{TextureWrapMode as V}from"../../webgl/enums.js";let O=class extends(f(P(x))){get interactive(){return this._interaction.enabled}set interactive(e){this._interaction&&(this._interaction.enabled=e)}get selectedElement(){return this._interaction.selectedElement}set selectedElement(e){this._interaction&&(this._interaction.selectedElement=e)}get visibleAtCurrentScale(){return L(this.layer.effectiveScaleRange,this.view.scale)}get usedMemory(){return Array.from(this._renderElements.values()).reduce(((e,t)=>e+(t.getRenderData()?.texture.usedMemory??0)),0)}constructor(e){super(e),this.type="media-3d",this.drapeSourceType=_.Features,this.updatePolicy=A.SYNC,this.ignoresMemoryFactor=!0,this.unloadedMemory=0,this._uidToElement=new Map,this._highlightedElements=new Map,this._elementsInHighlightedId=new Map,this._renderElements=new Map,this._lastDrapingExtent=null,this._update=o((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0);const{view:t,layer:r}=e;this._interaction=new E({view:t,layer:r}),this.addHandles(l((()=>this.interactionOptions),(e=>this._interaction.options=e),h))}initialize(){const{view:e,layer:t}=this;this._renderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const i=()=>this._updateWithLastDrapingExtent();this.addHandles([r((()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(this))),m((()=>t.effectiveSource),"change",i),m((()=>t.effectiveSource),"refresh",i)]),this._updatingHandles.add((()=>this.suspended),i)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}highlight(e,t){const i=new H(t?.name??S),n=s(e)?Array.from(e):[e];this._elementsInHighlightedId.set(i,n);for(const r of n){const e=this._highlightedElements.get(r);e?e.add(i):this._highlightedElements.set(r,new Set([i]));const t=this._renderElements.get(r)?.getRenderData();t&&(t.renderGeometry.geometry.addHighlight(i),this._renderer.modifyGeometries([t.renderGeometry],R.HIGHLIGHT))}return r((()=>{const e=this._elementsInHighlightedId.get(i);if(e){for(const t of e){const e=this._highlightedElements.get(t);if(!e)continue;e.delete(i);const r=this._renderElements.get(t)?.getRenderData();r&&(r.renderGeometry.geometry.removeHighlight(i),this._renderer.modifyGeometries([r.renderGeometry],R.HIGHLIGHT)),0===e.size&&this._highlightedElements.delete(t)}this._elementsInHighlightedId.delete(i)}}))}isUpdating(){return super.isUpdating()||this._interaction.updating}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map((e=>i.queryElements(u(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){this._renderElements.forEach(((t,r)=>{e.has(r)||(this._removeElement(r,t),this.emit("element-render-changed",{element:r}))}))}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderElements.has(t)||this._createRenderElement(t)}_removeElement(e,t){this._destroyRenderData(e,t),this._renderElements.delete(e),this._uidToElement.delete(e.uid),t.handle.remove()}_createRenderElement(e){const t=new y({spatialReference:this.view.spatialReference,element:e}),r=new U(i([this._updatingHandles.add((()=>e.opacity),(e=>r.getRenderData()?.material.setParameters({opacity:e}))),this._updatingHandles.add((()=>t.coords),(()=>{r.data?this._updateGeometry(t,r):this._initializeRenderData(t,r)})),this._updatingHandles.add((()=>e.content),(()=>this._initializeRenderData(t,r))),n(t)]));this._renderElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e,{contentWidth:n,contentHeight:s}=i;if(null==r||null==i.content)return void this._destroyRenderData(i,t);if(t.data)return;const a=this._createTexture(i.content),o=a.load(this.view.stage.renderView.renderingContext),l=()=>{if(!a.loaded)return;this.view.stage.add(a);const e=new T({draped:!0,texture:a,opacity:i.opacity,perspectiveInterpolation:!0}),o=this._getPositionAttributeArray(r),d=[0,0,1,0,1,1,0,1],l=this._getPerspectiveDivideAttributeArray(o,n,s),m=[0,1,2,0,2,3],h=new b(e,[[M.POSITION,new v(o,m,3,!0)],[M.UV0,new v(d,m,2,!0)],[M.PERSPECTIVEDIVIDE,new v(l,m,1,!0)]]),c=new I(h,{layerViewUid:this.uid,graphicUid:i.uid}),p=this._highlightedElements.get(i);p?.forEach((e=>c.geometry.addHighlight(e))),this._renderer.addGeometries([c],j.ADD),t.data=new C(c,a,e),this.emit("element-render-changed",{element:i})};d(o)?(t.data=a,this._updatingHandles.addPromise(o),o.then(l).catch((()=>a.dispose()))):l()}_updateGeometry(e,t){const{coords:r,element:i}=e;if(null==r||null==i.content)return void this._destroyRenderData(i,t);const n=t.getRenderData();if(!n)return;const s=this._getPositionAttributeArray(r);n.renderGeometry.geometry.setAttributeData(M.POSITION,s);const a=this._getPerspectiveDivideAttributeArray(s,i.contentWidth,i.contentHeight);n.renderGeometry.geometry.setAttributeData(M.PERSPECTIVEDIVIDE,a),n.renderGeometry.geometry.invalidateBoundingInfo(),this._renderer.modifyGeometries([n.renderGeometry],R.GEOMETRY),this.emit("element-render-changed",{element:i})}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],w,n[0],n[1],w,i[0],i[1],w,r[0],r[1],w]}_getPerspectiveDivideAttributeArray(e,t,r){a(z,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=z[6]/z[8]*t,n=z[7]/z[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e,t){const r=t.data;if(null==r)return;if(t.data=null,r?.type===D.Texture)return void r.dispose();const i=r.texture;i.unload(),this.view.stage.remove(i),this._renderer.removeGeometries([r.renderGeometry],j.REMOVE),this.emit("element-render-changed",{element:e})}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new G(e,{wrap:{s:V.CLAMP_TO_EDGE,t:V.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.requestRender()})}get test(){}};e([c({readOnly:!0})],O.prototype,"type",void 0),e([c()],O.prototype,"layer",void 0),e([c()],O.prototype,"interactive",null),e([c()],O.prototype,"selectedElement",null),e([c({readOnly:!0})],O.prototype,"visibleAtCurrentScale",null),O=e([p("esri.views.3d.layers.MediaLayerView3D")],O);const z=g();class U{constructor(e){this.handle=e}getRenderData(){return this.data?.type===D.Texture?null:this.data}}class C{constructor(e,t,r){this.renderGeometry=e,this.texture=t,this.material=r,this.type="RenderData"}}const W=O;export{W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectWithoutEngine as s}from"../../../geometry/projection.js";import{LayerView3D as o}from"./LayerView3D.js";import{TiledLayerView3D as l}from"./TiledLayerView3D.js";import{fetchTile as a}from"./support/fetchTile.js";import p from"../../layers/LayerView.js";import n from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as m,MapServiceLayerViewHelper as u}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as h}from"../../support/drapedUtils.js";let c=class extends(n(l(o(p)))){constructor(){super(...arguments),this.type="tile-3d",this._popupHighlightHelper=null}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,r=this.layer.tileInfo?.spatialReference;if(null==e||null==r||!s(e,r)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}m(this,this.layer)&&(this._popupHighlightHelper=new u({createFetchPopupFeaturesQueryGeometry:(e,t)=>h(e,t,this.view),layerView:this,updatingHandles:this._updatingHandles})),this._addTilingSchemeMatchPromise()}destroy(){this._popupHighlightHelper?.destroy()}async fetchTile(e,t){return a(this,e,t)}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtLocation(e,t)??[]}async doRefresh(){this.suspended||this.emit("data-changed")}};e([r()],c.prototype,"imageFormatIsOpaque",null),e([r()],c.prototype,"hasMixedImageFormats",null),e([r()],c.prototype,"layer",void 0),e([r()],c.prototype,"tileInfo",null),c=e([i("esri.views.3d.layers.TileLayerView3D")],c);const f=c;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyHandle as r,makeHandle as i}from"../../../core/handleUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectWithoutEngine as l}from"../../../geometry/projection.js";import{LayerView3D as a}from"./LayerView3D.js";import{TiledLayerView3D as p}from"./TiledLayerView3D.js";import{fetchTile as n}from"./support/fetchTile.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import u from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as c}from"../../layers/support/MapServiceLayerViewHelper.js";let f=class extends(u(p(a(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,r=this.layer.tileInfo?.spatialReference;if(null==e||null==r||!l(e,r)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(c(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(r(e))}this._addTilingSchemeMatchPromise()}async fetchTile(e,t){return n(this,e,t)}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtLocation(e,t)??[]}highlight(e,t){return this._popupHighlightHelper?.highlight(e,t)??i()}async doRefresh(){this.suspended||this.emit("data-changed")}};e([s()],f.prototype,"imageFormatIsOpaque",null),e([s()],f.prototype,"hasMixedImageFormats",null),e([s()],f.prototype,"layer",void 0),e([s()],f.prototype,"tileInfo",null),f=e([o("esri.views.3d.layers.TileLayerView3D")],f);const y=f;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{defaultAcceptedFormats as t}from"../../../../symbols/support/webStyleAcceptedFormats.js";import{emptySymbolComplexity as r}from"./defaultSymbolComplexity.js";import{ApplyRendererDiffResult as s,FastUpdateStatus as e}from"./interfaces.js";import{Loadable as i}from"./Loadable.js";import{getSymbolMemorySize as o}from"./symbolMemory.js";class l extends i{constructor(t,r,s){super(r),this.symbol=t,this._convert=s,this.symbologySnappingSupported=!1,this.graphics3DSymbol=null,this.referenced=0}getSymbolLayerSize(t){return null!=this.graphics3DSymbol?this.graphics3DSymbol.getSymbolLayerSize(t):null}get symbolLayers(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.symbolLayers:[]}get extentPadding(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.extentPadding:0}async doLoad(r){const s=await this.symbol.fetchSymbol({signal:r,acceptedFormats:t});s.id=this.symbol.id,this.graphics3DSymbol=this._convert(s),null!=this.graphics3DSymbol&&await this.graphics3DSymbol.load()}createGraphics3DGraphic(t){return null!=this.graphics3DSymbol?this.graphics3DSymbol.createGraphics3DGraphic(t,this):null}get complexity(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.complexity:r}globalPropertyChanged(t,r){return null!=this.graphics3DSymbol&&this.graphics3DSymbol.globalPropertyChanged(t,r)}applyRendererDiff(t,r){return null!=this.graphics3DSymbol?this.graphics3DSymbol.applyRendererDiff(t,r):s.RecreateSymbol}prepareSymbolPatch(t){null!=this.graphics3DSymbol&&this.graphics3DSymbol.prepareSymbolPatch(t)}updateGeometry(t,r){return null!=this.graphics3DSymbol&&this.graphics3DSymbol.updateGeometry(t,r)}updateTransform(t,r,s,e){return this.graphics3DSymbol?.updateTransform(t,r,s,e)??!1}onRemoveGraphic(){}updateFocus(t,r){}getFastUpdateStatus(){return this.graphics3DSymbol?.getFastUpdateStatus()??e.Loading}destroy(){null!=this.graphics3DSymbol&&this.graphics3DSymbol.destroy(),this.graphics3DSymbol=void 0,super.destroy()}get destroyed(){return void 0===this.graphics3DSymbol}get cachedMemory(){return o(this)}}export{l as Graphics3DWebStyleSymbol};
5
+ import{emptySymbolComplexity as t}from"./defaultSymbolComplexity.js";import{ApplyRendererDiffResult as r,FastUpdateStatus as s}from"./interfaces.js";import{Loadable as e}from"./Loadable.js";import{getSymbolMemorySize as i}from"./symbolMemory.js";class o extends e{constructor(t,r,s){super(r),this.symbol=t,this._convert=s,this.symbologySnappingSupported=!1,this.graphics3DSymbol=null,this.referenced=0}getSymbolLayerSize(t){return null!=this.graphics3DSymbol?this.graphics3DSymbol.getSymbolLayerSize(t):null}get symbolLayers(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.symbolLayers:[]}get extentPadding(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.extentPadding:0}async doLoad(t){const r=await this.symbol.fetchSymbol({signal:t});r.id=this.symbol.id,this.graphics3DSymbol=this._convert(r),null!=this.graphics3DSymbol&&await this.graphics3DSymbol.load()}createGraphics3DGraphic(t){return null!=this.graphics3DSymbol?this.graphics3DSymbol.createGraphics3DGraphic(t,this):null}get complexity(){return null!=this.graphics3DSymbol?this.graphics3DSymbol.complexity:t}globalPropertyChanged(t,r){return null!=this.graphics3DSymbol&&this.graphics3DSymbol.globalPropertyChanged(t,r)}applyRendererDiff(t,s){return null!=this.graphics3DSymbol?this.graphics3DSymbol.applyRendererDiff(t,s):r.RecreateSymbol}prepareSymbolPatch(t){null!=this.graphics3DSymbol&&this.graphics3DSymbol.prepareSymbolPatch(t)}updateGeometry(t,r){return null!=this.graphics3DSymbol&&this.graphics3DSymbol.updateGeometry(t,r)}updateTransform(t,r,s,e){return this.graphics3DSymbol?.updateTransform(t,r,s,e)??!1}onRemoveGraphic(){}updateFocus(t,r){}getFastUpdateStatus(){return this.graphics3DSymbol?.getFastUpdateStatus()??s.Loading}destroy(){null!=this.graphics3DSymbol&&this.graphics3DSymbol.destroy(),this.graphics3DSymbol=void 0,super.destroy()}get destroyed(){return void 0===this.graphics3DSymbol}get cachedMemory(){return i(this)}}export{o as Graphics3DWebStyleSymbol};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import e from"../../../../core/Accessor.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{watch as o,sync as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as h}from"../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../layers/Layer.js";import{hydrateGraphic as y}from"../../../../layers/graphics/hydratedFeatures.js";import{getRenderingInfo as g,getRenderingInfoAsync as m}from"../../../../renderers/support/renderingInfoUtils.js";import f from"../../../../rest/support/Query.js";import{DrapeSourceType as b}from"../interfaces.js";import{suspendResumeExtentOptimism as C}from"./constants.js";import{Graphics3DCore as w}from"./Graphics3DCore.js";import{Graphics3DElevationAlignment as j}from"./Graphics3DElevationAlignment.js";import{Graphics3DFrustumVisibility as V}from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as v}from"./Graphics3DObjectStates.js";import{Graphics3DScaleVisibility as G}from"./Graphics3DScaleVisibility.js";import{enlargeExtent as E}from"./graphicUtils.js";import{normalizeHighlightTargetExceptQuery as S}from"../support/highlightUtils.js";import{UpdatePolicy as _}from"../../webgl-engine/lib/UpdatePolicy.js";let x=class extends e{constructor(i){super(i),this.type="graphics-3d",this.graphicsCore=null,this.drapeSourceType=b.Features,this.scaleVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this._suspendResumeExtent=null,this._updatingHandles=new u}initialize(){const{layer:i}=this,t="effectiveScaleRange"in i?i:null,e=this.scaleVisibilityEnabled&&null!=t,r=new w({owner:this,layer:this.owner.layer,preferredUpdatePolicy:_.SYNC,graphicSymbolSupported:!0,componentFactories:{elevationAlignment:(i,t)=>new j({graphicsCoreOwner:this,graphicsCore:i,queryGraphicUIDsInExtent:t,elevationProvider:this.view.elevationProvider}),scaleVisibility:e?(i,e)=>new G({graphicsCoreOwner:this,layer:t,queryGraphicUIDsInExtent:e,graphicsCore:i,basemapTerrain:this.owner.view.basemapTerrain}):null,objectStates:i=>new v(i)}});if(this._set("graphicsCore",r),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new V({graphicsCoreOwner:this})),"fullOpacity"in this.owner){const i=this.owner;this._updatingHandles.add((()=>i.fullOpacity),(()=>this.graphicsCore.opacityChange()))}if("elevationInfo"in i){const t=i;this._updatingHandles.add((()=>t.elevationInfo),((i,t)=>{h(i,t)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}))}this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){try{await this.graphicsCore.initializePromise}catch(i){if(n(i))return;throw i}this.destroyed||(this.addHandles(o((()=>this.view.clippingArea),(()=>this._updateClippingExtent()),a)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",s(this.frustumVisibility)),this._set("graphicsCore",s(this.graphicsCore))}get layer(){return this.owner.layer}get layerViewUid(){return this.owner.uid}get view(){return this.owner.view}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get scaleVisibilitySuspended(){return!(null==this.scaleVisibility||!this.scaleVisibility.suspended)}get frustumVisibilitySuspended(){return null!=this.frustumVisibility&&this.frustumVisibility.suspended}get suspended(){return this.owner.suspended??!1}get updating(){return!!(this.graphicsCore?.updating||null!=this.scaleVisibility&&this.scaleVisibility.updating||null!=this.frustumVisibility&&this.frustumVisibility.updating||this._updatingHandles.updating)}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity??1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(i){this.graphicsCore.notifyGraphicGeometryChanged(i)}notifyGraphicVisibilityChanged(i){this.graphicsCore.notifyGraphicVisibilityChanged(i)}getRenderingInfo(i,t,e){const r=g(i,{renderer:t,arcade:e});if(r?.color){const i=r.color;i[0]=i[0]/255,i[1]=i[1]/255,i[2]=i[2]/255}return r}getRenderingInfoAsync(i,t,e,r){return m(i,{renderer:t,arcade:e,...r})}getHit(i){if(this.owner.loadedGraphics){const t=this.owner.loadedGraphics.find((t=>t.uid===i));if(t){const i=this.layer instanceof d?this.layer:null,e=y(t,i);return{type:"graphic",graphic:e,layer:e.layer}}}return null}async getHitAsync(i){return this.getHit(i)}whenGraphicBounds(i,t){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(i,t):Promise.reject()}computeAttachmentOrigin(i,t){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(i,t):null}getSymbolLayerSize(i,t){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(i,t):null}maskOccludee(i){const t=this.graphicsCore?.objectStates;if(!t)return r();const{set:e,handle:s}=t.acquireOccludeeSet(null);return t.setUid(e,i.uid),s}highlight(i,e){const r=this.graphicsCore?.objectStates;if(!r)return O;if(i instanceof f)return O;const s=S(i);if(0===s.length)return O;if(s[0]instanceof t){const i=s.map((i=>i.uid)),{set:t,handle:n}=r.acquireHighlightSet(e,null);return r.setUids(t,i),n}if("number"==typeof s[0]){const i=s,{set:t,handle:n}=r.acquireHighlightSet(e,null);return r.setObjectIds(t,i),n}return O}_setupSuspendResumeExtent(){const{scaleVisibility:i,frustumVisibility:t}=this;if(null==i&&null==t)return;const e=({computedExtent:e,extentPadding:r})=>{this._suspendResumeExtent=E(e,this._suspendResumeExtent,C,r),null!=i&&i.setExtent(this._suspendResumeExtent),null!=t&&t.setExtent(this._suspendResumeExtent)};this.addHandles(o((()=>({computedExtent:this.graphicsCore?.computedExtent,extentPadding:this.graphicsCore?.extentPadding})),(i=>e(i)),l))}_updateClippingExtent(){const i=this.view.clippingArea;this.graphicsCore.setClippingExtent(i,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}};i([p()],x.prototype,"type",void 0),i([p({constructOnly:!0})],x.prototype,"owner",void 0),i([p()],x.prototype,"layer",null),i([p()],x.prototype,"layerViewUid",null),i([p()],x.prototype,"view",null),i([p({constructOnly:!0})],x.prototype,"graphicsCore",void 0),i([p()],x.prototype,"scaleVisibility",null),i([p({constructOnly:!0})],x.prototype,"frustumVisibility",void 0),i([p()],x.prototype,"elevationAlignment",null),i([p()],x.prototype,"scaleVisibilitySuspended",null),i([p({readOnly:!0})],x.prototype,"frustumVisibilitySuspended",null),i([p()],x.prototype,"suspended",null),i([p({readOnly:!0})],x.prototype,"updating",null),i([p()],x.prototype,"loadedGraphics",null),i([p()],x.prototype,"fullOpacity",null),i([p()],x.prototype,"slicePlaneEnabled",null),i([p()],x.prototype,"drapeSourceType",void 0),i([p()],x.prototype,"updatePolicy",null),i([p({constructOnly:!0})],x.prototype,"scaleVisibilityEnabled",void 0),i([p({constructOnly:!0})],x.prototype,"frustumVisibilityEnabled",void 0),i([p()],x.prototype,"initializePromise",void 0),x=i([c("esri.views.3d.layers.graphics.GraphicsProcessor")],x);const O=r();export{x as GraphicsProcessor};
5
+ import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import e from"../../../../core/Accessor.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{isAbortError as n}from"../../../../core/promiseUtils.js";import{watch as o,sync as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as h}from"../../../../core/accessorSupport/diffUtils.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import d from"../../../../layers/Layer.js";import{hydrateGraphic as y}from"../../../../layers/graphics/hydratedFeatures.js";import{getRenderingInfo as g,getRenderingInfoAsync as m}from"../../../../renderers/support/renderingInfoUtils.js";import f from"../../../../rest/support/Query.js";import{DrapeSourceType as b}from"../interfaces.js";import{suspendResumeExtentOptimism as C}from"./constants.js";import{Graphics3DCore as w}from"./Graphics3DCore.js";import{Graphics3DElevationAlignment as j}from"./Graphics3DElevationAlignment.js";import{Graphics3DFrustumVisibility as V}from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as v}from"./Graphics3DObjectStates.js";import{Graphics3DScaleVisibility as G}from"./Graphics3DScaleVisibility.js";import{enlargeExtent as S}from"./graphicUtils.js";import{normalizeHighlightTargetExceptQuery as E}from"../support/highlightUtils.js";import{UpdatePolicy as O}from"../../webgl-engine/lib/UpdatePolicy.js";let _=class extends e{constructor(i){super(i),this.drapeSourcePriorityOffset=0,this.type="graphics-3d",this.graphicsCore=null,this.drapeSourceType=b.Features,this.scaleVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this._suspendResumeExtent=null,this._updatingHandles=new u}initialize(){const{layer:i}=this,t="effectiveScaleRange"in i?i:null,e=this.scaleVisibilityEnabled&&null!=t,r=new w({owner:this,layer:this.owner.layer,preferredUpdatePolicy:O.SYNC,graphicSymbolSupported:!0,componentFactories:{elevationAlignment:(i,t)=>new j({graphicsCoreOwner:this,graphicsCore:i,queryGraphicUIDsInExtent:t,elevationProvider:this.view.elevationProvider}),scaleVisibility:e?(i,e)=>new G({graphicsCoreOwner:this,layer:t,queryGraphicUIDsInExtent:e,graphicsCore:i,basemapTerrain:this.owner.view.basemapTerrain}):null,objectStates:i=>new v(i)}});if(this._set("graphicsCore",r),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new V({graphicsCoreOwner:this})),"fullOpacity"in this.owner){const i=this.owner;this._updatingHandles.add((()=>i.fullOpacity),(()=>this.graphicsCore.opacityChange()))}if("elevationInfo"in i){const t=i;this._updatingHandles.add((()=>t.elevationInfo),((i,t)=>{h(i,t)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}))}this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){try{await this.graphicsCore.initializePromise}catch(i){if(n(i))return;throw i}this.destroyed||(this.addHandles(o((()=>this.view.clippingArea),(()=>this._updateClippingExtent()),a)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",s(this.frustumVisibility)),this._set("graphicsCore",s(this.graphicsCore))}get layer(){return this.owner.layer}get layerViewUid(){return this.owner.uid}get view(){return this.owner.view}get scaleVisibility(){return this.graphicsCore?.scaleVisibility}get elevationAlignment(){return this.graphicsCore?.elevationAlignment}get scaleVisibilitySuspended(){return!(null==this.scaleVisibility||!this.scaleVisibility.suspended)}get frustumVisibilitySuspended(){return null!=this.frustumVisibility&&this.frustumVisibility.suspended}get suspended(){return this.owner.suspended??!1}get updating(){return!!(this.graphicsCore?.updating||null!=this.scaleVisibility&&this.scaleVisibility.updating||null!=this.frustumVisibility&&this.frustumVisibility.updating||this._updatingHandles.updating)}get graphics3DGraphics(){return this.graphicsCore?.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.graphicsCore?.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity??1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(i){this.graphicsCore.notifyGraphicGeometryChanged(i)}notifyGraphicVisibilityChanged(i){this.graphicsCore.notifyGraphicVisibilityChanged(i)}getRenderingInfo(i,t,e){const r=g(i,{renderer:t,arcade:e});if(r?.color){const i=r.color;i[0]=i[0]/255,i[1]=i[1]/255,i[2]=i[2]/255}return r}getRenderingInfoAsync(i,t,e,r){return m(i,{renderer:t,arcade:e,...r})}getHit(i){if(this.owner.loadedGraphics){const t=this.owner.loadedGraphics.find((t=>t.uid===i));if(t){const i=this.layer instanceof d?this.layer:null,e=y(t,i);return{type:"graphic",graphic:e,layer:e.layer}}}return null}async getHitAsync(i){return this.getHit(i)}whenGraphicBounds(i,t){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(i,t):Promise.reject()}computeAttachmentOrigin(i,t){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(i,t):null}getSymbolLayerSize(i,t){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(i,t):null}maskOccludee(i){const t=this.graphicsCore?.objectStates;if(!t)return r();const{set:e,handle:s}=t.acquireOccludeeSet(null);return t.setUid(e,i.uid),s}highlight(i,e){const r=this.graphicsCore?.objectStates;if(!r)return x;if(i instanceof f)return x;const s=E(i);if(0===s.length)return x;if(s[0]instanceof t){const i=s.map((i=>i.uid)),{set:t,handle:n}=r.acquireHighlightSet(e,null);return r.setUids(t,i),n}if("number"==typeof s[0]){const i=s,{set:t,handle:n}=r.acquireHighlightSet(e,null);return r.setObjectIds(t,i),n}return x}_setupSuspendResumeExtent(){const{scaleVisibility:i,frustumVisibility:t}=this;if(null==i&&null==t)return;const e=({computedExtent:e,extentPadding:r})=>{this._suspendResumeExtent=S(e,this._suspendResumeExtent,C,r),null!=i&&i.setExtent(this._suspendResumeExtent),null!=t&&t.setExtent(this._suspendResumeExtent)};this.addHandles(o((()=>({computedExtent:this.graphicsCore?.computedExtent,extentPadding:this.graphicsCore?.extentPadding})),(i=>e(i)),l))}_updateClippingExtent(){const i=this.view.clippingArea;this.graphicsCore.setClippingExtent(i,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}};i([p()],_.prototype,"drapeSourcePriorityOffset",void 0),i([p()],_.prototype,"type",void 0),i([p({constructOnly:!0})],_.prototype,"owner",void 0),i([p()],_.prototype,"layer",null),i([p()],_.prototype,"layerViewUid",null),i([p()],_.prototype,"view",null),i([p({constructOnly:!0})],_.prototype,"graphicsCore",void 0),i([p()],_.prototype,"scaleVisibility",null),i([p({constructOnly:!0})],_.prototype,"frustumVisibility",void 0),i([p()],_.prototype,"elevationAlignment",null),i([p()],_.prototype,"scaleVisibilitySuspended",null),i([p({readOnly:!0})],_.prototype,"frustumVisibilitySuspended",null),i([p()],_.prototype,"suspended",null),i([p({readOnly:!0})],_.prototype,"updating",null),i([p()],_.prototype,"loadedGraphics",null),i([p()],_.prototype,"fullOpacity",null),i([p()],_.prototype,"slicePlaneEnabled",null),i([p()],_.prototype,"drapeSourceType",void 0),i([p()],_.prototype,"updatePolicy",null),i([p({constructOnly:!0})],_.prototype,"scaleVisibilityEnabled",void 0),i([p({constructOnly:!0})],_.prototype,"frustumVisibilityEnabled",void 0),i([p()],_.prototype,"initializePromise",void 0),_=i([c("esri.views.3d.layers.graphics.GraphicsProcessor")],_);const x=r();export{_ as GraphicsProcessor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{disposeMaybe as t}from"../../../../core/maybe.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,h as a,v as l,f as h,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as m,offset as p,contains as g,containsPoint as _,set as f,positiveInfinity as P,equals as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as x}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as R}from"./PointCloudHighlights.js";import{isDepth as z,ShaderOutput as A,isColorOrColorEmission as j}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as y}from"../../webgl-engine/effects/RenderPlugin.js";import{Default3D as I}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as v}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as E,StoreResults as L}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{RenderSlot as O}from"../../webgl-engine/lib/RenderSlot.js";import{VertexArrayObject as q}from"../../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as T}from"../../webgl-engine/lib/VertexAttribute.js";import{P as M,g as N}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as F}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as H}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{BufferObject as V}from"../../../webgl/BufferObject.js";import{DataType as U,PrimitiveType as B,Usage as C}from"../../../webgl/enums.js";import{VertexElementDescriptor as W}from"../../../webgl/VertexElementDescriptor.js";const D=new Map([["positions",[new W(T.POSITION,3,U.FLOAT,0,12)]],["colors",[new W(T.COLOR,3,U.UNSIGNED_BYTE,0,3,!0)]]]);let k=class extends y{constructor(e){super(e),this.type=E.PCL,this.isGround=!1,this._passParameters=new M,this._highlights=new R({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.produces=new Map([[O.OPAQUE_MATERIAL,e=>!(z(e)||e===A.Highlight&&this._highlights.empty)],[O.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>z(e)]]),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new H,this._nodes=new s}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const r=d(),f=d(),P=d(),b=d(),R=x(),z=e.camera.perScreenPixelRatio/2,A=e.camera.near;n(f,i,s);const j=1/o(f);a(f,f,j),l(P,f),u(R,f[0],f[1],f[2],-h(f,s));const y=new J,I=new J,E=new Array,O=m(),q=m(this._passParameters.clipBox);p(q,-s[0],-s[1],-s[2],q),this._nodes.forAll((o=>{const a=o.splatSize*this._passParameters.scaleFactor;let l=o.obb.minimumDistancePlane(R),d=o.obb.maximumDistancePlane(R);l-=Q(a,l+A,this._passParameters,z,o.isLeaf),d-=Q(a,d+A,this._passParameters,z,o.isLeaf);const u=d<0,m=null!=y.dist&&null!=I.dist&&y.dist<l*j&&I.dist>d*j;if(u||m)return;const x=G(a,d+A,this._passParameters,z,o.isLeaf);if(!o.obb.intersectRay(s,f,x))return;const S=x*x;o.obb.toAaBoundingBox(O),p(O,-s[0],-s[1],-s[2],O);const w=!g(q,O);n(b,o.origin,s);const v=o.coordinates.length/3;for(let n=0;n<v;n++){if(r[0]=b[0]+o.coordinates[3*n],r[1]=b[1]+o.coordinates[3*n+1],r[2]=b[2]+o.coordinates[3*n+2],w&&!_(q,r))continue;const l=h(r,f),d=c(r)-l*l;if(d>S)continue;let u=l+A;const m=Q(a,u,this._passParameters,z,o.isLeaf);if(l-m<0)continue;u-=m;const p=G(a,u,this._passParameters,z,o.isLeaf);if(d>p*p)continue;const g=(l-m)*j,x=e=>(e.point=Y(o,n,e.point),e.dist=g,e.normal=P,e.node=o,e.pointId=n,e.layerViewUid=this.layerViewUid,e);if((null==y.dist||g<y.dist)&&(null==t||t(s,i,g))&&x(y),e.options.store!==L.MIN&&(null==I.dist||g>I.dist)&&(null==t||t(s,i,g))&&x(I),e.options.store===L.ALL&&(null==t||t(s,i,g))){const e=new J;E.push(x(e))}}}));const T=e=>{const{layerViewUid:t,node:s,pointId:i}=e;return new w(e.point,t,i,(()=>this.createGraphic(s,i,e.point)))},M=(e,t)=>{const s=T(t);e.set(this.type,s,t.dist,t.normal)};if(K(y)){const t=e.results.min;(null==t.dist||y.dist<t.dist)&&M(t,y)}if(K(I)&&e.options.store!==L.MIN){const t=e.results.max;(null==t.dist||I.dist>t.dist)&&M(t,I)}if(e.options.store===L.ALL){const t=S(s,i);for(const s of E){const i=v(t);M(i,s),e.results.all.push(i)}}}acquireTechniques(e){return 0!==this._nodes.length&&(j(e.output)||z(e.output)&&e.bind.slot===O.OPAQUE_MATERIAL_WITHOUT_NORMALS||e.output===A.Highlight)?(this._nodes.forAll((t=>this._initNode(e,t))),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.output=e.output,this._context.techniques.get(F,this._configuration)):null}render(e,t){const{rctx:s,bind:i,output:r}=e,n=s.bindTechnique(t,i,this._passParameters),o=r===A.Highlight,a=i.highlight?.name??null;o&&!a||this._nodes.forAll((t=>{0===t.coordinates.length||o&&!t.highlightMap.has(a)||(n.bindDraw(i,this._passParameters,t),s.bindVAO(t.vao),o?this._renderHighlightFragments(e,t):s.drawArrays(B.POINTS,0,t.coordinates.length/3))}))}_renderHighlightFragments(e,t){const{highlightMap:s}=t,{rctx:i,bind:r}=e,{highlight:n}=r;if(!n)return;const o=n.name,a=s.get(o);if(!a||0===a.length)return;const{highlightOrderMap:l,highlightLevel:h}=r;if(null==h)return;for(const g of s.keys())if(g!==o){const e=l.get(g);if(void 0!==e&&e>h)return}let c=0,d=a[0].componentIndex,u=d+1;const m=()=>{for(;c<a.length&&a[c].id.highlightName!==o;)d=a[c].componentIndex,++c;u=d+1};m();const p=(e,t)=>{const s=t-e;s>0&&i.drawArrays(B.POINTS,e,s)};for(;c<a.length;){const e=a[c];if(e.id.highlightName!==o){p(d,u),++c,m();continue}const t=e.componentIndex;t!==u&&(p(d,u),d=t),u=t+1,++c}p(d,u)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!b(this._passParameters.clipBox,P,((e,t)=>e===t))}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let s=null;return this._nodes.filterInPlace((i=>i.id!==e||(s=i,i.vao=t(i.vao),this._highlights.nodeRemoved(i),!1))),this._requestRender(),s}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll((e=>e.vao=t(e.vao))),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,t){return this._highlights.add(e,t)}_addHighlight(e,t,s){e.addHighlight(t,s),this._requestRender()}_removeHighlight(e,t){e.removeHighlight(t),this._requestRender()}_initNode(e,t){t.vao??=new q(e.rctx,I,D,new Map([["positions",V.createVertex(e.rctx,C.STATIC_DRAW,t.coordinates)],["colors",V.createVertex(e.rctx,C.STATIC_DRAW,t.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}};function G(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=N(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function Q(e,t,s,i,r){return s.drawScreenSpace?0:G(e,t,s,i,r)}function Y(e,t,s){return null==s&&(s=d()),s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}e([i({constructOnly:!0})],k.prototype,"createGraphic",void 0),k=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],k);class J{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function K(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}export{k as PointCloudRenderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{disposeMaybe as t}from"../../../../core/maybe.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,h as a,v as l,f as h,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as m,offset as g,contains as p,containsPoint as _,set as f,positiveInfinity as P,equals as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as x}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as R}from"./PointCloudHighlights.js";import{isDepth as z,ShaderOutput as A,isColorOrColorEmission as j}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as y}from"../../webgl-engine/effects/RenderPlugin.js";import{Default3D as I}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as v}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as E,StoreResults as L}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{RenderSlot as O}from"../../webgl-engine/lib/RenderSlot.js";import{VertexArrayObject as T}from"../../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as q}from"../../webgl-engine/lib/VertexAttribute.js";import{P as M,g as H}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as N}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as F}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{BufferObject as V}from"../../../webgl/BufferObject.js";import{DataType as U,PrimitiveType as B,Usage as C}from"../../../webgl/enums.js";import{VertexElementDescriptor as W}from"../../../webgl/VertexElementDescriptor.js";const D=new Map([["positions",[new W(q.POSITION,3,U.FLOAT,0,12)]],["colors",[new W(q.COLOR,3,U.UNSIGNED_BYTE,0,3,!0)]]]);let k=class extends y{constructor(e){super(e),this.type=E.PCL,this.isGround=!1,this._passParameters=new M,this._highlights=new R({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.produces=new Map([[O.OPAQUE_MATERIAL,e=>!(z(e)||e===A.Highlight&&this._highlights.empty)],[O.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>z(e)]]),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new F,this._nodes=new s}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const r=d(),f=d(),P=d(),b=d(),R=x(),z=e.camera.perScreenPixelRatio/2,A=e.camera.near;n(f,i,s);const j=1/o(f);a(f,f,j),l(P,f),u(R,f[0],f[1],f[2],-h(f,s));const y=new J,I=new J,E=new Array,O=m(),T=m(this._passParameters.clipBox);g(T,-s[0],-s[1],-s[2],T),this._nodes.forAll((o=>{const a=o.splatSize*this._passParameters.scaleFactor;let l=o.obb.minimumDistancePlane(R),d=o.obb.maximumDistancePlane(R);l-=Q(a,l+A,this._passParameters,z,o.isLeaf),d-=Q(a,d+A,this._passParameters,z,o.isLeaf);const u=d<0,m=null!=y.dist&&null!=I.dist&&y.dist<l*j&&I.dist>d*j;if(u||m)return;const x=G(a,d+A,this._passParameters,z,o.isLeaf);if(!o.obb.intersectRay(s,f,x))return;const S=x*x;o.obb.toAaBoundingBox(O),g(O,-s[0],-s[1],-s[2],O);const w=!p(T,O);n(b,o.origin,s);const v=o.coordinates.length/3;for(let n=0;n<v;n++){if(r[0]=b[0]+o.coordinates[3*n],r[1]=b[1]+o.coordinates[3*n+1],r[2]=b[2]+o.coordinates[3*n+2],w&&!_(T,r))continue;const l=h(r,f),d=c(r)-l*l;if(d>S)continue;let u=l+A;const m=Q(a,u,this._passParameters,z,o.isLeaf);if(l-m<0)continue;u-=m;const g=G(a,u,this._passParameters,z,o.isLeaf);if(d>g*g)continue;const p=(l-m)*j,x=e=>(e.point=Y(o,n,e.point),e.dist=p,e.normal=P,e.node=o,e.pointId=n,e.layerViewUid=this.layerViewUid,e);if((null==y.dist||p<y.dist)&&(null==t||t(s,i,p))&&x(y),e.options.store!==L.MIN&&(null==I.dist||p>I.dist)&&(null==t||t(s,i,p))&&x(I),e.options.store===L.ALL&&(null==t||t(s,i,p))){const e=new J;E.push(x(e))}}}));const q=e=>{const{layerViewUid:t,node:s,pointId:i}=e;return new w(e.point,t,i,(()=>this.createGraphic(s,i,e.point)))},M=(e,t)=>{const s=q(t);e.set(this.type,s,t.dist,t.normal)};if(K(y)){const t=e.results.min;(null==t.dist||y.dist<t.dist)&&M(t,y)}if(K(I)&&e.options.store!==L.MIN){const t=e.results.max;(null==t.dist||I.dist>t.dist)&&M(t,I)}if(e.options.store===L.ALL){const t=S(s,i);for(const s of E){const i=v(t);M(i,s),e.results.all.push(i)}}}acquireTechniques(e){const t=e.output===A.Highlight;return 0!==this._nodes.length&&(j(e.output)||z(e.output)&&e.bind.slot===O.OPAQUE_MATERIAL_WITHOUT_NORMALS||t)?(this._nodes.forAll((t=>this._initNode(e,t))),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=t&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._context.techniques.get(N,this._configuration)):null}render(e,t){const{rctx:s,bind:i,output:r}=e,n=s.bindTechnique(t,i,this._passParameters),o=r===A.Highlight,a=i.highlight?.name??null;o&&!a||this._nodes.forAll((t=>{0===t.coordinates.length||o&&!t.highlightMap.has(a)||(n.bindDraw(i,this._passParameters,t),s.bindVAO(t.vao),o?this._renderHighlightFragments(e,t):s.drawArrays(B.POINTS,0,t.coordinates.length/3))}))}_renderHighlightFragments(e,t){const{highlightMap:s}=t,{rctx:i,bind:r}=e,{highlight:n}=r;if(!n)return;const o=n.name,a=s.get(o);if(!a||0===a.length)return;const{highlightOrderMap:l,highlightLevel:h}=r;if(null==h)return;for(const p of s.keys())if(p!==o){const e=l.get(p);if(void 0!==e&&e>h)return}let c=0,d=a[0].componentIndex,u=d+1;const m=()=>{for(;c<a.length&&a[c].id.highlightName!==o;)d=a[c].componentIndex,++c;u=d+1};m();const g=(e,t)=>{const s=t-e;s>0&&i.drawArrays(B.POINTS,e,s)};for(;c<a.length;){const e=a[c];if(e.id.highlightName!==o){g(d,u),++c,m();continue}const t=e.componentIndex;t!==u&&(g(d,u),d=t),u=t+1,++c}g(d,u)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!b(this._passParameters.clipBox,P,((e,t)=>e===t))}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let s=null;return this._nodes.filterInPlace((i=>i.id!==e||(s=i,i.vao=t(i.vao),this._highlights.nodeRemoved(i),!1))),this._requestRender(),s}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll((e=>e.vao=t(e.vao))),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,t){return this._highlights.add(e,t)}_addHighlight(e,t,s){e.addHighlight(t,s),this._requestRender()}_removeHighlight(e,t){e.removeHighlight(t),this._requestRender()}_initNode(e,t){t.vao??=new T(e.rctx,I,D,new Map([["positions",V.createVertex(e.rctx,C.STATIC_DRAW,t.coordinates)],["colors",V.createVertex(e.rctx,C.STATIC_DRAW,t.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}};function G(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=H(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function Q(e,t,s,i,r){return s.drawScreenSpace?0:G(e,t,s,i,r)}function Y(e,t,s){return null==s&&(s=d()),s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}e([i({constructOnly:!0})],k.prototype,"createGraphic",void 0),k=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],k);class J{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function K(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}export{k as PointCloudRenderer};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import{makeHandle as r,destroyHandle as o}from"../../../../core/handleUtils.js";import{watch as h,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{initializeProjection as c,project as n}from"../../../../geometry/projection.js";import{GraphicsCollection as g}from"../../../../support/GraphicsCollection.js";import m from"../../../../symbols/SimpleFillSymbol.js";import u from"../../../../symbols/SimpleLineSymbol.js";import d from"../../../../symbols/SimpleMarkerSymbol.js";import{getHighlightGraphics as y}from"../../../layers/support/highlightUtils.js";let w=class extends i{constructor(e){super(e),this._highlightCounts=new Map,this._graphicsViewLoader=null,this.graphics=new g,this.graphicsView=null,this.suspended=!1;const i=new t([255,255,255,1/255]);this._symbols=new Map([["point",new d({size:"2px",style:"square",color:i})],["polyline",new u({width:"2px",color:i})],["polygon",new m({outline:null,color:i})]])}highlight(e,t){const i=y(e);if(0===i.length)return r();let s,o=!1;return Promise.all([this._createHighlightGraphics(i),this._ensureGraphicsView3D()]).then((([e,i])=>{!o&&i&&(s=this._addHighlightGraphics(i,e,t))})),r((()=>{o=!0,s?.remove()}))}preload(){this._ensureGraphicsView3D()}_addHighlightGraphics(e,t,i){for(const r of t)this._highlightCounts.set(r,(this._highlightCounts.get(r)??0)+1);this.graphics.addMany(t);const s=e.highlight(t,i);return r((()=>{this._removeHighlightGraphics(t),s.remove()}))}_removeHighlightGraphics(e){this.graphics.removeMany(e.filter((e=>{const t=Math.max(0,(this._highlightCounts.get(e)??0)-1);return 0===t?(this._highlightCounts.delete(e),!0):(this._highlightCounts.set(e,t),!1)})))}async _ensureGraphicsView3D(){if(this.graphicsView)return this.graphicsView;this._graphicsViewLoader||(this._graphicsViewLoader=import("../GraphicsView3D.js"));const{default:e}=await this._graphicsViewLoader;if(this.destroyed)return null;const t=new e({view:this.view,layer:this.layer,getGraphics:()=>this.graphics,drapeSourcePriorityOffset:.5});return this._set("graphicsView",t),this.addHandles([o(this.graphicsView),h((()=>this.suspended),(e=>{t.suspended=e}),p)]),t}async _createHighlightGraphics(e){const t=e.map((({geometry:e})=>e?.spatialReference)).filter(s).reduce(((e,t)=>(0!==e.length&&e.at(-1)?.equals(t)||e.push(t),e)),[]),i=this.view.spatialReference,r=t.map((e=>({source:e,dest:i})));try{await c(r)}catch{return[]}return e.map((e=>{const{geometry:t}=e;try{const s=t?n(t,i):null,r=e.cloneShallow();return r.geometry=s,r.symbol=this._symbols.get(s?.type),r}catch{return e}}))}};e([a()],w.prototype,"graphics",void 0),e([a()],w.prototype,"graphicsView",void 0),e([a()],w.prototype,"view",void 0),e([a()],w.prototype,"layer",void 0),e([a()],w.prototype,"updatingHandles",void 0),e([a()],w.prototype,"suspended",void 0),w=e([l("esri.views.3d.layers.support.ImageHighlightHelper3D")],w);export{w as ImageHighlightHelper3D};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{when as t,initial as s,watch as p,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ImageHighlightHelper3D as l}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as c}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as g}from"../../../support/drapedUtils.js";let d=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new l({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new c({createFetchPopupFeaturesQueryGeometry:(e,i)=>g(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),t((()=>this.view?.stationary),(()=>this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution)),s),p((()=>this.layerView.suspended),(e=>this._highlightHelper.suspended=e),o)])}fetchPopupFeaturesAtLocation(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([h()],d.prototype,"view",void 0),e([h()],d.prototype,"layerView",void 0),e([h()],d.prototype,"updatingHandles",void 0),d=e([a("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],d);export{d as SublayerPopupHighlightHelper3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as e,offset as t,copy as s}from"../../../geometry/support/aaBoundingRect.js";import{fromValues as i}from"../webgl-engine/lib/LocalOriginFactory.js";class n{constructor(){this._extent=e(),this.resolution=0,this.renderLocalOrigin=i(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new r}get extent(){return this._extent}setupGeometryViewsCyclical(e){this.setupGeometryView();const s=.001*e.range;if(this._extent[0]-s<=e.min){const s=this.canvasGeometries.extents[this.canvasGeometries.numViews++];t(this._extent,e.range,0,s)}if(this._extent[2]+s>=e.max){const s=this.canvasGeometries.extents[this.canvasGeometries.numViews++];t(this._extent,-e.range,0,s)}}setupGeometryView(){this.canvasGeometries.numViews=1,s(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class r{constructor(){this.extents=[e(),e(),e()],this.numViews=0}}export{n as Overlay};
5
+ import{create as e,offset as t,copy as s}from"../../../geometry/support/aaBoundingRect.js";import{fromValues as i}from"../webgl-engine/lib/LocalOriginFactory.js";class n{constructor(){this._extent=e(),this.resolution=0,this.renderLocalOrigin=i(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new r}get extent(){return this._extent}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const s=.001*e.range;if(this._extent[0]-s<=e.min){const s=this.canvasGeometries.extents[this.canvasGeometries.numViews++];t(this._extent,e.range,0,s)}if(this._extent[2]+s>=e.max){const s=this.canvasGeometries.extents[this.canvasGeometries.numViews++];t(this._extent,-e.range,0,s)}}_setupGeometryView(){this.canvasGeometries.numViews=1,s(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class r{constructor(){this.extents=[e(),e(),e()],this.numViews=0}}export{n as Overlay};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as t}from"../../../core/MapUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import i from"../../../core/PooledArray.js";import{watch as n,syncAndInitial as o,on as a,initial as h}from"../../../core/reactiveUtils.js";import{someSet as l}from"../../../core/SetUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{ortho as u,fromTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{i as g}from"../../../chunks/vec32.js";import{ones as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DrapeTargetType as m,DrapeSourceType as y,DrapedRenderGroup as f}from"../layers/interfaces.js";import{debugFlags as R}from"../support/debugFlags.js";import{OverlayIndex as b}from"./interfaces.js";import{Overlay as T}from"./Overlay.js";import{OverlayContent as w}from"./OverlayContent.js";import{OverlayRenderTargets as D}from"./OverlayRenderTargets.js";import v from"../webgl/RenderCamera.js";import{ShaderOutput as x}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as O}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as C}from"../../../chunks/TextureOnly.glsl.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as E,renderHighlightBuffer as P}from"../webgl-engine/effects/highlight/Highlight.js";import{RenderRequestType as j}from"../webgl-engine/lib/basicInterfaces.js";import{GLMaterialRepository as A}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as M}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{OITPass as I}from"../webgl-engine/lib/OITPass.js";import{OverlayRenderContext as q,defaultRenderOccludedMask as L}from"../webgl-engine/lib/RenderContext.js";import{RenderSlot as F}from"../webgl-engine/lib/RenderSlot.js";import{ShadowMap as N}from"../webgl-engine/lib/ShadowMap.js";import{TextureTechnique as V}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as H}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{Update as G}from"../webgl-engine/lib/Update.js";import{UpdatePolicy as k}from"../webgl-engine/lib/UpdatePolicy.js";import{AmbientLight as U}from"../webgl-engine/lighting/Lightsources.js";import{O as B}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as z}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as Y,noBudget as X}from"../../support/Scheduler.js";import{FramebufferBit as K,TextureSamplingMode as J}from"../../webgl/enums.js";import{Texture as Q}from"../../webgl/Texture.js";import{TextureDescriptor as Z}from"../../webgl/TextureDescriptor.js";let $=class extends S{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new B,this.hasHighlights=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new i,this._passParameters=new C,this._materials=null,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new v,this.events=new r,this.longitudeCyclical=null,this.produces=new Map([[F.DRAPED_MATERIAL,e=>e!==x.Highlight||this.hasHighlights],[F.DRAPED_WATER,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this._view,r=e.stage,t=r.renderer.fboCache,{waterTextures:s,textures:i}=r.renderView;this._renderContext=new q(this._rctx,new N(t,e.state.viewingMode)),this.addHandles([n((()=>s.updating),(()=>this.events.emit("content-changed")),o),n((()=>this.spatialReference),(e=>this._localOriginFactory=new M(e)),o),a((()=>e.allLayerViews),"after-changes",(()=>this._sortedDrapeSourceRenderersDirty=!0)),n((()=>E(e.state.highlights)),(()=>this._sortedDrapeSourceRenderersDirty=!0),h),n((()=>e.state.highlights),(r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap,this._updateHighlights()}),h),e.resourceController.scheduler.registerTask(Y.STAGE,this)]),this._materials=new A(i,this._techniques,(()=>{this.notifyChange("rendersOccludedDraped"),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")}),(()=>this.events.emit("content-changed")));const{_bindParameters:l,_camera:d}=this;d.near=1,d.far=1e4,d.relativeElevation=null,l.slot=F.DRAPED_MATERIAL,l.mainDepth=null,l.camera=d,l.oitPass=I.NONE,l.updateLighting([new U(_())],0,0,G.Immediate)}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._passParameters.texture=s(this._passParameters.texture),this.disposeOverlays()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}get pluginContext(){return this._pluginContext}initializeRenderContext(e){this._pluginContext=e,this._techniques.precompile(z)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||t(this._renderers,(e=>e.updating))}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),this._sortedRenderers.map((e=>e.drapeSource.layer)).filter((e=>!!e))}_updateHighlights(){const e=this._view.state;this._renderers.forEach((r=>r.updateHighlights(e.highlightOrderMap)))}createDrapeSourceRenderer(e,r,t){const s=this._renderers.get(e);null!=s&&s.destroy();const i=new r({...t,rendererContext:this,drapeSource:e});return this._renderers.set(e,i),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(n((()=>e.fullOpacity),(()=>this.events.emit("content-changed"))),e),i}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&l(e,(e=>e.drapeTargetType===m.WithoutRasterImage))}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=l(e,(e=>e.drapeSourceType===y.Features)),this._hasDrapedRasterSource=l(e,(e=>e.drapeSourceType===y.RasterImage))):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new D(this._stage.renderer.fboCache),this._overlays=[new T,new T]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets=s(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){if(null!=e)return e===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(w.Color):this._renderTargets?.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,(()=>!0))}_processDrapeSources(e,r){let s=!1;for(const[t,i]of this._renderers){if(e.done)break;(t.destroyed||r(t))&&(i.commitChanges(this._view.state.highlightOrderMap)&&(s=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,s=!0,this._updateSortedDrapeSourceRenderers()),s&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=t(this._renderers,(e=>e.hasHighlights)),this.notifyChange("rendersOccludedDraped"))}hasHighlight(e){return t(this._renderers,(r=>r.hasHighlight(e)))}processSyncDrapeSources(){this._processDrapeSources(X,(e=>e.updatePolicy===k.SYNC))}get isEmpty(){return!R.OVERLAY_DRAW_DEBUG_TEXTURE&&!t(this._renderers,(e=>!e.isEmpty))}get hasWater(){const e=t(this._renderers,(({hasWater:e})=>e));return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}get rendersOccludedDraped(){const e=this._renderContext.renderOccludedMask;this._renderContext.renderOccludedMask=se,++this._techniques.precompiling;const r=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.renderOccludedMask=e,r}renders(e){if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==w.Occluded&&e!==w.Highlight)return!0;++this._techniques.precompiling;const r=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,r}get mode(){return this.isEmpty?O.Disabled:this.hasWater&&this.renders(w.WaterNormal)?O.EnabledWithWater:this._renderTargets?.getTexture(w.Color)?O.Enabled:O.Disabled}updateAnimation(e){let r=!1;return this._renderers.forEach((t=>r=t.updateAnimation(e)||r)),r&&this.parent.requestRender(j.BACKGROUND),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(this._renderTargets){this._bindParameters.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const e of this._renderTargets.targets){if(e.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const r=e.output;this._renderContext.output=r,this._bindParameters.slot=r===x.Normal?F.DRAPED_WATER:F.DRAPED_MATERIAL,e.content===w.Occluded&&(this._renderContext.renderOccludedMask=se),this._sortedRenderers.forAll((({drapeSource:r,renderer:t})=>{e.content===w.ColorNoRasterImage&&r.drapeSourceType===y.RasterImage||t.precompile(this._renderContext)})),this._renderContext.renderOccludedMask=L}--this._techniques.precompiling}}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const e of this._overlays)this.longitudeCyclical?e.setupGeometryViewsCyclical(this.longitudeCyclical):e.setupGeometryView();this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;for(const e of this._renderTargets.targets){if(e.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const r=this._drawTarget(b.INNER,e),t=this._drawTarget(b.OUTER,e);(r||t)&&e.fbo.generateMipMap()}}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n}=r;if(this.isEmpty||n===x.Normal&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:a,_renderContext:h,_bindParameters:l}=this;if(a.pixelRatio=t.pixelRatio*i,h.output=n,l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,l.slot=n===x.Normal?F.DRAPED_WATER:F.DRAPED_MATERIAL,r.content===w.Occluded&&(h.renderOccludedMask=se),!this.renders(r.content))return h.renderOccludedMask=L,!1;const{resolution:d}=t,c=e===b.INNER,u=c?0:d;if(o.setViewport(u,0,d,d),this._bindTargetFBO(r),c)if(r.output!==x.Highlight)o.setClearColor(0,0,0,0),o.clear(K.COLOR);else{const{gl:e}=o;e.clearBufferuiv(e.COLOR,0,[0,0,0,0])}if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&r.content!==w.Occluded&&r.content!==w.Highlight){this._techniques.precompile(V,ie);const r=this._techniques.get(V,ie);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,re[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(r.output===x.Highlight){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),P(o,t,{width:s,height:s},l,(()=>this._renderAllGeometry(e,r)),u)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),h.renderOccludedMask=L,!0}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll((({drapeSource:i,renderer:n})=>{if(r.content===w.ColorNoRasterImage&&i.drapeSourceType===y.RasterImage)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&r.output===x.Color&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(z);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}}))}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.bind(this._rctx,t,r)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(K.COLOR),s}get _resolution(){return this._overlays?.[b.INNER].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers,r=e.length;this._renderers.forEach(((t,s)=>{const i=e.indexOf(s.layer),n=i>=0,o=s.renderGroup??(n?f.MapLayer:f.ViewLayer),a=r*o+(n?i:0);this._sortedRenderers.push(new ee(s,t,a))})),this._sortedRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],u(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),p(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(g(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new Z(e);i.samplingMode=J.NEAREST,this._passParameters.texture=new Q(this._rctx,i,t)}get test(){}};e([d()],$.prototype,"hasHighlights",void 0),e([d()],$.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([d({constructOnly:!0})],$.prototype,"parent",void 0),e([d({readOnly:!0})],$.prototype,"_techniques",null),e([d({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([d()],$.prototype,"isEmpty",null),e([d({readOnly:!0})],$.prototype,"rendersOccludedDraped",null),$=e([c("esri.views.3d.terrain.OverlayRenderer")],$);class ee{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const re=[[1,.5,.5],[.5,.5,1]],te=-2,se=W.OccludeAndTransparent,ie=new H;ie.hasAlpha=!0;export{$ as OverlayRenderer,te as drapedZ,se as overlayRenderOccludedFlag};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as t}from"../../../core/MapUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import i from"../../../core/PooledArray.js";import{watch as n,syncAndInitial as o,on as a,initial as h}from"../../../core/reactiveUtils.js";import{someSet as l}from"../../../core/SetUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{ortho as u,fromTranslation as p}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{i as g}from"../../../chunks/vec32.js";import{ones as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DrapeTargetType as m,DrapeSourceType as f,DrapedRenderGroup as y}from"../layers/interfaces.js";import{debugFlags as R}from"../support/debugFlags.js";import{OverlayIndex as T}from"./interfaces.js";import{Overlay as b}from"./Overlay.js";import{OverlayContent as w}from"./OverlayContent.js";import{OverlayRenderTargets as x}from"./OverlayRenderTargets.js";import D from"../webgl/RenderCamera.js";import{ShaderOutput as v}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{OverlayMode as O}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{T as C}from"../../../chunks/TextureOnly.glsl.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as E,renderHighlightBuffer as P}from"../webgl-engine/effects/highlight/Highlight.js";import{RenderRequestType as j}from"../webgl-engine/lib/basicInterfaces.js";import{GLMaterialRepository as A}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as M}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{OITPass as I}from"../webgl-engine/lib/OITPass.js";import{OverlayRenderContext as q,defaultRenderOccludedMask as L}from"../webgl-engine/lib/RenderContext.js";import{RenderSlot as N}from"../webgl-engine/lib/RenderSlot.js";import{ShadowMap as F}from"../webgl-engine/lib/ShadowMap.js";import{TextureTechnique as V}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as H}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{Update as G}from"../webgl-engine/lib/Update.js";import{UpdatePolicy as k}from"../webgl-engine/lib/UpdatePolicy.js";import{AmbientLight as U}from"../webgl-engine/lighting/Lightsources.js";import{O as B}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as z}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as Y,noBudget as X}from"../../support/Scheduler.js";import{FramebufferBit as K,TextureSamplingMode as J}from"../../webgl/enums.js";import{Texture as Q}from"../../webgl/Texture.js";import{TextureDescriptor as Z}from"../../webgl/TextureDescriptor.js";let $=class extends S{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new B,this.hasHighlights=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new i,this._passParameters=new C,this._materials=null,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new D,this.events=new r,this.longitudeCyclical=null,this.produces=new Map([[N.DRAPED_MATERIAL,e=>e!==v.Highlight||this.hasHighlights],[N.DRAPED_WATER,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this._view,r=e.stage,t=r.renderer.fboCache,{waterTextures:s,textures:i}=r.renderView;this._renderContext=new q(this._rctx,new F(t,e.state.viewingMode)),this.addHandles([n((()=>s.updating),(()=>this.events.emit("content-changed")),o),n((()=>this.spatialReference),(e=>this._localOriginFactory=new M(e)),o),a((()=>e.allLayerViews),"after-changes",(()=>this._sortedDrapeSourceRenderersDirty=!0)),n((()=>E(e.state.highlights)),(()=>this._sortedDrapeSourceRenderersDirty=!0),h),n((()=>e.state.highlights),(r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap,this._updateHighlights()}),h),e.resourceController.scheduler.registerTask(Y.STAGE,this)]),this._materials=new A(i,this._techniques,(()=>{this.notifyChange("rendersOccludedDraped"),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")}),(()=>this.events.emit("content-changed")));const{_bindParameters:l,_camera:d}=this;d.near=1,d.far=1e4,d.relativeElevation=null,l.slot=N.DRAPED_MATERIAL,l.mainDepth=null,l.camera=d,l.oitPass=I.NONE,l.updateLighting([new U(_())],0,0,G.Immediate)}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear(),this._passParameters.texture=s(this._passParameters.texture),this.disposeOverlays()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}get pluginContext(){return this._pluginContext}initializeRenderContext(e){this._pluginContext=e,this._techniques.precompile(z)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||t(this._renderers,(e=>e.updating))}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),this._sortedRenderers.map((e=>e.drapeSource.layer)).filter((e=>!!e))}_updateHighlights(){const e=this._view.state;this._renderers.forEach((r=>r.updateHighlights(e.highlightOrderMap)))}createDrapeSourceRenderer(e,r,t){const s=this._renderers.get(e);null!=s&&s.destroy();const i=new r({...t,rendererContext:this,drapeSource:e});return this._renderers.set(e,i),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(n((()=>e.fullOpacity),(()=>this.events.emit("content-changed"))),e),i}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(){this._renderTargets?.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&l(e,(e=>e.drapeTargetType===m.WithoutRasterImage))}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=l(e,(e=>e.drapeSourceType===f.Features)),this._hasDrapedRasterSource=l(e,(e=>e.drapeSourceType===f.RasterImage))):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new x(this._stage.renderer.fboCache),this._overlays=[new b,new b]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets=s(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){return e===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?this._renderTargets?.getTexture(w.Color):this._renderTargets?.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,(()=>!0))}_processDrapeSources(e,r){let s=!1;for(const[t,i]of this._renderers){if(e.done)break;(t.destroyed||r(t))&&(i.commitChanges(this._view.state.highlightOrderMap)&&(s=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,s=!0,this._updateSortedDrapeSourceRenderers()),s&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=t(this._renderers,(e=>e.hasHighlights)),this.notifyChange("rendersOccludedDraped"))}hasHighlight(e){return t(this._renderers,(r=>r.hasHighlight(e)))}processSyncDrapeSources(){this._processDrapeSources(X,(e=>e.updatePolicy===k.SYNC))}get isEmpty(){return!R.OVERLAY_DRAW_DEBUG_TEXTURE&&!t(this._renderers,(e=>!e.isEmpty))}get hasWater(){const e=t(this._renderers,(({hasWater:e})=>e));return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}get rendersOccludedDraped(){const e=this._renderContext.renderOccludedMask;this._renderContext.renderOccludedMask=se,++this._techniques.precompiling;const r=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.renderOccludedMask=e,r}renders(e){if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&e!==w.Occluded&&e!==w.Highlight)return!0;if(!this._overlays)return!1;const r=this._overlays[T.INNER];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._renderContext.output;this._renderContext.output=this._renderTargets?.targets.find((r=>r.content===e))?.output??v.Color,++this._techniques.precompiling;const s=this._sortedRenderers.some((({renderer:e})=>e.precompile(this._renderContext)));return--this._techniques.precompiling,this._renderContext.output=t,s}get mode(){return this.isEmpty?O.Disabled:this.hasWater&&this.renders(w.WaterNormal)?O.EnabledWithWater:this._renderTargets?.getTexture(w.Color)?O.Enabled:O.Disabled}updateAnimation(e){let r=!1;return this._renderers.forEach((t=>r=t.updateAnimation(e)||r)),r&&this.parent.requestRender(j.BACKGROUND),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(t.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const e=t.output;this._renderContext.output=e,r.slot=e===v.Normal?N.DRAPED_WATER:N.DRAPED_MATERIAL,e===v.Highlight&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null),t.content===w.Occluded&&(this._renderContext.renderOccludedMask=se),this._sortedRenderers.forAll((({drapeSource:e,renderer:r})=>{t.content===w.ColorNoRasterImage&&e.drapeSourceType===f.RasterImage||r.precompile(this._renderContext)})),this._renderContext.renderOccludedMask=L,r.highlightMixTexture=null}--this._techniques.precompiling}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;for(const e of this._renderTargets.targets){if(e.content===w.ColorNoRasterImage&&!this._needsColorWithoutRasterImage)continue;const r=this._drawTarget(T.INNER,e),t=this._drawTarget(T.OUTER,e);(r||t)&&e.fbo.generateMipMap()}}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n}=r;if(this.isEmpty||n===v.Normal&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:a,_renderContext:h,_bindParameters:l}=this;if(a.pixelRatio=t.pixelRatio*i,h.output=n,l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,l.slot=n===v.Normal?N.DRAPED_WATER:N.DRAPED_MATERIAL,r.content===w.Occluded&&(h.renderOccludedMask=se),!this.renders(r.content))return h.renderOccludedMask=L,!1;const{resolution:d}=t,c=e===T.INNER,u=c?0:d;if(o.setViewport(u,0,d,d),this._bindTargetFBO(r),c)if(r.output!==v.Highlight)o.setClearColor(0,0,0,0),o.clear(K.COLOR);else{const{gl:e}=o;e.clearBufferuiv(e.COLOR,0,[0,0,0,0])}if(R.OVERLAY_DRAW_DEBUG_TEXTURE&&r.content!==w.Occluded&&r.content!==w.Highlight){this._techniques.precompile(V,ie);const r=this._techniques.get(V,ie);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,re[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(r.output===v.Highlight){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),P(o,t,{width:s,height:s},l,(()=>this._renderAllGeometry(e,r)),u)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),h.renderOccludedMask=L,!0}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll((({drapeSource:i,renderer:n})=>{if(r.content===w.ColorNoRasterImage&&i.drapeSourceType===f.RasterImage)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&r.output===v.Color&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(z);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}}))}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.bind(this._rctx,t,r)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(K.COLOR),s}get _resolution(){return this._overlays?.[T.INNER].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers,r=e.length;this._renderers.forEach(((t,s)=>{const i=e.indexOf(s.layer),n=i>=0,o=s.renderGroup??(n?y.MapLayer:y.ViewLayer),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new ee(s,t,h))})),this._sortedRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],u(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),p(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(g(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new Z(e);i.samplingMode=J.NEAREST,this._passParameters.texture=new Q(this._rctx,i,t)}get test(){}};e([d()],$.prototype,"hasHighlights",void 0),e([d()],$.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([d({constructOnly:!0})],$.prototype,"parent",void 0),e([d({readOnly:!0})],$.prototype,"_techniques",null),e([d({type:Boolean,readOnly:!0})],$.prototype,"updating",null),e([d()],$.prototype,"isEmpty",null),e([d({readOnly:!0})],$.prototype,"rendersOccludedDraped",null),$=e([c("esri.views.3d.terrain.OverlayRenderer")],$);class ee{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const re=[[1,.5,.5],[.5,.5,1]],te=-2,se=W.OccludeAndTransparent,ie=new H;ie.hasAlpha=!0;export{$ as OverlayRenderer,te as drapedZ,se as overlayRenderOccludedFlag};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../core/maybe.js";import{C as e}from"../../../chunks/RasterColorizer.glsl.js";import{TextureSamplingMode as r}from"../../webgl/enums.js";import{createTransformTexture as s,getCommonUniforms as i,getColormapUniforms as o,getStretchUniforms as a,getShadedReliefUniforms as l,createRasterTexture as h,createColormapTexture as n}from"../../webgl/rasterUtils.js";const u={bandCount:3,minOutput:0,maxOutput:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class m{constructor(t,e,r=null,s=null){this.lij=t,this.type="raster-tile",this._memoryUsed=null,this._source=null,this._symbolizerParameters=null,this._bandIds=null,this._interpolation=null,this._dirty=!1,this._transformGrid=null,this.isRendereredSource=!1,this.symbolizerRenderer=null,this.rawPixelData=null,this.opacity=1,this.source=e,this.width=r||e.width,this.height=s||e.height}get source(){return this._source}set source(e){this._source=e,this._rasterTexture=t(this._rasterTexture),this._memoryUsed=null}get symbolizerParameters(){return this.isRendereredSource?{...u,maxCutOff:[1,1,1],factor:[1,1,1]}:this._symbolizerParameters||u}set symbolizerParameters(t){this._symbolizerParameters=t}get bandIds(){return this._bandIds}set bandIds(t){if(null!=t&&t.length>0){this._bandIds&&t.every(((t,e)=>!!this._bandIds?.[e]&&t===this._bandIds[e]))||(this._bandIds=t,this._dirty=!0)}else this._bandIds=null}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){if(this._interpolation=t,null!=this._rasterTexture){const e=this._getRasterTextureInterpolation(t);this._rasterTexture.setSamplingMode("bilinear"===e?r.LINEAR:r.NEAREST)}}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture),this._memoryUsed=null}bind(t){return!!(this.source&&this.source.pixels&&this.source.pixels.length>0)&&((null==this._rasterTexture||this._dirty)&&this._updateRasterTexture(t,this.bandIds),null!=this._rasterTexture&&(this._updateColormapTexture(t),this.transformGrid&&null==this._transformGridTexture&&(this._transformGridTexture=s(t,this.transformGrid))),!0)}getUniforms(){const{symbolizerParameters:t,transformGrid:r,width:s,height:h,opacity:n}=this,u=i(r,[s,h],[this.source.width,this.source.height],n),m=o(t.colormap,t.colormapOffset),d="stretch"===this.symbolizerParameters.type?a(this.symbolizerParameters):null,_="hillshade"===this.symbolizerParameters.type?l(this.symbolizerParameters):null;return new e(u,m,d||_,this._rasterTexture,this._transformGridTexture,this._colormapTexture)}get isBilinearWithStretchColorRamp(){const{symbolizerParameters:t}=this;return"bilinear"===this.interpolation&&null!=t.colormap&&"stretch"===t.type}get memoryUsage(){if(null==this._memoryUsed){const t=[this._rasterTexture,this._transformGridTexture,this._colormapTexture];this._memoryUsed=t.map((t=>null!=t?t.descriptor.width*t.descriptor.height*4:0)).reduce(((t,e)=>t+e),0)}return this._memoryUsed}release(){return this._rasterTexture=t(this._rasterTexture),this._transformGridTexture=t(this._transformGridTexture),this._colormapTexture=t(this._colormapTexture),this.source=null,this.transformGrid=null,this.rawPixelData=null,!0}_updateRasterTexture(e,r){const s=this.source?this.source.extractBands(r):null;if(!(s?.pixels&&s.pixels.length>0))return void(this._rasterTexture=t(this._rasterTexture));const i=null==r&&null==this.bandIds||null!=r&&null!=this.bandIds&&r.join("")===this.bandIds.join("");if(null!=this._rasterTexture&&i)return;this._rasterTexture=t(this._rasterTexture);const o=this._getRasterTextureInterpolation(this.interpolation);this._rasterTexture=h(e,s,o,this.isRendereredSource||this.hasStretchTypeNone())}hasStretchTypeNone(){return"stretchType"in this.symbolizerParameters&&"none"===this.symbolizerParameters.stretchType&&!this.symbolizerParameters.useGamma&&"u8"===this.source.pixelType}_getRasterTextureInterpolation(t){return"lut"===this.symbolizerParameters.type||"nearest"===t||"majority"===t||this.isBilinearWithStretchColorRamp?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some(((t,e)=>t!==r[e]))?(this._colormapTexture=t(this._colormapTexture),this._colormapTexture=n(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=n(e,s),void(this._colormap=s)):(this._colormapTexture=t(this._colormapTexture),void(this._colormap=null))}}export{m as RasterTile};
5
+ import{disposeMaybe as t}from"../../../core/maybe.js";import{C as e}from"../../../chunks/RasterColorizer.glsl.js";import{TextureSamplingMode as r}from"../../webgl/enums.js";import{createTransformTexture as s,getCommonUniforms as i,getColormapUniforms as o,getStretchUniforms as a,getShadedReliefUniforms as l,createRasterTexture as h,createColormapTexture as n}from"../../webgl/rasterUtils.js";const u={bandCount:3,minOutput:0,maxOutput:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class m{constructor(t,e,r=null,s=null){this.lij=t,this.type="raster-tile",this._memoryUsed=null,this._source=null,this._symbolizerParameters=null,this._bandIds=null,this._interpolation=null,this._dirty=!1,this._transformGrid=null,this.isRendereredSource=!1,this.symbolizerRenderer=null,this.rawPixelData=null,this.opacity=1,this.source=e,this.width=r||e.width,this.height=s||e.height}get source(){return this._source}set source(e){this._source=e,this._rasterTexture=t(this._rasterTexture),this._memoryUsed=null}get symbolizerParameters(){return this.isRendereredSource?{...u,maxCutOff:[1,1,1],factor:[1,1,1]}:this._symbolizerParameters||u}set symbolizerParameters(t){this._symbolizerParameters=t}get bandIds(){return this._bandIds}set bandIds(t){if(null!=t&&t.length>0){this._bandIds&&t.every(((t,e)=>!!this._bandIds?.[e]&&t===this._bandIds[e]))||(this._bandIds=t,this._dirty=!0)}else this._bandIds=null}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){if(this._interpolation=t,null!=this._rasterTexture){const e=this._getRasterTextureInterpolation(t);this._rasterTexture.setSamplingMode("bilinear"===e?r.LINEAR:r.NEAREST)}}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture),this._memoryUsed=null}bind(t){return!!(this.source&&this.source.pixels&&this.source.pixels.length>0)&&((null==this._rasterTexture||this._dirty)&&this._updateRasterTexture(t,this.bandIds),null!=this._rasterTexture&&(this._updateColormapTexture(t),this.transformGrid&&null==this._transformGridTexture&&(this._transformGridTexture=s(t,this.transformGrid))),!0)}getUniforms(t){const{symbolizerParameters:r,transformGrid:s,width:h,height:n,opacity:u}=this,m=i(s,[h,n],[this.source.width,this.source.height],u),d=o(r.colormap,r.colormapOffset),_="stretch"===this.symbolizerParameters.type?a(this.symbolizerParameters):null,c="hillshade"===this.symbolizerParameters.type?l(this.symbolizerParameters):null,p=t.emptyTexture;return new e(m,d,_||c,this._rasterTexture??p,this._transformGridTexture??p,this._colormapTexture??p)}get isBilinearWithStretchColorRamp(){const{symbolizerParameters:t}=this;return"bilinear"===this.interpolation&&null!=t.colormap&&"stretch"===t.type}get memoryUsage(){if(null==this._memoryUsed){const t=[this._rasterTexture,this._transformGridTexture,this._colormapTexture];this._memoryUsed=t.map((t=>null!=t?t.descriptor.width*t.descriptor.height*4:0)).reduce(((t,e)=>t+e),0)}return this._memoryUsed}release(){return this._rasterTexture=t(this._rasterTexture),this._transformGridTexture=t(this._transformGridTexture),this._colormapTexture=t(this._colormapTexture),this.source=null,this.transformGrid=null,this.rawPixelData=null,!0}_updateRasterTexture(e,r){const s=this.source?this.source.extractBands(r):null;if(!(s?.pixels&&s.pixels.length>0))return void(this._rasterTexture=t(this._rasterTexture));const i=null==r&&null==this.bandIds||null!=r&&null!=this.bandIds&&r.join("")===this.bandIds.join("");if(null!=this._rasterTexture&&i)return;this._rasterTexture=t(this._rasterTexture);const o=this._getRasterTextureInterpolation(this.interpolation);this._rasterTexture=h(e,s,o,this.isRendereredSource||this.hasStretchTypeNone())}hasStretchTypeNone(){return"stretchType"in this.symbolizerParameters&&"none"===this.symbolizerParameters.stretchType&&!this.symbolizerParameters.useGamma&&"u8"===this.source.pixelType}_getRasterTextureInterpolation(t){return"lut"===this.symbolizerParameters.type||"nearest"===t||"majority"===t||this.isBilinearWithStretchColorRamp?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some(((t,e)=>t!==r[e]))?(this._colormapTexture=t(this._colormapTexture),this._colormapTexture=n(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=n(e,s),void(this._colormap=s)):(this._colormapTexture=t(this._colormapTexture),void(this._colormap=null))}}export{m as RasterTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as d}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as c,i as h,f as u}from"../../../chunks/vec32.js";import{ZEROS as p,fromValues as g,create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as m}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as b,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as T}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as R}from"../../ViewingMode.js";import{TextureUpdate as x}from"./interfaces.js";import{LayerClass as O}from"./LayerClass.js";import{OverlayContent as v}from"./OverlayContent.js";import{overlayRenderOccludedFlag as w}from"./OverlayRenderer.js";import{PatchRenderData as P}from"./PatchRenderData.js";import{RenderOrder as D}from"./RenderOrder.js";import{TerrainAttributesCache as S}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as C}from"./terrainUtils.js";import{TileRenderer as E}from"./TileRenderer.js";import{TileUpdate as A}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as N,compareTiles as B}from"./tileUtils.js";import{TransparencyMode as I}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as q,ComponentIntersectionData as U}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as F}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as G}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as M,ConsumesDepth as L,ConsumesNone as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as z}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as V}from"../webgl-engine/lib/basicInterfaces.js";import{newIntersectorResult as H}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as Y,StoreResults as Q}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as X,intersectTriangles as K,MeshIntersectionOptions as Z}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as J}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as $}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as ee}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as te,getVerticalOffsetTerrain as re}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as ie}from"../webgl-engine/materials/DrawParameters.js";import{T as se}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as ne}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ae}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as oe}from"../../webgl/enums.js";import{isCompressedWithPremultiplyAlpha as le}from"../../webgl/textureUtils.js";const de=7,ce=10,he=b();let ue=class extends M{get _isGlobal(){return this._stage.viewingMode===R.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,r,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=r,this._ellipsoidRadius=n,this.type=Y.TERRAIN,this.isGround=!0,this._passParameters=new se,this._drawParameters=new ie,this._renderDataPool=new s(P),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new j,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=W.Occlude,this.produces=new Map([[J.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===I.Opaque],[J.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===I.Transparent||this.transparency===I.InvisibleWithDraped)],[J.OCCLUDED_TERRAIN,()=>this._produces()]]),this._tileSize=256,this._configuration=new ae(t.viewingMode===R.Global),this._tileTextureCache=new i(((e,t)=>a.newCache(e,t)),"TileTexture"),this.tileGeometryCache=new S(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n((()=>this._overlayRenderer.rendersOccludedDraped),(e=>{this.renderOccludedFlags=e?w:W.Occlude,this.setNeedsRender()}),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?L:k}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get tileRenderer(){return this._tileRenderer}get texturesBeingCompressed(){return this._tileRenderer?this._tileRenderer?.texturesBeingCompressed:null}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return te}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,A.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const r=_(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,r)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===A.TEXTURE_FADING?x.FADING:x.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const r of e.layerInfo[O.ELEVATION])r.pendingUpdates&=~A.GEOMETRY;e.resetPendingUpdate(A.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=ce-de,r=Math.max(0,Math.floor((e.level-t)/de)*de);if(this._isGlobal&&0===r)return p;for(;e.parent&&e.level>r;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=V.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=V.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=V.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new E({rctx:this._rctx,tileSize:this._tileSize,techniques:this._techniques,cache:this._tileTextureCache}),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=r(this._tileRenderer)}intersect(e,t,r,i){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==I.Opaque)return;const s=pe,n=ge;c(s,i,r),h(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,p=e.options.store===Q.MIN,g=!!e.results.ground.target,f=re(e.verticalOffset),_=e.tolerance;let m,b=p&&null!=a.dist?a.dist:1/0;const R=e.options,x=R.normalRequired||!R.backfacesTerrain,O=new Z(!1,x),v=h=>{const g=h.renderData;if(!g?.vao)return;const v=g.geometry;y(he,v.boundingBox);const w=g.localOrigin;null!=f&&(f.localOrigin=w,f.applyToAabb(he));const P=he;if(fe[0]=r[0]-w[0],fe[1]=r[1]-w[1],fe[2]=r[2]-w[2],!X(P,fe,n,_,b))return;const D=(e,t,r)=>{e.set(this.type,h,t,r,d),b=p&&null!=a.dist?a.dist:1/0},S=(n,d,c)=>{if((!x||null!=c)&&n>=0&&(R.backfacesTerrain||u(c,s)<0)&&(R.invisibleTerrain||!R.selectionMode||null==t||t(r,i,n))){if((null==l.dist||n<l.dist)&&D(l,n,c),R.isFiltered)return;R.store===Q.ALL&&(null==m?(m=H(e.ray),D(m,n,c),e.results.all.push(m)):n<m.dist&&D(m,n,c)),(null==a.dist||n<a.dist)&&D(a,n,c),R.store!==Q.MIN&&(null==o.dist||n>o.dist)&&D(o,n,c)}},C=_e;c(C,i,w);const{indices:E,indexCount:A}=v,j=v.vertexAttributes,N=j.getField(ee.POSITION,T),B=new z(N.typedBuffer,3,j.stride/4),I=A/3;if(!f&&I>q){const e=h.renderData;null==e.intersectionData&&(e.intersectionData=new U(E,0,I,B)),e.intersectionData.intersectRay(fe,C,O,S)}else K(fe,C,0,I,E,B,f,O,S)},w=this._rootTiles;if(null!=w){(()=>{const t=this._tileIterator;t.reset(w);const i=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||i&&e.intersectsClippingArea)||null==f&&!e.intersectsRay(r,s,_,b)||g&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const r of t)null!=r.renderData?.textureReference&&e.queriesForTile(r);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const r=e.bind.viewshedEnabled;if(this._inViewshed!==r&&(this._inViewshed=r,this._patchesByOriginDirty=!0),e.bind.slot===J.OCCLUDED_TERRAIN){if(!(e.renderOccludedMask&w))return null}else{const t=this.transparency===I.Opaque?J.OPAQUE_TERRAIN:J.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===I.Invisible)return null;const i=this._configuration;switch(i.screenSpaceReflections=i.cloudReflections=i.receiveShadows=i.receiveAmbientOcclusion=!1,i.overlayMode=this._overlayRenderer.mode,i.renderOccluded=!1,e.output){case F.Color:case F.ColorEmission:{i.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,i.cloudReflections=null!=e.bind.clouds.data,i.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===J.OCCLUDED_TERRAIN;return i.renderOccluded=t,i.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case F.Shadow:case F.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(F.Shadow):null;case F.ViewshedShadow:return this._inViewshed?this._acquireTechnique(F.ViewshedShadow):null;case F.Depth:case F.Normal:return this._acquireTechnique(e.output);case F.ObjectAndLayerIdColor:return this._acquireTechnique(F.ObjectAndLayerIdColor);case F.Highlight:return this._overlayRenderer.hasHighlights?this._acquireTechnique(F.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case F.Color:case F.ColorEmission:{const r=e.bind.slot===J.OCCLUDED_TERRAIN?v.Occluded:v.Color;this._renderMaterialPass(e,t,r);break}case F.Depth:case F.Normal:this._renderAuxiliaryPass(e,t,v.Color,this._visiblePatchesByOrigin);break;case F.Highlight:{const r=e.bind.highlight?.name;r&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(v.Highlight)&&this._overlayRenderer.hasHighlight(r)&&this._renderAuxiliaryPass(e,t,v.Highlight,this._visiblePatchesByOrigin);break}case F.Shadow:case F.ShadowExcludeHighlight:case F.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case F.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,v.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const r=this._tileRenderer;let i;if(null!=e){const r=t.toUnitRGBA(e);i=g(r[0]||0,r[1]||0,r[2]||0)}r.setBackground(i),this._allTiles.forAll((e=>r.updateTileTexture(e,x.FADING))),this._configuration.tileBlendInput=r.backgroundIsGrid?G.GridComposite:null!=r.backgroundColor?G.ColorComposite:G.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==D.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const r of e)N(this.renderOrder,r,t);e.sort(((e,t)=>B(e[0],t[0],this.renderOrder))),this._visiblePatchesByOrigin=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),r=e.renderData;if(!r){this._numTilesCulled++;continue}const i=r.localOrigin;if(this._castShadows||this._inViewshed){let t=this._allPatchesByOrigin.get(i);t||(t=[],this._allPatchesByOrigin.set(i,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(i);s||(s=[],this._visiblePatchesByOrigin.set(i,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,r,i){const s=e.rctx;this._passParameters.overlayContent=r,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach((i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<i.length;s++)this._renderPatch(e,t,i[s],oe.TRIANGLES,n,r)})),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,r){const{rctx:i}=e;this._passParameters.overlayContent=r,i.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=$(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=r===v.Occluded;o&&(n.bindTexture("tex",i.emptyTexture),n.setUniform3fv("textureOpacities",p),n.setUniform4fv("texOffsetAndScale",m));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:p;this._configuration.tileBlendInput===G.ColorComposite&&n.setUniform3fv("backgroundColor",l);const d=this.wireframe?oe.LINES:oe.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const h of c.values()){const i=h[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const i=s.renderData,l=i.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture),n.setUniform1b("premultiplyAlpha",le(l.texture.texture));const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,d,a,r),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,r,i,s,n){const a=r.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(C&&console.error("Rendered tile with no indices: ",r.lij," : ",a));const d=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(d,a.overlay),s&&(t.useStencil=this._useStencilForTile(r),e.rctx.setPipelineState(t.getPipeline()));const c=a.geometry.indexCount;e.rctx.bindVAO(o),d.assertCompatibleVertexAttributeLocations(o),e.rctx.drawElements(i,c,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(ne,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],ue.prototype,"_isGlobal",null),e([o()],ue.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],ue.prototype,"renderingDisabled",null),e([o({value:!0})],ue.prototype,"visible",null),e([o()],ue.prototype,"texturesBeingCompressed",null),e([o()],ue.prototype,"renderPatchBorders",null),e([o()],ue.prototype,"visualizeNormals",null),e([o()],ue.prototype,"cullBackFaces",null),e([o({value:D.FRONT_TO_BACK})],ue.prototype,"renderOrder",null),e([o()],ue.prototype,"wireframe",null),ue=e([l("esri.views.3d.terrain.TerrainRenderer")],ue);const pe=f(),ge=f(),fe=f(),_e=f();export{ue as TerrainRenderer};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import has from"../../../core/has.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{MemCachePool as r}from"../../../core/MemCachePool.js";import s from"../../../core/ObjectPool.js";import{watch as n,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as d}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as c,i as h,f as u}from"../../../chunks/vec32.js";import{ZEROS as g,fromValues as p,create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as _,ZEROS as m}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as b,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as T}from"../../../geometry/support/buffer/BufferView.js";import{ViewingMode as R}from"../../ViewingMode.js";import{TextureUpdate as x}from"./interfaces.js";import{LayerClass as O}from"./LayerClass.js";import{OverlayContent as v}from"./OverlayContent.js";import{overlayRenderOccludedFlag as w}from"./OverlayRenderer.js";import{PatchRenderData as P}from"./PatchRenderData.js";import{RenderOrder as D}from"./RenderOrder.js";import{TerrainAttributesCache as S}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as E}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{TileUpdate as A}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as N,compareTiles as B}from"./tileUtils.js";import{TransparencyMode as I}from"./TransparencyMode.js";import{componentMinimalSizeForIntersectionData as U,ComponentIntersectionData as q}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as F}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{TileBlendInput as M}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{SyncRenderPlugin as G,ConsumesDepth as L,ConsumesNone as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as z}from"../webgl-engine/lib/Attribute.js";import{RenderRequestType as H}from"../webgl-engine/lib/basicInterfaces.js";import{newIntersectorResult as V}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as Y,StoreResults as Q}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as W}from"../webgl-engine/lib/Material.js";import{intersectAabbInvDirBefore as X,intersectTriangles as K,MeshIntersectionOptions as Z}from"../webgl-engine/lib/RayIntersections.js";import{RenderSlot as J}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as $}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as ee}from"../webgl-engine/lib/VertexAttribute.js";import{terrainId as te,getVerticalOffsetTerrain as ie}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as re}from"../webgl-engine/materials/DrawParameters.js";import{T as se}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as ne}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as ae}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as oe}from"../../webgl/enums.js";import{isCompressedWithPremultiplyAlpha as le}from"../../webgl/textureUtils.js";const de=7,ce=10,he=b();let ue=class extends G{get _isGlobal(){return this._stage.viewingMode===R.Global}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}constructor(e,t,i,n,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._ellipsoidRadius=n,this._compressionHandle=a,this.type=Y.TERRAIN,this.isGround=!0,this._passParameters=new se,this._drawParameters=new re,this._renderDataPool=new s(P),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new j,this._castShadows=!1,this._inViewshed=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.renderOccludedFlags=W.Occlude,this.produces=new Map([[J.OPAQUE_TERRAIN,()=>this._produces()&&this.transparency===I.Opaque],[J.TRANSPARENT_TERRAIN,()=>this._produces()&&(this.transparency===I.Transparent||this.transparency===I.InvisibleWithDraped)],[J.OCCLUDED_TERRAIN,()=>this._produces()]]),this._tileSize=256,this._configuration=new ae(t.viewingMode===R.Global),this._tileTextureCache=new r(((e,t)=>o.newCache(e,t)),"TileTexture"),this.tileGeometryCache=new S(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(n((()=>this._overlayRenderer.rendersOccludedDraped),(e=>{this.renderOccludedFlags=e?w:W.Occlude,this.setNeedsRender()}),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?L:k}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return this._configuration.visualizeNormals}set visualizeNormals(e){this._configuration.visualizeNormals!==e&&(this._configuration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._configuration.backfaceCullingEnabled}set cullBackFaces(e){this._configuration.backfaceCullingEnabled!==e&&(this._configuration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerViewUid(){return te}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._configuration.screenSizePerspective!==e&&(this._configuration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,A.TEXTURE_FADING)}reuseTextureFromParent(e){const t=e.parent;if(!t)return!1;const i=_(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,t===A.TEXTURE_FADING?x.FADING:x.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[O.ELEVATION])i.pendingUpdates&=~A.GEOMETRY;e.resetPendingUpdate(A.GEOMETRY);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=ce-de,i=Math.max(0,Math.floor((e.level-t)/de)*de);if(this._isGlobal&&0===i)return g;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=H.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=H.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=H.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionHandle),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=i(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==I.Opaque)return;const s=ge,n=pe;c(s,r,i),h(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,o=e.results.max,l=e.results.ground,g=e.options.store===Q.MIN,p=!!e.results.ground.target,f=ie(e.verticalOffset),_=e.tolerance;let m,b=g&&null!=a.dist?a.dist:1/0;const R=e.options,x=R.normalRequired||!R.backfacesTerrain,O=new Z(!1,x),v=h=>{const p=h.renderData;if(!p?.vao)return;const v=p.geometry;y(he,v.boundingBox);const w=p.localOrigin;null!=f&&(f.localOrigin=w,f.applyToAabb(he));const P=he;if(fe[0]=i[0]-w[0],fe[1]=i[1]-w[1],fe[2]=i[2]-w[2],!X(P,fe,n,_,b))return;const D=(e,t,i)=>{e.set(this.type,h,t,i,d),b=g&&null!=a.dist?a.dist:1/0},S=(n,d,c)=>{if((!x||null!=c)&&n>=0&&(R.backfacesTerrain||u(c,s)<0)&&(R.invisibleTerrain||!R.selectionMode||null==t||t(i,r,n))){if((null==l.dist||n<l.dist)&&D(l,n,c),R.isFiltered)return;R.store===Q.ALL&&(null==m?(m=V(e.ray),D(m,n,c),e.results.all.push(m)):n<m.dist&&D(m,n,c)),(null==a.dist||n<a.dist)&&D(a,n,c),R.store!==Q.MIN&&(null==o.dist||n>o.dist)&&D(o,n,c)}},E=_e;c(E,r,w);const{indices:C,indexCount:A}=v,j=v.vertexAttributes,N=j.getField(ee.POSITION,T),B=new z(N.typedBuffer,3,j.stride/4),I=A/3;if(!f&&I>U){const e=h.renderData;null==e.intersectionData&&(e.intersectionData=new q(C,0,I,B)),e.intersectionData.intersectRay(fe,E,O,S)}else K(fe,E,0,I,C,B,f,O,S)},w=this._rootTiles;if(null!=w){(()=>{const t=this._tileIterator;t.reset(w);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==f&&!e.intersectsRay(i,s,_,b)||p&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}acquireTechniques(e){const t=!!has("enable-feature:terrain-shadows")&&e.bind.shadowMap.enabled;t!==this._castShadows&&(this._castShadows=t,this._patchesByOriginDirty=!0);const i=e.bind.viewshedEnabled;if(this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),e.bind.slot===J.OCCLUDED_TERRAIN){if(!(e.renderOccludedMask&w))return null}else{const t=this.transparency===I.Opaque?J.OPAQUE_TERRAIN:J.TRANSPARENT_TERRAIN;if(e.bind.slot!==t)return null}if(this.transparency===I.Invisible)return null;const r=this._configuration;switch(r.screenSpaceReflections=r.cloudReflections=r.receiveShadows=r.receiveAmbientOcclusion=r.renderOccluded=r.hasHighlightMixTexture=!1,r.overlayMode=this._overlayRenderer.mode,e.output){case F.Color:case F.ColorEmission:{r.screenSpaceReflections=null!=e.bind.ssr.lastFrameColor,r.cloudReflections=null!=e.bind.clouds.data,r.receiveShadows=e.bind.shadowMap.ready;const t=e.bind.slot===J.OCCLUDED_TERRAIN;return r.renderOccluded=t,r.receiveAmbientOcclusion=!t&&null!=e.bind.ssao,this._acquireTechnique(e.output)}case F.Shadow:case F.ShadowExcludeHighlight:return this._castShadows?this._acquireTechnique(F.Shadow):null;case F.ViewshedShadow:return this._inViewshed?this._acquireTechnique(F.ViewshedShadow):null;case F.Depth:case F.Normal:return this._acquireTechnique(e.output);case F.ObjectAndLayerIdColor:return this._acquireTechnique(F.ObjectAndLayerIdColor);case F.Highlight:return r.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(F.Highlight):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,e.output){case F.Color:case F.ColorEmission:{const i=e.bind.slot===J.OCCLUDED_TERRAIN?v.Occluded:v.Color;this._renderMaterialPass(e,t,i);break}case F.Depth:case F.Normal:this._renderAuxiliaryPass(e,t,v.Color,this._visiblePatchesByOrigin);break;case F.Highlight:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(v.Highlight)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,v.Highlight,this._visiblePatchesByOrigin);break}case F.Shadow:case F.ShadowExcludeHighlight:case F.ViewshedShadow:this._renderAuxiliaryPass(e,t,null,this._allPatchesByOrigin);break;case F.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,t,v.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const i=this._tileRenderer;let r;if(null!=e){const i=t.toUnitRGBA(e);r=p(i[0]||0,i[1]||0,i[2]||0)}i.setBackground(r),this._allTiles.forAll((e=>i.updateTileTexture(e,x.FADING))),this._configuration.tileBlendInput=i.backgroundIsGrid?M.GridComposite:null!=i.backgroundColor?M.ColorComposite:M.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==D.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)N(this.renderOrder,i,t);e.sort(((e,t)=>B(e[0],t[0],this.renderOrder))),this._visiblePatchesByOrigin=new Map(e.map((e=>[e[0].renderData.localOrigin,e]))),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i,r){const s=e.rctx;this._passParameters.overlayContent=i,s.bindTechnique(t,e.bind,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;r.forEach((r=>{this._drawParameters.origin=r[0].renderData.localOrigin,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters);for(let s=0;s<r.length;s++)this._renderPatch(e,t,r[s],oe.TRIANGLES,n,i)})),e.rctx.bindVAO(null)}_renderMaterialPass(e,t,i){const{rctx:r}=e;this._passParameters.overlayContent=i,r.bindTechnique(t,e.bind,this._passParameters),this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const s=e.bind.camera,n=t.program;if(this._configuration.screenSizePerspective&&this.pointsOfInterest){const e=$(this._stage.viewingMode,this._ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:s.fovY})}const a=this._stencilEnabledLayerExtents.length>0,o=i===v.Occluded;o&&(n.bindTexture("tex",r.emptyTexture),n.setUniform3fv("textureOpacities",g),n.setUniform4fv("texOffsetAndScale",m));const l=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:g;this._configuration.tileBlendInput===M.ColorComposite&&n.setUniform3fv("backgroundColor",l);const d=this.wireframe?oe.LINES:oe.TRIANGLES;this._configuration.textureFadingEnabled&&n.bindTexture("texNext",r.emptyTexture);const c=this._visiblePatchesByOrigin;for(const h of c.values()){const r=h[0].renderData.localOrigin;this._drawParameters.origin=r,t.program.bindDraw(e.bind,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const s of h){const r=s.renderData,l=r.textureReference;if(null!=l){if(!o){n.setUniform4fv("texOffsetAndScale",l.offsetAndScale),n.bindTexture("tex",l.texture.texture),n.setUniform1b("premultiplyAlpha",le(l.texture.texture));const e=r.textureFadeFactor,t=e<1?r.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(n.setUniform1f("fadeFactor",e),n.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),n.setUniform3fv("nextTexOpacities",t.opacities),n.bindTexture("texNext",t.texture.texture)):n.setUniform1f("fadeFactor",1),r.textureIsFading&&this.setNeedsRender(),n.setUniform3fv("textureOpacities",l.opacities)}this._renderPatch(e,t,s,d,a,i),s.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,t,i,r,s,n){const a=i.renderData,o=a.vao,l=o?.indexBuffer;if(!o||null==l)return void(E&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const d=t.program;null==n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(d,a.overlay),s&&(t.useStencil=this._useStencilForTile(i),e.rctx.setPipelineState(t.getPipeline()));const c=a.geometry.indexCount;e.rctx.bindVAO(o),d.assertCompatibleVertexAttributeLocations(o),e.rctx.drawElements(r,c,l.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(ne,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],ue.prototype,"_isGlobal",null),e([o()],ue.prototype,"renderOccludedFlags",void 0),e([o({value:!1})],ue.prototype,"renderingDisabled",null),e([o({value:!0})],ue.prototype,"visible",null),e([o()],ue.prototype,"renderPatchBorders",null),e([o()],ue.prototype,"visualizeNormals",null),e([o()],ue.prototype,"cullBackFaces",null),e([o({value:D.FRONT_TO_BACK})],ue.prototype,"renderOrder",null),e([o()],ue.prototype,"wireframe",null),ue=e([l("esri.views.3d.terrain.TerrainRenderer")],ue);const ge=f(),pe=f(),fe=f(),_e=f();export{ue as TerrainRenderer};