@arcgis/core 5.1.0-next.30 → 5.1.0-next.32

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 (284) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{dcdddbc02b7d7febc56d.js → 005fe95c3329cfe74219.js} +1 -1
  3. package/assets/esri/core/workers/chunks/00947268b6de12329146.js +1 -0
  4. package/assets/esri/core/workers/chunks/{2563ce0f18eb84a9971a.js → 0337138d3702a1a52ce0.js} +1 -1
  5. package/assets/esri/core/workers/chunks/0554f310066937098099.js +1 -0
  6. package/assets/esri/core/workers/chunks/087403b53f15eb4d375c.js +1 -0
  7. package/assets/esri/core/workers/chunks/0d156e14fc34d0600fd5.js +1 -0
  8. package/assets/esri/core/workers/chunks/{eb4934d3a3b82316c7c6.js → 0d196cf72cd8bef8d91d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{764d080f77dec5e7a02c.js → 0e7d3f3479fcb366cc6f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/0efe90bd43ab29dab8ae.js +1 -0
  11. package/assets/esri/core/workers/chunks/122ff8d0d428f31fc5d1.js +1 -0
  12. package/assets/esri/core/workers/chunks/{37d943d3f2c40468438c.js → 144acac9bb1aa78f1170.js} +1 -1
  13. package/assets/esri/core/workers/chunks/14e05d37e10ebba8cf10.js +1 -0
  14. package/assets/esri/core/workers/chunks/19722dfef06028ab399b.js +1 -0
  15. package/assets/esri/core/workers/chunks/1ff40e6057916e8482b3.js +1 -0
  16. package/assets/esri/core/workers/chunks/209d8ee81cc3ebb18b27.js +1 -0
  17. package/assets/esri/core/workers/chunks/22aeab5c363645c04806.js +1 -0
  18. package/assets/esri/core/workers/chunks/283ce37403c5e7a76e95.js +1 -0
  19. package/assets/esri/core/workers/chunks/29687aae97dc01f33fa6.js +1 -0
  20. package/assets/esri/core/workers/chunks/2d6165796af522858e56.js +1 -0
  21. package/assets/esri/core/workers/chunks/2f0e850ebea0ffd2708f.js +1 -0
  22. package/assets/esri/core/workers/chunks/34cdcee6d0ea595d7aed.js +1 -0
  23. package/assets/esri/core/workers/chunks/34f2e9d7466abc0919e7.js +1 -0
  24. package/assets/esri/core/workers/chunks/36f91b5c4345a179b8b1.js +1 -0
  25. package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +1 -0
  26. package/assets/esri/core/workers/chunks/3b86e8eb553122d3b68d.js +1 -0
  27. package/assets/esri/core/workers/chunks/3b9de873f87f0feeb20b.js +1 -0
  28. package/assets/esri/core/workers/chunks/{f0bb986dce9cf75c890c.js → 3c597d8ef898627b8f93.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3ca7f5cedf3cb747c0cf.js +1 -0
  30. package/assets/esri/core/workers/chunks/3d18b8c1c759c7240721.js +1 -0
  31. package/assets/esri/core/workers/chunks/3dcb4ee8b862689a141b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{c814abf3e67d9eadbc6b.js → 414a802b6365688d31cb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/446bc8461403ed1ac7b2.js +1 -0
  34. package/assets/esri/core/workers/chunks/4bfc6f8c2d13ca4d2082.js +1 -0
  35. package/assets/esri/core/workers/chunks/4ceba469398ef55de8ea.js +1 -0
  36. package/assets/esri/core/workers/chunks/54c1d31e1efab765ee7a.js +1 -0
  37. package/assets/esri/core/workers/chunks/{84073653ff50e5d3c47a.js → 55165b6b49b87c1aff8f.js} +24 -13
  38. package/assets/esri/core/workers/chunks/582d45a41e29005f6c63.js +1 -0
  39. package/assets/esri/core/workers/chunks/586bc903e2c285649bf2.js +1 -0
  40. package/assets/esri/core/workers/chunks/{aa3bdfd00f666c6cc521.js → 5b12865ac53d984d8149.js} +1 -1
  41. package/assets/esri/core/workers/chunks/5e5b358e603b13b4d7d7.js +1 -0
  42. package/assets/esri/core/workers/chunks/5f3b25b30acd7a07f5c0.js +1 -0
  43. package/assets/esri/core/workers/chunks/620965d2e1a9ccf81d43.js +1 -0
  44. package/assets/esri/core/workers/chunks/623bfacf4b9c9a5387cc.js +1 -0
  45. package/assets/esri/core/workers/chunks/63722607fbf8d411188d.js +1 -0
  46. package/assets/esri/core/workers/chunks/64870f555fefa85a5c59.js +1 -0
  47. package/assets/esri/core/workers/chunks/{0df585420c9cec6a7265.js → 666db81085bc97831b18.js} +1 -1
  48. package/assets/esri/core/workers/chunks/67de5225b2c66c9c7bc9.js +1 -0
  49. package/assets/esri/core/workers/chunks/696f645349249f26090c.js +1 -0
  50. package/assets/esri/core/workers/chunks/{57e375d8a8db9fa57193.js → 6e8cfe69617876ee0dac.js} +1 -1
  51. package/assets/esri/core/workers/chunks/6f3f7f785241edacdb8b.js +1 -0
  52. package/assets/esri/core/workers/chunks/{ee6f7c5d3c2f187645ff.js → 7411ca5e1876aaa0228e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{94563b007647a9c4ad76.js → 75cde632887a95ea20f2.js} +1 -1
  54. package/assets/esri/core/workers/chunks/776a7179d32fe62a37e3.js +1 -0
  55. package/assets/esri/core/workers/chunks/7ddb11a127b9458e9eac.js +1 -0
  56. package/assets/esri/core/workers/chunks/7ebd836b98d14c7d3ecf.js +1 -0
  57. package/assets/esri/core/workers/chunks/80f0810527743833b4b7.js +1 -0
  58. package/assets/esri/core/workers/chunks/828998d33a48be161782.js +1 -0
  59. package/assets/esri/core/workers/chunks/8bd24534ed185afcb124.js +1 -0
  60. package/assets/esri/core/workers/chunks/8d4ddaace906dd09de2c.js +1 -0
  61. package/assets/esri/core/workers/chunks/8e10e4c25869af9da5ba.js +1 -0
  62. package/assets/esri/core/workers/chunks/8eed5b6cac937099102c.js +1 -0
  63. package/assets/esri/core/workers/chunks/{71be4833a260714d3b2c.js → 917474f9dd2039b82e9d.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{c3a0b38abf0a12a466fa.js → 965b8fa54d0cfafd4a70.js} +1 -1
  65. package/assets/esri/core/workers/chunks/9813f25192ea27084754.js +1 -0
  66. package/assets/esri/core/workers/chunks/9a3e5053e95db36f26dc.js +1 -0
  67. package/assets/esri/core/workers/chunks/9cc1b44c5a325a840307.js +1 -0
  68. package/assets/esri/core/workers/chunks/9cd548ea00b641d8e65d.js +1 -0
  69. package/assets/esri/core/workers/chunks/a2d045217a42ecc36308.js +1 -0
  70. package/assets/esri/core/workers/chunks/{9417c32ad50970ffb61a.js → a3b29eca5807978fb2a3.js} +1 -1
  71. package/assets/esri/core/workers/chunks/a52a8254577840a23aba.js +1 -0
  72. package/assets/esri/core/workers/chunks/{1cbe564cfc9eb0723827.js → aa367ca7f8326fd67881.js} +1 -1
  73. package/assets/esri/core/workers/chunks/ad9194335902c687bb96.js +1 -0
  74. package/assets/esri/core/workers/chunks/ae72c530d52a6d4461be.js +1 -0
  75. package/assets/esri/core/workers/chunks/af601eb8c938c0720406.js +1 -0
  76. package/assets/esri/core/workers/chunks/b2cf19a28aa5c32a99e3.js +1 -0
  77. package/assets/esri/core/workers/chunks/b2f497339493926d4c9e.js +1 -0
  78. package/assets/esri/core/workers/chunks/b7a3a7f7fb747f9689d7.js +1 -0
  79. package/assets/esri/core/workers/chunks/b81780e5e7cd9a1a010a.js +1 -0
  80. package/assets/esri/core/workers/chunks/b98366d8a5bc6cc2b219.js +1 -0
  81. package/assets/esri/core/workers/chunks/bb7e0334f438daa665da.js +1 -0
  82. package/assets/esri/core/workers/chunks/{5690b49f355a5e2083a9.js → c17c3453d014dc73fe0b.js} +1 -1
  83. package/assets/esri/core/workers/chunks/c1be9c4e59925a897a91.js +1 -0
  84. package/assets/esri/core/workers/chunks/{0389ebb63510dd7024de.js → c24ce19ab8580364c703.js} +2 -2
  85. package/assets/esri/core/workers/chunks/c2882a9e67124b7c18be.js +1 -0
  86. package/assets/esri/core/workers/chunks/c6112dcd6b36e256d7b5.js +1 -0
  87. package/assets/esri/core/workers/chunks/c8ae8d1b456ace0b383b.js +1 -0
  88. package/assets/esri/core/workers/chunks/{3a018c78859b5edec4fd.js → ca700e9e1bced9f99899.js} +1 -1
  89. package/assets/esri/core/workers/chunks/cc8e6d1eb90221103023.js +1 -0
  90. package/assets/esri/core/workers/chunks/d0d836502321e7a80e61.js +1 -0
  91. package/assets/esri/core/workers/chunks/d2fa8bd3f4cd3cf6b436.js +1 -0
  92. package/assets/esri/core/workers/chunks/d4b97ca16d79809ed6f2.js +1 -0
  93. package/assets/esri/core/workers/chunks/e00000468fb8ec2b3d43.js +1 -0
  94. package/assets/esri/core/workers/chunks/e0d6292aaa3f8a796de3.js +1 -0
  95. package/assets/esri/core/workers/chunks/ee582bbe7365b678ec54.js +1 -0
  96. package/assets/esri/core/workers/chunks/f4053e4e2d6e678db48a.js +1 -0
  97. package/assets/esri/core/workers/chunks/f5dbda08d7fd4bed1c62.js +1 -0
  98. package/assets/esri/core/workers/chunks/{a7dbd38bc216713044fc.js → fe21b2d31fbf83224e6b.js} +1 -1
  99. package/assets/esri/core/workers/chunks/ff8de370abf661768380.js +1 -0
  100. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  101. package/assets/esri/themes/base/widgets/_Grid.scss +14 -0
  102. package/assets/esri/themes/dark/main.css +1 -1
  103. package/assets/esri/themes/light/main.css +1 -1
  104. package/assets/esri/themes/light/view.css +1 -1
  105. package/chunks/HUDMaterial.glsl.js +34 -45
  106. package/chunks/LineCallout.glsl.js +10 -14
  107. package/config.js +1 -1
  108. package/core/timeUtils.js +1 -1
  109. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  110. package/kernel.js +1 -1
  111. package/layers/VoxelWasmPerSceneView.js +1 -1
  112. package/package.json +2 -2
  113. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  114. package/support/actions/ActionBase.d.ts +8 -0
  115. package/support/actions/ActionBase.js +1 -1
  116. package/support/actions/ActionButton.js +1 -1
  117. package/support/actions/ActionToggle.js +1 -1
  118. package/support/basemapDefinitions.js +1 -1
  119. package/support/revision.js +1 -1
  120. package/symbols/CIMSymbol.d.ts +3 -3
  121. package/symbols/ExtrudeSymbol3DLayer.d.ts +1 -1
  122. package/symbols/FillSymbol.d.ts +1 -1
  123. package/symbols/FillSymbol3DLayer.d.ts +1 -1
  124. package/symbols/IconSymbol3DLayer.d.ts +1 -1
  125. package/symbols/LabelSymbol3D.d.ts +1 -1
  126. package/symbols/LineSymbol.d.ts +1 -1
  127. package/symbols/LineSymbol3D.d.ts +1 -1
  128. package/symbols/LineSymbol3DLayer.d.ts +1 -1
  129. package/symbols/LineSymbolMarker.d.ts +1 -1
  130. package/symbols/MarkerSymbol.d.ts +1 -1
  131. package/symbols/MeshSymbol3D.d.ts +1 -1
  132. package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
  133. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  134. package/symbols/PictureFillSymbol.d.ts +1 -1
  135. package/symbols/PictureMarkerSymbol.d.ts +1 -1
  136. package/symbols/PointSymbol3D.d.ts +1 -1
  137. package/symbols/PolygonSymbol3D.d.ts +1 -1
  138. package/symbols/SimpleFillSymbol.d.ts +1 -1
  139. package/symbols/SimpleLineSymbol.d.ts +1 -1
  140. package/symbols/SimpleMarkerSymbol.d.ts +1 -1
  141. package/symbols/Symbol.d.ts +1 -1
  142. package/symbols/Symbol3D.d.ts +1 -1
  143. package/symbols/Symbol3DLayer.d.ts +1 -1
  144. package/symbols/TextSymbol.d.ts +1 -1
  145. package/symbols/TextSymbol3DLayer.d.ts +1 -1
  146. package/symbols/WebStyleSymbol.d.ts +1 -1
  147. package/time/TimeExtent.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  150. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  151. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  152. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  153. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  154. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  155. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  160. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  161. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  162. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  163. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  164. package/views/3d/webgl/RenderNode.js +1 -1
  165. package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
  166. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  167. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  168. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  169. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  170. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +13 -3
  171. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +27 -9
  172. package/views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js +7 -6
  173. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  174. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  175. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  176. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +1 -1
  177. package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
  178. package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
  179. package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
  180. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  181. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  182. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  183. package/views/3d/webgl-engine/effects/transparency/OITDimTechnique.js +1 -1
  184. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  185. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  186. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  187. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  188. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  189. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  190. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  191. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  192. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  193. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  194. package/views/3d/webgl.js +1 -1
  195. package/views/VideoView.js +1 -1
  196. package/views/draw/DrawTool.js +1 -1
  197. package/views/webgl/RenderingContext.js +1 -1
  198. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  199. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  200. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +3 -3
  201. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  202. package/widgets/Popup/actions.js +1 -1
  203. package/widgets/Sketch/SketchViewModel.js +1 -1
  204. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  205. package/widgets/TimeSlider.js +1 -1
  206. package/assets/esri/core/workers/chunks/011b31df019b3ce2277e.js +0 -1
  207. package/assets/esri/core/workers/chunks/018859b79f9ce7528ac7.js +0 -1
  208. package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +0 -1
  209. package/assets/esri/core/workers/chunks/0711c856144cd8700e7e.js +0 -1
  210. package/assets/esri/core/workers/chunks/0ca9953afaea7c7e11e0.js +0 -1
  211. package/assets/esri/core/workers/chunks/1482262d0788ee65ddf7.js +0 -1
  212. package/assets/esri/core/workers/chunks/15d7c9f5a55985ed00b4.js +0 -1
  213. package/assets/esri/core/workers/chunks/16b9ac49d13057b3aff5.js +0 -1
  214. package/assets/esri/core/workers/chunks/172137cc98be03de1436.js +0 -1
  215. package/assets/esri/core/workers/chunks/179b3385c24ad8a05e1d.js +0 -1
  216. package/assets/esri/core/workers/chunks/18a40606e4c39f244ecd.js +0 -1
  217. package/assets/esri/core/workers/chunks/19cb4720e92ac3c0478c.js +0 -1
  218. package/assets/esri/core/workers/chunks/1d697642fb2a6332b7f9.js +0 -1
  219. package/assets/esri/core/workers/chunks/2003dae2d7f6d52ea643.js +0 -1
  220. package/assets/esri/core/workers/chunks/209acb3ad16c99bb506c.js +0 -1
  221. package/assets/esri/core/workers/chunks/23079a2e584fca0bdb66.js +0 -1
  222. package/assets/esri/core/workers/chunks/2e06baf6469820697f17.js +0 -1
  223. package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +0 -1
  224. package/assets/esri/core/workers/chunks/2f3aeaa25a76ab94b8e5.js +0 -1
  225. package/assets/esri/core/workers/chunks/33de1d899a4fa9ab6ab1.js +0 -1
  226. package/assets/esri/core/workers/chunks/359d3ba9d6e3b1de05d1.js +0 -1
  227. package/assets/esri/core/workers/chunks/36fd18a05ba503e6f3b5.js +0 -1
  228. package/assets/esri/core/workers/chunks/38d5dd4d457428244302.js +0 -1
  229. package/assets/esri/core/workers/chunks/3a8f2f6ac3c3e7e71c00.js +0 -1
  230. package/assets/esri/core/workers/chunks/3ad1edf199e7159f3cc2.js +0 -1
  231. package/assets/esri/core/workers/chunks/452d71789a1b77cff48d.js +0 -1
  232. package/assets/esri/core/workers/chunks/48a56b19bf825f05cc6e.js +0 -1
  233. package/assets/esri/core/workers/chunks/48e66b78274b82478bae.js +0 -1
  234. package/assets/esri/core/workers/chunks/48fb1520cb8c5ce248d9.js +0 -1
  235. package/assets/esri/core/workers/chunks/4e9b3b4b3dcce94c99a5.js +0 -1
  236. package/assets/esri/core/workers/chunks/5028de543cc1b8e60e65.js +0 -1
  237. package/assets/esri/core/workers/chunks/544bfa97837770a8792f.js +0 -1
  238. package/assets/esri/core/workers/chunks/55d4483b1862077e3732.js +0 -1
  239. package/assets/esri/core/workers/chunks/561484ab6ed564e4b90f.js +0 -1
  240. package/assets/esri/core/workers/chunks/592f6bf0283152481f21.js +0 -1
  241. package/assets/esri/core/workers/chunks/5b70ee8122262de5bbdf.js +0 -1
  242. package/assets/esri/core/workers/chunks/6138a528c3820af81bc6.js +0 -1
  243. package/assets/esri/core/workers/chunks/72cd450b24fdfcef6547.js +0 -1
  244. package/assets/esri/core/workers/chunks/75fd96fd9557ac1f8e10.js +0 -1
  245. package/assets/esri/core/workers/chunks/777b0e07f72c42470d36.js +0 -1
  246. package/assets/esri/core/workers/chunks/7b297a2f712361bfae2e.js +0 -1
  247. package/assets/esri/core/workers/chunks/7d274a077bdfa8c485e8.js +0 -1
  248. package/assets/esri/core/workers/chunks/7dd1e93469d0b1d652bc.js +0 -1
  249. package/assets/esri/core/workers/chunks/835a929e37811d0f82cb.js +0 -1
  250. package/assets/esri/core/workers/chunks/843c505148ed728d3c30.js +0 -1
  251. package/assets/esri/core/workers/chunks/8dcc8df5925f66e45b8c.js +0 -1
  252. package/assets/esri/core/workers/chunks/8eae33c4d8932b7a6bc1.js +0 -1
  253. package/assets/esri/core/workers/chunks/91e56959b2fddf1a9743.js +0 -1
  254. package/assets/esri/core/workers/chunks/925980d26d71987ac80c.js +0 -1
  255. package/assets/esri/core/workers/chunks/9bd5c56f879eb935d906.js +0 -1
  256. package/assets/esri/core/workers/chunks/aa9c11f25d95372998a3.js +0 -1
  257. package/assets/esri/core/workers/chunks/aec33bdb355bd04f28ae.js +0 -1
  258. package/assets/esri/core/workers/chunks/af618a1c55c15e17189b.js +0 -1
  259. package/assets/esri/core/workers/chunks/b35ea099334c867bde02.js +0 -1
  260. package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +0 -1
  261. package/assets/esri/core/workers/chunks/b730131e52f9220db031.js +0 -1
  262. package/assets/esri/core/workers/chunks/b81824d62be92ab595f7.js +0 -1
  263. package/assets/esri/core/workers/chunks/b9d68a5dcb50999d3a90.js +0 -1
  264. package/assets/esri/core/workers/chunks/bae7376b554cac4a8f96.js +0 -1
  265. package/assets/esri/core/workers/chunks/bcd701892ee120e13a18.js +0 -1
  266. package/assets/esri/core/workers/chunks/c1c006c86cf31f934684.js +0 -1
  267. package/assets/esri/core/workers/chunks/cb6a7ca4ba2cf0b5ced7.js +0 -1
  268. package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +0 -1
  269. package/assets/esri/core/workers/chunks/d72d5031887373d35610.js +0 -1
  270. package/assets/esri/core/workers/chunks/d8896c57a414f2450190.js +0 -1
  271. package/assets/esri/core/workers/chunks/da780342f16e65b55ac8.js +0 -1
  272. package/assets/esri/core/workers/chunks/db005d9419bb718b3962.js +0 -1
  273. package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +0 -1
  274. package/assets/esri/core/workers/chunks/e2bdb0e87422e222646e.js +0 -1
  275. package/assets/esri/core/workers/chunks/e4faccd48060349b8da1.js +0 -1
  276. package/assets/esri/core/workers/chunks/ea245d3a6fd601fffd88.js +0 -1
  277. package/assets/esri/core/workers/chunks/efb2a8879011d2d77a81.js +0 -1
  278. package/assets/esri/core/workers/chunks/f6c9742691ccdaed44a2.js +0 -1
  279. package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +0 -1
  280. package/assets/esri/core/workers/chunks/fd9ef90e2ebb7fed62b1.js +0 -1
  281. package/assets/esri/core/workers/chunks/feac196493ccd087de35.js +0 -1
  282. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +0 -19
  283. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js +0 -9
  284. /package/assets/esri/core/workers/chunks/{0389ebb63510dd7024de.js.LICENSE.txt → c24ce19ab8580364c703.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import s from"../../../core/Error.js";import t from"../../../core/Logger.js";import{watch as i,initial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{cross as l,normalize as n,set as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as p}from"../../../geometry/support/aaBoundingBox.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as _}from"./LayerView3D.js";import{VoxelGraphic as b}from"./VoxelGraphic.js";import{addLayerViewToWasm as w,getVoxelWasm as V,removeLayerViewFromWasm as f}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as g}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import v from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as W,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";const x=d(),L=d();let M=class extends(S(_(v))){constructor(){super(...arguments),this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.type="voxel-3d",this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this.ignoresMemoryFactor=!0,this._dbgFlags=new Set}get baseUrl(){return this.layer.parsedUrl?.path??""}get wasmLayerId(){return this._wasmLayerId}initialize(){if(this._dbgFlags.add(3),"local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!!!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new s("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!y(e,this.view.spatialReference))throw W("voxel layer",e.wkid,this.view.spatialReference.wkid);const t=this.layer.currentVariableId,o=this.layer.getVolume(t),r=this.layer.getVariable(t);if(null!=o&&null!=r){const e=o.dimensions[0],s=o.dimensions[1],t=o.zDimension;if(t>1){const i=o.dimensions[t],a=e.size*s.size*i.size;let l=1;switch(r.renderingFormat.type){case"Int16":case"UInt16":l=2;break;case"Int32":case"UInt32":case"Float32":l=4}this._futureMemory=l*a}}const l=w(this).then(e=>{this._wasmLayerId=e,this._suspendedHandle=i(()=>this.suspended,e=>{const s=V(this.view);s&&s.setEnabled(this,!e)},a),this.addHandles([i(()=>this.layer.renderMode,e=>this._pushRenderModeToWasm(e)),i(()=>this.layer.currentVariableId,e=>this._pushCurrentVariableIdToWasm(e)),i(()=>this.layer.getSections(),e=>this._pushSectionsToWasm(e)),i(()=>this.layer.getVariableStyles(),e=>this._pushVariableStylesToWasm(e)),i(()=>this.layer.getVolumeStyles(),e=>this._pushVolumeStylesToWasm(e)),i(()=>this.layer.enableDynamicSections,e=>this._pushEnableDynamicSectionsToWasm(e)),i(()=>this.layer.enableIsosurfaces,e=>this._pushEnableIsosurfacesToWasm(e)),i(()=>this.layer.enableSections,e=>this._pushEnableSectionsToWasm(e)),i(()=>this.layer.enableSlices,e=>this._pushEnableSlicesToWasm(e)),i(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),i(()=>this.slicePlaneEnabled,e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane)),i(()=>this.view.slice.plane,e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e))])}).catch(e=>{if(f(this),this._wasmLayerId=-1,-1===e)throw new s("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new s("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})});this.addResolvingPromise(l)}destroy(){f(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=V(this.view);return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new g(this.usedMemory)}get visibleAtCurrentScale(){return T(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,s){const t=e.attributes["Voxel.WorldPosition"];if(t){const e=m(),s=JSON.parse(t);if(u(s,this.view.renderSpatialReference,L,this.view.spatialReference||c.WGS84))return p(e,L),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,s){const t=V(this.view);if(!t)return e;const i=[];for(const a of e)this._isValidVoxelGraphic(a)&&i.push(a);return i.length&&await t.getOtherFieldPopupValues(i,s),e}_isValidVoxelGraphic(e){return e instanceof b}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=V(this.view);e?.captureFrustum()}toggleFullVolumeExtentDraw(){const e=V(this.view);e?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){const e=V(this.view);return e?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){const e=V(this.view);return e?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){const e=V(this.view);e?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setRenderMode(this,e)||this._dbg(3,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setStaticSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s?"have WASM":"don't have WASM!!!")),s?.setCurrentVariable(this,e)||this._dbg(3,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setVariableStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(e,s){const t=null!=s?s:this.layer.enableSlices;for(let i=0;i<e.length;++i){const s=e[i];for(const e of s.slices)e.enabled=e.enabled&&t}}_pushVolumeStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVolumeStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s&&(this._accountForEnableSlices(e,null),s.setVolumeStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVolumeStylesToWasm() failed!"))}_pushAnalysisSliceToWasm(e,s){const t=V(this.view);this._dbg(2,"VoxelLayerView3D._pushAnalysisSliceToWasm() called, "+(t?"have WASM":"don't have WASM!!!"));let i=!1;if(t){if(s){const a=s.origin;l(x,s.basis1,s.basis2),n(x,x),i=t.setAnalysisSlice(this,e,a,x)}else h(x,0,0,1),i=t.setAnalysisSlice(this,!1,x,x);i||this._dbg(3,"VoxelLayerView3D._pushAnalysisSliceToWasm() failed!")}}_updateLayerTimeProperties(){const e=V(this.view);this._dbg(2,"VoxelLayerView3D._updateLayerTimeProperties() called, "+(e?"have WASM":"don't have WASM!!!")),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableDynamicSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!")}_pushEnableSlicesToWasm(e){const s=V(this.view);if(this._dbg(2,"VoxelLayerView3D._pushEnableSlicesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s){const t=this.layer.getVolumeStyles();this._accountForEnableSlices(t,e),s.setVolumeStyles(this,t)||this._dbg(3,"VoxelLayerView3D._pushEnableSlicesToWasm() failed!")}}_pushEnableIsosurfacesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableIsosurfaces(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!")}_pushEnableSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableSectionsToWasm() failed!")}_dbg(e,s){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(s):t.getLogger(this).warn(s))}};e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"baseUrl",null),e([o({type:Boolean})],M.prototype,"slicePlaneEnabled",void 0),e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),M=e([r("esri.views.3d.layers.VoxelLayerView3D")],M);const A=M;export{A as default};
2
+ import{__decorate as e}from"tslib";import s from"../../../core/Error.js";import t from"../../../core/Logger.js";import{watch as i,initial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{cross as l,normalize as n,set as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{empty as m,expandWithVec3 as p}from"../../../geometry/support/aaBoundingBox.js";import{equals as y}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as _}from"./LayerView3D.js";import{VoxelGraphic as b}from"./VoxelGraphic.js";import{addLayerViewToWasm as w,getVoxelWasm as V,removeLayerViewFromWasm as f}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as g}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import v from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as W,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";const x=d(),L=d();let M=class extends(S(_(v))){constructor(){super(...arguments),this.type="voxel-3d",this.ignoresMemoryFactor=!0,this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this._dbgFlags=new Set}initialize(){if(this._dbgFlags.add(3),"local"!==this.view.viewingMode)throw new s("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!!!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new s("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!y(e,this.view.spatialReference))throw W("voxel layer",e.wkid,this.view.spatialReference.wkid);const t=this.layer.currentVariableId,o=this.layer.getVolume(t),r=this.layer.getVariable(t);if(null!=o&&null!=r){const e=o.dimensions[0],s=o.dimensions[1],t=o.zDimension;if(t>1){const i=o.dimensions[t],a=e.size*s.size*i.size;let l=1;switch(r.renderingFormat.type){case"Int16":case"UInt16":l=2;break;case"Int32":case"UInt32":case"Float32":l=4}this._futureMemory=l*a}}const l=w(this).then(e=>{this._wasmLayerId=e,this._suspendedHandle=i(()=>this.suspended,e=>{const s=V(this.view);s&&s.setEnabled(this,!e)},a),this.addHandles([i(()=>this.layer.renderMode,e=>this._pushRenderModeToWasm(e)),i(()=>this.layer.currentVariableId,e=>this._pushCurrentVariableIdToWasm(e)),i(()=>this.layer.getSections(),e=>this._pushSectionsToWasm(e)),i(()=>this.layer.getVariableStyles(),e=>this._pushVariableStylesToWasm(e)),i(()=>this.layer.getVolumeStyles(),e=>this._pushVolumeStylesToWasm(e)),i(()=>this.layer.enableDynamicSections,e=>this._pushEnableDynamicSectionsToWasm(e)),i(()=>this.layer.enableIsosurfaces,e=>this._pushEnableIsosurfacesToWasm(e)),i(()=>this.layer.enableSections,e=>this._pushEnableSectionsToWasm(e)),i(()=>this.layer.enableSlices,e=>this._pushEnableSlicesToWasm(e)),i(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),i(()=>this.slicePlaneEnabled,e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane)),i(()=>this.view.slice.plane,e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e))])}).catch(e=>{if(f(this),this._wasmLayerId=-1,-1===e)throw new s("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(-2===e)throw new s("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})});this.addResolvingPromise(l)}destroy(){f(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=V(this.view);return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new g(this.usedMemory)}get visibleAtCurrentScale(){return T(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,s){const t=e.attributes["Voxel.WorldPosition"];if(t){const e=m(),s=JSON.parse(t);if(u(s,this.view.renderSpatialReference,L,this.view.spatialReference||c.WGS84))return p(e,L),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,s){const t=V(this.view);if(!t)return e;const i=[];for(const a of e)this._isValidVoxelGraphic(a)&&i.push(a);return i.length&&await t.getOtherFieldPopupValues(i,s),e}_isValidVoxelGraphic(e){return e instanceof b}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=V(this.view);e?.captureFrustum()}toggleFullVolumeExtentDraw(){const e=V(this.view);e?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){const e=V(this.view);return e?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){const e=V(this.view);return e?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){const e=V(this.view);e?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setRenderMode(this,e)||this._dbg(3,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setStaticSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s?"have WASM":"don't have WASM!!!")),s?.setCurrentVariable(this,e)||this._dbg(3,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setVariableStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(e,s){const t=null!=s?s:this.layer.enableSlices;for(let i=0;i<e.length;++i){const s=e[i];for(const e of s.slices)e.enabled=e.enabled&&t}}_pushVolumeStylesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushVolumeStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s&&(this._accountForEnableSlices(e,null),s.setVolumeStyles(this,e)||this._dbg(3,"VoxelLayerView3D._pushVolumeStylesToWasm() failed!"))}_pushAnalysisSliceToWasm(e,s){const t=V(this.view);this._dbg(2,"VoxelLayerView3D._pushAnalysisSliceToWasm() called, "+(t?"have WASM":"don't have WASM!!!"));let i=!1;if(t){if(s){const a=s.origin;l(x,s.basis1,s.basis2),n(x,x),i=t.setAnalysisSlice(this,e,a,x)}else h(x,0,0,1),i=t.setAnalysisSlice(this,!1,x,x);i||this._dbg(3,"VoxelLayerView3D._pushAnalysisSliceToWasm() failed!")}}_updateLayerTimeProperties(){const e=V(this.view);this._dbg(2,"VoxelLayerView3D._updateLayerTimeProperties() called, "+(e?"have WASM":"don't have WASM!!!")),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableDynamicSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!")}_pushEnableSlicesToWasm(e){const s=V(this.view);if(this._dbg(2,"VoxelLayerView3D._pushEnableSlicesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s){const t=this.layer.getVolumeStyles();this._accountForEnableSlices(t,e),s.setVolumeStyles(this,t)||this._dbg(3,"VoxelLayerView3D._pushEnableSlicesToWasm() failed!")}}_pushEnableIsosurfacesToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableIsosurfaces(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!")}_pushEnableSectionsToWasm(e){const s=V(this.view);this._dbg(2,"VoxelLayerView3D._pushEnableSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s?.setEnableSections(this,e)||this._dbg(3,"VoxelLayerView3D._pushEnableSectionsToWasm() failed!")}get baseUrl(){return this.layer.parsedUrl?.path??""}get wasmLayerId(){return this._wasmLayerId}_dbg(e,s){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(s):t.getLogger(this).warn(s))}};e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"baseUrl",null),e([o({type:Boolean})],M.prototype,"slicePlaneEnabled",void 0),M=e([r("esri.views.3d.layers.VoxelLayerView3D")],M);const A=M;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{lerp as e}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{transpose as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as l,scale as u,round as h,copy as d,set as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as _,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as f,transformMat4 as m,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as O}from"../../../../geometry/ellipsoidUtils.js";import{create as w,empty as Q,copy as D,offset as G,width as I,height as j,expand as P}from"../../../../geometry/support/aaBoundingRect.js";import{e as k,d as S,c as T}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{Sphere as M,sphereCSO as V}from"../../../../geometry/support/sphere.js";import{RenderNodeOutput as x}from"../../webgl.js";import{DeconflictAABR as U}from"./DeconflictAABR.js";import{prepare as R,drawPoly as A}from"./deconflictorDebug.js";import{isSymbolLayerWithTransparencyMode as E}from"./transparencyUtils.js";import N from"../../webgl/RenderCamera.js";import{GPUPointOcclusionQuery as q}from"../../webgl-engine/lib/GPUPointOcclusionQuery.js";import{SeparateScreenSizePerspectiveEvaluators as H}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as W}from"../../webgl-engine/materials/HUDMaterial.js";import{Yield as z}from"../../../support/Yield.js";const F=y(),B=y(),L=v(),Y=v(),J=y(),K=n(),X=new M,Z=C(),$=y(),ii=w();class ti{constructor(i){this.id=i,this.aabr=w(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.culled=!1,this.visible=!1,this.priority=0}}function ei(i,t){const e=0!==i.distanceToOccluder&&i.distance>i.distanceToOccluder,s=0!==t.distanceToOccluder&&t.distance>t.distanceToOccluder;return e!==s?+e-+s:i.priority!==t.priority?t.priority-i.priority:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?+t.visible-+i.visible:i.id-t.id}class si{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this._info=null,this._labelInfo=null}ensureInfo(i){let t=this.getInfo(i);return t||(t=new ti(this.graphics3DGraphic.graphic.uid),this._setInfo(i,t)),t}getInfo(i){return 16===i?this._labelInfo:this._info}removeInfo(i){this._setInfo(i,null)}_setInfo(i,t){16===i?this._labelInfo=t:this._info=t}}class ri{constructor(){this.camera=new N,this.slicePlane=S(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.equals(i.camera)||this.camera.copyFrom(i.camera),T(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let oi=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._viewState=new ri,this._state=0,this._checkOcclusion=new Map,this._active=new Map,this._checkOcclusionIterator=null,this._activeIterator=null,this._occlusionQueryUids=new Array,this._updatingHandles=new b,this._deconflictor=new U((i,t)=>{i.visible=t,this._setGraphicVisibility(this._active.get(i.id),t)},(i,t)=>i.id!==t.id,ei),this._baseOccludedVisibility=10,this._altitudeFactor=2,this._minAltitudeDifference=100}initialize(){this._updatingHandles.add(()=>(this.view?.map?.ground?.opacity??0)>0,()=>this.setDirty()),this._updatingHandles.add(()=>this.view.ready,()=>{this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this.setDirty()})}destroy(){this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this._updatingHandles.destroy(),this._deconflictor.destroy(),this._checkOcclusion.clear(),this._active.clear()}setDirty(){!this._dirty&&(this._active.size>0||this._checkOcclusion.size>0)&&(this._dirty=!0,this.notifyChange("_readyToRun"))}setPriority(i,t){const e=this._active.get(i.graphic.uid)?.getInfo(this.visibilityGroup);e&&(e.priority=t)}get _readyToRun(){return 0!==this._state||this._dirty}get updating(){return this._readyToRun||this._updatingHandles.updating}get updatingProgress(){if(!this.updating)return 1;const i=this._state/5;return this._dirty?.5*i:i}get readyToRun(){return this.view.ready&&null!=this.view.state&&this._readyToRun}get usedMemory(){return this._occlusionQuery?.usedMemory??0+4*(this._occlusionQueryUids?.length??0)}runTask(i){switch(this._state){case 0:this._startUpdate(),i.madeProgress();case 1:if(this._state=1,!this._processCheckOcclusion(i))return;case 2:if(this._state=2,!(this._occlusionQuery?.done??1)||!(this._opaqueOcclusionQuery?.done??1))return z;this._readOcclusionQueryResult(),i.madeProgress();case 3:if(this._state=3,!this._collectActiveGraphics(i))return;case 4:if(this._state=4,this._deconflictor.run(i),!this._deconflictor.done)return;default:this._state=0,this.notifyChange("_readyToRun")}}setGraphicsActive(i,t){t?i.forEach(i=>this.addToActiveGraphics(i)):i.forEach(i=>this.removeFromActiveGraphics(i))}isSupportedLayer(i){if(null==i||!("hiddenIfDeconflicted"in i)||!i.hiddenIfDeconflicted)return!1;const t=i.stageObject;if(1!==(t?.geometries.length??0))return!1;const e=t?.geometries[0],s=e?.material;return s instanceof W}_startUpdate(){R(this.view),this._dirty=!1,this._viewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._viewState.camera;if(this._deconflictor.reset(i,t),this._resetIterators(),this._occlusionQueryUids.length=0,!this._checkOcclusion.size)return this._occlusionQuery=s(this._occlusionQuery),void(this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery))}addToActiveGraphics(i){i.ensureInfo(this.visibilityGroup),this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){ci(i,this.visibilityGroup),i.removeInfo(this.visibilityGroup),this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}addToCheckOcclusion(i){this._checkOcclusion.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromCheckOcclusion(i){this._checkOcclusion.delete(i.graphics3DGraphic.graphic.uid)}_processCheckOcclusion(i){if(0===this._checkOcclusion.size)return!0;const t=this._ensureCheckOcclusionIterator(),e=this._viewState.camera,r=c(K,e.viewInverseTransposeMatrix),o=this.view.map.ground.opacity>0,n="global"===this.view.viewingMode&&o&&e.relativeElevation>0?X:null;let a=0;null!=n&&(l(n.center,_,e.viewMatrix),n.radius=O(this.view.spatialReference).radius,a=V.distanceToSilhouette(n,_));const u=w();for(;;){if(i.done)return!1;i.madeProgress();const s=t.next();if(!0===s.done)break;const o=s.value,c=o.graphics3DGraphic;if(c.destroyed)continue;if(!c.isVisible(1,8))continue;const h=ui(c,this.visibilityGroup);let d=null,p=!0,_=!1;for(const i of h){if(!this.isSupportedLayer(i))continue;d=hi,this._projectHudLayer(i,e,d),Q(u);const t=i.stageObject.geometries[0].material;if(this._expandBoundingRect(u,e,i,t,d),d.isOutsideScreen){p=!1;break}if(this._isCulledBySlice(o,d.positionWorld)){p=!1;break}if(null!=n&&li(d,n,a)){p=!1;break}d.altitude=this.view.renderCoordsHelper.getAltitude(d.positionWorld);const s=o.ensureInfo(this.visibilityGroup);if(s.altitude=d.altitude,s.distance=d.distance,s.distanceToOccluder=d.distanceToOccluder,s.culled=!1,D(s.aabr,u),t.parameters.useVisibilityPixel||"visible"===t.parameters.occludedVisibilityMode)break;l(B,d.positionView,r);const h=this._ensureOcclusionQuery(),y=this._ensureOpaqueOcclusionQuery();0===this._occlusionQueryUids.length&&(this._initOcclusionQuery(h),this._initOcclusionQuery(y));const f=h.addPosition(B),m=y.addPosition(B);if(f===this._occlusionQueryUids.length&&m===f){const i="adaptive"===t.parameters.occludedVisibilityMode;this._occlusionQueryUids.push(i?-c.graphic.uid:c.graphic.uid),_=!0}break}const y=this._active.has(c.graphic.uid);if(y||_){if(y&&(!p||!d)){const i=o.ensureInfo(this.visibilityGroup);i.visible=!d,i.culled=!0}}else this._setGraphicVisibility(o,p)}return this._checkOcclusionIterator=null,this._occlusionQueryUids.length||(this._occlusionQuery=s(this._occlusionQuery),this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery)),this._occlusionQuery?.start(),this._opaqueOcclusionQuery?.start(),!0}_readOcclusionQueryResult(){if(!this._occlusionQuery||!this._occlusionQueryUids.length)return;const i=this._viewState.camera,t=this.view.renderCoordsHelper.getAltitude(i.eye);for(let e=0;e<this._occlusionQueryUids.length;e++){const i=this._occlusionQueryUids[e],s=Math.abs(i),r=i<0,o=this._checkOcclusion.get(s);if(!o)continue;const c=this._occlusionQuery.getOcclusion(e)??-1,n=this._opaqueOcclusionQuery?.getOcclusion(e)??-1,a=o.getInfo(this.visibilityGroup);a&&(a.distanceToOccluder=c>0?a.distance-c:0);const l=0===n||n>0&&this._occludedVisibility(a?a.distance-n:0,a?.distance??n,a?.altitude??0,t,r),u=0===c||c>0&&this._occludedVisibility(a?.distanceToOccluder??0,a?.distance??c,a?.altitude??0,t,r),h=l||u;h&&this._setTransparentMode(o,l&&!u),this._active.has(s)?a&&(a.culled=!h,a.visible=h):this._setGraphicVisibility(o,h)}this._occlusionQueryUids.length=0}_collectActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),e=16===this.visibilityGroup;for(;!i.done;){i.madeProgress();const s=t.next();if(!0===s.done)return this._activeIterator=null,!0;const r=s.value,o=r.getInfo(this.visibilityGroup);if(!o)continue;const c=!e||r.graphics3DGraphic.isVisible();!c||o.culled?(A(o.aabr,!1,!0),this._setGraphicVisibility(r,c&&o.visible)):this._deconflictor.add(o)}return!1}_occludedVisibility(i,t,e,s,r=!0){const o=Math.max(this._minAltitudeDifference,Math.abs(e-s))-this._minAltitudeDifference,c=r?this._baseOccludedVisibility+this._altitudeFactor*o:0;return 0===i||t-i<=c}_resetIterators(){this._checkOcclusionIterator=null,this._activeIterator=null}_ensureCheckOcclusionIterator(){return this._checkOcclusionIterator??=this._checkOcclusion.values(),this._checkOcclusionIterator}_ensureActiveGraphicsIterator(){return this._activeIterator??=this._active.values(),this._activeIterator}_initOcclusionQuery(i){if(!i)return;const{camera:t}=this._viewState,e=2,s=Math.max(e,e+Math.round(Math.log2(Math.abs(t.relativeElevation))));u(F,this._viewState.camera.eye,2**-s),u(F,h(F,F),2**s),i.init(this._checkOcclusion.size,F)}_ensureOcclusionQuery(){return this._occlusionQuery??=new q({view:this.view}),this._occlusionQuery}_ensureOpaqueOcclusionQuery(){return this._opaqueOcclusionQuery??=new q({view:this.view,category:x.OPAQUE}),this._opaqueOcclusionQuery}_getNumVisible(i){return[...this._checkOcclusion.values()].reduce((t,e)=>t+(e.getInfo(i)?.visible?1:0),0)}_projectHudLayer(i,t,e){const s=i.stageObject,r=s.geometries[0],o=r.material;d(B,s.boundingVolumeWorldSpace.bounds.center),l(F,B,t.viewMatrix);const c=r.attributes,n=c.get("normal").data,a=c.get("centerOffset")?.data??_,[h]=c.get("groundDistance").data;o.applyShaderOffsets(B,F,n,s.transformation,a,h,t,e.screenSizePerspectiveEvaluators),f(L,F[0],F[1],F[2],1),m(Y,L,t.projectionMatrix),u(e.positionNDC,Y,1/Y[3]),o.applyShaderOffsetsNDC(e.positionNDC,a,h,t,e.positionNDC,J),e.distanceWithoutPolygonOffset=t.depthNDCToWorld(J[2]),e.distance=J[2]===e.positionNDC[2]?e.distanceWithoutPolygonOffset:t.depthNDCToWorld(e.positionNDC[2]),f(Y,e.positionNDC[0],e.positionNDC[1],e.positionNDC[2],1),m(L,Y,t.inverseProjectionMatrix),g(L,L,1/L[3]),p(e.positionView,L[0],L[1],L[2]),d(e.positionWorld,B)}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&k(this._viewState.slicePlane,t)}_expandBoundingRect(i,t,s,r,{positionNDC:o,screenSizePerspectiveEvaluators:c}){const n=s.getScreenSize(ni);c.evaluator.applyVec2(n,n),n[0]*=t.pixelRatio,n[1]*=t.pixelRatio;const a=G(r.calculateRelativeScreenBounds(n,c.alignmentEvaluator.apply(t.pixelRatio),ii),e(0,t.fullWidth,.5+.5*o[0]),e(0,t.fullHeight,.5+.5*o[1])),l=this.marginFactor;if(0!==l){const i=l*Math.min(I(a),j(a));a[0]-=i,a[1]-=i,a[2]+=i,a[3]+=i}P(i,a,i)}_setGraphicVisibility(i,t){const e=i?.graphics3DGraphic;e&&!e.destroyed&&(e.setVisibilityFlag(this.visibilityGroup,8,t),16===this.visibilityGroup&&this.view.labeler.setLabelGraphicVisibility(e,t))}_setTransparentMode(i,t){const e=i?.graphics3DGraphic;if(e&&!e.destroyed)for(const s of e.layers){if("object3d"!==s?.type)continue;const{graphics3DSymbolLayer:i}=s;E(i)&&i.updateTransparentMode(s,t)}}};function ci(i,t){const e=i.graphics3DGraphic;e.destroyed||e.setVisibilityFlag(t,8,!0)}i([r({constructOnly:!0})],oi.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],oi.prototype,"_readyToRun",null),i([r({type:Boolean,readOnly:!0})],oi.prototype,"updating",null),i([r({readOnly:!0})],oi.prototype,"_updatingHandles",void 0),oi=i([o("esri.views.3d.layers.graphics.Deconflictor")],oi);const ni=a();class ai{constructor(){this.positionWorld=y(),this.positionView=y(),this.positionNDC=y(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.distanceWithoutPolygonOffset=0,this.screenSizePerspectiveEvaluators=new H}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1||i[2]>=1}}function li(i,t,e){return d(Z.direction,i.positionView),p(Z.origin,0,0,0),!!t.intersectRay(Z,$)&&i.distanceWithoutPolygonOffset>e}function ui(i,t){return 16===t?i.labelLayers:i.layers}const hi=new ai;export{oi as Deconflictor,si as DeconflictorGraphic,ri as DeconflictorViewState};
2
+ import{__decorate as i}from"tslib";import t from"../../../../core/Accessor.js";import{lerp as e}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{transpose as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as l,scale as u,round as h,copy as d,set as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as _,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as f,transformMat4 as m,scale as g}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as O}from"../../../../geometry/ellipsoidUtils.js";import{create as w,empty as Q,copy as D,offset as G,width as I,height as j,expand as P}from"../../../../geometry/support/aaBoundingRect.js";import{e as k,d as S,c as T}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{Sphere as M,sphereCSO as V}from"../../../../geometry/support/sphere.js";import{RenderNodeOutput as x}from"../../webgl.js";import{DeconflictAABR as U}from"./DeconflictAABR.js";import{prepare as R,drawPoly as A}from"./deconflictorDebug.js";import{isSymbolLayerWithTransparencyMode as E}from"./transparencyUtils.js";import N from"../../webgl/RenderCamera.js";import{GPUPointOcclusionQuery as q}from"../../webgl-engine/lib/GPUPointOcclusionQuery.js";import{SeparateScreenSizePerspectiveEvaluators as H}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as W}from"../../webgl-engine/materials/HUDMaterial.js";import{Yield as z}from"../../../support/Yield.js";const F=y(),B=y(),L=v(),Y=v(),J=y(),K=n(),X=new M,Z=C(),$=y(),ii=w();class ti{constructor(i){this.id=i,this.aabr=w(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.culled=!1,this.visible=!1,this.priority=0}}function ei(i,t){const e=0!==i.distanceToOccluder&&i.distance>i.distanceToOccluder,s=0!==t.distanceToOccluder&&t.distance>t.distanceToOccluder;return e!==s?+e-+s:i.priority!==t.priority?t.priority-i.priority:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?+t.visible-+i.visible:i.id-t.id}class si{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this._info=null,this._labelInfo=null}ensureInfo(i){let t=this.getInfo(i);return t||(t=new ti(this.graphics3DGraphic.graphic.uid),this._setInfo(i,t)),t}getInfo(i){return 16===i?this._labelInfo:this._info}removeInfo(i){this._setInfo(i,null)}_setInfo(i,t){16===i?this._labelInfo=t:this._info=t}}class ri{constructor(){this.camera=new N,this.slicePlane=S(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.equals(i.camera)||this.camera.copyFrom(i.camera),T(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let oi=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._viewState=new ri,this._state=0,this._checkOcclusion=new Map,this._active=new Map,this._checkOcclusionIterator=null,this._activeIterator=null,this._occlusionQueryUids=new Array,this._updatingHandles=new b,this._deconflictor=new U((i,t)=>{i.visible=t,this._setGraphicVisibility(this._active.get(i.id),t)},(i,t)=>i.id!==t.id,ei),this._baseOccludedVisibility=10,this._altitudeFactor=2,this._minAltitudeDifference=100}initialize(){this._updatingHandles.add(()=>(this.view?.map?.ground?.opacity??0)>0,()=>this.setDirty()),this._updatingHandles.add(()=>this.view.ready,()=>{this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this.setDirty()})}destroy(){this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this._updatingHandles.destroy(),this._deconflictor.destroy(),this._checkOcclusion.clear(),this._active.clear()}setDirty(){!this._dirty&&(this._active.size>0||this._checkOcclusion.size>0)&&(this._dirty=!0,this.notifyChange("_readyToRun"))}setPriority(i,t){const e=this._active.get(i.graphic.uid)?.getInfo(this.visibilityGroup);e&&(e.priority=t)}get _readyToRun(){return 0!==this._state||this._dirty}get updating(){return this._readyToRun||this._updatingHandles.updating}get updatingProgress(){if(!this.updating)return 1;const i=this._state/5;return this._dirty?.5*i:i}get readyToRun(){return this.view.ready&&null!=this.view.state&&this._readyToRun}get usedMemory(){return this._occlusionQuery?.usedMemory??0+4*(this._occlusionQueryUids?.length??0)}runTask(i){switch(this._state){case 0:this._startUpdate(),i.madeProgress();case 1:if(this._state=1,!this._processCheckOcclusion(i))return;case 2:if(this._state=2,!(this._occlusionQuery?.done??1)||!(this._opaqueOcclusionQuery?.done??1))return z;this._readOcclusionQueryResult(),i.madeProgress();case 3:if(this._state=3,!this._collectActiveGraphics(i))return;case 4:if(this._state=4,this._deconflictor.run(i),!this._deconflictor.done)return;default:this._state=0,this.notifyChange("_readyToRun")}}setGraphicsActive(i,t){t?i.forEach(i=>this.addToActiveGraphics(i)):i.forEach(i=>this.removeFromActiveGraphics(i))}isSupportedLayer(i){if(null==i||!("hiddenIfDeconflicted"in i)||!i.hiddenIfDeconflicted)return!1;const t=i.stageObject;if(1!==(t?.geometries.length??0))return!1;const e=t?.geometries[0],s=e?.material;return s instanceof W}_startUpdate(){R(this.view),this._dirty=!1,this._viewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._viewState.camera;if(this._deconflictor.reset(i,t),this._resetIterators(),this._occlusionQueryUids.length=0,!this._checkOcclusion.size)return this._occlusionQuery=s(this._occlusionQuery),void(this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery))}addToActiveGraphics(i){i.ensureInfo(this.visibilityGroup),this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){ci(i,this.visibilityGroup),i.removeInfo(this.visibilityGroup),this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}addToCheckOcclusion(i){this._checkOcclusion.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromCheckOcclusion(i){this._checkOcclusion.delete(i.graphics3DGraphic.graphic.uid)}_processCheckOcclusion(i){if(0===this._checkOcclusion.size)return!0;const t=this._ensureCheckOcclusionIterator(),e=this._viewState.camera,r=c(K,e.viewInverseTransposeMatrix),o=this.view.map.ground.opacity>0,n="global"===this.view.viewingMode&&o&&e.relativeElevation>0?X:null;let a=0;null!=n&&(l(n.center,_,e.viewMatrix),n.radius=O(this.view.spatialReference).radius,a=V.distanceToSilhouette(n,_));const u=w();for(;;){if(i.done)return!1;i.madeProgress();const s=t.next();if(!0===s.done)break;const o=s.value,c=o.graphics3DGraphic;if(c.destroyed)continue;if(!c.isVisible(1,8))continue;const h=ui(c,this.visibilityGroup);let d=null,p=!0,_=!1;for(const i of h){if(!this.isSupportedLayer(i))continue;d=hi,this._projectHudLayer(i,e,d),Q(u);const t=i.stageObject.geometries[0].material;if(this._expandBoundingRect(u,e,i,t,d),d.isOutsideScreen){p=!1;break}if(this._isCulledBySlice(o,d.positionWorld)){p=!1;break}if(null!=n&&li(d,n,a)){p=!1;break}d.altitude=this.view.renderCoordsHelper.getAltitude(d.positionWorld);const s=o.ensureInfo(this.visibilityGroup);if(s.altitude=d.altitude,s.distance=d.distance,s.distanceToOccluder=d.distanceToOccluder,s.culled=!1,D(s.aabr,u),"visible"===t.parameters.occludedVisibilityMode)break;l(B,d.positionView,r);const h=this._ensureOcclusionQuery(),y=this._ensureOpaqueOcclusionQuery();0===this._occlusionQueryUids.length&&(this._initOcclusionQuery(h),this._initOcclusionQuery(y));const f=h.addPosition(B),m=y.addPosition(B);if(f===this._occlusionQueryUids.length&&m===f){const i="adaptive"===t.parameters.occludedVisibilityMode;this._occlusionQueryUids.push(i?-c.graphic.uid:c.graphic.uid),_=!0}break}const y=this._active.has(c.graphic.uid);if(y||_){if(y&&(!p||!d)){const i=o.ensureInfo(this.visibilityGroup);i.visible=!d,i.culled=!0}}else this._setGraphicVisibility(o,p)}return this._checkOcclusionIterator=null,this._occlusionQueryUids.length||(this._occlusionQuery=s(this._occlusionQuery),this._opaqueOcclusionQuery=s(this._opaqueOcclusionQuery)),this._occlusionQuery?.start(),this._opaqueOcclusionQuery?.start(),!0}_readOcclusionQueryResult(){if(!this._occlusionQuery||!this._occlusionQueryUids.length)return;const i=this._viewState.camera,t=this.view.renderCoordsHelper.getAltitude(i.eye);for(let e=0;e<this._occlusionQueryUids.length;e++){const i=this._occlusionQueryUids[e],s=Math.abs(i),r=i<0,o=this._checkOcclusion.get(s);if(!o)continue;const c=this._occlusionQuery.getOcclusion(e)??-1,n=this._opaqueOcclusionQuery?.getOcclusion(e)??-1,a=o.getInfo(this.visibilityGroup);a&&(a.distanceToOccluder=c>0?a.distance-c:0);const l=0===n||n>0&&this._occludedVisibility(a?a.distance-n:0,a?.distance??n,a?.altitude??0,t,r),u=0===c||c>0&&this._occludedVisibility(a?.distanceToOccluder??0,a?.distance??c,a?.altitude??0,t,r),h=l||u;h&&this._setTransparentMode(o,l&&!u),this._active.has(s)?a&&(a.culled=!h,a.visible=h):this._setGraphicVisibility(o,h)}this._occlusionQueryUids.length=0}_collectActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),e=16===this.visibilityGroup;for(;!i.done;){i.madeProgress();const s=t.next();if(!0===s.done)return this._activeIterator=null,!0;const r=s.value,o=r.getInfo(this.visibilityGroup);if(!o)continue;const c=!e||r.graphics3DGraphic.isVisible();!c||o.culled?(A(o.aabr,!1,!0),this._setGraphicVisibility(r,c&&o.visible)):this._deconflictor.add(o)}return!1}_occludedVisibility(i,t,e,s,r=!0){const o=Math.max(this._minAltitudeDifference,Math.abs(e-s))-this._minAltitudeDifference,c=r?this._baseOccludedVisibility+this._altitudeFactor*o:0;return 0===i||t-i<=c}_resetIterators(){this._checkOcclusionIterator=null,this._activeIterator=null}_ensureCheckOcclusionIterator(){return this._checkOcclusionIterator??=this._checkOcclusion.values(),this._checkOcclusionIterator}_ensureActiveGraphicsIterator(){return this._activeIterator??=this._active.values(),this._activeIterator}_initOcclusionQuery(i){if(!i)return;const{camera:t}=this._viewState,e=2,s=Math.max(e,e+Math.round(Math.log2(Math.abs(t.relativeElevation))));u(F,this._viewState.camera.eye,2**-s),u(F,h(F,F),2**s),i.init(this._checkOcclusion.size,F)}_ensureOcclusionQuery(){return this._occlusionQuery??=new q({view:this.view}),this._occlusionQuery}_ensureOpaqueOcclusionQuery(){return this._opaqueOcclusionQuery??=new q({view:this.view,category:x.OPAQUE}),this._opaqueOcclusionQuery}_getNumVisible(i){return[...this._checkOcclusion.values()].reduce((t,e)=>t+(e.getInfo(i)?.visible?1:0),0)}_projectHudLayer(i,t,e){const s=i.stageObject,r=s.geometries[0],o=r.material;d(B,s.boundingVolumeWorldSpace.bounds.center),l(F,B,t.viewMatrix);const c=r.attributes,n=c.get("normal").data,a=c.get("centerOffset")?.data??_,[h]=c.get("groundDistance").data;o.applyShaderOffsets(B,F,n,s.transformation,a,h,t,e.screenSizePerspectiveEvaluators),f(L,F[0],F[1],F[2],1),m(Y,L,t.projectionMatrix),u(e.positionNDC,Y,1/Y[3]),o.applyShaderOffsetsNDC(e.positionNDC,a,h,t,e.positionNDC,J),e.distanceWithoutPolygonOffset=t.depthNDCToWorld(J[2]),e.distance=J[2]===e.positionNDC[2]?e.distanceWithoutPolygonOffset:t.depthNDCToWorld(e.positionNDC[2]),f(Y,e.positionNDC[0],e.positionNDC[1],e.positionNDC[2],1),m(L,Y,t.inverseProjectionMatrix),g(L,L,1/L[3]),p(e.positionView,L[0],L[1],L[2]),d(e.positionWorld,B)}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&k(this._viewState.slicePlane,t)}_expandBoundingRect(i,t,s,r,{positionNDC:o,screenSizePerspectiveEvaluators:c}){const n=s.getScreenSize(ni);c.evaluator.applyVec2(n,n),n[0]*=t.pixelRatio,n[1]*=t.pixelRatio;const a=G(r.calculateRelativeScreenBounds(n,c.alignmentEvaluator.apply(t.pixelRatio),ii),e(0,t.fullWidth,.5+.5*o[0]),e(0,t.fullHeight,.5+.5*o[1])),l=this.marginFactor;if(0!==l){const i=l*Math.min(I(a),j(a));a[0]-=i,a[1]-=i,a[2]+=i,a[3]+=i}P(i,a,i)}_setGraphicVisibility(i,t){const e=i?.graphics3DGraphic;e&&!e.destroyed&&(e.setVisibilityFlag(this.visibilityGroup,8,t),16===this.visibilityGroup&&this.view.labeler.setLabelGraphicVisibility(e,t))}_setTransparentMode(i,t){const e=i?.graphics3DGraphic;if(e&&!e.destroyed)for(const s of e.layers){if("object3d"!==s?.type)continue;const{graphics3DSymbolLayer:i}=s;E(i)&&i.updateTransparentMode(s,t)}}};function ci(i,t){const e=i.graphics3DGraphic;e.destroyed||e.setVisibilityFlag(t,8,!0)}i([r({constructOnly:!0})],oi.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],oi.prototype,"_readyToRun",null),i([r({type:Boolean,readOnly:!0})],oi.prototype,"updating",null),i([r({readOnly:!0})],oi.prototype,"_updatingHandles",void 0),oi=i([o("esri.views.3d.layers.graphics.Deconflictor")],oi);const ni=a();class ai{constructor(){this.positionWorld=y(),this.positionView=y(),this.positionNDC=y(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.distanceWithoutPolygonOffset=0,this.screenSizePerspectiveEvaluators=new H}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1||i[2]>=1}}function li(i,t,e){return d(Z.direction,i.positionView),p(Z.origin,0,0,0),!!t.intersectRay(Z,$)&&i.distanceWithoutPolygonOffset>e}function ui(i,t){return 16===t?i.labelLayers:i.layers}const hi=new ai;export{oi as Deconflictor,si as DeconflictorGraphic,ri as DeconflictorViewState};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{result as e,createTask as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/Error.js";import{clone as i}from"../../../../core/lang.js";import{abortMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as o,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{pt2px as l,px2pt as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import{dataComponents as u}from"../../../../core/urlUtils.js";import{fromValues as m,fromArray as d,create as p,ONES as _}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as f,fromValues as y,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x,ZEROS as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as b}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as S}from"../../../../geometry/support/aaBoundingBox.js";import P from"../../../../layers/support/FieldsIndex.js";import{createRendererExpression as z}from"../../../../support/ArcadeExpression.js";import{CIMSymbolHelper as w}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as C}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as O}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultIconPrimitive as M}from"../../../../symbols/support/primitives.js";import R from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as I}from"../../../../symbols/support/utils.js";import{transparentUnit as j}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as U,needsElevationUpdates2D as F}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as T}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as V}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G}from"./graphicUtils.js";import{namedAnchorToHUDMaterialAnchorPos as A}from"./placementUtils.js";import{placePointOnGeometry as L,updateStageObjectGeometry as H,getLocalOriginForPoint as k,extendPointGraphicElevationContext as B,createStageObject as N}from"./pointUtils.js";import{hasTransparencyModeSymbol as $}from"./transparencyUtils.js";import{initFastSymbolUpdatesState as q,updateFastSymbolUpdatesState as J,evaluateModelTransformScale as Z,ConvertOptions as W}from"../support/FastSymbolUpdates.js";import{createTexture as K,requiresHalfTexelOffset as Q,defaultBoundingBox as X,defaultSymbolSizeRatio as Y,defaultTexSize as ee}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as te}from"../../terrain/OverlayRenderer.js";import{VerticalOffsetParameters as re}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{createPointGeometry as ie}from"../../webgl-engine/lib/GeometryUtil.js";import{ManagedTexture as se}from"../../webgl-engine/lib/ManagedTexture.js";import{RenderGeometry as ae}from"../../webgl-engine/lib/RenderGeometry.js";import{HUDMaterial as oe}from"../../webgl-engine/materials/HUDMaterial.js";var ne;const le=y(0,0,1),ce=16,he=1.5,ue=[ee*Y,ee*Y];class me extends D{static{ne=$}static{this.PRIMITIVE_SIZE=ue}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:1,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,xe(t)),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=[1,1],this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0},this[ne]=!0}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=I(this.symbolLayer),i=_e(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=G(this._getIconSize());if(e)throw new r("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?l(e.size):ce);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e,t){const r=this._overrideHelperClass;let s=this._cimData;if(r&&s&&s.symbol||this.logger.error("Can't create texture, CIM data is undefined"),s.primitiveOverrides){s=i(s);const a=s.primitiveOverrides;r.evaluateOverrides(a,e,this._arcadeInfo.geometryType,null,null,t.layer.fieldsIndex),r.applyOverrides(s.symbol,a)}const a=h(JSON.stringify(s));let o=this._cimSymbolTextures.get(a);if(o)return o;const n=this._context.sharedResources.cimSymbolRasterizer,l=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;l&&r.applyDictionaryTextOverrides(s.symbol,e,l,null);const c=null!=this._cimScaleFactorOrFunction?C(this._cimScaleFactorOrFunction,e):1;1!==c&&s.symbol&&O(s.symbol,c,!0);const u=w.getEnvelope(s,null,n.resourceManager);if(u?.width&&u.height){const e=u.x+u.width/2,t=u.y+u.height/2,r=n.rasterize({type:"cim",data:s},u.width,u.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),i=new R({x:-u.x/u.width-.5,y:(u.height+u.y)/u.height-.5});this._cimMaterialParametersInfo.anchorPosition=fe("relative",i),o=new se(r,{width:r?.width??1,height:r?.height??1,reloadable:!0})}else o=new se(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(a,o),this._context.stage.addTexture(o),o}_prepareMaterialParameters(){const{symbolLayer:e,symbol:t,_context:r,_drivenProperties:i,view:s}=this,a=this.symbolLayer.occludedVisibility?.mode??"hidden";return{anchorPosition:fe(e.anchor,e.anchorPosition),rotation:e.angle,hasRotation:0!==e.angle||i.rotation,hasVertexRotation:i.rotation,useVisibilityPixel:!1,occludedVisibilityMode:a,occludedFragmentOpacity:"hidden"!==a?s.state.ensureOccludedFragmentOpacity():void 0,hasSlicePlane:r.slicePlaneEnabled,verticalOffset:de(t)?new re(t.verticalOffset):void 0,screenSizePerspective:r.screenSizePerspectiveEnabled?s.screenSizePerspective.parameters:void 0}}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(pe(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,()=>K(t));this._textureHandle=r,e.textureId=r.managedTexture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Q(t),e.distanceFieldBoundingBox=X;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Y,e.size=m(i*this._symbolTextureRatio,i*this._symbolTextureRatio),this._createMaterial(e)}async _prepareResourcesHref(t,i,s){this._outlineSize=this._getOutlineSize(),t.color=this._getFillColor(),t.outlineColor=this._getOutlineColor(),t.outlineSize=this._outlineSize,t.textureIsSignedDistanceField=!1;const a=this._getIconSize(),n=a*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await e(this._context.sharedResources.textures.fromUrl(i,n,{signal:s}));if(!1===l.ok){o(l.error);throw new r("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${i})`)}this._textureHandle=l.value;const c=l.value.managedTexture;this._size=ye(c,a),t.size=d(this._size),t.textureId=c.id}this._createMaterial(t)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;n(r),this._context.sharedResources.cimSymbolRasterizer??=new e(this._context.renderCoordsHelper.spatialReference)}const s=this._context.sharedResources.cimSymbolRasterizer,a=[],o=t,l=o?.symbol;w.fetchResources(l,s.resourceManager,a,r),w.fetchFonts(l,s.resourceManager,a);const c=this._context.layer.fields?this._context.layer.fields.map(e=>e.toJSON()):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},o?.primitiveOverrides&&a.push(i.createRenderExpressions(o.primitiveOverrides,this._arcadeInfo)),a.length>0&&(await Promise.all(a),n(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await z(t,this._context.layer.spatialReference),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js"),s=new P(c);this._cimScaleFactorOrFunction=(e,t,a)=>{const o=i(r,e,{$view:a},"esriGeometryPoint",s,t);return null!==o?o:1}}}n(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return ge(this.symbolLayer)}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(l(t.outline.size),0);return e=pe(this._getPrimitive())?he:0,Math.max(e,0)}_getOutlineColor(){const e=this._getLayerOpacity(),t=this.symbolLayer,r=t?.outline?.color;if(null!=r){const t=r.toUnitRGB(),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(pe(this._getPrimitive()))return j;const e=null==this._getPrimitive(),t=this._materialColor;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}get _materialColor(){return this.symbolLayer.material?.color}get _fastVisualVariableFallbackColor(){const e=this._materialColor;if(null==e){return null==this._getPrimitive()?x:v}return e.toUnitRGBA()}_getFallbackSize(){const e=this._getIconSize(),{symbolLayer:{size:t}}=this;return(null!=t?Math.round(l(t)):ce)/e}_createMaterial(e){const t=this._context.spherical;if(this._cimData){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new oe(e,t),this._cimSymbolMaterials.set(e.textureId??0,r)),r}return this._fastUpdates=q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),e.hasVertexColor=this._drivenProperties.color&&!this._fastUpdates?.visualVariables.color||this._drivenProperties.opacity&&!this._fastUpdates?.visualVariables.opacity,e.hasVertexSize=this._drivenProperties.size&&!this._fastUpdates?.visualVariables.size,e.focusAreaStyle=null,this._materials[0]=new oe(e,t),this._materials[1]=new oe(e,t,!0),e.focusAreaStyle=this._context.focusAreaStyle,this._materials[2]=new oe(e,t),this._materials[3]=new oe(e,t,!0),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=s(this._patchTask),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach(e=>this._context.stage.removeTexture(e)),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor({size:e},t){if(!this._drivenProperties.size)return 1;if(null==e)return this._getFallbackSize();const[r,i,s]=e.output;return"symbol-value"===r?1:"number"==typeof r&&isFinite(r)?l(r)/t:"number"==typeof s&&isFinite(s)?l(s)/t:1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading?.output??0:null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const r=L(t.geometry);if(null==r)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;let i;const s=this.view.focusAreasView?.containsGeometry(r)??!0;if(this._cimData){if(!this._cimData.symbol)return null;const r=this._context.graphicsCoreOwner.view.state.rasterPixelRatio,a=this._generateTextureCIM(t,e),o={textureId:a.id,focusAreaStyle:s?null:this._context.focusAreaStyle,size:m(a.parameters.width/r,a.parameters.height/r),...this._cimMaterialParametersInfo};i=this._createMaterial(o)}else i=this._materials[s?0:2];if(null==r)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=null==this._getPrimitive(),o=e.renderingInfo,n=this._hasDrivenColorOrOpacity?this._getDrivenUInt8Color(o,this._materialColor,a):null,l=this._getDrivenRotation(o);let c=null;if(!this._fastUpdates?.visualVariables.size){const e=this._size,t=e[0]>e[1]?e[0]:e[1];c=this._getScaleFactor(o,t)}const h=null!=c?m(c,c):null,u=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(o,r,i,n,l,h,t.uid):this._createAs3DShape(o,r,i,n,l,h,u,t.uid)}terrainTransparencyChanged(){return this.draped}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial(r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})}layerScreenSizePerspectiveChanged(){const e=this._context.screenSizePerspectiveEnabled&&!this.draped?this.view.screenSizePerspective.parameters:null;this._forEachMaterial(t=>{t.setParameters({screenSizePerspective:e})})}updateTransparentMode(e,t){const r=e.stageObject.geometries[0]?.material,i=this._materials.indexOf(r)<2,s=t?i?1:3:i?0:2,a=this._materials[s];a&&a!==r&&e.updateMaterial(a)}updateGeometry(e,t){const r=e.geometry;if(this.draped||!r||!this._validateGeometry(r))return!1;const{elevationContext:i,stageObject:s}=t;if(i.mode!==this.getGeometryElevationMode(r))return!1;const a=L(r);if(!a)return!1;i.updateFeatureExpressionFeature(e,this._context.layer);const o=H(s,this._context,a,i);if(null==o)return!1;const n=k(this._context,a);return s.geometries[0].localOrigin===n&&(t.alignedSampledElevation=o,B(t,a,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=U(me.elevationModeChangeTypes,r,i);if(1!==s)return s;const a=F(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial(e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!J(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return 0;{const e=this._fastUpdates;this._materials.forEach(t=>t?.setParameters(e.materialParameters))}}return 2}get needsUpdateFocus(){return!0}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(i,l){if(!l.resource||"partial"!==l.resource.type)return;const c=l.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=_e(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;i.symbolLayerStatePatches.push(()=>{this._patchTask=s(this._patchTask),this._patchTask=t(t=>this._context.schedule(async(t,i)=>{const s=await e(u.fromUrl(h,d,{signal:i}));n(i);const l=!s.ok;if(l&&o(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,l){this._forEachMaterial(e=>{e.visible=!1,e.setParameters({textureId:null})});const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new r("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.managedTexture;this._size=ye(c,m),this._forEachMaterial(e=>{e.setParameters({textureId:c.id}),e.visible=!0})},t))}),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push(()=>{this._forEachMaterial(e=>e.setParameters({rotation:r,hasRotation:i}))}),delete t.angle}_defaultElevationInfoNoZ(){return ve}_createAs3DShape(e,t,r,i,s,a,o,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layerViewUid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:c}),u=ie(r,{normal:le,color:i,rotation:s,size:a,centerOffset:f,groundDistance:1,featureAttribute:l,olidColor:h}),m=N(this._context,t,u,o,n);if(null==m)return null;const d=new V(this,m.object,null,E,o);return d.hiddenIfDeconflicted=!0,d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=F(o.mode)||"absolute-height"===o.mode,d.getScreenSize=this._createScreenSizeGetter(a,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),B(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,a,o){r.renderPriority=this._renderPriority;const n=g();b(t,n,this._context.overlaySR),n[2]=te;const l=this._context.clippingExtent;if(null!=l&&!S(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:h}),m=ie(r,{normal:le,position:n,color:i,rotation:s,size:a,featureAttribute:c,olidColor:u}),d=new ae(m,{layerViewUid:h,graphicUid:o}),p=new T(this,[d],null,this._context.drapeSourceRenderer);return p.getScreenSize=this._createScreenSizeGetter(a,c),p.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(p.getScreenSize(),1,e),p}_createScreenSizeGetter(e,t){e??=_;const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]*this._size[0],s=e[1]*this._size[1];return(e=p())=>{const[a,o]=Z(be,this._fastUpdates.materialParameters,t);return e[0]=a*i+r,e[1]=o*s+r,e}}const i=e[0]*this._size[0]+r,s=e[1]*this._size[1]+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=y(e,e,e),r=c(1),i=e*r,s=y(i,i,i),a=this._getFallbackSize();return new W({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:t,symbolSize:s,unitInMeters:r,fallbackColor:this._fastVisualVariableFallbackColor,fallbackSize:y(a,a,a)})}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function de(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function pe(e){return null!=e&&("cross"===e||"x"===e)}function _e(e){const t=u(e);return"application/json"===t?.mediaType?t.data:void 0}function fe(e,t){return"relative"===e?m((t.x||0)+.5,.5-(t.y||0)):e in A?A[e]:A.center}function ye({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}function ge(e){return e.resource?.href?null:e.resource?.primitive??M}function xe(e){return 1===(e.material?.color?.a??0)&&null!=ge(e)}const ve={mode:"relative-to-ground",offset:0},be=g();export{me as Graphics3DIconSymbolLayer};
2
+ import{result as e,createTask as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/Error.js";import{clone as i}from"../../../../core/lang.js";import{abortMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as o,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{pt2px as l,px2pt as c}from"../../../../core/screenUtils.js";import{numericHash as h}from"../../../../core/string.js";import{dataComponents as u}from"../../../../core/urlUtils.js";import{fromValues as m,fromArray as d,create as p,ONES as _}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ZEROS as f,fromValues as y,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as x,ZEROS as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as b}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as S}from"../../../../geometry/support/aaBoundingBox.js";import P from"../../../../layers/support/FieldsIndex.js";import{createRendererExpression as z}from"../../../../support/ArcadeExpression.js";import{CIMSymbolHelper as w}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as C}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as O}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultIconPrimitive as M}from"../../../../symbols/support/primitives.js";import R from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as I}from"../../../../symbols/support/utils.js";import{transparentUnit as j}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as U,needsElevationUpdates2D as F}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as T}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as V}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G}from"./graphicUtils.js";import{namedAnchorToHUDMaterialAnchorPos as A}from"./placementUtils.js";import{placePointOnGeometry as L,updateStageObjectGeometry as H,getLocalOriginForPoint as k,extendPointGraphicElevationContext as B,createStageObject as N}from"./pointUtils.js";import{hasTransparencyModeSymbol as $}from"./transparencyUtils.js";import{initFastSymbolUpdatesState as q,updateFastSymbolUpdatesState as J,evaluateModelTransformScale as Z,ConvertOptions as W}from"../support/FastSymbolUpdates.js";import{createTexture as K,requiresHalfTexelOffset as Q,defaultBoundingBox as X,defaultSymbolSizeRatio as Y,defaultTexSize as ee}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as te}from"../../terrain/OverlayRenderer.js";import{VerticalOffsetParameters as re}from"../../webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js";import{createPointGeometry as ie}from"../../webgl-engine/lib/GeometryUtil.js";import{ManagedTexture as se}from"../../webgl-engine/lib/ManagedTexture.js";import{RenderGeometry as ae}from"../../webgl-engine/lib/RenderGeometry.js";import{HUDMaterial as oe}from"../../webgl-engine/materials/HUDMaterial.js";var ne;const le=y(0,0,1),ce=16,he=1.5,ue=[ee*Y,ee*Y];class me extends D{static{ne=$}static{this.PRIMITIVE_SIZE=ue}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:1,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i,xe(t)),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=[1,1],this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0},this[ne]=!0}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=I(this.symbolLayer),i=_e(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=G(this._getIconSize());if(e)throw new r("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?l(e.size):ce);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e,t){const r=this._overrideHelperClass;let s=this._cimData;if(r&&s&&s.symbol||this.logger.error("Can't create texture, CIM data is undefined"),s.primitiveOverrides){s=i(s);const a=s.primitiveOverrides;r.evaluateOverrides(a,e,this._arcadeInfo.geometryType,null,null,t.layer.fieldsIndex),r.applyOverrides(s.symbol,a)}const a=h(JSON.stringify(s));let o=this._cimSymbolTextures.get(a);if(o)return o;const n=this._context.sharedResources.cimSymbolRasterizer,l=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;l&&r.applyDictionaryTextOverrides(s.symbol,e,l,null);const c=null!=this._cimScaleFactorOrFunction?C(this._cimScaleFactorOrFunction,e):1;1!==c&&s.symbol&&O(s.symbol,c,!0);const u=w.getEnvelope(s,null,n.resourceManager);if(u?.width&&u.height){const e=u.x+u.width/2,t=u.y+u.height/2,r=n.rasterize({type:"cim",data:s},u.width,u.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),i=new R({x:-u.x/u.width-.5,y:(u.height+u.y)/u.height-.5});this._cimMaterialParametersInfo.anchorPosition=fe("relative",i),o=new se(r,{width:r?.width??1,height:r?.height??1,reloadable:!0})}else o=new se(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(a,o),this._context.stage.addTexture(o),o}_prepareMaterialParameters(){const{symbolLayer:e,symbol:t,_context:r,_drivenProperties:i,view:s}=this,a=this.symbolLayer.occludedVisibility?.mode??"hidden";return{anchorPosition:fe(e.anchor,e.anchorPosition),rotation:e.angle,hasRotation:0!==e.angle||i.rotation,hasVertexRotation:i.rotation,occludedVisibilityMode:a,occludedFragmentOpacity:"hidden"!==a?s.state.ensureOccludedFragmentOpacity():void 0,hasSlicePlane:r.slicePlaneEnabled,verticalOffset:de(t)?new re(t.verticalOffset):void 0,screenSizePerspective:r.screenSizePerspectiveEnabled?s.screenSizePerspective.parameters:void 0}}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(pe(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,()=>K(t));this._textureHandle=r,e.textureId=r.managedTexture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Q(t),e.distanceFieldBoundingBox=X;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Y,e.size=m(i*this._symbolTextureRatio,i*this._symbolTextureRatio),this._createMaterial(e)}async _prepareResourcesHref(t,i,s){this._outlineSize=this._getOutlineSize(),t.color=this._getFillColor(),t.outlineColor=this._getOutlineColor(),t.outlineSize=this._outlineSize,t.textureIsSignedDistanceField=!1;const a=this._getIconSize(),n=a*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await e(this._context.sharedResources.textures.fromUrl(i,n,{signal:s}));if(!1===l.ok){o(l.error);throw new r("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${i})`)}this._textureHandle=l.value;const c=l.value.managedTexture;this._size=ye(c,a),t.size=d(this._size),t.textureId=c.id}this._createMaterial(t)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;n(r),this._context.sharedResources.cimSymbolRasterizer??=new e(this._context.renderCoordsHelper.spatialReference)}const s=this._context.sharedResources.cimSymbolRasterizer,a=[],o=t,l=o?.symbol;w.fetchResources(l,s.resourceManager,a,r),w.fetchFonts(l,s.resourceManager,a);const c=this._context.layer.fields?this._context.layer.fields.map(e=>e.toJSON()):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},o?.primitiveOverrides&&a.push(i.createRenderExpressions(o.primitiveOverrides,this._arcadeInfo)),a.length>0&&(await Promise.all(a),n(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await z(t,this._context.layer.spatialReference),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js"),s=new P(c);this._cimScaleFactorOrFunction=(e,t,a)=>{const o=i(r,e,{$view:a},"esriGeometryPoint",s,t);return null!==o?o:1}}}n(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return ge(this.symbolLayer)}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(l(t.outline.size),0);return e=pe(this._getPrimitive())?he:0,Math.max(e,0)}_getOutlineColor(){const e=this._getLayerOpacity(),t=this.symbolLayer,r=t?.outline?.color;if(null!=r){const t=r.toUnitRGB(),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(pe(this._getPrimitive()))return j;const e=null==this._getPrimitive(),t=this._materialColor;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}get _materialColor(){return this.symbolLayer.material?.color}get _fastVisualVariableFallbackColor(){const e=this._materialColor;if(null==e){return null==this._getPrimitive()?x:v}return e.toUnitRGBA()}_getFallbackSize(){const e=this._getIconSize(),{symbolLayer:{size:t}}=this;return(null!=t?Math.round(l(t)):ce)/e}_createMaterial(e){const t=this._context.spherical;if(this._cimData){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new oe(e,t),this._cimSymbolMaterials.set(e.textureId??0,r)),r}return this._fastUpdates=q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),e.hasVertexColor=this._drivenProperties.color&&!this._fastUpdates?.visualVariables.color||this._drivenProperties.opacity&&!this._fastUpdates?.visualVariables.opacity,e.hasVertexSize=this._drivenProperties.size&&!this._fastUpdates?.visualVariables.size,e.focusAreaStyle=null,this._materials[0]=new oe(e,t),this._materials[1]=new oe(e,t,!0),e.focusAreaStyle=this._context.focusAreaStyle,this._materials[2]=new oe(e,t),this._materials[3]=new oe(e,t,!0),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=s(this._patchTask),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach(e=>this._context.stage.removeTexture(e)),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor({size:e},t){if(!this._drivenProperties.size)return 1;if(null==e)return this._getFallbackSize();const[r,i,s]=e.output;return"symbol-value"===r?1:"number"==typeof r&&isFinite(r)?l(r)/t:"number"==typeof s&&isFinite(s)?l(s)/t:1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading?.output??0:null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const r=L(t.geometry);if(null==r)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;let i;const s=this.view.focusAreasView?.containsGeometry(r)??!0;if(this._cimData){if(!this._cimData.symbol)return null;const r=this._context.graphicsCoreOwner.view.state.rasterPixelRatio,a=this._generateTextureCIM(t,e),o={textureId:a.id,focusAreaStyle:s?null:this._context.focusAreaStyle,size:m(a.parameters.width/r,a.parameters.height/r),...this._cimMaterialParametersInfo};i=this._createMaterial(o)}else i=this._materials[s?0:2];if(null==r)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=null==this._getPrimitive(),o=e.renderingInfo,n=this._hasDrivenColorOrOpacity?this._getDrivenUInt8Color(o,this._materialColor,a):null,l=this._getDrivenRotation(o);let c=null;if(!this._fastUpdates?.visualVariables.size){const e=this._size,t=e[0]>e[1]?e[0]:e[1];c=this._getScaleFactor(o,t)}const h=null!=c?m(c,c):null,u=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(o,r,i,n,l,h,t.uid):this._createAs3DShape(o,r,i,n,l,h,u,t.uid)}terrainTransparencyChanged(){return this.draped}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial(r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})})}layerScreenSizePerspectiveChanged(){const e=this._context.screenSizePerspectiveEnabled&&!this.draped?this.view.screenSizePerspective.parameters:null;this._forEachMaterial(t=>{t.setParameters({screenSizePerspective:e})})}updateTransparentMode(e,t){const r=e.stageObject.geometries[0]?.material,i=this._materials.indexOf(r)<2,s=t?i?1:3:i?0:2,a=this._materials[s];a&&a!==r&&e.updateMaterial(a)}updateGeometry(e,t){const r=e.geometry;if(this.draped||!r||!this._validateGeometry(r))return!1;const{elevationContext:i,stageObject:s}=t;if(i.mode!==this.getGeometryElevationMode(r))return!1;const a=L(r);if(!a)return!1;i.updateFeatureExpressionFeature(e,this._context.layer);const o=H(s,this._context,a,i);if(null==o)return!1;const n=k(this._context,a);return s.geometries[0].localOrigin===n&&(t.alignedSampledElevation=o,B(t,a,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=U(me.elevationModeChangeTypes,r,i);if(1!==s)return s;const a=F(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial(e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return 0;if(!J(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return 0;{const e=this._fastUpdates;this._materials.forEach(t=>t?.setParameters(e.materialParameters))}}return 2}get needsUpdateFocus(){return!0}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(i,l){if(!l.resource||"partial"!==l.resource.type)return;const c=l.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=_e(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;i.symbolLayerStatePatches.push(()=>{this._patchTask=s(this._patchTask),this._patchTask=t(t=>this._context.schedule(async(t,i)=>{const s=await e(u.fromUrl(h,d,{signal:i}));n(i);const l=!s.ok;if(l&&o(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,l){this._forEachMaterial(e=>{e.visible=!1,e.setParameters({textureId:null})});const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new r("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.managedTexture;this._size=ye(c,m),this._forEachMaterial(e=>{e.setParameters({textureId:c.id}),e.visible=!0})},t))}),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push(()=>{this._forEachMaterial(e=>e.setParameters({rotation:r,hasRotation:i}))}),delete t.angle}_defaultElevationInfoNoZ(){return ve}_createAs3DShape(e,t,r,i,s,a,o,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layerViewUid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:c}),u=ie(r,{normal:le,color:i,rotation:s,size:a,centerOffset:f,groundDistance:1,featureAttribute:l,olidColor:h}),m=N(this._context,t,u,o,n);if(null==m)return null;const d=new V(this,m.object,null,E,o);return d.hiddenIfDeconflicted=!0,d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=F(o.mode)||"absolute-height"===o.mode,d.getScreenSize=this._createScreenSizeGetter(a,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),B(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,a,o){r.renderPriority=this._renderPriority;const n=g();b(t,n,this._context.overlaySR),n[2]=te;const l=this._context.clippingExtent;if(null!=l&&!S(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:h}),m=ie(r,{normal:le,position:n,color:i,rotation:s,size:a,featureAttribute:c,olidColor:u}),d=new ae(m,{layerViewUid:h,graphicUid:o}),p=new T(this,[d],null,this._context.drapeSourceRenderer);return p.getScreenSize=this._createScreenSizeGetter(a,c),p.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(p.getScreenSize(),1,e),p}_createScreenSizeGetter(e,t){e??=_;const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]*this._size[0],s=e[1]*this._size[1];return(e=p())=>{const[a,o]=Z(be,this._fastUpdates.materialParameters,t);return e[0]=a*i+r,e[1]=o*s+r,e}}const i=e[0]*this._size[0]+r,s=e[1]*this._size[1]+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=y(e,e,e),r=c(1),i=e*r,s=y(i,i,i),a=this._getFallbackSize();return new W({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:t,symbolSize:s,unitInMeters:r,fallbackColor:this._fastVisualVariableFallbackColor,fallbackSize:y(a,a,a)})}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function de(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function pe(e){return null!=e&&("cross"===e||"x"===e)}function _e(e){const t=u(e);return"application/json"===t?.mediaType?t.data:void 0}function fe(e,t){return"relative"===e?m((t.x||0)+.5,.5-(t.y||0)):e in A?A[e]:A.center}function ye({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}function ge(e){return e.resource?.href?null:e.resource?.primitive??M}function xe(e){return 1===(e.material?.color?.a??0)&&null!=ge(e)}const ve={mode:"relative-to-ground",offset:0},be=g();export{me as Graphics3DIconSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{pt2px as e}from"../../../../core/screenUtils.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderingInfo as n}from"../../../../renderers/support/RenderingInfo.js";import{textSymbolLayerSupportsVerticalOffset as i}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as s}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as a,needsElevationUpdates2D as o}from"./elevationAlignmentUtils.js";import{Graphics3DGraphicCreationContext as l}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DObject3DGraphicLayer as c}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as h}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as p}from"./Graphics3DSymbolLayer.js";import{computeCentroid as m}from"./graphicUtils.js";import{createStageObject as d,extendPointGraphicElevationContext as f}from"./pointUtils.js";import{SymbolComplexity as u}from"./SymbolComplexity.js";import{isObjectSymbol3DLayer as g,isTextSymbol3DLayer as v}from"../support/layerUtils.js";import{Attribute as y}from"../../webgl-engine/lib/Attribute.js";import{Geometry as x}from"../../webgl-engine/lib/Geometry.js";import{LineCalloutMaterial as b,Parameters as _,uniqueMaterialIdentifier as C}from"../../webgl-engine/materials/LineCalloutMaterial.js";import{getLineCalloutMaterialBaseInstance as O}from"../../webgl-engine/materials/LineCalloutMaterialBaseInstance.js";class P extends p{static{this.elevationModeChangeTypes={definedChanged:1,staysOnTheGround:1,onTheGroundChanged:2}}constructor(e,t){super(e,null,t,E),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new b(this._materialParameters,this._context.spherical)}_perInstanceMaterialParameters(e){const t=this._materialParameters;return t.horizontalScreenOffset=e.horizontalScreenOffset??0,t.centerOffsetUnits=e.centerOffsetUnits||"world",t}get _materialParameters(){const t=new _,n=this.symbol,i=n.callout;if(i.color){const e=i.color.toUnitRGBA();e[3]*=this._getLayerOpacity(),t.color=e}else t.color=r;if(t.size=e(i.size||0),n.verticalOffset){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=n.verticalOffset;t.verticalOffset={screenLength:e(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}t.borderColor=null!=i.border?.color?i.border.color.toUnitRGBA():null;const s=n.symbolLayers.at(0),a=g(s),o="label-3d"===n.type;return t.useVisibilityPixel=!1,a&&(t.shaderPolygonOffset=0),t.hudDepthAlignStart=o,t.hasSlicePlane=this._context.slicePlaneEnabled,t.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null,t}_defaultElevationInfoNoZ(){return G}createGraphics3DGraphic(e,t){const r=e.renderingInfo,n=e.graphic,s=this.createElevationContextForGraphic(n,r.elevationOffset||0),a=r.symbol,o="on-the-ground"===this._elevationContext.mode&&("cim"===a.type||!a.symbolLayers.some(e=>g(e)||v(e)));if("label-3d"!==a.type&&o)return null;if("point-3d"===a.type&&a.symbolLayers.every(e=>"text"===e.type&&!i(e)))return null;const l=m(n.geometry);return null==l?null:this._createAs3DShape(l,s,r,n.uid,t)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerScreenSizePerspectiveChanged(){const e=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null;this._materials[0]?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,r){const n=this._elevationContext.mode,i=a(P.elevationModeChangeTypes,r,n);return 1!==i||e?.forEach(e=>{const r=t(e);null!=r&&this.graphics3DGraphicLayerElevationInfoChanged(e.graphic,r)}),i}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}createElevationContextForGraphic(e,t=0){const r=super.createElevationContextForGraphic(e);return r.addOffsetRenderUnits(t),r}updateElevationContextForGraphic(e,t,r=0){super.updateElevationContextForGraphic(e,t),e.addOffsetRenderUnits(r)}graphics3DGraphicLayerElevationInfoChanged(e,t){const{elevationContext:r,metadata:n}=t;this.updateElevationContextForGraphic(r,e,n?.elevationOffset??0),t.needsElevationUpdates=o(r.mode)}computeComplexity(){return new u({verticesPerFeature:6})}_getOrCreateMaterial(e,t){const r=this._perInstanceMaterialParameters(e),n=C(r);if(n===this._materials[0]?.uniqueMaterialIdentifier)return this._materials[0];if(t){let e=t.get(n);return null==e&&(e=new b(r,this._context.spherical),t.set(n,e)),e}return new b(r,this._context.spherical)}_createAs3DShape(e,t,r,n,i){const a=this._context.layerViewUid,l=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:a}),p=this._getOrCreateMaterial(r,i),m=new x(p,j(r),null,1,l,void 0,O()),u=d(this._context,e,m,t,n);if(null==u)return null;const g=new c(this,u.object,null,s,t);return g.hiddenIfDeconflicted=!0,g.metadata=new h(r.elevationOffset),g.alignedSampledElevation=u.sampledElevation,g.needsElevationUpdates=o(t.mode),f(g,e,this._context.elevationProvider),g}}function j(e){const{translation:t,centerOffset:r,groundDistance:n}=e,i=new y(t?[t[0],t[1],t[2]]:[0,0,0],w,3,!0),s=new y(r?[r[0],r[1],r[2]]:[0,0,0],w,3,!0),a=new y(null!=n?[n]:[1],w,1,!0);return[["position",i],["normal",new y([0,0,1],w,3,!0)],["centerOffset",s],["groundDistance",a]]}const w=[0],G={mode:"relative-to-ground",offset:0},E={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class S extends n{constructor(e,r,n=t(),i=t(),s=0,a=0,o="world",l=0){super(e,r),this.translation=n,this.centerOffset=i,this.groundDistance=s,this.horizontalScreenOffset=a,this.centerOffsetUnits=o,this.elevationOffset=l}}class L extends l{}export{P as Graphics3DLineCalloutSymbolLayer,L as LineCalloutCreationContext,S as LineCalloutSymbolLayerRenderingInfo};
2
+ import{pt2px as e}from"../../../../core/screenUtils.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderingInfo as n}from"../../../../renderers/support/RenderingInfo.js";import{textSymbolLayerSupportsVerticalOffset as i}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as s}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as a,needsElevationUpdates2D as o}from"./elevationAlignmentUtils.js";import{Graphics3DGraphicCreationContext as l}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DObject3DGraphicLayer as c}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as h}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as p}from"./Graphics3DSymbolLayer.js";import{computeCentroid as m}from"./graphicUtils.js";import{createStageObject as d,extendPointGraphicElevationContext as f}from"./pointUtils.js";import{SymbolComplexity as u}from"./SymbolComplexity.js";import{isObjectSymbol3DLayer as g,isTextSymbol3DLayer as v}from"../support/layerUtils.js";import{Attribute as y}from"../../webgl-engine/lib/Attribute.js";import{Geometry as x}from"../../webgl-engine/lib/Geometry.js";import{LineCalloutMaterial as _,Parameters as b,uniqueMaterialIdentifier as C}from"../../webgl-engine/materials/LineCalloutMaterial.js";import{getLineCalloutMaterialBaseInstance as O}from"../../webgl-engine/materials/LineCalloutMaterialBaseInstance.js";class P extends p{static{this.elevationModeChangeTypes={definedChanged:1,staysOnTheGround:1,onTheGroundChanged:2}}constructor(e,t){super(e,null,t,E),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new _(this._materialParameters,this._context.spherical)}_perInstanceMaterialParameters(e){const t=this._materialParameters;return t.horizontalScreenOffset=e.horizontalScreenOffset??0,t.centerOffsetUnits=e.centerOffsetUnits||"world",t}get _materialParameters(){const t=new b,n=this.symbol,i=n.callout;if(i.color){const e=i.color.toUnitRGBA();e[3]*=this._getLayerOpacity(),t.color=e}else t.color=r;if(t.size=e(i.size||0),n.verticalOffset){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=n.verticalOffset;t.verticalOffset={screenLength:e(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}t.borderColor=null!=i.border?.color?i.border.color.toUnitRGBA():null;const s=n.symbolLayers.at(0),a=g(s),o="label-3d"===n.type;return a&&(t.shaderPolygonOffset=0),t.hudDepthAlignStart=o,t.hasSlicePlane=this._context.slicePlaneEnabled,t.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null,t}_defaultElevationInfoNoZ(){return G}createGraphics3DGraphic(e,t){const r=e.renderingInfo,n=e.graphic,s=this.createElevationContextForGraphic(n,r.elevationOffset||0),a=r.symbol,o="on-the-ground"===this._elevationContext.mode&&("cim"===a.type||!a.symbolLayers.some(e=>g(e)||v(e)));if("label-3d"!==a.type&&o)return null;if("point-3d"===a.type&&a.symbolLayers.every(e=>"text"===e.type&&!i(e)))return null;const l=m(n.geometry);return null==l?null:this._createAs3DShape(l,s,r,n.uid,t)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerScreenSizePerspectiveChanged(){const e=this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null;this._materials[0]?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,r){const n=this._elevationContext.mode,i=a(P.elevationModeChangeTypes,r,n);return 1!==i||e?.forEach(e=>{const r=t(e);null!=r&&this.graphics3DGraphicLayerElevationInfoChanged(e.graphic,r)}),i}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}createElevationContextForGraphic(e,t=0){const r=super.createElevationContextForGraphic(e);return r.addOffsetRenderUnits(t),r}updateElevationContextForGraphic(e,t,r=0){super.updateElevationContextForGraphic(e,t),e.addOffsetRenderUnits(r)}graphics3DGraphicLayerElevationInfoChanged(e,t){const{elevationContext:r,metadata:n}=t;this.updateElevationContextForGraphic(r,e,n?.elevationOffset??0),t.needsElevationUpdates=o(r.mode)}computeComplexity(){return new u({verticesPerFeature:6})}_getOrCreateMaterial(e,t){const r=this._perInstanceMaterialParameters(e),n=C(r);if(n===this._materials[0]?.uniqueMaterialIdentifier)return this._materials[0];if(t){let e=t.get(n);return null==e&&(e=new _(r,this._context.spherical),t.set(n,e)),e}return new _(r,this._context.spherical)}_createAs3DShape(e,t,r,n,i){const a=this._context.layerViewUid,l=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:a}),p=this._getOrCreateMaterial(r,i),m=new x(p,j(r),null,1,l,void 0,O()),u=d(this._context,e,m,t,n);if(null==u)return null;const g=new c(this,u.object,null,s,t);return g.hiddenIfDeconflicted=!0,g.metadata=new h(r.elevationOffset),g.alignedSampledElevation=u.sampledElevation,g.needsElevationUpdates=o(t.mode),f(g,e,this._context.elevationProvider),g}}function j(e){const{translation:t,centerOffset:r,groundDistance:n}=e,i=new y(t?[t[0],t[1],t[2]]:[0,0,0],w,3,!0),s=new y(r?[r[0],r[1],r[2]]:[0,0,0],w,3,!0),a=new y(null!=n?[n]:[1],w,1,!0);return[["position",i],["normal",new y([0,0,1],w,3,!0)],["centerOffset",s],["groundDistance",a]]}const w=[0],G={mode:"relative-to-ground",offset:0},E={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class S extends n{constructor(e,r,n=t(),i=t(),s=0,a=0,o="world",l=0){super(e,r),this.translation=n,this.centerOffset=i,this.groundDistance=s,this.horizontalScreenOffset=a,this.centerOffsetUnits=o,this.elevationOffset=l}}class L extends l{}export{P as Graphics3DLineCalloutSymbolLayer,L as LineCalloutCreationContext,S as LineCalloutSymbolLayerRenderingInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import{releaseMaybe as t}from"../../../../core/maybe.js";import{isPromiseLike as r}from"../../../../core/promiseUtils.js";import{pt2px as n}from"../../../../core/screenUtils.js";import{fromValues as i,ONES as s,ZEROS as o,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{freeze as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasCalloutSupport as m,textSymbolLayerSupportsVerticalOffset as h}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as f}from"./ElevationAligners.js";import{needsElevationUpdates2D as d}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as p}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as u}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as y}from"./graphicUtils.js";import{LabelPlacement as v,LabelParameters as x}from"./LabelParameters.js";import{verticalScreenOffsetFromAlignment as b,verticalPlacementFromAlignment as O,textRenderAlignmentFromHorizontalPlacement as P,horizontalPlacementToAnchorX as S,anchorFromPlacements as w,namedAnchorToHUDMaterialAnchorPos as j}from"./placementUtils.js";import{placePointOnGeometry as _,updateStageObjectGeometry as z,getLocalOriginForPoint as E,extendPointGraphicElevationContext as L,createStageObject as G}from"./pointUtils.js";import{getFontMetrics as C}from"../../webgl-engine/lib/FontMetrics.js";import{createPointGeometry as A}from"../../webgl-engine/lib/GeometryUtil.js";import{TextRenderParameters as U}from"../../webgl-engine/lib/TextRenderParameters.js";import D from"../../webgl-engine/lib/TextTextureFactory.js";import{HUDMaterial as V}from"../../webgl-engine/materials/HUDMaterial.js";const F=l(0,0,1);class R extends g{constructor(e,t,r,n){super(e,t,r,n),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=y(this.symbolLayer.size);if(t)throw new e("graphics3dtextsymbollayer:invalid-size",t)}await this._createTextRenderParameters()}async _createTextRenderParameters(){const e=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;this._textRenderParameters=await U.fromSymbol(this.symbolLayer,e)}destroy(){super.destroy()}createGraphics3DGraphic(e){const t=e.graphic,r=_(t.geometry);if(null==r)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const n=this.view.focusAreasView?.containsGeometry(r)??!0,i=this.symbolLayer.text;if(null==i||""===i)return null;const s=m(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol.verticalOffset:null;if(null!=s&&!h(this.symbolLayer))return this.logger.errorOncePerTick(`Callouts and vertical offset on text symbols are currently only supported with 'center' horizontal alignment (not with '${this.symbolLayer.horizontalAlignment}' alignment)`),null;const{verticalAlignment:o}=this.symbolLayer,a=new v(s);b(o,a.screenOffset);const l=new x(a,this.symbolLayer.horizontalAlignment,O(o)),c=n?null:this._context.focusAreaStyle;return this._createAs3DShape(t,r,i,l,c)}get needsUpdateFocus(){return!0}createLabel(e,t,r,n,i){const s=e.graphic,o=_(s.geometry);if(null==o)return this.logger.warn(`unsupported geometry type for label: ${s.geometry.type}`),null;const a=this.view.focusAreasView?.containsGeometry(o)??!0,l=t.text;if(!l||/^\s+$/.test(l))return null;const c=a?null:this._context.focusAreaStyle;return this._createAs3DShape(s,o,l,t,c,r,n,i)}createElevationContextForGraphic(e,t=0){const r=super.createElevationContextForGraphic(e);return r.addOffsetRenderUnits(t),r}updateElevationContextForGraphic(e,t,r=0){super.updateElevationContextForGraphic(e,t),e.addOffsetRenderUnits(r)}layerOpacityChanged(){return this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer"),!1}layerScreenSizePerspectiveChanged(e,t){const r=!this.draped&&this._context.screenSizePerspectiveEnabled,n=r?this.view.screenSizePerspective.labelParameters:null,i=r?this.view.screenSizePerspective.parameters:null;T(e,t,e=>{for(const t of e.stageObject.geometries)t.material.setParameters({screenSizePerspective:n,screenSizePerspectiveAlignment:i})})}layerElevationInfoChanged(e,t){return T(e,t,(e,t)=>{this.graphics3DGraphicLayerElevationInfoChanged(t,e)}),1}slicePlaneEnabledChanged(e,t){return T(e,t,e=>{for(const t of e.stageObject.geometries)t.material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}terrainTransparencyChanged(){return this.draped}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return!1}graphics3DGraphicLayerElevationInfoChanged(e,t){const{elevationContext:r,metadata:n}=t;this.updateElevationContextForGraphic(r,e,n?.elevationOffset??0),t.needsElevationUpdates=d(r.mode)||"absolute-height"===r.mode}updateGeometry(e,t){const r=e.geometry;if(this.draped||!r||!this._validateGeometry(r))return!1;const{elevationContext:n,stageObject:i}=t;if(n.mode!==this.getGeometryElevationMode(r))return!1;const s=_(r);if(!s)return!1;n.updateFeatureExpressionFeature(e,this._context.layer);const o=z(i,this._context,s,n);if(null==o)return!1;const a=E(this._context,s);return i.geometries[0].localOrigin===a&&(t.alignedSampledElevation=o,L(t,s,this._context.elevationProvider),!0)}_defaultElevationInfoNoZ(){return I}_createAs3DShape(e,l,m,h,g,y,v=null,x=()=>h.placement.elevationOffset){const b=this.createElevationContextForGraphic(e,h.placement.elevationOffset),O=e.uid;let S=null,w=null;if(null==v){const e=P(h.horizontalPlacement);S=new D(m,e,this._textRenderParameters);let n=null;if(null!=this._context.sharedResources.textures){w=this._context.sharedResources.textures.fromData(S.key,()=>S.create()),w.managedTexture.events.on("unloaded",()=>n=t(n));const e=this._context.stage.renderView.textures.acquire(w.managedTexture.id);if(null==e||r(e))return w.release(),null;n=e}}const j=this.symbolLayer.occludedVisibility?.mode??"hidden",_=M(S,h),z=null!=v,E={useVisibilityPixel:!1,occludedVisibilityMode:j,occludedFragmentOpacity:"hidden"!==j?this.view.state.ensureOccludedFragmentOpacity():null,screenOffset:h.placement.screenOffset,anchorPosition:_,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:h.placement.centerOffsetUnits,depthEnabled:!1,drawAsLabel:!0,isLabel:!0,hasVertexSize:z,hasVertexUVi:z,hasVertexCenterOffset:z,size:S?i(S.displayWidth,S.displayHeight):s,focusAreaStyle:g};if("polyline"===e.geometry?.type&&(E.shaderPolygonOffset=1e-4),z?E.textureId=v.id:w&&(E.textureId=w.managedTexture.id),null!=h.placement.verticalOffset){const{screenLength:e,minWorldLength:t,maxWorldLength:r}=h.placement.verticalOffset;E.verticalOffset={screenLength:n(e),minWorldLength:t||0,maxWorldLength:null!=r?r:1/0}}const U={screenOffset:E.screenOffset,anchorPosition:_,centerOffsetUnits:E.centerOffsetUnits,verticalOffset:E.verticalOffset,shaderPolygonOffset:E.shaderPolygonOffset,occludedVisibilityMode:E.occludedVisibilityMode,focusAreaStyle:E.focusAreaStyle};if(this._context.screenSizePerspectiveEnabled){const{parameters:e,labelParameters:t}=this.view.screenSizePerspective,r=C(this._textRenderParameters);E.screenSizePerspective=t,E.screenSizePerspectiveMinPixelReferenceSize=r.maxHeight,E.screenSizePerspectiveAlignment=e,U.fontHeight=r.maxHeight}E.hasSlicePlane=this._context.slicePlaneEnabled;const R=this._context.spherical,T=y?JSON.stringify(U):"";let I=y?.get(T);null==I&&(I=new V(E,R),y?.set(T,I));const H=h.placement.translation,W=z?o:null,$=z?h.placement.centerOffset:null,k=h.placement.groundDistance,N=F,q=z?c(0,0,0,0):null,B=A(I,{normal:N,position:H,size:W,centerOffset:$,groundDistance:k,uvi:q}),J=G(this._context,l,B,b,O);if(null==J)return null;const Y=(t,r,n,i,s,o)=>{const a=x()||h.placement.elevationOffset;return this.updateElevationContextForGraphic(r,e,a),f(t,r,n,i,s,o)},Z=new p(this,J.object,w,Y,b);Z.alignedSampledElevation=J.sampledElevation,Z.hiddenIfDeconflicted=!0,Z.needsElevationUpdates=d(b.mode)||"absolute-height"===b.mode,Z.getScreenSize=(e=a())=>(e[0]=S?S.displayWidth:h.displaySize[0],e[1]=S?S.displayHeight:h.displaySize[1],e);const K=new u(h.placement.elevationOffset,m);return Z.metadata=K,L(Z,l,this._context.elevationProvider),Z}}function T(e,t,r){e?.forEach(e=>{const n=t(e);null!=n&&r(n,e.graphic)})}function M(e,t){if("baseline"===t.verticalPlacement){const r=S[t.horizontalPlacement],n=null!=e?e.baselineAnchorY:0;return i(r,n)}const r=w(t.horizontalPlacement,t.verticalPlacement);return j[r]}const I={mode:"relative-to-ground",offset:0};export{R as Graphics3DTextSymbolLayer};
2
+ import e from"../../../../core/Error.js";import{releaseMaybe as t}from"../../../../core/maybe.js";import{isPromiseLike as r}from"../../../../core/promiseUtils.js";import{pt2px as n}from"../../../../core/screenUtils.js";import{fromValues as i,ONES as s,ZEROS as o,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{freeze as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasCalloutSupport as m,textSymbolLayerSupportsVerticalOffset as h}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as f}from"./ElevationAligners.js";import{needsElevationUpdates2D as d}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as p}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as u}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as y}from"./graphicUtils.js";import{LabelPlacement as v,LabelParameters as x}from"./LabelParameters.js";import{verticalScreenOffsetFromAlignment as b,verticalPlacementFromAlignment as O,textRenderAlignmentFromHorizontalPlacement as P,horizontalPlacementToAnchorX as S,anchorFromPlacements as w,namedAnchorToHUDMaterialAnchorPos as j}from"./placementUtils.js";import{placePointOnGeometry as _,updateStageObjectGeometry as z,getLocalOriginForPoint as E,extendPointGraphicElevationContext as L,createStageObject as G}from"./pointUtils.js";import{getFontMetrics as C}from"../../webgl-engine/lib/FontMetrics.js";import{createPointGeometry as A}from"../../webgl-engine/lib/GeometryUtil.js";import{TextRenderParameters as U}from"../../webgl-engine/lib/TextRenderParameters.js";import D from"../../webgl-engine/lib/TextTextureFactory.js";import{HUDMaterial as F}from"../../webgl-engine/materials/HUDMaterial.js";const R=l(0,0,1);class V extends g{constructor(e,t,r,n){super(e,t,r,n),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=y(this.symbolLayer.size);if(t)throw new e("graphics3dtextsymbollayer:invalid-size",t)}await this._createTextRenderParameters()}async _createTextRenderParameters(){const e=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;this._textRenderParameters=await U.fromSymbol(this.symbolLayer,e)}destroy(){super.destroy()}createGraphics3DGraphic(e){const t=e.graphic,r=_(t.geometry);if(null==r)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const n=this.view.focusAreasView?.containsGeometry(r)??!0,i=this.symbolLayer.text;if(null==i||""===i)return null;const s=m(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol.verticalOffset:null;if(null!=s&&!h(this.symbolLayer))return this.logger.errorOncePerTick(`Callouts and vertical offset on text symbols are currently only supported with 'center' horizontal alignment (not with '${this.symbolLayer.horizontalAlignment}' alignment)`),null;const{verticalAlignment:o}=this.symbolLayer,a=new v(s);b(o,a.screenOffset);const l=new x(a,this.symbolLayer.horizontalAlignment,O(o)),c=n?null:this._context.focusAreaStyle;return this._createAs3DShape(t,r,i,l,c)}get needsUpdateFocus(){return!0}createLabel(e,t,r,n,i){const s=e.graphic,o=_(s.geometry);if(null==o)return this.logger.warn(`unsupported geometry type for label: ${s.geometry.type}`),null;const a=this.view.focusAreasView?.containsGeometry(o)??!0,l=t.text;if(!l||/^\s+$/.test(l))return null;const c=a?null:this._context.focusAreaStyle;return this._createAs3DShape(s,o,l,t,c,r,n,i)}createElevationContextForGraphic(e,t=0){const r=super.createElevationContextForGraphic(e);return r.addOffsetRenderUnits(t),r}updateElevationContextForGraphic(e,t,r=0){super.updateElevationContextForGraphic(e,t),e.addOffsetRenderUnits(r)}layerOpacityChanged(){return this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer"),!1}layerScreenSizePerspectiveChanged(e,t){const r=!this.draped&&this._context.screenSizePerspectiveEnabled,n=r?this.view.screenSizePerspective.labelParameters:null,i=r?this.view.screenSizePerspective.parameters:null;T(e,t,e=>{for(const t of e.stageObject.geometries)t.material.setParameters({screenSizePerspective:n,screenSizePerspectiveAlignment:i})})}layerElevationInfoChanged(e,t){return T(e,t,(e,t)=>{this.graphics3DGraphicLayerElevationInfoChanged(t,e)}),1}slicePlaneEnabledChanged(e,t){return T(e,t,e=>{for(const t of e.stageObject.geometries)t.material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}terrainTransparencyChanged(){return this.draped}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return!1}graphics3DGraphicLayerElevationInfoChanged(e,t){const{elevationContext:r,metadata:n}=t;this.updateElevationContextForGraphic(r,e,n?.elevationOffset??0),t.needsElevationUpdates=d(r.mode)||"absolute-height"===r.mode}updateGeometry(e,t){const r=e.geometry;if(this.draped||!r||!this._validateGeometry(r))return!1;const{elevationContext:n,stageObject:i}=t;if(n.mode!==this.getGeometryElevationMode(r))return!1;const s=_(r);if(!s)return!1;n.updateFeatureExpressionFeature(e,this._context.layer);const o=z(i,this._context,s,n);if(null==o)return!1;const a=E(this._context,s);return i.geometries[0].localOrigin===a&&(t.alignedSampledElevation=o,L(t,s,this._context.elevationProvider),!0)}_defaultElevationInfoNoZ(){return I}_createAs3DShape(e,l,m,h,g,y,v=null,x=()=>h.placement.elevationOffset){const b=this.createElevationContextForGraphic(e,h.placement.elevationOffset),O=e.uid;let S=null,w=null;if(null==v){const e=P(h.horizontalPlacement);S=new D(m,e,this._textRenderParameters);let n=null;if(null!=this._context.sharedResources.textures){w=this._context.sharedResources.textures.fromData(S.key,()=>S.create()),w.managedTexture.events.on("unloaded",()=>n=t(n));const e=this._context.stage.renderView.textures.acquire(w.managedTexture.id);if(null==e||r(e))return w.release(),null;n=e}}const j=this.symbolLayer.occludedVisibility?.mode??"hidden",_=M(S,h),z=null!=v,E={occludedVisibilityMode:j,occludedFragmentOpacity:"hidden"!==j?this.view.state.ensureOccludedFragmentOpacity():null,screenOffset:h.placement.screenOffset,anchorPosition:_,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:h.placement.centerOffsetUnits,depthEnabled:!1,drawAsLabel:!0,isLabel:!0,hasVertexSize:z,hasVertexUVi:z,hasVertexCenterOffset:z,size:S?i(S.displayWidth,S.displayHeight):s,focusAreaStyle:g};if("polyline"===e.geometry?.type&&(E.shaderPolygonOffset=1e-4),z?E.textureId=v.id:w&&(E.textureId=w.managedTexture.id),null!=h.placement.verticalOffset){const{screenLength:e,minWorldLength:t,maxWorldLength:r}=h.placement.verticalOffset;E.verticalOffset={screenLength:n(e),minWorldLength:t||0,maxWorldLength:null!=r?r:1/0}}const U={screenOffset:E.screenOffset,anchorPosition:_,centerOffsetUnits:E.centerOffsetUnits,verticalOffset:E.verticalOffset,shaderPolygonOffset:E.shaderPolygonOffset,occludedVisibilityMode:E.occludedVisibilityMode,focusAreaStyle:E.focusAreaStyle};if(this._context.screenSizePerspectiveEnabled){const{parameters:e,labelParameters:t}=this.view.screenSizePerspective,r=C(this._textRenderParameters);E.screenSizePerspective=t,E.screenSizePerspectiveMinPixelReferenceSize=r.maxHeight,E.screenSizePerspectiveAlignment=e,U.fontHeight=r.maxHeight}E.hasSlicePlane=this._context.slicePlaneEnabled;const V=this._context.spherical,T=y?JSON.stringify(U):"";let I=y?.get(T);null==I&&(I=new F(E,V),y?.set(T,I));const H=h.placement.translation,W=z?o:null,$=z?h.placement.centerOffset:null,k=h.placement.groundDistance,N=R,q=z?c(0,0,0,0):null,B=A(I,{normal:N,position:H,size:W,centerOffset:$,groundDistance:k,uvi:q}),J=G(this._context,l,B,b,O);if(null==J)return null;const Y=(t,r,n,i,s,o)=>{const a=x()||h.placement.elevationOffset;return this.updateElevationContextForGraphic(r,e,a),f(t,r,n,i,s,o)},Z=new p(this,J.object,w,Y,b);Z.alignedSampledElevation=J.sampledElevation,Z.hiddenIfDeconflicted=!0,Z.needsElevationUpdates=d(b.mode)||"absolute-height"===b.mode,Z.getScreenSize=(e=a())=>(e[0]=S?S.displayWidth:h.displaySize[0],e[1]=S?S.displayHeight:h.displaySize[1],e);const K=new u(h.placement.elevationOffset,m);return Z.metadata=K,L(Z,l,this._context.elevationProvider),Z}}function T(e,t,r){e?.forEach(e=>{const n=t(e);null!=n&&r(n,e.graphic)})}function M(e,t){if("baseline"===t.verticalPlacement){const r=S[t.horizontalPlacement],n=null!=e?e.baselineAnchorY:0;return i(r,n)}const r=w(t.horizontalPlacement,t.verticalPlacement);return j[r]}const I={mode:"relative-to-ground",offset:0};export{V as Graphics3DTextSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{destroyMaybe as t,removeMaybe as i}from"../../../../core/maybe.js";import{initial as s,watch as a,sync as r}from"../../../../core/reactiveUtils.js";import{subclass as l}from"../../../../core/accessorSupport/decorators.js";import{c}from"../../../../chunks/boundedPlane.js";import{Deconflictor as h,DeconflictorGraphic as n}from"./Deconflictor.js";import{LabelDeconflictor as o}from"./LabelDeconflictor.js";import{TaskPriority as d}from"../../../support/Scheduler.js";let p=class extends h{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=1,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()},getNumVisibleLabels:()=>this._getNumVisible(16),getNumVisibleGraphics:()=>this._getNumVisible(1)}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add(()=>this.view?.state?.camera,()=>{this._updateViewState(),this.setDirty()}),this._updatingHandles.add(()=>this.view?.slice?.plane,()=>{this._updateSlicePlane(),this._slicePlaneChanged(),this.setDirty()},s),this.addHandles(a(()=>this.view.basemapTerrain?.updating||this.view.graphicsView?.updating||this.view.allLayerViews.some(e=>e.updating),(e,t)=>{!e&&t&&this.setDirty()},r)),this._frameTask=this.view.resourceController.scheduler.registerTask(d.GRAPHICS_DECONFLICTOR,this),this._labels=new o({view:this.view,parent:this})}destroy(){this._labels=t(this._labels),this._frameTask=i(this._frameTask)}get marginFactor(){return this._marginFactor}get usedMemory(){return super.usedMemory+this._labels.usedMemory}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){const t=super.runTask(e);return this.readyToRun||this._labels.setDirty(),t}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const e=this.view?.slice?.plane;null!=e&&c(e,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=null!=e}_slicePlaneChanged(){for(const e of this._contexts.keys())if(e.symbolCreationContext.slicePlaneEnabled)return void this.setDirty()}addGraphicsOwner(e){const t=this._getGraphicsContext(e);return{addGraphic:i=>this._addGraphic(e,t,i),removeGraphic:e=>this._removeGraphic(t,e),labelingInfoChange:()=>this._labelsEnabledChanged(e,t),featureReductionChange:()=>this._enabledChanged(e,t),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,t),screenSizePerspectiveEnabledChanged:()=>this._screenSizePerspectiveEnabledChange(),clear:()=>t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty(),getState:e=>this._getDeconflictorState(e),setState:(e,t)=>this._setDeconflictorState(e,t)}}_getDeconflictorState(e){return(e.getVisibilityFlag(1,8)?1:0)|(e.getVisibilityFlag(16,8)?16:0)}_setDeconflictorState(e,t){const i=!!(1&t),s=!!(16&t);e.setVisibilityFlag(1,8,i),e.setVisibilityFlag(16,8,s),this.setDirty()}_removeGraphicsOwner(e){const t=this._contexts.get(e);t&&(t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),this._contexts.delete(e),this.setDirty())}_addGraphic(e,t,i){const s=i.graphic.uid,a=new n(i,e.symbolCreationContext.slicePlaneEnabled);t.set(s,a),this.addToCheckOcclusion(a),_(e)&&this.addToActiveGraphics(a),e.labelsEnabled&&(this._labels.addToCheckOcclusion(a),this._labels.addToActiveGraphics(a));const r=this._initialVisibility(e,i);i.setVisibilityFlag(1,8,r)}_removeGraphic(e,t){const i=t.graphic.uid,s=e.get(i);s&&(this.removeFromActiveGraphics(s),this.removeFromCheckOcclusion(s),this._labels.removeFromActiveGraphics(s),this._labels.removeFromCheckOcclusion(s),e.delete(i),this.setDirty())}_enabledChanged(e,t){_(e)?t.forEach(e=>this.addToActiveGraphics(e)):t.forEach(e=>this.removeFromActiveGraphics(e)),this.setDirty()}_labelsEnabledChanged(e,t){e.labelsEnabled?(t.forEach(e=>this._labels.addToCheckOcclusion(e)),t.forEach(e=>this._labels.addToActiveGraphics(e))):(t.forEach(e=>this._labels.removeFromCheckOcclusion(e)),t.forEach(e=>this._labels.removeFromActiveGraphics(e)))}_slicePlaneEnabledChanged(e,t){const i=e.symbolCreationContext.slicePlaneEnabled;t.forEach(e=>e.slicePlaneEnabled=i),this.setDirty()}_screenSizePerspectiveEnabledChange(){this.setDirty()}_initialVisibility(e,t){if(t.isDraped)return!1;const i=t.layers;if(!i?.length)return!1;let s=!1,a=!1;for(const r of i)if(this.isSupportedLayer(r)){s=!0;const{useVisibilityPixel:e,occludedVisibilityMode:t}=r.stageObject.geometries[0].material.parameters;a||=!e&&"visible"!==t}return!(a||s&&_(e))}_getGraphicsContext(e){const t=this._contexts.get(e);if(t)return t;const i=new Map;return this._contexts.set(e,i),this.setDirty(),i}};function _(e){const t=e.layer;return!("selection"!==t?.featureReduction?.type)}p=e([l("esri.views.3d.layers.graphics.GraphicsDeconflictor")],p);export{p as GraphicsDeconflictor};
2
+ import{__decorate as e}from"tslib";import{destroyMaybe as t,removeMaybe as i}from"../../../../core/maybe.js";import{initial as s,watch as a,sync as r}from"../../../../core/reactiveUtils.js";import{subclass as l}from"../../../../core/accessorSupport/decorators.js";import{c}from"../../../../chunks/boundedPlane.js";import{Deconflictor as h,DeconflictorGraphic as n}from"./Deconflictor.js";import{LabelDeconflictor as o}from"./LabelDeconflictor.js";import{TaskPriority as d}from"../../../support/Scheduler.js";let p=class extends h{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=1,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()},getNumVisibleLabels:()=>this._getNumVisible(16),getNumVisibleGraphics:()=>this._getNumVisible(1)}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add(()=>this.view?.state?.camera,()=>{this._updateViewState(),this.setDirty()}),this._updatingHandles.add(()=>this.view?.slice?.plane,()=>{this._updateSlicePlane(),this._slicePlaneChanged(),this.setDirty()},s),this.addHandles(a(()=>this.view.basemapTerrain?.updating||this.view.graphicsView?.updating||this.view.allLayerViews.some(e=>e.updating),(e,t)=>{!e&&t&&this.setDirty()},r)),this._frameTask=this.view.resourceController.scheduler.registerTask(d.GRAPHICS_DECONFLICTOR,this),this._labels=new o({view:this.view,parent:this})}destroy(){this._labels=t(this._labels),this._frameTask=i(this._frameTask)}get marginFactor(){return this._marginFactor}get usedMemory(){return super.usedMemory+this._labels.usedMemory}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){const t=super.runTask(e);return this.readyToRun||this._labels.setDirty(),t}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const e=this.view?.slice?.plane;null!=e&&c(e,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=null!=e}_slicePlaneChanged(){for(const e of this._contexts.keys())if(e.symbolCreationContext.slicePlaneEnabled)return void this.setDirty()}addGraphicsOwner(e){const t=this._getGraphicsContext(e);return{addGraphic:i=>this._addGraphic(e,t,i),removeGraphic:e=>this._removeGraphic(t,e),labelingInfoChange:()=>this._labelsEnabledChanged(e,t),featureReductionChange:()=>this._enabledChanged(e,t),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,t),screenSizePerspectiveEnabledChanged:()=>this._screenSizePerspectiveEnabledChange(),clear:()=>t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty(),getState:e=>this._getDeconflictorState(e),setState:(e,t)=>this._setDeconflictorState(e,t)}}_getDeconflictorState(e){return(e.getVisibilityFlag(1,8)?1:0)|(e.getVisibilityFlag(16,8)?16:0)}_setDeconflictorState(e,t){const i=!!(1&t),s=!!(16&t);e.setVisibilityFlag(1,8,i),e.setVisibilityFlag(16,8,s),this.setDirty()}_removeGraphicsOwner(e){const t=this._contexts.get(e);t&&(t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),this._contexts.delete(e),this.setDirty())}_addGraphic(e,t,i){const s=i.graphic.uid,a=new n(i,e.symbolCreationContext.slicePlaneEnabled);t.set(s,a),this.addToCheckOcclusion(a),_(e)&&this.addToActiveGraphics(a),e.labelsEnabled&&(this._labels.addToCheckOcclusion(a),this._labels.addToActiveGraphics(a));const r=this._initialVisibility(e,i);i.setVisibilityFlag(1,8,r)}_removeGraphic(e,t){const i=t.graphic.uid,s=e.get(i);s&&(this.removeFromActiveGraphics(s),this.removeFromCheckOcclusion(s),this._labels.removeFromActiveGraphics(s),this._labels.removeFromCheckOcclusion(s),e.delete(i),this.setDirty())}_enabledChanged(e,t){_(e)?t.forEach(e=>this.addToActiveGraphics(e)):t.forEach(e=>this.removeFromActiveGraphics(e)),this.setDirty()}_labelsEnabledChanged(e,t){e.labelsEnabled?(t.forEach(e=>this._labels.addToCheckOcclusion(e)),t.forEach(e=>this._labels.addToActiveGraphics(e))):(t.forEach(e=>this._labels.removeFromCheckOcclusion(e)),t.forEach(e=>this._labels.removeFromActiveGraphics(e)))}_slicePlaneEnabledChanged(e,t){const i=e.symbolCreationContext.slicePlaneEnabled;t.forEach(e=>e.slicePlaneEnabled=i),this.setDirty()}_screenSizePerspectiveEnabledChange(){this.setDirty()}_initialVisibility(e,t){if(t.isDraped)return!1;const i=t.layers;if(!i?.length)return!1;let s=!1,a=!1;for(const r of i)if(this.isSupportedLayer(r)){s=!0;const{occludedVisibilityMode:e}=r.stageObject.geometries[0].material.parameters;a||="visible"!==e}return!(a||s&&_(e))}_getGraphicsContext(e){const t=this._contexts.get(e);if(t)return t;const i=new Map;return this._contexts.set(e,i),this.setDirty(),i}};function _(e){const t=e.layer;return!("selection"!==t?.featureReduction?.type)}p=e([l("esri.views.3d.layers.graphics.GraphicsDeconflictor")],p);export{p as GraphicsDeconflictor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/units.js";import{add as n,normalize as s,dot as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{computeMapPointFromVec3d as g}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as b}from"../../support/geometryUtils/ray.js";import{defaultTolerance as w,Intersector as R}from"../../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as v}from"../../webgl-engine/lib/IntersectorResult.js";import{sliceFilterPredicate as P}from"../../webgl-engine/lib/intersectorUtils.js";class I{constructor(t,r,i){this.viewingMode=t,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new e,this._tolerance=w,this._tmpRay=m(),this._tmpRegion=a(),this._validateHUDIntersector=new R(this.viewingMode),this._validateHUDIntersector.options.hud=!1}destroy(){this._externalIntersectionHandlers.prune()}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,H(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,i){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,i),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,i=.5){return e.getRenderCenter(F,r,i),F[0]+=.0466,F[1]-=.0123,_(e,F,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}intersectToolIntersectorScreen(e,t,r){const i=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(i,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const i=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||v(i)&&7!==i.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=w){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return b(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||n(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,i=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,i)}_intersectElevation(e,r,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,h=i(c.spatialReference),d=null!=r?r.mode:"absolute-height",p=f(r)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:_}=c.state;if("absolute-height"===d){const t=u?.getAltitude(_.eye),r=o(s(k,e.direction),u.worldUpAtPosition(_.eye,E));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,k)){const e=g(c,k);return e.z??=0,e.z-=p,e}return null}const b=_.projectToRenderScreen(e.origin,t(y.get())),w=new V(null,this._forEachLayer),v=c.slice.plane,I=v?P(v):null,x=new R(this.viewingMode);x.options.store=0,x.options.verticalOffset=m,x.options.normalRequired=!1;const j=e.origin,M=n(y.get(),j,e.direction);x.reset(j,M,_),x.point=b;let U=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find(e=>e.layer===a)?.uid;U=e?t=>t.layerViewUid===e:null}else a&&(U=e=>e.graphicUid!==a.uid);switch(d){case"relative-to-scene":{const e=e=>(!U||U(e))&&!!e.lastValidElevationBB;x.intersect(w.layers,b,this._tolerance,null,e),this._externalIntersectionHandlers.forAll(e=>{if(2===e.type||7===e.type||8===e.type){const t=e.slicePlaneEnabled?I:null;e.intersect(x,t,x.rayBegin,x.rayEnd,b,!1)}});break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll(e=>{if(e.isGround){const t=e.slicePlaneEnabled?I:null;e.intersect(x,t,x.rayBegin,x.rayEnd,b,!1)}})}if(x.results.min.getIntersectionPoint(k)){const e=g(c,k);return e.z=l,e}return null}computeIntersection(e,r,i,s){if(null==e)return;const o=this._view.state.camera,l=o.projectToRenderScreen(e.origin,t(y.get())),a=new V(s,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!s||!("include"in s||"exclude"in s);const c=e.origin,u=n(y.get(),e.origin,e.direction);r.reset(c,u,o),r.intersect(a.layers,l,this._tolerance);const h=this._view.slice.plane,d=null!=h?P(h):null;r.intersect(a.sliceableLayers,l,this._tolerance,d);const p=s&&(s.requiresGroundFeedback||s.enableDraped);this._externalIntersectionHandlers.forAll(e=>{const t=e.layerViewUid,n=e.sublayerId,s=Array.isArray(t),o=s?t:[t];s&&(r.options.filteredLayerViewUids=[]);let h=!1;for(const i of o)a.filterLayerViewUid(i,n)?h=!0:s&&r.options.filteredLayerViewUids.push(i);if(r.options.isFiltered=!h,e.isGround&&p||!r.options.isFiltered){const t=e.slicePlaneEnabled?d:null;e.intersect(r,t,c,u,l,i)}});const m=y.get(),f=this._view,g=f.basemapTerrain;if(s&&s.enableDraped&&null!=g.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,t=f.renderCoordsHelper.spatialReference,i=y.get();f.renderCoordsHelper.fromRenderCoords(m,i,g.spatialReference),i[2]=f.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,i,r.results.ground,e=>a.filterRenderGeometry(e))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=this._view.state.camera,i=[],n=this._tmpRegion,s=e=>{const t=new M(e),s=t.result.target.object.geometries.every(({material:e})=>{const{parameters:t}=e;return"useVisibilityPixel"in t&&t.useVisibilityPixel});i.push({item:t,useVisibilityPixel:s}),s&&(r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),p(n,t.screenPoint))};e.sortResults(t.all),null!=t.min.distance&&s(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&s(c);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&s(t.max),!i.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);const o=r.fullWidth,l=r.fullHeight,a=Math.max(0,n[0]-x),m=Math.max(0,n[1]-x),y=Math.min(h(n)+2*x,o-a),f=Math.min(d(n)+2*x,l-m),g=y>0&&f>0?new Uint8Array(y*f*4):null;g&&this._view.stage.renderer.readHUDVisibility(a,m,y,f,g);let _=!0;const b=null==e.results.max.distance;let w=0;for(const{item:c,useVisibilityPixel:u}of i){let t=!u;if(u&&g)for(const e of j){const r=4*(Math.min(c.screenPoint[0]+e[0],o)-n[0]+(Math.min(c.screenPoint[1]+e[1],l)-n[1])*y);if(r>=0&&r<g.length&&g[r]){t=!0;break}}t&&(_&&(e.results.min.copy(c.result),_=!1),b&&e.results.max.copy(c.result),2===e.options.store&&e.results.all.splice(w++,0,c.result))}}}const x=1,j=(()=>{const e=[],t=x;for(let r=-t;r<=t;r++)for(let i=-t;i<=t;i++)e.push([i+t,r+t]);return e})();class M{constructor(e){this.result=e,this.screenPoint=r()}}let U;function H(e){return U&&U.viewingMode===e||(U=new R(e)),U}class V{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:i}=this;if(null==e)return null==r&&null==i;const n=r instanceof Map?r.get(e)??!1:r?.has(e),s=i instanceof Map?i.get(e)??!1:i?.has(e);return(null==n||("boolean"==typeof n?n:null!=t&&n.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function L(e){return"object"==typeof e&&"intersect"in e}const k=l(),E=l(),F=r();export{I as SceneIntersectionHelper,L as isIntersectionHandler};
2
+ import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/units.js";import{add as i,normalize as s,dot as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u}from"../../../../geometry/support/aaBoundingRect.js";import{create as d}from"../../../../geometry/support/ray.js";import{sv3d as p}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as h}from"../../../../support/elevationInfoUtils.js";import{computeMapPointFromVec3d as y}from"../../support/hitTest.js";import{fromRenderAtEye as m,fromScreen as g}from"../../support/geometryUtils/ray.js";import{defaultTolerance as f,Intersector as _}from"../../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as R}from"../../webgl-engine/lib/IntersectorResult.js";import{sliceFilterPredicate as w}from"../../webgl-engine/lib/intersectorUtils.js";class b{constructor(t,r,n){this.viewingMode=t,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new e,this._tolerance=f,this._tmpRay=d(),this._tmpRegion=a(),this._validateHUDIntersector=new _(this.viewingMode),this._validateHUDIntersector.options.hud=!1}destroy(){this._externalIntersectionHandlers.prune()}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),j(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,j(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(L,r,n),L[0]+=.0466,L[1]-=.0123,m(e,L,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const n=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||R(n)&&7!==n.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=f){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return g(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||i(t,e.origin,s(p.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,r,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,d=n(c.spatialReference),m=null!=r?r.mode:"absolute-height",g=h(r)/d,f=("on-the-ground"!==m?g+l:0)*d/u.unitInMeters,{camera:R}=c.state;if("absolute-height"===m){const t=u?.getAltitude(R.eye),r=o(s(U,e.direction),u.worldUpAtPosition(R.eye,H));if(t<f&&r<0||t>=f&&r>0)return null;if(u.intersectInfiniteManifold(e,f,U)){const e=y(c,U);return e.z??=0,e.z-=g,e}return null}const b=R.projectToRenderScreen(e.origin,t(p.get())),v=new x(null,this._forEachLayer),I=c.slice.plane,j=I?w(I):null,P=new _(this.viewingMode);P.options.store=0,P.options.verticalOffset=f,P.options.normalRequired=!1;const L=e.origin,M=i(p.get(),L,e.direction);P.reset(L,M,R),P.point=b;let k=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find(e=>e.layer===a)?.uid;k=e?t=>t.layerViewUid===e:null}else a&&(k=e=>e.graphicUid!==a.uid);switch(m){case"relative-to-scene":{const e=e=>(!k||k(e))&&!!e.lastValidElevationBB;P.intersect(v.layers,b,this._tolerance,null,e),this._externalIntersectionHandlers.forAll(e=>{if(2===e.type||7===e.type||8===e.type){const t=e.slicePlaneEnabled?j:null;e.intersect(P,t,P.rayBegin,P.rayEnd,b,!1)}});break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll(e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(P,t,P.rayBegin,P.rayEnd,b,!1)}})}if(P.results.min.getIntersectionPoint(U)){const e=y(c,U);return e.z=l,e}return null}computeIntersection(e,r,n,s){if(null==e)return;const o=this._view.state.camera,l=o.projectToRenderScreen(e.origin,t(p.get())),a=new x(s,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!s||!("include"in s||"exclude"in s);const c=e.origin,u=i(p.get(),e.origin,e.direction);r.reset(c,u,o),r.intersect(a.layers,l,this._tolerance);const d=this._view.slice.plane,h=null!=d?w(d):null;r.intersect(a.sliceableLayers,l,this._tolerance,h);const y=s&&(s.requiresGroundFeedback||s.enableDraped);this._externalIntersectionHandlers.forAll(e=>{const t=e.layerViewUid,i=e.sublayerId,s=Array.isArray(t),o=s?t:[t];s&&(r.options.filteredLayerViewUids=[]);let d=!1;for(const n of o)a.filterLayerViewUid(n,i)?d=!0:s&&r.options.filteredLayerViewUids.push(n);if(r.options.isFiltered=!d,e.isGround&&y||!r.options.isFiltered){const t=e.slicePlaneEnabled?h:null;e.intersect(r,t,c,u,l,n)}});const m=p.get(),g=this._view,f=g.basemapTerrain;if(s&&s.enableDraped&&null!=f.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=g.overlayManager.renderer,t=g.renderCoordsHelper.spatialReference,n=p.get();g.renderCoordsHelper.fromRenderCoords(m,n,f.spatialReference),n[2]=g.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,n,r.results.ground,e=>a.filterRenderGeometry(e))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=new Array,n=this._tmpRegion,i=e=>{r.push(new v(e))};e.sortResults(t.all),null!=t.min.distance&&i(t.min);for(const a of t.all)t.min.target.object!==a.target.object&&t.max.target.object!==a.target.object&&i(a);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&i(t.max),!r.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);let s=!0;const o=null==e.results.max.distance;let l=0;for(const a of r)s&&(e.results.min.copy(a.result),s=!1),o&&e.results.max.copy(a.result),2===e.options.store&&e.results.all.splice(l++,0,a.result)}}class v{constructor(e){this.result=e,this.screenPoint=r()}}let I;function j(e){return I&&I.viewingMode===e||(I=new _(e)),I}class x{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:n}=this;if(null==e)return null==r&&null==n;const i=r instanceof Map?r.get(e)??!1:r?.has(e),s=n instanceof Map?n.get(e)??!1:n?.has(e);return(null==i||("boolean"==typeof i?i:null!=t&&i.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function P(e){return"object"==typeof e&&"intersect"in e}const U=l(),H=l(),L=r();export{b as SceneIntersectionHelper,P as isIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{signal as t}from"../../../../core/signal.js";import{normalize as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as i}from"../../../../geometry/support/frustum.js";import{Sphere as n}from"../../../../geometry/support/sphere.js";import{makeScheduleFunction as a}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as o}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as u}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as h}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as d}from"./GaussianSplatTextureAtlas.js";import{TaskPriority as l}from"../../../support/Scheduler.js";class c{constructor(e){this._updating=t(!1),this._useDeterministicSort=!1,this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._minimumBoundingSphere=new n,this._cameraDirectionNormalized=s(),this._frameTask=null,this._renderer=e,this._orderTexture=new h(this._renderer.renderingContext),this._fadingTexture=new u(this._renderer.renderingContext),this._textureAtlas=new d(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:r}=this._renderer.view;this._workerHandle=new o(a(r)),this._frameTask=r.scheduler.registerTask(l.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}forEachTile(e){for(const t of this._visibleGaussianTiles)e(t)}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}get updating(){return this._updating.value}destroy(){this._pendingSortTask=!1,this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){this._updating.value=!0,this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>this._handleSortComplete()).catch(()=>this._handleSortComplete()))}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureSortBufferCapacities(t){if(this._bufferCapacity<t){const r=Math.ceil(t*e);this._atlasIndicesBuffer=new Uint32Array(r),this._distancesBuffer=new Float64Array(r),this._sortOrderBuffer=new Uint32Array(r),this._bufferCapacity=r}}_ensureSortedAtlasIndicesBufferCapacity(t){if(!(t<=0)&&(!this._sortedAtlasIndicesBuffer||this._sortedAtlasIndicesBuffer.length<t)){const r=Math.ceil(t*e);this._sortedAtlasIndicesBuffer=new Uint32Array(r)}}async _sortOnWorker(){if(0===this._visibleGaussianTiles.length)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._useDeterministicSort&&this._visibleGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);let e=this._visibleGaussianTiles.reduce((e,t)=>e+t.gaussianAtlasIndices.length,0);this._ensureSortBufferCapacities(e),this._textureAtlas.ensureTextureAtlas();const{frustum:t}=this._renderer.camera;r(this._cameraDirectionNormalized,this._renderer.camera.ray.direction);const s=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],a=this._cameraDirectionNormalized[2];let o=0;const u=1.5;if(this.forEachTile(r=>{const{gaussianAtlasIndices:h,positions:d}=r;if(this._minimumBoundingSphere.center=r.obb.center,this._minimumBoundingSphere.radius=(r.obb.radius+r.maxScale)*u,i(t,this._minimumBoundingSphere))for(let e=0;e<h.length;e++){this._atlasIndicesBuffer[o]=h[e];const t=3*e,r=d[t],i=d[t+1],u=d[t+2];this._distancesBuffer[o]=r*s+i*n+u*a,this._sortOrderBuffer[o]=o,o++}else e-=h.length}),0===e)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);const h={distances:this._distancesBuffer,sortOrderIndices:this._sortOrderBuffer,numGaussians:e,preciseSort:this._useDeterministicSort};await(this._workerHandle?.sort(h).then(e=>{this._distancesBuffer=e.distances,this._sortOrderBuffer=e.sortedOrderIndices}));const d=async t=>{const{paddedSize:r}=this._orderTexture.ensureCapacity(e);this._ensureSortedAtlasIndicesBufferCapacity(r);const s=this._atlasIndicesBuffer,i=this._sortOrderBuffer,n=this._sortedAtlasIndicesBuffer;for(let a=0;a<e;a++)n[a]=s[i[a]];this._orderTexture.setData(n,e),this.visibleGaussians=e,this._renderer.requestRender(1),t.madeProgress()};await this._frameTask.schedule(d)}set useDeterministicSort(e){this._useDeterministicSort=e}}export{c as GaussianSplatDataStore};
2
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{signal as t}from"../../../../core/signal.js";import{normalize as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as i}from"../../../../geometry/support/frustum.js";import{Sphere as n}from"../../../../geometry/support/sphere.js";import{makeScheduleFunction as a}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as o}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as u}from"./GaussianSplatFadeTexture.js";import{GaussianSplatOrderTexture as h}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as d}from"./GaussianSplatTextureAtlas.js";import{TaskPriority as l}from"../../../support/Scheduler.js";class c{constructor(e){this._updating=t(!1),this._useDeterministicSort=!1,this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._minimumBoundingSphere=new n,this._cameraDirectionNormalized=s(),this._frameTask=null,this._renderer=e,this._orderTexture=new h(this._renderer.renderingContext),this._fadingTexture=new u(this._renderer.renderingContext),this._textureAtlas=new d(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:r}=this._renderer.view;this._workerHandle=new o(a(r)),this._frameTask=r.scheduler.registerTask(l.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}forEachTile(e){for(const t of this._visibleGaussianTiles)e(t)}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}get updating(){return this._updating.value}destroy(){this._pendingSortTask=!1,this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){this._updating.value=!0,this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>this._handleSortComplete()).catch(()=>this._handleSortComplete()))}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this.requestSort():this._updating.value=!1}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureSortBufferCapacities(t){if(this._bufferCapacity<t){const r=Math.ceil(t*e);this._atlasIndicesBuffer=new Uint32Array(r),this._distancesBuffer=new Float64Array(r),this._sortOrderBuffer=new Uint32Array(r),this._bufferCapacity=r}}_ensureSortedAtlasIndicesBufferCapacity(t){if(!(t<=0)&&(!this._sortedAtlasIndicesBuffer||this._sortedAtlasIndicesBuffer.length<t)){const r=Math.ceil(t*e);this._sortedAtlasIndicesBuffer=new Uint32Array(r)}}async _sortOnWorker(){if(0===this._visibleGaussianTiles.length)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._useDeterministicSort&&this._visibleGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const e=this._visibleGaussianTiles,t=e.length;let s=0;for(let r=0;r<t;r++)s+=e[r].gaussianAtlasIndices.length;this._ensureSortBufferCapacities(s),this._textureAtlas.ensureTextureAtlas();const{frustum:n}=this._renderer.camera;r(this._cameraDirectionNormalized,this._renderer.camera.ray.direction);const a=this._cameraDirectionNormalized[0],o=this._cameraDirectionNormalized[1],u=this._cameraDirectionNormalized[2];let h=0;const d=1.5,l=this._atlasIndicesBuffer,c=this._distancesBuffer,_=this._sortOrderBuffer,f=this._minimumBoundingSphere,m=f.center;for(let r=0;r<t;r++){const t=e[r],{gaussianAtlasIndices:s,relativePositions:_,obb:p,maxScale:g}=t,S=s.length,{centerX:T,centerY:b,centerZ:x}=p;if(m[0]=T,m[1]=b,m[2]=x,f.radius=(p.radius+g)*d,!i(n,f))continue;l.set(s,h);const A=a*T+o*b+u*x,y=h+S;for(let e=h,r=0;e<y;e++,r+=3){const t=_[r],s=_[r+1],i=_[r+2];c[e]=t*a+s*o+i*u+A}h=y}for(let r=0;r<h;r++)_[r]=r;if(0===h)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);const p={distances:this._distancesBuffer,sortOrderIndices:this._sortOrderBuffer,numGaussians:h,preciseSort:this._useDeterministicSort};await(this._workerHandle?.sort(p).then(e=>{this._distancesBuffer=e.distances,this._sortOrderBuffer=e.sortedOrderIndices}));const g=async e=>{const{paddedSize:t}=this._orderTexture.ensureCapacity(h);this._ensureSortedAtlasIndicesBufferCapacity(t);const r=this._atlasIndicesBuffer,s=this._sortOrderBuffer,i=this._sortedAtlasIndicesBuffer;for(let n=0;n<h;n++)i[n]=r[s[n]];this._orderTexture.setData(i,h),this.visibleGaussians=h,this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(g)}set useDeterministicSort(e){this._useDeterministicSort=e}}export{c as GaussianSplatDataStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{subtract as t,length as i,scale as e,negate as n,dot as s,set as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as c}from"../../../../geometry/support/plane.js";import{fromPoints as u}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as m}from"../../layers/i3s/Intersector.js";import{ElevationRange as d}from"../ElevationRange.js";import{IntersectorResult as p}from"../../webgl-engine/lib/IntersectorResult.js";class f{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this.intersectionNormal=r(),this.intersectionRayDir=r(),this.intersectionPlane=c(),this.layerViewUid=t.uid}intersect(r,c,d,f){const{intersectionRayDir:w,intersectionPlane:y,layerViewUid:b,intersectionNormal:V}=this,R=u(d,f);t(w,f,d);const j=1/i(w);e(w,w,j),n(V,w),a(y,w[0],w[1],w[2],-s(w,d));const v=new g,x=new g,E=r.options.store,I=2===E,P=0!==E,U=I?new Array:null,D=(t,i,e,n,s)=>(t.point=t.point?o(t.point,e,n,s):l(e,n,s),t.dist=i,t.normal=V,t.layerViewUid=b,t),A=d[0],N=d[1],S=d[2],T=w[0],q=w[1],G=w[2];this.layerView.data.forEachTile(t=>{const i=t.obb.minimumDistancePlane(y),e=t.obb.maximumDistancePlane(y),n=e<0,s=null!=v.dist&&null!=x.dist&&v.dist<i*j&&x.dist>e*j;if(n||s)return;if(!t.boundingVolumeIntersectsRay(d,w))return;const{positions:o,squaredScales:r,gaussianAtlasIndices:l}=t,a=l.length;for(let u=0,m=0;u<a;u++,m+=3){const t=o[m],i=o[m+1],e=o[m+2],n=t-A,s=i-N,l=e-S,a=n*T+s*q+l*G;if(a<0)continue;if(n*n+s*s+l*l-a*a>r[u])continue;const p=a*j;if((!c||c(d,f,p))&&((null==v.dist||p<v.dist)&&D(v,p,t,i,e),P&&(null==x.dist||p>x.dist)&&D(x,p,t,i,e),I)){const n=new g;U.push(D(n,p,t,i,e))}}});const k=(t,i)=>{const{layerViewUid:e}=i,n=new m(i.point,e);t.set(0,n,i.dist,i.normal)};if(h(v)){const t=r.results.min;(null==t.distance||v.dist<t.distance)&&k(t,v)}if(h(x)&&0!==r.options.store){const t=r.results.max;(null==t.distance||x.dist>t.distance)&&k(t,x)}if(I&&U?.length)for(const t of U){const i=new p(R);k(i,t),r.results.all.push(i)}}getElevationRange(t){let i=null;return this.layerView.data.forEachTile(e=>{i?.contains(e.elevationRange)||e.boundingVolumeIntersectsSphere(t)&&(i||(i=new d),i.expandElevationRange(e.elevationRange))}),i||(i=new d(0,0)),i}}function h(t){return null!=t.dist&&null!=t.point}class g{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{f as GaussianSplatIntersectionHandler};
2
+ import{subtract as t,length as e,scale as i,negate as n,dot as s,set as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as c}from"../../../../geometry/support/plane.js";import{fromPoints as u}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as m}from"../../layers/i3s/Intersector.js";import{ElevationRange as d}from"../ElevationRange.js";import{IntersectorResult as p}from"../../webgl-engine/lib/IntersectorResult.js";class f{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this.intersectionNormal=r(),this.intersectionRayDir=r(),this.intersectionPlane=c(),this.layerViewUid=t.uid}intersect(r,c,d,f){const{intersectionRayDir:w,intersectionPlane:y,layerViewUid:b,intersectionNormal:V}=this,v=u(d,f);t(w,f,d);const R=1/e(w);i(w,w,R),n(V,w),a(y,w[0],w[1],w[2],-s(w,d));const j=new g,x=new g,E=r.options.store,P=2===E,I=0!==E,U=P?new Array:null,D=(t,e,i,n,s)=>(t.point=t.point?o(t.point,i,n,s):l(i,n,s),t.dist=e,t.normal=V,t.layerViewUid=b,t),A=d[0],N=d[1],S=d[2],T=w[0],q=w[1],G=w[2];this.layerView.data.forEachTile(t=>{const e=t.obb.minimumDistancePlane(y),i=t.obb.maximumDistancePlane(y),n=i<0,s=null!=j.dist&&null!=x.dist&&j.dist<e*R&&x.dist>i*R;if(n||s)return;if(!t.boundingVolumeIntersectsRay(d,w))return;const{relativePositions:o,squaredScales:r,gaussianAtlasIndices:l,obb:a}=t,u=a.centerX,m=a.centerY,p=a.centerZ,h=A-u,b=N-m,V=S-p,v=l.length;for(let w=0,y=0;w<v;w++,y+=3){const t=o[y]-h,e=o[y+1]-b,i=o[y+2]-V,n=t*T+e*q+i*G;if(n<0)continue;if(t*t+e*e+i*i-n*n>r[w])continue;const s=n*R;if(!(!c||c(d,f,s)))continue;const l=o[y]+u,a=o[y+1]+m,v=o[y+2]+p;if((null==j.dist||s<j.dist)&&D(j,s,l,a,v),I&&(null==x.dist||s>x.dist)&&D(x,s,l,a,v),P){const t=new g;U.push(D(t,s,l,a,v))}}});const X=(t,e)=>{const{layerViewUid:i}=e,n=new m(e.point,i);t.set(0,n,e.dist,e.normal)};if(h(j)){const t=r.results.min;(null==t.distance||j.dist<t.distance)&&X(t,j)}if(h(x)&&0!==r.options.store){const t=r.results.max;(null==t.distance||x.dist>t.distance)&&X(t,x)}if(P&&U?.length)for(const t of U){const e=new p(v);X(e,t),r.results.all.push(e)}}getElevationRange(t){let e=null;return this.layerView.data.forEachTile(i=>{e?.contains(i.elevationRange)||i.boundingVolumeIntersectsSphere(t)&&(e||(e=new d),e.expandElevationRange(i.elevationRange))}),e||(e=new d(0,0)),e}}function h(t){return null!=t.dist&&null!=t.point}class g{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{f as GaussianSplatIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{splatPageSizeInU32 as e}from"./GaussianSplatAtlasPages.js";class i{constructor(i,r,o,n,a,b,h,u){this.handle=i,this.obb=r,this.gaussianAtlasIndices=o,this.pageIds=n,this.positions=a,this.squaredScales=b,this.maxScale=h,this.elevationRange=u,this.isVisible=!1,this.fadeDirection=0,this.opacityModifier=0,this.usedMemory=t(this.gaussianAtlasIndices,this.positions,this.squaredScales)+this.pageIds.length*e*4;const c=s();r?.getCenter(c),this._obbCenterX=c[0],this._obbCenterY=c[1],this._obbCenterZ=c[2];const d=r?.radius??-1;this._obbRadius=d;const l=d<0?-1:d*d;this._obbRadiusSquared=l;const f=r?.halfSize;this._obbShortestHalfsize=f?Math.min(f[0],f[1],f[2]):0}boundingVolumeIntersectsRay(t,s){if(!this.obb)return!0;const{_obbCenterX:e,_obbCenterY:i,_obbCenterZ:r}=this,o=e-t[0],n=i-t[1],a=r-t[2],b=o*s[0]+n*s[1]+a*s[2],h=o*o+n*n+a*a-b*b;return(this._obbRadiusSquared<0||h<=this._obbRadiusSquared)&&this.obb.intersectRay(t,s)}boundingVolumeIntersectsSphere(t){const s=this._obbRadius;if(s<0)return!0;const e=t.center,i=t.radius,r=s+i,o=this._obbCenterX-e[0];if(o>r)return!1;const n=this._obbCenterY-e[1];if(n>r)return!1;const a=this._obbCenterZ-e[2];if(a>r)return!1;const b=o*o+n*n+a*a;if(b>r*r)return!1;if(b<=(this._obbShortestHalfsize+i)**2)return!0;return Math.sqrt(b)+s<=i||(this.obb?.intersectSphere(t)??!0)}}export{i as GaussianTile};
2
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{splatPageSizeInU32 as e}from"./GaussianSplatAtlasPages.js";class i{constructor(i,r,o,n,a,b,h,u){this.handle=i,this.obb=r,this.gaussianAtlasIndices=o,this.pageIds=n,this.relativePositions=a,this.squaredScales=b,this.maxScale=h,this.elevationRange=u,this.isVisible=!1,this.fadeDirection=0,this.opacityModifier=0,this.usedMemory=t(this.gaussianAtlasIndices,this.relativePositions,this.squaredScales)+this.pageIds.length*e*4;const c=s();r?.getCenter(c),this._obbCenterX=c[0],this._obbCenterY=c[1],this._obbCenterZ=c[2];const d=r?.radius??-1;this._obbRadius=d;const l=d<0?-1:d*d;this._obbRadiusSquared=l;const f=r?.halfSize;this._obbShortestHalfsize=f?Math.min(f[0],f[1],f[2]):0}boundingVolumeIntersectsRay(t,s){if(!this.obb)return!0;const{_obbCenterX:e,_obbCenterY:i,_obbCenterZ:r}=this,o=e-t[0],n=i-t[1],a=r-t[2],b=o*s[0]+n*s[1]+a*s[2],h=o*o+n*n+a*a-b*b;return(this._obbRadiusSquared<0||h<=this._obbRadiusSquared)&&this.obb.intersectRay(t,s)}boundingVolumeIntersectsSphere(t){const s=this._obbRadius;if(s<0)return!0;const e=t.center,i=t.radius,r=s+i,o=this._obbCenterX-e[0];if(o>r)return!1;const n=this._obbCenterY-e[1];if(n>r)return!1;const a=this._obbCenterZ-e[2];if(a>r)return!1;const b=o*o+n*n+a*a;if(b>r*r)return!1;if(b<=(this._obbShortestHalfsize+i)**2)return!0;return Math.sqrt(b)+s<=i||(this.obb?.intersectSphere(t)??!0)}}export{i as GaussianTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import t from"../../../core/Error.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{RenderNodeOutput as d}from"../webgl.js";import{getFramebufferDrawBuffers as a}from"../../webgl/RenderingContext.js";let h=class extends r{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=d.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([i(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},s)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new t("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,r=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(r),r}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(a(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n({constructOnly:!0})],h.prototype,"consumes",void 0),e([n()],h.prototype,"produces",void 0),e([n({readOnly:!0})],h.prototype,"techniques",null),h=e([o("esri.views.3d.webgl.RenderNode")],h);export{h as default};
2
+ import{__decorate as e}from"tslib";import r from"../../../core/Accessor.js";import t from"../../../core/Error.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{RenderNodeOutput as d}from"../webgl.js";import{getFramebufferDrawBuffers as a}from"../../webgl/RenderingContext.js";let h=class extends r{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=d.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([i(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},s)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new t("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,r=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(r),r}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(a(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};e([n({constructOnly:!0})],h.prototype,"view",void 0),e([n({constructOnly:!0})],h.prototype,"consumes",void 0),e([n()],h.prototype,"produces",void 0),e([n({readOnly:!0})],h.prototype,"techniques",null),h=e([o("esri.views.3d.webgl.RenderNode")],h);const u=h;export{u as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{invert as e,transpose as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{ones as s,clone as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{TwoVectorPosition as i}from"../../core/util/TwoVectorPosition.js";import{NoParameters as a}from"../../../../webgl/NoParameters.js";class n extends a{constructor(s,o){super(),this._componentParameters=m;const{transform:a,toMapSpace:n}=s;this.toMapSpace=n;const u=r(a.rotationScale);e(u,u),t(u,u),this.transformNormalGlobalFromModel=u;const l=new i(a.position);this.transformWorldFromModelTL=l.low,this.transformWorldFromModelTH=l.high,this.transformWorldFromModelRS=a.rotationScale,this.useENUForGlobalOverlayUV=s.obb.radius<h,this.baseColor=o.baseColor,this.opacity=o.opacity,this.textureAlphaCutoff=o.textureAlphaCutoff,this.mrrFactors=o.mrrFactors,this.emissiveBaseColor=o.emissiveBaseColor,this.baseColorTexture=o.baseColorTexture,this.metallicRoughnessTexture=o.metallicRoughnessTexture,this.normalTexture=o.normalTexture,this.occlusionTexture=o.occlusionTexture,this.emissionTexture=o.emissionTexture}destroy(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}get componentParameters(){return this._componentParameters}updateComponentParameters(e,t){this._componentParameters=e,this.textureBackedBuffer=t}get castAnyShadows(){return 2!==this.componentParameters.castShadows}}class u{constructor(e,t,r,s,i){this.castShadows=i,this.componentDataType=0,this.externalColor=o(e),this.externalColorMixMode=t,this.emissiveStrength=r,this.emissiveSource=s}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}}class l{constructor(e,t,r,s,o){this.transparent=e,this.opaqueOverride=t,this.emissiveOverride=r,this.emissiveSourceOverride=s,this.castShadows=o,this.componentDataType=1}}const m=new u(s(),1,0,0,0),h=5e4;export{n as ComponentDrawParametersImplementation,u as ComponentParametersUniform,l as ComponentParametersVarying,m as defaultComponentParameters};
2
+ import{invert as e,transpose as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{ones as s,clone as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{VertexPositionDrawParameters as i}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{TwoVectorPosition as a}from"../../core/util/TwoVectorPosition.js";class n extends i{constructor(s,o){super(),this._componentParameters=u;const{transform:i,toMapSpace:n}=s;this.toMapSpace=n;const l=r(i.rotationScale);e(l,l),t(l,l),this.transformNormalGlobalFromModel=l;const m=new a(i.position);this.transformWorldFromModelTL=m.low,this.transformWorldFromModelTH=m.high,this.transformWorldFromModelRS=i.rotationScale,this.useENUForGlobalOverlayUV=s.obb.radius<h,this.baseColor=o.baseColor,this.opacity=o.opacity,this.textureAlphaCutoff=o.textureAlphaCutoff,this.mrrFactors=o.mrrFactors,this.emissiveBaseColor=o.emissiveBaseColor,this.baseColorTexture=o.baseColorTexture,this.metallicRoughnessTexture=o.metallicRoughnessTexture,this.normalTexture=o.normalTexture,this.occlusionTexture=o.occlusionTexture,this.emissionTexture=o.emissionTexture;const c=new Float32Array(24);c.set(this.transformWorldFromModelTL,0),c.set(this.transformWorldFromModelTH,3),c.set(this.transformWorldFromModelRS,6),c.set(this.transformNormalGlobalFromModel,15),this.transformationFloats=c}destroy(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}setTransformationDrawId(e){this.transformationDrawId=e}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}get componentParameters(){return this._componentParameters}updateComponentParameters(e,t){this._componentParameters=e,this.textureBackedBuffer=t}get castAnyShadows(){return 2!==this.componentParameters.castShadows}}class l{constructor(e,t,r,s,i){this.castShadows=i,this.componentDataType=0,this.externalColor=o(e),this.externalColorMixMode=t,this.emissiveStrength=r,this.emissiveSource=s}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}}class m{constructor(e,t,r,s,o){this.transparent=e,this.opaqueOverride=t,this.emissiveOverride=r,this.emissiveSourceOverride=s,this.castShadows=o,this.componentDataType=1}}const u=new l(s(),1,0,0,0),h=5e4;export{n as ComponentDrawParametersImplementation,l as ComponentParametersUniform,m as ComponentParametersVarying,u as defaultComponentParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.sphericalSR=e,this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.hasModelRotationScale=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o({count:10})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:3})],s.prototype,"oitPass",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"blendingEnabled",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasPolygonOffset",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0),e([o()],s.prototype,"hasModelRotationScale",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.sphericalSR=e,this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.hasModelRotationScale=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o({count:10})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:3})],s.prototype,"oitPass",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"blendingEnabled",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasPolygonOffset",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0),e([o()],s.prototype,"hasModelRotationScale",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t){const e=t.renderContext.rctx,i=t.techniques;this.opaque=new s(e,i),this.transparent=new s(e,i,1),this.integratedMesh=new s(e,i),this.transparentIntegratedMesh=new s(e,i),this.occludedGround=new s(e,i),this.shadowMap=new s(e,i),this.highlight=new s(e,i),this.highlightIntegratedMesh=new s(e,i),this.highlightShadowMap=new s(e,i),this.viewshedShadowMap=new s(e,i),this.defaultShadowMap=new s(e,i)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class h extends i{}class o extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class a extends n{constructor(){super(...arguments),this.identifier=1,this.output=3}}class c extends n{constructor(){super(...arguments),this.identifier=2,this.output=8}}class d extends n{constructor(){super(...arguments),this.identifier=3,this.output=6}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,o as MaterialPassParameters,n as PassParameters,a as ShadowMapPassParameters,d as ViewshedShadowMapPassParameters};
2
+ import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t,e){const{rctx:i}=t.renderContext,{techniques:r}=t;this.opaque=new s(e,i,r),this.transparent=new s(e,i,r,1),this.integratedMesh=new s(e,i,r),this.transparentIntegratedMesh=new s(e,i,r),this.occludedGround=new s(e,i,r),this.shadowMap=new s(e,i,r),this.highlight=new s(e,i,r),this.highlightIntegratedMesh=new s(e,i,r),this.highlightShadowMap=new s(e,i,r),this.viewshedShadowMap=new s(e,i,r),this.defaultShadowMap=new s(e,i,r)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}setTransformationTexture(t){this.transformationTexture=t}}class h extends i{}class o extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class a extends n{constructor(){super(...arguments),this.identifier=1,this.output=3}}class c extends n{constructor(){super(...arguments),this.identifier=2,this.output=8}}class u extends n{constructor(){super(...arguments),this.identifier=3,this.output=6}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,o as MaterialPassParameters,n as PassParameters,a as ShadowMapPassParameters,u as ViewshedShadowMapPassParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{DataType as t}from"../../../../webgl/enums.js";class s{constructor(e,t,s=0){this._rctx=e,this._techniques=t,this._sorting=s,this._draws=new Array,this._previouslyBoundDraw=new Map}submitDraw(e,t,s,r,n,a){const o=(s.indexed?s.vao.indexBuffer.indexType:null)??0,h=new i(e,t,s,r,n,o,a);this._draws.push(h)}acquire(t,s){const i=new Map;return this._draws.map(r=>e(i,r.material,()=>r.material.acquireTechnique(this._techniques,t,s,r.geometry.parameters)))}dispatch(e,t,s){const i=this._rctx;this._previouslyBoundDraw.clear();let n=null;const a=this._draws.length,o=t.highlight?.name;for(let h=0;h<a;h++){const a=this._draws[h];if(2===e.identifier){const e=a.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const d=s[h];d===n&&0===t.oitPass||(i.bindTechnique(d,t,e),n=d);const{geometryRanges:u,indexType:c,geometry:l,drawParameters:m}=a;i.bindVAO(l.vao),this._previouslyBoundDraw.get(d)!==m&&(d.program.bindDraw(t,e,m),this._previouslyBoundDraw.set(d,m));const g=u.length,{primitiveType:p}=l;for(let e=0;e<g;e+=2){const t=u[e],s=u[e+1];if(0!==c){const e=r.get(c);i.drawElements(p,s,c,t*e)}else i.drawArrays(p,t,s)}}}prepareSubmit(){this._draws.length=0}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,s)=>e*(t.depthSquaredHint-s.depthSquaredHint)||t.geometry.vao.usedMemory-s.geometry.vao.usedMemory)}get count(){return this._draws.length}}class i{constructor(e,t,s,i,r,n,a){this.material=e,this.drawParameters=t,this.geometry=s,this.geometryRanges=i,this.depthSquaredHint=r,this.indexType=n,this.highlightName=a}}const r=new Map;r.set(t.UNSIGNED_BYTE,1),r.set(t.UNSIGNED_SHORT,2),r.set(t.UNSIGNED_INT,4);export{s as RenderPass};
2
+ import{getOrCreateMapValue as e}from"../../../../../core/MapUtils.js";import{DataType as t}from"../../../../webgl/enums.js";class r{constructor(e,t,r,s=0){this._owner=e,this._rctx=t,this._techniques=r,this._sorting=s,this._draws=new Array,this._previouslyBoundDraw=new Map}destroy(){this._draws.length=0,this._previouslyBoundDraw.clear()}submitDraw(e,t,r,i,a,n){const o=(r.indexed?r.vao.indexBuffer.indexType:null)??0;this._owner.registerDrawParameters(t);const h=new s(e,t,r,i,a,o,n);this._draws.push(h)}acquire(t,r){const s=new Map;return this._draws.map(i=>e(s,i.material,()=>i.material.acquireTechnique(this._techniques,t,r,i.geometry.parameters)))}dispatch(e,t,r){const s=this._rctx;this._previouslyBoundDraw.clear();let a=null;e.setTransformationTexture(this._owner.drawTransformationTexture);const n=this._draws.length,o=t.highlight?.name;if(0!==n)for(let h=0;h<n;h++){const n=this._draws[h];if(2===e.identifier){const e=n.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const d=r[h];d===a&&0===t.oitPass||(s.bindTechnique(d,t,e),a=d);const{geometryRanges:u,indexType:c,geometry:m,drawParameters:l}=n;s.bindVAO(m.vao),this._previouslyBoundDraw.get(d)!==l&&(l.setTransformationDrawId(this._owner.getDrawParametersId(l)),d.program.bindDraw(t,e,l),this._previouslyBoundDraw.set(d,l));const w=u.length,{primitiveType:g}=m;for(let e=0;e<w;e+=2){const t=u[e],r=u[e+1];if(0!==c){const e=i.get(c);s.drawElements(g,r,c,t*e)}else s.drawArrays(g,t,r)}}}prepareSubmit(){this._draws.length=0}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,r)=>e*(t.depthSquaredHint-r.depthSquaredHint)||t.geometry.vao.usedMemory-r.geometry.vao.usedMemory)}get count(){return this._draws.length}}class s{constructor(e,t,r,s,i,a,n){this.material=e,this.drawParameters=t,this.geometry=r,this.geometryRanges=s,this.depthSquaredHint=i,this.indexType=a,this.highlightName=n}}const i=new Map;i.set(t.UNSIGNED_BYTE,1),i.set(t.UNSIGNED_SHORT,2),i.set(t.UNSIGNED_INT,4);export{r as RenderPass};