@arcgis/core 4.34.0-next.75 → 4.34.0-next.77

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 (269) hide show
  1. package/Basemap.js +1 -1
  2. package/Ground.js +1 -1
  3. package/applications/Components/arcadeEditorUtils.d.ts +4 -0
  4. package/applications/Components/arcadeEditorUtils.js +5 -0
  5. package/applications/Components/featureUtils.d.ts +1 -0
  6. package/applications/Components/featureUtils.js +1 -1
  7. package/arcade/Feature.js +1 -1
  8. package/arcade/Pixel.js +1 -1
  9. package/arcade/Voxel.js +1 -1
  10. package/arcade/arcadeAsyncRuntime.js +1 -1
  11. package/arcade/arcadeCompiler.js +1 -1
  12. package/arcade/arcadeRuntime.js +1 -1
  13. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  14. package/arcade/functions/feature.js +1 -1
  15. package/arcade/functions/featuresetbase.js +1 -1
  16. package/arcade/functions/geometry.js +1 -1
  17. package/assets/esri/core/workers/RemoteClient.js +1 -1
  18. package/assets/esri/core/workers/chunks/025f1d78dfa5ec93178b.js +1 -0
  19. package/assets/esri/core/workers/chunks/050429f516149ce3b517.js +1 -0
  20. package/assets/esri/core/workers/chunks/0652d7e525d99e39c957.js +1 -0
  21. package/assets/esri/core/workers/chunks/0668eee42b3169e1bf66.js +1 -0
  22. package/assets/esri/core/workers/chunks/07a355a9c95154971aab.js +1 -0
  23. package/assets/esri/core/workers/chunks/0dd6b8b3e634bb5f0ca7.js +1 -0
  24. package/assets/esri/core/workers/chunks/124f8757ea18bfd158ec.js +1 -0
  25. package/assets/esri/core/workers/chunks/16d66770ef841564ee3f.js +1 -0
  26. package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
  27. package/assets/esri/core/workers/chunks/1990162dcf73601d54f7.js +1 -0
  28. package/assets/esri/core/workers/chunks/{5c30252c1bb8350cae5f.js → 1c52999a6392370844a6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/20850b0fdb55fb17bc90.js +1 -0
  30. package/assets/esri/core/workers/chunks/{6a1b652ccbf58ac44658.js → 23e17b745adf71a5efc7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +1 -0
  32. package/assets/esri/core/workers/chunks/29a86d51407310bb7745.js +1 -0
  33. package/assets/esri/core/workers/chunks/2a2a925c45d5fd58628b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2fe96bf7dedef11a3b63.js +1 -0
  35. package/assets/esri/core/workers/chunks/3452ba299f6ce0582f09.js +1 -0
  36. package/assets/esri/core/workers/chunks/36a006c55766f9540bfc.js +1 -0
  37. package/assets/esri/core/workers/chunks/{18641332bee3e9b9c44a.js → 388482cea4b9fdeaf06e.js} +1 -1
  38. package/assets/esri/core/workers/chunks/3b23c37e5bc552dc81d4.js +1 -0
  39. package/assets/esri/core/workers/chunks/{9325000c87295c473291.js → 3b2ef975831eb75b40fb.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +1 -0
  41. package/assets/esri/core/workers/chunks/43818bf53dd5445a7bdb.js +1 -0
  42. package/assets/esri/core/workers/chunks/4823e4522bd7379d858e.js +1 -0
  43. package/assets/esri/core/workers/chunks/49e6202da7a20f06c661.js +353 -0
  44. package/assets/esri/core/workers/chunks/4d47187bc0821413492d.js +1 -0
  45. package/assets/esri/core/workers/chunks/{b818b5e392d5eb7c7e70.js → 4e6e8dda6c12f6fbed8e.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5019f1b8186a65a0313b.js +1 -0
  47. package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +1 -0
  48. package/assets/esri/core/workers/chunks/512dcd6e34e217029391.js +1 -0
  49. package/assets/esri/core/workers/chunks/5248581d23ada240c78d.js +1 -0
  50. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +1 -0
  51. package/assets/esri/core/workers/chunks/{e12e8d69c05c182b6a69.js → 61bb39597ccf89f99a72.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{5477ff0ce432c9e5b3ab.js → 6201356f7f91e5c06425.js} +1 -1
  53. package/assets/esri/core/workers/chunks/6271a706ac3fcba91432.js +1 -0
  54. package/assets/esri/core/workers/chunks/6593b419339e7598b760.js +1 -0
  55. package/assets/esri/core/workers/chunks/{51ddda291bbbf5db9905.js → 65e279516170ddbd4a65.js} +1 -1
  56. package/assets/esri/core/workers/chunks/67fdc8074cdcf374af9a.js +1 -0
  57. package/assets/esri/core/workers/chunks/6dafb2b95bae552c1cc2.js +1 -0
  58. package/assets/esri/core/workers/chunks/7680d4d739f7aa3f7ae1.js +1 -0
  59. package/assets/esri/core/workers/chunks/7889a909394c61a9d3e0.js +1 -0
  60. package/assets/esri/core/workers/chunks/79e965e8f7cf822b4f45.js +1 -0
  61. package/assets/esri/core/workers/chunks/804e3b3df375177e6c86.js +1 -0
  62. package/assets/esri/core/workers/chunks/81a8addcb858086ff9ee.js +1 -0
  63. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +1 -0
  64. package/assets/esri/core/workers/chunks/8a5e40f48a8265fd1b42.js +1 -0
  65. package/assets/esri/core/workers/chunks/8bd6c27a93a697a7fa3d.js +1 -0
  66. package/assets/esri/core/workers/chunks/8c94448a44fb27054a22.js +1 -0
  67. package/assets/esri/core/workers/chunks/92d0e0155563c6355079.js +1 -0
  68. package/assets/esri/core/workers/chunks/930322c9790572bd0c49.js +1 -0
  69. package/assets/esri/core/workers/chunks/96a14689815bec741308.js +1 -0
  70. package/assets/esri/core/workers/chunks/97d71459ad72b4b780a3.js +1 -0
  71. package/assets/esri/core/workers/chunks/9835c579edfc08125d31.js +1 -0
  72. package/assets/esri/core/workers/chunks/9971de3f38a55735cec9.js +1 -0
  73. package/assets/esri/core/workers/chunks/99ac292a858bbedc6a89.js +1 -0
  74. package/assets/esri/core/workers/chunks/9ce599dc1d385e6893c1.js +1 -0
  75. package/assets/esri/core/workers/chunks/{fec572f03f9514244972.js → a05a7df07b74e1957538.js} +1 -1
  76. package/assets/esri/core/workers/chunks/a0edff37fd4a3f2cb2eb.js +1 -0
  77. package/assets/esri/core/workers/chunks/a7e649b3b02e664ada80.js +1 -0
  78. package/assets/esri/core/workers/chunks/a8a79a5c804ef715aa94.js +1 -0
  79. package/assets/esri/core/workers/chunks/{10ec10ca361842efce92.js → ab005fe84952f0676020.js} +1 -1
  80. package/assets/esri/core/workers/chunks/acb49f3d2b783e81a215.js +1 -0
  81. package/assets/esri/core/workers/chunks/adc61d88c3c6936ad75a.js +1 -0
  82. package/assets/esri/core/workers/chunks/afa3ca2bd2648774f133.js +1 -0
  83. package/assets/esri/core/workers/chunks/afb76f9d6abedef771df.js +1 -0
  84. package/assets/esri/core/workers/chunks/b168b6ffc16cd509d316.js +1 -0
  85. package/assets/esri/core/workers/chunks/b19d723d09f5bea9ca27.js +1 -0
  86. package/assets/esri/core/workers/chunks/b246ed6d86c2c8df56fb.js +1 -0
  87. package/assets/esri/core/workers/chunks/b4a053063e6022080d31.js +1 -0
  88. package/assets/esri/core/workers/chunks/b4ba7f8ea81522ad1e2e.js +1 -0
  89. package/assets/esri/core/workers/chunks/b8d02f1b73c374767a5f.js +1 -0
  90. package/assets/esri/core/workers/chunks/b97f224972f1b1abaee8.js +1 -0
  91. package/assets/esri/core/workers/chunks/b9e725d2b5a7d0132663.js +1 -0
  92. package/assets/esri/core/workers/chunks/ba6452acee3d6defb37e.js +1 -0
  93. package/assets/esri/core/workers/chunks/bbb3b32affde9ea78534.js +1 -0
  94. package/assets/esri/core/workers/chunks/bbb585f0b484ab5eabb3.js +1 -0
  95. package/assets/esri/core/workers/chunks/bc83bcfe123525d21884.js +1 -0
  96. package/assets/esri/core/workers/chunks/c799f1c03cb22ef52f5f.js +1 -0
  97. package/assets/esri/core/workers/chunks/cac5732f9dfece4bf2c5.js +1 -0
  98. package/assets/esri/core/workers/chunks/cafc19bf2caaf7a8c2e8.js +1 -0
  99. package/assets/esri/core/workers/chunks/cc7423413747566f56e2.js +1 -0
  100. package/assets/esri/core/workers/chunks/ccd157ede169b93eea65.js +1 -0
  101. package/assets/esri/core/workers/chunks/ce0bf0d0cd9e9a90093b.js +1 -0
  102. package/assets/esri/core/workers/chunks/ce49ff6bf20cff349726.js +1 -0
  103. package/assets/esri/core/workers/chunks/d1657a29321adb259166.js +1 -0
  104. package/assets/esri/core/workers/chunks/d2b69f91eb85b561fe01.js +1 -0
  105. package/assets/esri/core/workers/chunks/d51e8eeb1e1eb0605cc9.js +1 -0
  106. package/assets/esri/core/workers/chunks/d69bd6b5d781a6c527d1.js +1 -0
  107. package/assets/esri/core/workers/chunks/d7fc8ea2ff527a09f4b9.js +1 -0
  108. package/assets/esri/core/workers/chunks/d8494617cebc68e50d35.js +1 -0
  109. package/assets/esri/core/workers/chunks/d89832617bac4890893e.js +1 -0
  110. package/assets/esri/core/workers/chunks/{d55c55d39a253630d228.js → db2396bf062468ee8b60.js} +1 -1
  111. package/assets/esri/core/workers/chunks/e4833b718a813a8d125b.js +1 -0
  112. package/assets/esri/core/workers/chunks/{b5f197e24982f6e14468.js → e7af5caab9aa9b6a12e3.js} +3 -3
  113. package/assets/esri/core/workers/chunks/e81386199a6db9a50fd3.js +1 -0
  114. package/assets/esri/core/workers/chunks/ecac5ca00c742bfb5898.js +1 -0
  115. package/assets/esri/core/workers/chunks/f45c343527709f6f91c2.js +1 -0
  116. package/assets/esri/core/workers/chunks/f5710ced8d38f9a90fc5.js +1 -0
  117. package/assets/esri/core/workers/chunks/f592c4e5e1746d4619db.js +1 -0
  118. package/assets/esri/core/workers/chunks/f8d2c52cc51d5f1bbce2.js +1 -0
  119. package/assets/esri/core/workers/chunks/{0d946a226b846b3c0849.js → fc06014fb484fc8c697e.js} +1 -1
  120. package/assets/esri/core/workers/chunks/feed74ed275f21a68a1b.js +1 -0
  121. package/assets/esri/core/workers/chunks/ffee8cc83d703c1dc0c0.js +1 -0
  122. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  123. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  124. package/chunks/Compositing.glsl.js +4 -3
  125. package/chunks/cameraUtilsSpherical.js +1 -1
  126. package/chunks/lyr3DMain.js +1 -1
  127. package/chunks/lyr3DWorker.js +1 -1
  128. package/config.js +1 -1
  129. package/core/sql.d.ts +1 -0
  130. package/geometry/support/heightModelInfoUtils.js +1 -1
  131. package/geometry/support/normalizeUtils.js +1 -1
  132. package/geometry/support/spatialReferenceUtils.js +1 -1
  133. package/interfaces.d.ts +45 -0
  134. package/kernel.js +1 -1
  135. package/layers/GaussianSplatLayer.js +1 -1
  136. package/layers/Layer.js +1 -1
  137. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  138. package/layers/Lyr3DWorkerHandle.js +1 -1
  139. package/layers/catalog/catalogUtils.js +1 -1
  140. package/layers/mixins/ScaleRangeLayer.js +1 -1
  141. package/layers/support/tiles3DUtils.js +1 -1
  142. package/networks/CircuitManager.js +1 -1
  143. package/networks/support/Circuit.js +1 -1
  144. package/networks/support/CircuitSection.js +1 -1
  145. package/networks/support/Subcircuit.js +1 -1
  146. package/package.json +1 -1
  147. package/support/LayersMixin.js +1 -1
  148. package/support/TablesMixin.js +1 -1
  149. package/support/arcadeUtils.js +1 -1
  150. package/support/modeUtils.js +1 -1
  151. package/support/revision.js +1 -1
  152. package/symbols/support/symbolUtils.js +1 -1
  153. package/views/2d/layers/MediaLayerView2D.js +1 -1
  154. package/views/2d/layers/TileLayerView2D.js +1 -1
  155. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  156. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  157. package/views/3d/layers/Lyr3DWorker.js +1 -1
  158. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  159. package/views/3d/support/cameraUtils.js +1 -1
  160. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  161. package/{layers/support/GaussianSplatAtlasPageAllocator.js → views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js} +1 -1
  162. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +5 -0
  163. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +5 -0
  164. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +5 -0
  165. package/views/3d/support/gaussianSplatting/GaussianTile.js +5 -0
  166. package/views/3d/terrain/OverlayManager.js +1 -1
  167. package/views/3d/terrain/TerrainSurface.js +1 -1
  168. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
  169. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  170. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  171. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  172. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  173. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  174. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  175. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  176. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +10 -11
  177. package/views/VideoView.js +1 -1
  178. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  179. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  180. package/widgets/support/widget.js +1 -1
  181. package/assets/esri/core/workers/chunks/03fac1122eb73bb14d2d.js +0 -1
  182. package/assets/esri/core/workers/chunks/0434a490326c0de47c22.js +0 -1
  183. package/assets/esri/core/workers/chunks/0618ea8bf9da93d713b1.js +0 -1
  184. package/assets/esri/core/workers/chunks/06b65105b15abf4d0fbf.js +0 -1
  185. package/assets/esri/core/workers/chunks/06bd58c219678315cf5c.js +0 -1
  186. package/assets/esri/core/workers/chunks/0751f539db31bdb5caec.js +0 -1
  187. package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +0 -1
  188. package/assets/esri/core/workers/chunks/181b3564a0e3939020bc.js +0 -1
  189. package/assets/esri/core/workers/chunks/19228ab0fe7944c554e5.js +0 -1
  190. package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +0 -1
  191. package/assets/esri/core/workers/chunks/19c1f1431c0b2f4525a2.js +0 -1
  192. package/assets/esri/core/workers/chunks/28a2f74d4a449386d082.js +0 -1
  193. package/assets/esri/core/workers/chunks/2a19a4d7d1c580121065.js +0 -1
  194. package/assets/esri/core/workers/chunks/2afafaf40293d5ab1d8e.js +0 -1
  195. package/assets/esri/core/workers/chunks/2c399991e8627baa51b3.js +0 -1
  196. package/assets/esri/core/workers/chunks/2f44848916051f5501eb.js +0 -1
  197. package/assets/esri/core/workers/chunks/356c96fad88558be9054.js +0 -1
  198. package/assets/esri/core/workers/chunks/37ff19a9c5c99bd4e7c7.js +0 -1
  199. package/assets/esri/core/workers/chunks/38e7d1c6987aaa9b520b.js +0 -1
  200. package/assets/esri/core/workers/chunks/3bf99037befdedd75cb4.js +0 -1
  201. package/assets/esri/core/workers/chunks/3d2629357242492afcfa.js +0 -1
  202. package/assets/esri/core/workers/chunks/3e9c3e7c5cf7c0afbc80.js +0 -1
  203. package/assets/esri/core/workers/chunks/3fecfe4f8ca2a5fd7360.js +0 -1
  204. package/assets/esri/core/workers/chunks/43095bed5456251940b9.js +0 -1
  205. package/assets/esri/core/workers/chunks/433c4dc666a6b2c99063.js +0 -353
  206. package/assets/esri/core/workers/chunks/451761c7bd2da530e1d0.js +0 -1
  207. package/assets/esri/core/workers/chunks/48449abe795cb7a831eb.js +0 -1
  208. package/assets/esri/core/workers/chunks/4bc091770bab38874848.js +0 -1
  209. package/assets/esri/core/workers/chunks/52286d4135b8395a3400.js +0 -1
  210. package/assets/esri/core/workers/chunks/540506802776f77e47f3.js +0 -1
  211. package/assets/esri/core/workers/chunks/56f54d007b0da0d908aa.js +0 -1
  212. package/assets/esri/core/workers/chunks/5879cebb22157b0b4998.js +0 -1
  213. package/assets/esri/core/workers/chunks/5c4ba165816809e06340.js +0 -1
  214. package/assets/esri/core/workers/chunks/5f239972cb95afdfa77a.js +0 -1
  215. package/assets/esri/core/workers/chunks/61896e64e9ef49b4bb1b.js +0 -1
  216. package/assets/esri/core/workers/chunks/6531f33d6710960079e9.js +0 -1
  217. package/assets/esri/core/workers/chunks/6963ded8428cc8d51d85.js +0 -1
  218. package/assets/esri/core/workers/chunks/6c3ae96c6ef764fb9552.js +0 -1
  219. package/assets/esri/core/workers/chunks/6e59ba2afd444eb4be18.js +0 -1
  220. package/assets/esri/core/workers/chunks/7430c462c350fdd26349.js +0 -1
  221. package/assets/esri/core/workers/chunks/76ec3d2646ba64e3442f.js +0 -1
  222. package/assets/esri/core/workers/chunks/7aaa6b318195d7342e6c.js +0 -1
  223. package/assets/esri/core/workers/chunks/7e746427375e83fc4351.js +0 -1
  224. package/assets/esri/core/workers/chunks/810e4c16c6eae420508b.js +0 -1
  225. package/assets/esri/core/workers/chunks/8b587affaaa0b1e4368c.js +0 -1
  226. package/assets/esri/core/workers/chunks/8bc8caa384b24af12411.js +0 -1
  227. package/assets/esri/core/workers/chunks/8e428b0f33ef4688415e.js +0 -1
  228. package/assets/esri/core/workers/chunks/8fc13e0e1a5a8f3e4798.js +0 -1
  229. package/assets/esri/core/workers/chunks/90540fdfb0c5f68aa959.js +0 -1
  230. package/assets/esri/core/workers/chunks/925ad2665c2fe0f47cc3.js +0 -1
  231. package/assets/esri/core/workers/chunks/92d5b0559e128d62fbda.js +0 -1
  232. package/assets/esri/core/workers/chunks/9304c3cdf732745577fd.js +0 -1
  233. package/assets/esri/core/workers/chunks/93b2e0a300b2758a1ca4.js +0 -1
  234. package/assets/esri/core/workers/chunks/9421389888d4d9e4e809.js +0 -1
  235. package/assets/esri/core/workers/chunks/98c94a99e2e04d5ae65f.js +0 -1
  236. package/assets/esri/core/workers/chunks/9c35860439948638cb8f.js +0 -1
  237. package/assets/esri/core/workers/chunks/a0a519f498e9ea7623ff.js +0 -1
  238. package/assets/esri/core/workers/chunks/a25b75de1bca1dd21941.js +0 -1
  239. package/assets/esri/core/workers/chunks/a2baeb9fa805c3537049.js +0 -1
  240. package/assets/esri/core/workers/chunks/a33e1a031ba9f028023d.js +0 -1
  241. package/assets/esri/core/workers/chunks/ad3ebd4f05cc673140f3.js +0 -1
  242. package/assets/esri/core/workers/chunks/b03dcbc31bccb9fdf9fe.js +0 -1
  243. package/assets/esri/core/workers/chunks/b0de01f8c9b1c3182e0c.js +0 -1
  244. package/assets/esri/core/workers/chunks/b6c6f82df3b60c2f831f.js +0 -1
  245. package/assets/esri/core/workers/chunks/b7f5a26ff3a73c64552d.js +0 -1
  246. package/assets/esri/core/workers/chunks/bd2dc1282c49125ede89.js +0 -1
  247. package/assets/esri/core/workers/chunks/bd4e64d6e73cd4db9695.js +0 -1
  248. package/assets/esri/core/workers/chunks/c07507a42def2bd2a222.js +0 -1
  249. package/assets/esri/core/workers/chunks/c34a164a8ece4cb33e81.js +0 -1
  250. package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +0 -1
  251. package/assets/esri/core/workers/chunks/c908184d747d33366881.js +0 -1
  252. package/assets/esri/core/workers/chunks/d1711256493d55eca523.js +0 -1
  253. package/assets/esri/core/workers/chunks/e086b835a98b71a46825.js +0 -1
  254. package/assets/esri/core/workers/chunks/e3f2cdf5d71a7040894b.js +0 -1
  255. package/assets/esri/core/workers/chunks/e54df2128039425a9090.js +0 -1
  256. package/assets/esri/core/workers/chunks/e58c5c8639aa837c84d1.js +0 -1
  257. package/assets/esri/core/workers/chunks/e6e4e2fb9568319c6207.js +0 -1
  258. package/assets/esri/core/workers/chunks/e92d9e0ac789bcf1cdf4.js +0 -1
  259. package/assets/esri/core/workers/chunks/eb0a5d592f5805836203.js +0 -1
  260. package/assets/esri/core/workers/chunks/eccb4550edc4752cf41a.js +0 -1
  261. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +0 -1
  262. package/assets/esri/core/workers/chunks/f060a52a9b69eb250d63.js +0 -1
  263. package/assets/esri/core/workers/chunks/f3ef59991c577ff5e825.js +0 -1
  264. package/assets/esri/core/workers/chunks/f749e2a89a14ab89ae59.js +0 -1
  265. package/assets/esri/core/workers/chunks/f7f5c4f30e5a0ddbf9a4.js +0 -1
  266. package/assets/esri/core/workers/chunks/fb0f729eff2f2911d6c3.js +0 -1
  267. package/assets/esri/core/workers/chunks/fdf2b980e8a8aa47ce91.js +0 -1
  268. package/assets/esri/core/workers/chunks/fe24c6d61a50898549a5.js +0 -1
  269. package/layers/support/gaussianSplatUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as G,MapServiceLayerViewHelper as T}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const I=[0,0];let P=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:S.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),G(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new T({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=V(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const v=P;export{v as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/checkWebGLError.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as G,MapServiceLayerViewHelper as T}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const I=[0,0];let P=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:S.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),G(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new T({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=V(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const v=P;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as r,isAborted as o,createResolver as h,createAbortError as n,onAbort as c}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import u from"../../../../layers/GraphicsLayer.js";import _ from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as g,isPolygonGraphic as k}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as G}from"./VolumeMeasurementShiftTool.js";import{makeAllLayerSnappingOptions as w}from"../../../interactive/snapping/allLayerSnapping.js";import v from"../../../../widgets/Sketch/SketchViewModel.js";const b=Symbol("interactive-operation");let S=class extends s{constructor(e){super(e),this._updatingHandles=new y,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const i=w(s,{selfEnabled:!0,excludeInternal:!0});this._sketchViewModel=new v({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:i.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),p(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(f(e,t),s){case"idle":case"sketching":break;case"awaiting-sketch":this.analysisViewData.interactive=!0;break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic()}},l),i]),this._shiftTool=new G({analysis:e,view:s,analysisViewData:t}),s.tools.add(this._shiftTool)}destroy(){this._sketchViewModel.destroy(),this._shiftTool.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _polygonSymbol(){return new _({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._startPlaceOperation(e,(t,s)=>{const i=this.analysis.clone(),h=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateGeometryFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateGeometryFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(r(this._sketchViewModel.create("polygon"))),a(()=>(h.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?o(e)||i.equals(this.analysis)?s():void t():(this._clearGeometry(),s())))})}async _startPlaceOperation(e,t){const s=h(),i=t(()=>s.resolve({}),()=>s.reject(n()));return c(e,()=>this._stopOperation()),this._replaceHandles([i,c(e,()=>this._stopOperation())],b),await s.promise}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateGeometryFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(a(()=>{e.remove(),this._sketchViewModel.cancel()}),b);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(r(this._sketchViewModel.update(t,{tool:"reshape"})))}_stopOperation(){this.removeHandles(b)}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return g(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this._graphicsLayer.add(this.sketchGraphic),this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){const e=this.sketchGraphic;this.analysis.geometry=k(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(i),t)}get test(){}};function f(e,t){t&&(t.parent&&"remove"in t.parent&&t.parent.remove(t),e?.add(t))}e([d({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([d({constructOnly:!0})],S.prototype,"view",void 0),e([d({constructOnly:!0})],S.prototype,"analysis",void 0),e([d()],S.prototype,"sketchGraphic",null),e([d({nonNullable:!0})],S.prototype,"state",null),e([d()],S.prototype,"updating",null),e([d()],S.prototype,"_polygonSymbol",null),S=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],S);export{S as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as r,isAborted as o,createResolver as h,createAbortError as n,onAbort as c}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import u from"../../../../layers/GraphicsLayer.js";import _ from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as g,isPolygonGraphic as k}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as G}from"./VolumeMeasurementShiftTool.js";import{makeAllLayerSnappingOptions as w}from"../../../interactive/snapping/allLayerSnapping.js";import v from"../../../../widgets/Sketch/SketchViewModel.js";const b=Symbol("interactive-operation");let S=class extends s{constructor(e){super(e),this._updatingHandles=new y,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new u({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const i=w(s,{selfEnabled:!0,excludeInternal:!0});this._sketchViewModel=new v({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:i.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),p(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(f(e,t),s){case"idle":case"sketching":break;case"awaiting-sketch":this.analysisViewData.interactive=!0;break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic()}},l),i]),this._shiftTool=new G({analysis:e,view:s,analysisViewData:t}),s.tools.add(this._shiftTool)}destroy(){this._sketchViewModel.destroy(),this._shiftTool.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _polygonSymbol(){return new _({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._startPlaceOperation(e,(t,s)=>{const i=this.analysis.clone(),h=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateGeometryFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateGeometryFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(r(this._sketchViewModel.create("polygon"))),a(()=>(h.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?o(e)||i.equals(this.analysis)?s():void t():(this._clearGeometry(),s())))})}async _startPlaceOperation(e,t){const s=h(),i=t(()=>s.resolve({}),()=>s.reject(n()));return c(e,()=>this._stopOperation()),this._replaceHandles([i,c(e,()=>this._stopOperation())],b),await s.promise}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateGeometryFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(a(()=>{e.remove(),this._sketchViewModel.cancel()}),b);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(r(this._sketchViewModel.update(t,{tool:"reshape"})))}_stopOperation(){this.removeHandles(b)}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return g(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this._graphicsLayer.add(this.sketchGraphic),this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){const e=this.sketchGraphic;this.analysis.geometry=k(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(i),t)}get test(){}};function f(e,t){t&&(t.removeFromParent(),e?.add(t))}e([d({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([d({constructOnly:!0})],S.prototype,"view",void 0),e([d({constructOnly:!0})],S.prototype,"analysis",void 0),e([d()],S.prototype,"sketchGraphic",null),e([d({nonNullable:!0})],S.prototype,"state",null),e([d()],S.prototype,"updating",null),e([d()],S.prototype,"_polygonSymbol",null),S=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],S);export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{removeMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{watch as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{fromValues as l}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{splatPageSizeInU32 as d,elementsPerSplatPage as h,packedGaussianSizeInU32 as u,splatPageSizeInU32WithoutHeader as c,gaussiansPerSplatPage as m,splatAtlasTextureWidth as p}from"../../../layers/support/GaussianSplatAtlasPageAllocator.js";import{GaussianTile as f}from"../../../layers/support/gaussianSplatUtils.js";import{getElevationOffsetInMeters as y}from"../../../support/elevationInfoUtils.js";import{LayerView3D as _}from"./LayerView3D.js";import{addLayerViewToWasm as w,getLyr3DWasm as g,removeLayerViewFromWasm as b}from"./Lyr3DWasm.js";import{Obb as M}from"../support/orientedBoundingBox.js";import{GaussianSplatRenderNode as v}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import j from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as x}from"../../support/layerViewUtils.js";const A=()=>t.getLogger("esri.views.3d.layers.GaussianSPlatLayerView3D");let H=class extends(_(j)){constructor(e){super(e),this.type="gaussian-splat-3d",this._gaussianTileHandles=new Map,this._pageBuffer=new Uint32Array(d),this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer),this._memCache=e.view.resourceController.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._renderNode=new v(e)}initialize(){if(!this._canProjectWithoutEngine())throw x("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=w(this).then(e=>{this._wasmLayerId=e,this.addHandles([i(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=i(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),a)});this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get _wasm(){return g(this.view)}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const s=t.desc.prims[0],r=s.vertexCount,i=s.atrbs[0].view,a=s.atrbs[0].view.byteCount,o=s.atrbs[0].view.byteOffset;let n=null;if("U32"!==i.type)return A().warnOnce("unexpected meshData.data format"),{memUsageBytes:0};n=new Uint32Array(t.data.buffer,o,a/4);const d=this.extractHeader(n),y=Math.ceil(r/m),_=new Uint32Array(r),w=[];for(let l=0;l<y;l++){let e=this._renderNode.pageAllocator.findFirstFreePage();if(null===e&&(this._renderNode.growTextureAtlas(),e=this._renderNode.pageAllocator.findFirstFreePage()),null!==e){this._renderNode.pageAllocator.allocate(e),w.push(e);const t=r-l*m,s=Math.min(t,m),i=l*m;for(let r=0;r<s;r++)_[r+i]=r+h*e;const a=l*c;this._pageBuffer.set(n.subarray(a,a+s*u)),this._pageBuffer.set(d.packedHeader,c);const o=e*h,f=o%p,y=Math.floor(o/p);this._renderNode.updateTextureAtlas(f,y,this._pageBuffer)}}const g=new Float64Array(3*r),b=new Float32Array(r),v=2.048,j=d.tileOrigin.x*v,x=d.tileOrigin.y*v,H=d.tileOrigin.z*v,S=d.invPosScale;let U=0,V=0;for(let l=0;l<r;l++){const e=l*u,{rawX:t,rawY:s,rawZ:r}=this._extractGaussianPosition(n,e),i=this._extractGaussianSphericalScale(n,e);g[U]=t*S+j,g[U+1]=s*S+x,g[U+2]=r*S+H,b[l]=i*i,V=Math.max(V,i),U+=3}let C=null;if(t.desc.obb){const e=t.desc.obb.quaternion;C=new M(t.desc.obb.center,t.desc.obb.halfSize,l(e[0],e[1],e[2],e[3]))}C||(A().warnOnce("encountered tile without a bounding box"),C=new M);const L=new f(e.handle,C,_,w,g,b,V);return this._memCache.put(`${L.handle}`,L),this._gaussianTileHandles.set(e.handle,L),this._cacheMemory+=L.usedMemory,{memUsageBytes:L.usedMemory}}_extractGaussianPosition(e,t){const s=e[t+1];return{rawX:16383&s,rawY:s>>>14&16383,rawZ:s>>>28&15|(1023&e[t+2])<<4}}_extractGaussianSphericalScale(e,t){const s=e[t+2],r=s>>>10&255,i=s>>>18&255,a=s>>>26&63|(3&e[t+3])<<6,o=Math.exp(r/16-10),n=Math.exp(i/16-10),l=Math.exp(a/16-10);return Math.max(o,n,l)}freeRenderable(e){const t=this._gaussianTileHandles.get(e);t&&(t.isVisible?this._usedMemory-=t.usedMemory:this._cacheMemory-=t.usedMemory,t.pageIds.forEach(e=>this._renderNode.pageAllocator?.free(e)),this.freeObject(t),this._gaussianTileHandles.delete(e)),this._updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}setRenderableVisibility(e,t,s){for(let r=0;r<s;r++){if(!t[r])continue;const s=e[r],i=this._gaussianTileHandles.get(s);if(i){if(i.isVisible)continue;i.isVisible=!0,this._usedMemory+=i.usedMemory,this._cacheMemory-=i.usedMemory,this._memCache.pop(`${s}`)}}for(let r=0;r<s;r++){if(t[r])continue;const s=e[r],i=this._gaussianTileHandles.get(s);if(i){if(!i.isVisible)continue;i.isVisible=!1,this._usedMemory-=i.usedMemory,this._cacheMemory+=i.usedMemory,this._memCache.put(`${s}`,i)}}this._updateGaussians()}destroy(){b(this),this._suspendedHandle&&(this._suspendedHandle=s(this._suspendedHandle)),this._renderNode.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){return!0}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,y(e))}_updateGaussians(){const e=new r;for(const t of this._gaussianTileHandles.values())t.isVisible&&e.push(t);this._renderNode.updateGaussianVisibility(e)}extractHeader(e){const t=e.length-4,s=this.reinterpretU32AsFloat(e[t]),r=this.reinterpretU32AsFloat(e[t+1]),i=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:s,y:r,z:i},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}};e([o()],H.prototype,"layer",void 0),H=e([n("esri.views.3d.layers.GaussianSplatLayerView3D")],H);const S=H;export{S as default};
5
+ import{__decorate as e}from"tslib";import s from"../../../core/Logger.js";import{removeMaybe as t}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{fromValues as o}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{isCompatible as l}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as h,isWebMercator as d,equals as u}from"../../../geometry/support/spatialReferenceUtils.js";import{getHeightModelInfoFromVCS as c}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as m}from"../../../support/elevationInfoUtils.js";import{LayerView3D as p}from"./LayerView3D.js";import{addLayerViewToWasm as f,getLyr3DWasm as y,removeLayerViewFromWasm as _}from"./Lyr3DWasm.js";import{Obb as g}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as w,elementsPerSplatPage as b,packedGaussianSizeInU32 as M,splatPageSizeInU32WithoutHeader as v,gaussiansPerSplatPage as j,splatAtlasTextureWidth as C}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianTile as S}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatRenderNode as x}from"../webgl-engine/lib/GaussianSplatRenderNode.js";import U from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as A}from"../../support/layerViewUtils.js";const H=()=>s.getLogger("esri.views.3d.layers.GaussianSPlatLayerView3D");let R=class extends(p(U)){constructor(e){super(e),this.type="gaussian-splat-3d",this._gaussianTileHandles=new Map,this._pageBuffer=new Uint32Array(w),this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer),this._memCache=e.view.resourceController.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._renderNode=new x(e)}initialize(){if(!this._canProjectWithoutEngine())throw A("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=f(this).then(e=>{this._wasmLayerId=e,this.addHandles([r(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=r(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),i)});this.addResolvingPromise(e)}get wasmLayerId(){return this._wasmLayerId}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get _wasm(){return y(this.view)}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}async createRenderable(e){const s=e.meshData;if(null==s.data)throw new Error("meshData.data undefined");if(s.desc=JSON.parse(s.desc),null==s.desc)throw new Error("meshData.desc undefined");const t=s.desc.prims[0],r=t.vertexCount,i=t.atrbs[0].view,a=t.atrbs[0].view.byteCount,n=t.atrbs[0].view.byteOffset;let l=null;if("U32"!==i.type)return H().warnOnce("unexpected meshData.data format"),{memUsageBytes:0};l=new Uint32Array(s.data.buffer,n,a/4);const h=this.extractHeader(l),d=Math.ceil(r/j),u=new Uint32Array(r),c=[];for(let o=0;o<d;o++){const e=this._data.textureAtlas.requestPage();if(null===e)return H().warnOnce("ran out of available gaussian splat memory (all pages are occupied)"),{memUsageBytes:0};{c.push(e);const s=r-o*j,t=Math.min(s,j),i=o*j;for(let r=0;r<t;r++)u[r+i]=r+b*e;const a=o*v;this._pageBuffer.set(l.subarray(a,a+t*M)),this._pageBuffer.set(h.packedHeader,v);const n=e*b,d=n%C,m=Math.floor(n/C);this._data.textureAtlas.update(d,m,this._pageBuffer)}}const m=new Float64Array(3*r),p=new Float64Array(r),f=2.048,y=h.tileOrigin.x*f,_=h.tileOrigin.y*f,w=h.tileOrigin.z*f,x=h.invPosScale;let U=0,A=0;for(let o=0;o<r;o++){const e=o*M,{rawX:s,rawY:t,rawZ:r}=this._extractGaussianPosition(l,e),i=this._extractGaussianSphericalScale(l,e);m[U]=s*x+y,m[U+1]=t*x+_,m[U+2]=r*x+w,p[o]=i*i,A=Math.max(A,i),U+=3}let R=null;if(s.desc.obb){const e=s.desc.obb.quaternion;R=new g(s.desc.obb.center,s.desc.obb.halfSize,o(...e))}R||(H().warnOnce("encountered tile without a bounding box"),R=new g);const V=new S(e.handle,R,u,c,m,p,A);return this._memCache.put(`${V.handle}`,V),this._gaussianTileHandles.set(e.handle,V),this._cacheMemory+=V.usedMemory,{memUsageBytes:V.usedMemory}}_extractGaussianPosition(e,s){const t=e[s+1];return{rawX:16383&t,rawY:t>>>14&16383,rawZ:t>>>28&15|(1023&e[s+2])<<4}}_extractGaussianSphericalScale(e,s){const t=e[s+2],r=t>>>10&255,i=t>>>18&255,a=t>>>26&63|(3&e[s+3])<<6,n=Math.exp(r/16-10),o=Math.exp(i/16-10),l=Math.exp(a/16-10);return Math.max(n,o,l)}freeRenderable(e){const s=this._gaussianTileHandles.get(e);s&&(s.isVisible?this._usedMemory-=s.usedMemory:this._cacheMemory-=s.usedMemory,s.pageIds.forEach(e=>this._data.textureAtlas.freePage(e)),this.freeObject(s),this._gaussianTileHandles.delete(e)),this._updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}setRenderableVisibility(e,s,t){for(let r=0;r<t;r++){if(!s[r])continue;const t=e[r],i=this._gaussianTileHandles.get(t);if(i){if(i.isVisible)continue;i.isVisible=!0,this._usedMemory+=i.usedMemory,this._cacheMemory-=i.usedMemory,this._memCache.pop(`${t}`)}}for(let r=0;r<t;r++){if(s[r])continue;const t=e[r],i=this._gaussianTileHandles.get(t);if(i){if(!i.isVisible)continue;i.isVisible=!1,this._usedMemory-=i.usedMemory,this._cacheMemory+=i.usedMemory,this._memCache.put(`${t}`,i)}}this._updateGaussians()}destroy(){_(this),this._suspendedHandle&&(this._suspendedHandle=t(this._suspendedHandle)),this._renderNode.destroy(),this._memCache.destroy()}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(h(this.view.renderSpatialReference)||d(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&u(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){const e=c(this.layer.esriCrsSpatialReference),s=this.view.heightModelInfo;return this._useEsriCrs=0===l(e,s,!1),this._useEsriCrs}return!1}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,m(e))}_updateGaussians(){const e=new Array;for(const s of this._gaussianTileHandles.values())s.isVisible&&e.push(s);this._data.updateGaussianVisibility(e)}get _data(){return this._renderNode.data}extractHeader(e){const s=e.length-4,t=this.reinterpretU32AsFloat(e[s]),r=this.reinterpretU32AsFloat(e[s+1]),i=this.reinterpretU32AsFloat(e[s+2]),a=1/(1<<(255&e[s+3]));return{packedHeader:e.subarray(s,s+4),tileOrigin:{x:t,y:r,z:i},invPosScale:a}}_deleteTile(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}};e([a()],R.prototype,"layer",void 0),R=e([n("esri.views.3d.layers.GaussianSplatLayerView3D")],R);const V=R;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{loadLyr3DWorkerWASM as s}from"../../../libs/lyr3d/Lyr3DModule.js";let t,n;async function r(s){await i();const t={status:1,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]};if(s.inputs.length<1)return{result:t,transferList:[]};const r={ptrs:[],sizes:[]};for(const i of s.inputs){const s=n._malloc(i.byteLength);new Uint8Array(n.HEAPU8.buffer,s,i.byteLength).set(new Uint8Array(i)),r.ptrs.push(s),r.sizes.push(i.byteLength)}const e=n.process(s.jobDescJson,s.id,r,s.isMissingResourceCase);t.status=e.status,t.missingInputUrls=e.missingInputUrls.slice();const o=0===e.status&&e.data,u=2===t.status&&t.missingInputUrls.length>0;t.jobDescJson=e.jobDescJson.slice(),t.error=e.error.slice(),o?t.data=e.data.slice():u&&(t.originalInputs=s.inputs.slice());for(let i=0;i<r.ptrs.length;++i)n._free(r.ptrs[i]);const l=[];if(o)l.push(t.data.buffer);else if(u)for(const n of s.inputs)l.push(n);return{result:t,transferList:l}}function e(){n&&(n.uninitialize_lyr3d_worker_wasm(),n=null)}function i(){return n?Promise.resolve():(t||(t=s().then(s=>{n=s,n.initialize_lyr3d_worker_wasm(),t=null})),t)}export{e as destroyWasm,i as initialize,r as process};
5
+ import{loadLyr3DWorkerWASM as s}from"../../../libs/lyr3d/Lyr3DModule.js";let t,e;async function n(s){await o();const t={status:1,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]};if(s.inputs.length<1)return{result:t,transferList:[]};const n={ptrs:[],sizes:[]};for(const o of s.inputs){const s=e._malloc(o.byteLength);new Uint8Array(e.HEAPU8.buffer,s,o.byteLength).set(new Uint8Array(o)),n.ptrs.push(s),n.sizes.push(o.byteLength)}const r=e.process(s.jobDescJson,s.id,n,s.isMissingResourceCase);t.status=r.status,t.missingInputUrls=r.missingInputUrls.slice();const i=0===r.status&&r.data,a=2===t.status&&t.missingInputUrls.length>0;t.jobDescJson=r.jobDescJson.slice(),t.error=r.error.slice(),i?t.data=r.data.slice():a&&(t.originalInputs=s.inputs.slice());for(let o=0;o<n.ptrs.length;++o)e._free(n.ptrs[o]);const u=[];if(i)u.push(t.data.buffer);else if(a)for(const e of s.inputs)u.push(e);return{result:t,transferList:u}}async function r(s){await o(),e.add_spatial_reference_info(s.sr,s.isGCS,s.toMetersXY,s.toMetersZ)}function i(){e&&(e.uninitialize_lyr3d_worker_wasm(),e=null)}function o(){return e?Promise.resolve():(t||(t=s().then(s=>{e=s,e.initialize_lyr3d_worker_wasm(),t=null})),t)}export{r as addSpatialReferenceInfo,i as destroyWasm,o as initialize,n as process};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{disposeMaybe as s}from"../../../../core/maybe.js";import t from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,g as a,u as l,e as h,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as m,offset as p,contains as g,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as z}from"./PointCloudHighlights.js";import{isDepth as R,isColorOrColorEmission as y}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as j}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as v}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as q}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as A,g as F}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as E,positionsLayout as H,colorsLayout as M}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as I}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{PrimitiveType as N}from"../../../webgl/enums.js";import{VertexBuffer as L}from"../../../webgl/VertexBuffer.js";let B=class extends j{constructor(e){super(e),this.type=6,this.isGround=!1,this._passParameters=new A,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlight:(e,s,t)=>this._addHighlight(e,s,t),removeHighlight:(e,s)=>this._removeHighlight(e,s)}),this.produces=new Map([[2,e=>!(R(e)||9===e&&this._highlights.empty)],[3,e=>R(e)]]),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new I,this._nodes=new t}destroy(){this._nodes.prune()}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,s,t,i){const r=d(),f=d(),P=d(),x=d(),z=b(),R=e.camera.perScreenPixelRatio/2,y=e.camera.near;n(f,i,t);const j=1/o(f);a(f,f,j),l(P,f),u(z,f[0],f[1],f[2],-h(f,t));const q=new C,A=new C,F=new Array,E=m(),H=m(this._passParameters.clipBox);p(H,-t[0],-t[1],-t[2],H),this._nodes.forAll(o=>{const a=o.splatSize*this._passParameters.scaleFactor;let l=o.obb.minimumDistancePlane(z),d=o.obb.maximumDistancePlane(z);l-=V(a,l+y,this._passParameters,R,o.isLeaf),d-=V(a,d+y,this._passParameters,R,o.isLeaf);const u=d<0,m=null!=q.dist&&null!=A.dist&&q.dist<l*j&&A.dist>d*j;if(u||m)return;const b=O(a,d+y,this._passParameters,R,o.isLeaf);if(!o.obb.intersectRay(t,f,b))return;const S=b*b;o.obb.toAaBoundingBox(E),p(E,-t[0],-t[1],-t[2],E);const w=!g(H,E);n(x,o.origin,t);const v=o.coordinates.length/3;for(let n=0;n<v;n++){if(r[0]=x[0]+o.coordinates[3*n],r[1]=x[1]+o.coordinates[3*n+1],r[2]=x[2]+o.coordinates[3*n+2],w&&!_(H,r))continue;const l=h(r,f),d=c(r)-l*l;if(d>S)continue;let u=l+y;const m=V(a,u,this._passParameters,R,o.isLeaf);if(l-m<0)continue;u-=m;const p=O(a,u,this._passParameters,R,o.isLeaf);if(d>p*p)continue;const g=(l-m)*j,b=e=>(e.point=T(o,n,e.point),e.dist=g,e.normal=P,e.node=o,e.pointId=n,e.layerViewUid=this.layerViewUid,e);if((null==q.dist||g<q.dist)&&(null==s||s(t,i,g))&&b(q),0!==e.options.store&&(null==A.dist||g>A.dist)&&(null==s||s(t,i,g))&&b(A),2===e.options.store&&(null==s||s(t,i,g))){const e=new C;F.push(b(e))}}});const M=e=>{const{layerViewUid:s,node:t,pointId:i}=e;return new w(e.point,s,i,()=>this.createGraphic(t,i,e.point))},I=(e,s)=>{const t=M(s);e.set(this.type,t,s.dist,s.normal)};if(k(q)){const s=e.results.min;(null==s.distance||q.dist<s.distance)&&I(s,q)}if(k(A)&&0!==e.options.store){const s=e.results.max;(null==s.distance||A.dist>s.distance)&&I(s,A)}if(2===e.options.store){const s=S(t,i);for(const t of F){const i=new v(s);I(i,t),e.results.all.push(i)}}}acquireTechniques(e){const s=9===e.output;return 0!==this._nodes.length&&(y(e.output)||R(e.output)&&3===e.bind.slot||s)?(this._nodes.forAll(s=>this._initNode(e,s)),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=s&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._context.techniques.get(E,this._configuration)):null}render(e,s){const{rctx:t,bind:i,output:r}=e,n=t.bindTechnique(s,i,this._passParameters),o=9===r,a=i.highlight?.name??null;o&&!a||this._nodes.forAll(s=>{0===s.coordinates.length||null==s.vao||o&&!s.highlightMap.has(a)||(n.assertCompatibleVertexAttributeLocations(s.vao),n.bindDraw(i,this._passParameters,s),t.bindVAO(s.vao),o?this._renderHighlightFragments(e,s):t.drawArrays(N.POINTS,0,s.coordinates.length/3))})}_renderHighlightFragments(e,s){const{highlightMap:t}=s,{rctx:i,bind:r}=e,{highlight:n}=r;if(!n)return;const o=n.name,a=t.get(o);if(!a||0===a.length)return;const{highlightOrderMap:l,highlightLevel:h}=r;if(null==h)return;for(const g of t.keys())if(g!==o){const e=l.get(g);if(void 0!==e&&e>h)return}let c=0,d=a[0].componentIndex,u=d+1;const m=()=>{for(;c<a.length&&a[c].id.highlightName!==o;)d=a[c].componentIndex,++c;u=d+1};m();const p=(e,s)=>{const t=s-e;t>0&&i.drawArrays(N.POINTS,e,t)};for(;c<a.length;){const e=a[c];if(e.id.highlightName!==o){p(d,u),++c,m();continue}const s=e.componentIndex;s!==u&&(p(d,u),d=s),u=s+1,++c}p(d,u)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!x(this._passParameters.clipBox,P,(e,s)=>e===s)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace(i=>i.id!==e||(t=i,i.vao=s(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),t}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll(e=>e.vao=s(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,s){return this._highlights.add(e,s)}_addHighlight(e,s,t){e.addHighlight(s,t),this._requestRender()}_removeHighlight(e,s){e.removeHighlight(s),this._requestRender()}_initNode(e,s){s.vao??=new q(e.rctx,new Map([["positions",new L(e.rctx,H,s.coordinates)],["colors",new L(e.rctx,M,s.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}};function O(e,s,t,i,r){if(t.drawScreenSpace)return t.fixedSize*s*i;const n=F(r)*s*i;return t.useFixedSizes?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*s*i,e/2),n):Math.min(e/2,n)}function V(e,s,t,i,r){return t.drawScreenSpace?0:O(e,s,t,i,r)}function T(e,s,t){return null==t&&(t=d()),t[0]=e.origin[0]+e.coordinates[3*s],t[1]=e.origin[1]+e.coordinates[3*s+1],t[2]=e.origin[2]+e.coordinates[3*s+2],t}e([i({constructOnly:!0})],B.prototype,"createGraphic",void 0),B=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],B);class C{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function k(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}export{B as PointCloudRenderer};
5
+ import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../core/maybe.js";import s from"../../../../core/PooledArray.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,l as o,g as a,u as h,e as l,k as c}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as u}from"../../../../chunks/vec42.js";import{create as p,offset as m,contains as g,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{j as w,i as z}from"../../../../chunks/sphere.js";import{PclTarget as R}from"./Intersector.js";import{PointCloudHighlights as y}from"./PointCloudHighlights.js";import{isDepth as j,isColorOrColorEmission as v}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as q}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as F}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as A}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as E,g as B}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as H,positionsLayout as M,colorsLayout as O}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as I}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{PrimitiveType as N}from"../../../webgl/enums.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let T=class extends q{constructor(e){super(e),this.type=6,this.isGround=!1,this._passParameters=new E,this._highlights=new y({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,s)=>this._addHighlight(e,t,s),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.produces=new Map([[2,e=>!(j(e)||9===e&&this._highlights.empty)],[3,e=>j(e)]]),this.point=d(),this.intersectionRayDir=d(),this.intersectionPlane=b(),this.nodeOriginOffset=d(),this.nodeBoundingBox=p(),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new I,this._nodes=new s}destroy(){this._nodes.prune()}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,s,i){const{point:r,intersectionRayDir:f,nodeOriginOffset:P,intersectionPlane:x,layerViewUid:b,nodeBoundingBox:y}=this,j=S(s,i),v=e.camera.perScreenPixelRatio/2,q=e.camera.near;n(f,i,s);const A=1/o(f);a(f,f,A);const E=d();h(E,f),u(x,f[0],f[1],f[2],-l(f,s));const B=new D,H=new D,M=new Array,O=p(this._passParameters.clipBox);m(O,-s[0],-s[1],-s[2],O),this._nodes.forAll(o=>{const{isLeaf:a,coordinates:h}=o,d=o.splatSize*this._passParameters.scaleFactor;let u=o.obb.minimumDistancePlane(x),p=o.obb.maximumDistancePlane(x);u-=k(d,u+q,this._passParameters,v,a),p-=k(d,p+q,this._passParameters,v,a);const S=p<0,R=null!=B.dist&&null!=H.dist&&B.dist<u*A&&H.dist>p*A;if(S||R)return;const F=C(d,p+q,this._passParameters,v,a),I=w(o.obb.center,o.obb.radius+F);if(!z(I,j,null))return;if(!o.obb.intersectRay(s,f,F))return;const N=F*F;o.obb.toAaBoundingBox(y),m(y,-s[0],-s[1],-s[2],y);const V=!g(O,y);n(P,o.origin,s);const T=h.length/3;for(let n=0;n<T;n++){const u=3*n;if(r[0]=P[0]+h[u],r[1]=P[1]+h[u+1],r[2]=P[2]+h[u+2],V&&!_(O,r))continue;const p=l(r,f),m=p*p,g=c(r)-m;if(g>N)continue;let x=p+q;const S=k(d,x,this._passParameters,v,a);if(p-S<0)continue;x-=S;const w=C(d,x,this._passParameters,v,a);if(g>w*w)continue;const z=(p-S)*A,R=e=>(e.point=e.point?L(o,n,e.point):L(o,n),e.dist=z,e.normal=E,e.node=o,e.pointId=n,e.layerViewUid=b,e);if((null==B.dist||z<B.dist)&&(null==t||t(s,i,z))&&R(B),0!==e.options.store&&(null==H.dist||z>H.dist)&&(null==t||t(s,i,z))&&R(H),2===e.options.store&&(null==t||t(s,i,z))){const e=new D;M.push(R(e))}}});const I=e=>{const{layerViewUid:t,node:s,pointId:i}=e;return new R(e.point,t,i,()=>this.createGraphic(s,i,e.point))},N=(e,t)=>{const s=I(t);e.set(this.type,s,t.dist,t.normal)};if(U(B)){const t=e.results.min;(null==t.distance||B.dist<t.distance)&&N(t,B)}if(U(H)&&0!==e.options.store){const t=e.results.max;(null==t.distance||H.dist>t.distance)&&N(t,H)}if(2===e.options.store)for(const n of M){const t=new F(j);N(t,n),e.results.all.push(t)}}acquireTechniques(e){const t=9===e.output;return 0!==this._nodes.length&&(v(e.output)||j(e.output)&&3===e.bind.slot||t)?(this._nodes.forAll(t=>this._initNode(e,t)),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=t&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._context.techniques.get(H,this._configuration)):null}render(e,t){const{rctx:s,bind:i,output:r}=e,n=s.bindTechnique(t,i,this._passParameters),o=9===r,a=i.highlight?.name??null;o&&!a||this._nodes.forAll(t=>{0===t.coordinates.length||null==t.vao||o&&!t.highlightMap.has(a)||(n.assertCompatibleVertexAttributeLocations(t.vao),n.bindDraw(i,this._passParameters,t),s.bindVAO(t.vao),o?this._renderHighlightFragments(e,t):s.drawArrays(N.POINTS,0,t.coordinates.length/3))})}_renderHighlightFragments(e,t){const{highlightMap:s}=t,{rctx:i,bind:r}=e,{highlight:n}=r;if(!n)return;const o=n.name,a=s.get(o);if(!a||0===a.length)return;const{highlightOrderMap:h,highlightLevel:l}=r;if(null==l)return;for(const g of s.keys())if(g!==o){const e=h.get(g);if(void 0!==e&&e>l)return}let c=0,d=a[0].componentIndex,u=d+1;const p=()=>{for(;c<a.length&&a[c].id.highlightName!==o;)d=a[c].componentIndex,++c;u=d+1};p();const m=(e,t)=>{const s=t-e;s>0&&i.drawArrays(N.POINTS,e,s)};for(;c<a.length;){const e=a[c];if(e.id.highlightName!==o){m(d,u),++c,p();continue}const t=e.componentIndex;t!==u&&(m(d,u),d=t),u=t+1,++c}m(d,u)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!x(this._passParameters.clipBox,P,(e,t)=>e===t)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let s=null;return this._nodes.filterInPlace(i=>i.id!==e||(s=i,i.vao=t(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),s}forEachNode(e){this._nodes.forEach(e)}removeAll(){this._nodes.forAll(e=>e.vao=t(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,t){return this._highlights.add(e,t)}_addHighlight(e,t,s){e.addHighlight(t,s),this._requestRender()}_removeHighlight(e,t){e.removeHighlight(t),this._requestRender()}_initNode(e,t){t.vao??=new A(e.rctx,new Map([["positions",new V(e.rctx,M,t.coordinates)],["colors",new V(e.rctx,O,t.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}};function C(e,t,s,i,r){if(s.drawScreenSpace)return s.fixedSize*t*i;const n=B(r)*t*i;return s.useFixedSizes?Math.min(s.fixedSize/2,n):s.screenMinSize>0?Math.min(Math.max(s.screenMinSize*t*i,e/2),n):Math.min(e/2,n)}function k(e,t,s,i,r){return s.drawScreenSpace?0:C(e,t,s,i,r)}function L(e,t,s=d()){return s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}e([i({constructOnly:!0})],T.prototype,"createGraphic",void 0),T=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],T);class D{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function U(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}export{T as PointCloudRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Camera.js";import{Cyclical as t}from"../../../core/Cyclical.js";import n from"../../../core/Logger.js";import{deg2rad as r,rad2deg as i,asinClamped as a}from"../../../core/mathUtils.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{c,j as s,F as l,l as u}from"../../../chunks/vec32.js";import{create as f,clone as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import d from"../../../geometry/Point.js";import{projectWithZConversion as h,project as y}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as v,projectPointToVector as R}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as w,projectVectorToPoint as x}from"../../../geometry/projection/projectVectorToPoint.js";import{toRenderCamera as M}from"../webgl.js";import{getGreatCircleSpanAt as j}from"./earthUtils.js";import{getElevationAtPoint as T}from"./ElevationProvider.js";import{viewModeDependentUtil as S,directionToHeadingTilt as z}from"./viewingModeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";const b=()=>n.getLogger("esri.views.3d.support.cameraUtils"),P=96*39.37,A=1,L=8,U=5,H=1,q=f(),F=new t(-20037508.342788905,20037508.342788905),I=new t(-180,180);function E(e){return e.spatialReference??g.WGS84}function G(e,t,n,r,i){return S(e).headingTiltToDirectionUp(t,n,r,i)}function O(e,t){const{camera:n}=e.state,{unitInMeters:r}=e.renderCoordsHelper;t/=r;return n.width/2/n.pixelRatio/(P/t)/Math.tan(n.fovX/2)}function X(e,t){const{camera:n}=e.state,{unitInMeters:r}=e.renderCoordsHelper,i=t*Math.tan(n.fovX/2),a=n.width/2/n.pixelRatio;return P/(a/i)*r}function k(e,t,n,r){const i=r.levelAtScale(t),a=V(z(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function D(e,t,n){const r=n.levelAtScale(e),i=V(t);return n.scaleAtLevel(r+i)}function V(e){return 2*((e>90?180-e:e)/90)**2}function W(e,t,n=0){const r=e.basemapTerrain?.tilingScheme;if(!r)return 0;const i=p(e.spatialReference).radius,a=2===e.state.viewingMode?t.eye[2]:u(t.eye)-i;return k(e,X(e,Math.abs(a-n)),t,r)}function Y(e,t,n=0){const r=M(e,t);return r?W(e,r,n):0}const N=1,Z=100;function B(e,t,n,o){if(0===t)return 0;const c=e.state.contentCamera,l=s(c.eye,n),f=e.basemapTerrain?.tilingScheme;if(!f)return b().error("#scaleToTargetDistance()","Cannot compute distance from scale without a tiling scheme"),l;let m=l;const d=z(e,c.eye,c.viewForward,c.up),h=d.tilt>90;if(e.state.isLocal){const n=(O(e,D(t,d.tilt,f))-Math.abs(c.eye[2]-o[2]))/Math.cos(r(d.tilt));return m=h?m-n:m+n,m}let y=1/0,g=0,v=ne(e,d.heading,d.tilt,n,l,1);if(!v)return m;const R=u(o);for(;y>N&&g<Z;){const o=u(v.eye),l=h?180-v.tilt:v.tilt,w=r(l),x=Math.sin(w)*o,M=Math.cos(w)*o,j=O(e,D(t,v.tilt,f)),T=h?R-j:R+j,S=a(x/T),z=Math.cos(S)*T-M,C=s(v.eye,n);m=h?C-z:C+z,v=ne(e,d.heading,d.tilt,n,m,1);const b=je(e,v,i(c.fov));if(!v||!b)return m;const P=Y(e,b,R-p(e.spatialReference).radius);y=Math.abs(t-P),++g}return m}async function J(e,t,n,r,i,a){return Q(e,t,O(e,n),r,i,a)}function K(e,t,n,r,i,a){return je(e,ne(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function Q(e,t,n,r,i,a){const c=await re(e,r.heading,r.tilt,t,n,i,a);return o(a),Te(e,c,r.fov,a)}function $(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,q,e.spatialReference)&&e.elevationProvider&&(T(e.elevationProvider,q)??0)>q[2]-H)}async function _(e,t,n){if($(e,t))return!0;const{elevationProvider:r,spatialReference:i,renderCoordsHelper:a}=e;if(null==r||!a.fromRenderCoords(t,q,i))return!1;const[c,s,l]=q,u=await r.queryElevation(c,s,l,i,"ground",n)??0;return o(n),u>l-H}async function ee(e,t,n){const r=f();if(null==t)return c(r,e.state.camera.center);if(t instanceof d){const{renderSpatialReference:i,basemapTerrain:a,elevationProvider:c}=e,s=t.spatialReference;if(await v(t,r,i,0,{signal:n}),o(n),null==t.z&&null!=a&&null!=c){const i=await c.queryElevation(t.x,t.y,t.z??0,s,"ground",n);o(n),null!=i&&e.renderCoordsHelper.setAltitude(r,i)}return r}return c(r,t)}function te(e,t){const n=f();if(null==t)return c(n,e.state.camera.center);if(t instanceof d){if(!R(t,n,e.renderSpatialReference))return null;const{basemapTerrain:r,elevationProvider:i}=e;if(null==t.z&&null!=r&&null!=i){const r=T(i,t);null!=r&&e.renderCoordsHelper.setAltitude(n,r)}return n}return c(n,t)}function ne(e,t,n,r,i,a){return ie(e,t,n,r instanceof d?r:null,te(e,r),i,a)}async function re(e,t,n,r,i,a,c){const s=r instanceof d?r:null,l=await ee(e,r,c);return o(c),ae(e,t,n,s,l,i,a,c)}function ie(e,t,n,r,i,a,o){if(null==i)return null;if(!r&&(r=new d({spatialReference:E(e)}),!x(i,e.renderSpatialReference,r)))return null;const c=oe(e,t,n,i,a,o);if(ce(e,n,o)&&$(e,c.eye)){const{tilt:o,mode:c}=se(e,n,i,a);return ie(e,t,o,r,i,a,c)}return le(c,i)}async function ae(e,t,n,r,i,a,c,s){r||(r=new d({spatialReference:E(e)}),await w(i,e.renderSpatialReference,r,{signal:s})||(r=null)),o(s);const l=oe(e,t,n,i,a,c);if(ce(e,n,c)&&await _(e,l.eye,s)){o(s);const{tilt:c,mode:l}=se(e,n,i,a);return ae(e,t,c,r,i,a,l,s)}return le(l,i)}function oe(e,t,n,r,i,a){const o=ge(e,t,n,r,i=Math.max(i,e.state.constraints.minimumPoiDistance),a);return(0,S(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function ce(e,t,n){const r=e.map.ground.navigationConstraint;return 1===n&&e.state.isGlobal&&t>0&&(null==r||"stay-above"===r.type)}function se(e,t,n,r){const i=xe(e,n,r,we(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function le(e,t){return{...e,center:m(t)}}function ue(e,t){const{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&C(i,1)||n.isLocal&&r.equals(i)}function fe(e,t){let n,r,i;if(e.state.isGlobal){const e=new d(t.xmin,t.ymin,t.spatialReference),a=new d(t.xmax,t.ymax,t.spatialReference),o=t.spatialReference.isGeographic?I:F;n=new d({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});const c=p(t.spatialReference),s=j(n,e,a);r=s.lon,i=s.lat,o.diff(e.x,a.x)>o.range/2&&(r+=c.halfCircumference),r=Math.min(r,c.halfCircumference),i=Math.min(i,c.halfCircumference)}else{const a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=y(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;const o=null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0;n=new d({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}const a=null!=t.zmax&&null!=t.zmin?t.zmax-t.zmin:0,o=e.state.camera,c=1/Math.tan(o.fovX/2),s=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2);return{center:n,distance:Math.max(.5*r*c,.5*i*s,.5*a*l)/A}}async function me(e,t,n,r,i,a){const c=ue(e,t)?t:await h(t,e.spatialReference,{signal:a});o(a);const{center:s,distance:l}=fe(e,c),u=await re(e,n,r,s,l,i,a);return o(a),Te(e,u,e.camera.fov,a)}function pe(e,t,n,r,i,a){let o;try{o=ue(e,t)?t:y(t,e.spatialReference)}catch(u){return null}const{center:c,distance:s}=fe(e,o),l=ne(e,n,r,c,s,i);return null==l?null:je(e,l,e.camera.fov,a)}function de(e,t,n){const r=e.renderSpatialReference,i=new d({spatialReference:E(e)});if(!x(n,r,i))return null;const a=Math.tan(t.fovX/2),o=Math.tan(t.fovY/2),c=l(t.eye,n),s=2*c*a*A,u=2*c*o*A;return S(e).toExtent(e,i,s,u)}function he(e,t){return S(e).toArea(e,t)}function ye(e,t,n){const r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(n/r)/Math.LN2>L)return!0;const i=t,a=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return s(i,a)/(Math.tan(.5*e.state.camera.fov)*r)>U}function ge(e,t,n,r,i,a){let o=0;return 1===a&&ye(e,r,i)?(t=0,o=Re(e,i,n,r)):o=Me(e,r,i,n),o=e.state.constraints.clampTilt(i,o),{heading:t,tilt:n=xe(e,r,i,o)}}const ve=.7;function Re(e,t,n,r){const i=Me(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);a.max=Math.min(a.max,.5*Math.PI);const o=a.min*(1-ve)+a.max*ve;return Math.min(i,o)}function we(e,t,n,r){let i=Me(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);return i=Math.min(i,.5*Math.PI),a.min*(1-ve)+i*ve}function xe(e,t,n,r){return S(e).lookAtTiltToEyeTilt(r,t,n)}function Me(e,t,n,r){return S(e).eyeTiltToLookAtTilt(r,t,n)}function je(t,n,r,i){if(null==n)return null;const a=t.renderSpatialReference,o=new d({spatialReference:E(t)});return x(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function Te(t,n,r,i){const a=t.renderSpatialReference,c=new d({spatialReference:E(t)});return await w(n.eye,a,c,{signal:i}),o(i),new e(c,n.heading,n.tilt,r)}function Se(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.levelAtScale(t);b().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function ze(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.scaleAtLevel(t);b().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}export{k as applyTiltAdjustToScale,X as distanceToScale,Q as fromCenterDistanceAsync,K as fromCenterDistanceSync,J as fromCenterScale,me as fromExtentAsync,pe as fromExtentSync,re as getObserverForPointAtDistanceAsync,ne as getObserverForPointAtDistanceSync,E as getViewSR,G as headingTiltToDirectionUp,D as removeTiltAdjustFromScale,N as scaleErrorThreshold,O as scaleToDistance,Se as scaleToZoom,he as toArea,de as toExtent,B as viewScaleToCameraDistance,ze as zoomToScale};
5
+ import e from"../../../Camera.js";import t from"../../../core/Logger.js";import{deg2rad as n,rad2deg as r,asinClamped as i}from"../../../core/mathUtils.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{c as o,j as c,F as s,l}from"../../../chunks/vec32.js";import{create as u,clone as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectWithZConversion as d,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{projectPointToVectorAsync as y,projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as R,projectVectorToPoint as w}from"../../../geometry/projection/projectVectorToPoint.js";import{gcsCyclical as x,webMercatorCyclical as M}from"../../../geometry/support/normalizeUtils.js";import{toRenderCamera as j}from"../webgl.js";import{getGreatCircleSpanAt as T}from"./earthUtils.js";import{getElevationAtPoint as z}from"./ElevationProvider.js";import{viewModeDependentUtil as S,directionToHeadingTilt as C}from"./viewingModeUtils.js";import{isSpatialReferenceSupported as b}from"../../support/spatialReferenceSupport.js";const P=()=>t.getLogger("esri.views.3d.support.cameraUtils"),A=96*39.37,L=1,U=8,H=5,q=1,F=u();function I(e){return e.spatialReference??g.WGS84}function E(e,t,n,r,i){return S(e).headingTiltToDirectionUp(t,n,r,i)}function G(e,t){const{camera:n}=e.state,{unitInMeters:r}=e.renderCoordsHelper;t/=r;return n.width/2/n.pixelRatio/(A/t)/Math.tan(n.fovX/2)}function O(e,t){const{camera:n}=e.state,{unitInMeters:r}=e.renderCoordsHelper,i=t*Math.tan(n.fovX/2),a=n.width/2/n.pixelRatio;return A/(a/i)*r}function X(e,t,n,r){const i=r.levelAtScale(t),a=D(C(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function k(e,t,n){const r=n.levelAtScale(e),i=D(t);return n.scaleAtLevel(r+i)}function D(e){return 2*((e>90?180-e:e)/90)**2}function V(e,t,n=0){const r=e.basemapTerrain?.tilingScheme;if(!r)return 0;const i=m(e.spatialReference).radius,a=2===e.state.viewingMode?t.eye[2]:l(t.eye)-i;return X(e,O(e,Math.abs(a-n)),t,r)}function W(e,t,n=0){const r=j(e,t);return r?V(e,r,n):0}const Y=1,N=100;function Z(e,t,a,o){if(0===t)return 0;const s=e.state.contentCamera,u=c(s.eye,a),f=e.basemapTerrain?.tilingScheme;if(!f)return P().error("#scaleToTargetDistance()","Cannot compute distance from scale without a tiling scheme"),u;let p=u;const d=C(e,s.eye,s.viewForward,s.up),h=d.tilt>90;if(e.state.isLocal){const r=(G(e,k(t,d.tilt,f))-Math.abs(s.eye[2]-o[2]))/Math.cos(n(d.tilt));return p=h?p-r:p+r,p}let g=1/0,y=0,v=te(e,d.heading,d.tilt,a,u,1);if(!v)return p;const R=l(o);for(;g>Y&&y<N;){const o=l(v.eye),u=h?180-v.tilt:v.tilt,w=n(u),x=Math.sin(w)*o,M=Math.cos(w)*o,j=G(e,k(t,v.tilt,f)),T=h?R-j:R+j,z=i(x/T),S=Math.cos(z)*T-M,C=c(v.eye,a);p=h?C-S:C+S,v=te(e,d.heading,d.tilt,a,p,1);const b=Me(e,v,r(s.fov));if(!v||!b)return p;const P=W(e,b,R-m(e.spatialReference).radius);g=Math.abs(t-P),++y}return p}async function B(e,t,n,r,i,a){return K(e,t,G(e,n),r,i,a)}function J(e,t,n,r,i,a){return Me(e,te(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function K(e,t,n,r,i,o){const c=await ne(e,r.heading,r.tilt,t,n,i,o);return a(o),je(e,c,r.fov,o)}function Q(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,F,e.spatialReference)&&e.elevationProvider&&(z(e.elevationProvider,F)??0)>F[2]-q)}async function $(e,t,n){if(Q(e,t))return!0;const{elevationProvider:r,spatialReference:i,renderCoordsHelper:o}=e;if(null==r||!o.fromRenderCoords(t,F,i))return!1;const[c,s,l]=F,u=await r.queryElevation(c,s,l,i,"ground",n)??0;return a(n),u>l-q}async function _(e,t,n){const r=u();if(null==t)return o(r,e.state.camera.center);if(t instanceof p){const{renderSpatialReference:i,basemapTerrain:o,elevationProvider:c}=e,s=t.spatialReference;if(await y(t,r,i,0,{signal:n}),a(n),null==t.z&&null!=o&&null!=c){const i=await c.queryElevation(t.x,t.y,t.z??0,s,"ground",n);a(n),null!=i&&e.renderCoordsHelper.setAltitude(r,i)}return r}return o(r,t)}function ee(e,t){const n=u();if(null==t)return o(n,e.state.camera.center);if(t instanceof p){if(!v(t,n,e.renderSpatialReference))return null;const{basemapTerrain:r,elevationProvider:i}=e;if(null==t.z&&null!=r&&null!=i){const r=z(i,t);null!=r&&e.renderCoordsHelper.setAltitude(n,r)}return n}return o(n,t)}function te(e,t,n,r,i,a){return re(e,t,n,r instanceof p?r:null,ee(e,r),i,a)}async function ne(e,t,n,r,i,o,c){const s=r instanceof p?r:null,l=await _(e,r,c);return a(c),ie(e,t,n,s,l,i,o,c)}function re(e,t,n,r,i,a,o){if(null==i)return null;if(!r&&(r=new p({spatialReference:I(e)}),!w(i,e.renderSpatialReference,r)))return null;const c=ae(e,t,n,i,a,o);if(oe(e,n,o)&&Q(e,c.eye)){const{tilt:o,mode:c}=ce(e,n,i,a);return re(e,t,o,r,i,a,c)}return se(c,i)}async function ie(e,t,n,r,i,o,c,s){r||(r=new p({spatialReference:I(e)}),await R(i,e.renderSpatialReference,r,{signal:s})||(r=null)),a(s);const l=ae(e,t,n,i,o,c);if(oe(e,n,c)&&await $(e,l.eye,s)){a(s);const{tilt:c,mode:l}=ce(e,n,i,o);return ie(e,t,c,r,i,o,l,s)}return se(l,i)}function ae(e,t,n,r,i,a){const o=ge(e,t,n,r,i=Math.max(i,e.state.constraints.minimumPoiDistance),a);return(0,S(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function oe(e,t,n){const r=e.map.ground.navigationConstraint;return 1===n&&e.state.isGlobal&&t>0&&(null==r||"stay-above"===r.type)}function ce(e,t,n,r){const i=we(e,n,r,Re(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function se(e,t){return{...e,center:f(t)}}function le(e,t){const{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&b(i,1)||n.isLocal&&r.equals(i)}function ue(e,t){let n,r,i;if(e.state.isGlobal){const e=new p(t.xmin,t.ymin,t.spatialReference),a=new p(t.xmax,t.ymax,t.spatialReference),o=t.spatialReference.isGeographic?x:M;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});const c=m(t.spatialReference),s=T(n,e,a);r=s.lon,i=s.lat,o.diff(e.x,a.x)>o.range/2&&(r+=c.halfCircumference),r=Math.min(r,c.halfCircumference),i=Math.min(i,c.halfCircumference)}else{const a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=h(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;const o=null!=t.zmax&&null!=t.zmin?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}const a=null!=t.zmax&&null!=t.zmin?t.zmax-t.zmin:0,o=e.state.camera,c=1/Math.tan(o.fovX/2),s=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2);return{center:n,distance:Math.max(.5*r*c,.5*i*s,.5*a*l)/L}}async function fe(e,t,n,r,i,o){const c=le(e,t)?t:await d(t,e.spatialReference,{signal:o});a(o);const{center:s,distance:l}=ue(e,c),u=await ne(e,n,r,s,l,i,o);return a(o),je(e,u,e.camera.fov,o)}function me(e,t,n,r,i,a){let o;try{o=le(e,t)?t:h(t,e.spatialReference)}catch(u){return null}const{center:c,distance:s}=ue(e,o),l=te(e,n,r,c,s,i);return null==l?null:Me(e,l,e.camera.fov,a)}function pe(e,t,n){const r=e.renderSpatialReference,i=new p({spatialReference:I(e)});if(!w(n,r,i))return null;const a=Math.tan(t.fovX/2),o=Math.tan(t.fovY/2),c=s(t.eye,n),l=2*c*a*L,u=2*c*o*L;return S(e).toExtent(e,i,l,u)}function de(e,t){return S(e).toArea(e,t)}function he(e,t,n){const r=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(n/r)/Math.LN2>U)return!0;const i=t,a=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return c(i,a)/(Math.tan(.5*e.state.camera.fov)*r)>H}function ge(e,t,n,r,i,a){let o=0;return 1===a&&he(e,r,i)?(t=0,o=ve(e,i,n,r)):o=xe(e,r,i,n),o=e.state.constraints.clampTilt(i,o),{heading:t,tilt:n=we(e,r,i,o)}}const ye=.7;function ve(e,t,n,r){const i=xe(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);a.max=Math.min(a.max,.5*Math.PI);const o=a.min*(1-ye)+a.max*ye;return Math.min(i,o)}function Re(e,t,n,r){let i=xe(e,r,t,n);if(!e.state.constraints.tilt)return i;const a=e.state.constraints.tilt(t);return i=Math.min(i,.5*Math.PI),a.min*(1-ye)+i*ye}function we(e,t,n,r){return S(e).lookAtTiltToEyeTilt(r,t,n)}function xe(e,t,n,r){return S(e).eyeTiltToLookAtTilt(r,t,n)}function Me(t,n,r,i){if(null==n)return null;const a=t.renderSpatialReference,o=new p({spatialReference:I(t)});return w(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function je(t,n,r,i){const o=t.renderSpatialReference,c=new p({spatialReference:I(t)});return await R(n.eye,o,c,{signal:i}),a(i),new e(c,n.heading,n.tilt,r)}function Te(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.levelAtScale(t);P().error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function ze(e,t){const n=e.basemapTerrain?.tilingScheme;if(n)return n.scaleAtLevel(t);P().error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}export{X as applyTiltAdjustToScale,O as distanceToScale,K as fromCenterDistanceAsync,J as fromCenterDistanceSync,B as fromCenterScale,fe as fromExtentAsync,me as fromExtentSync,ne as getObserverForPointAtDistanceAsync,te as getObserverForPointAtDistanceSync,I as getViewSR,E as headingTiltToDirectionUp,k as removeTiltAdjustFromScale,Y as scaleErrorThreshold,G as scaleToDistance,Te as scaleToZoom,de as toArea,pe as toExtent,Z as viewScaleToCameraDistance,ze as zoomToScale};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/Cyclical.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../chunks/vec32.js";import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../chunks/vec42.js";import"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../core/libs/gl-matrix-2/math/common.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Polygon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/coordsUtils.js";import"../../../geometry/support/lineSegment.js";import"../../../geometry/support/plane.js";import"../../../geometry/support/ray.js";import"../../../chunks/sphere.js";import"../../../geometry/support/webMercatorUtils.js";import"../state/Frustum.js";import"../state/NearFarHeuristic.js";import"../state/utils/viewUtils.js";import"./cameraUtilsInternal.js";import"./earthUtils.js";import"./mathUtils.js";export{d as directionToHeadingTilt,e as eyeForCenterWithHeadingTilt,a as eyeTiltToLookAtTilt,h as headingTiltToDirectionUp,l as lookAtTiltToEyeTilt,b as toArea,t as toExtent}from"../../../chunks/cameraUtilsSpherical.js";
5
+ import"../../../core/Cyclical.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../chunks/vec32.js";import"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../../../chunks/vec42.js";import"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../../../core/libs/gl-matrix-2/math/common.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/Extent.js";import"../../../geometry/Polygon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/coordsUtils.js";import"../../../geometry/support/lineSegment.js";import"../../../geometry/support/normalizeUtils.js";import"../../../geometry/support/plane.js";import"../../../geometry/support/ray.js";import"../../../chunks/sphere.js";import"../../../geometry/support/webMercatorUtils.js";import"../state/Frustum.js";import"../state/NearFarHeuristic.js";import"../state/utils/viewUtils.js";import"./cameraUtilsInternal.js";import"./earthUtils.js";import"./mathUtils.js";export{d as directionToHeadingTilt,e as eyeForCenterWithHeadingTilt,a as eyeTiltToLookAtTilt,h as headingTiltToDirectionUp,l as lookAtTiltToEyeTilt,b as toArea,t as toExtent}from"../../../chunks/cameraUtilsSpherical.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const t=4096,s=16,e=1023,i=e+1,n=t*s/i,r=4,o=i*r,h=e*r;class a{constructor(t=n){this._pageCount=t;const s=Math.ceil(t/32);this._bitset=new Uint32Array(s)}get pageCount(){return this._pageCount}isAllocated(t){const s=t/32|0,e=t%32;return!!(this._bitset[s]&1<<e)}allocate(t){const s=t/32|0,e=t%32;this._bitset[s]|=1<<e}free(t){const s=t/32|0,e=t%32;this._bitset[s]&=~(1<<e)}findFirstFreePage(){for(let t=0;t<this._bitset.length;t++)if(4294967295!==this._bitset[t])for(let s=0;s<32;s++){const e=32*t+s;if(e>=this._pageCount)break;if(!(this._bitset[t]&1<<s))return e}return null}resize(t){this._pageCount=t;const s=Math.ceil(t/32),e=this._bitset.length;if(s!==e){const t=new Uint32Array(s),i=Math.min(e,s);t.set(this._bitset.subarray(0,i)),this._bitset=t}this._clearExcessBits(this._bitset,t)}_clearExcessBits(t,s){const e=Math.floor((s-1)/32),i=(s-1)%32;if(s>0&&i<31){const s=(1<<i+1)-1;t[e]&=s}e+1<t.length&&t.fill(0,e+1)}}export{a as GaussianSplatAtlasPageAllocator,i as elementsPerSplatPage,e as gaussiansPerSplatPage,s as initialSplatAtlasTextureHeight,n as initialSplatAtlasTexturePages,r as packedGaussianSizeInU32,t as splatAtlasTextureWidth,o as splatPageSizeInU32,h as splatPageSizeInU32WithoutHeader};
5
+ const t=4096,s=16,e=1023,i=e+1,n=t*s/i,r=4,o=i*r,h=e*r;class a{constructor(t=n){this._pageCount=t;const s=Math.ceil(t/32);this._bitset=new Uint32Array(s)}get pageCount(){return this._pageCount}isAllocated(t){const s=t/32|0,e=t%32;return!!(this._bitset[s]&1<<e)}allocate(t){const s=t/32|0,e=t%32;this._bitset[s]|=1<<e}free(t){const s=t/32|0,e=t%32;this._bitset[s]&=~(1<<e)}findFirstFreePage(){for(let t=0;t<this._bitset.length;t++)if(4294967295!==this._bitset[t])for(let s=0;s<32;s++){const e=32*t+s;if(e>=this._pageCount)break;if(!(this._bitset[t]&1<<s))return e}return null}resize(t){this._pageCount=t;const s=Math.ceil(t/32),e=this._bitset.length;if(s!==e){const t=new Uint32Array(s),i=Math.min(e,s);t.set(this._bitset.subarray(0,i)),this._bitset=t}this._clearExcessBits(this._bitset,t)}_clearExcessBits(t,s){const e=Math.floor((s-1)/32),i=(s-1)%32;if(s>0&&i<31){const s=(1<<i+1)-1;t[e]&=s}e+1<t.length&&t.fill(0,e+1)}}export{a as GaussianSplatAtlasPages,i as elementsPerSplatPage,e as gaussiansPerSplatPage,s as initialSplatAtlasTextureHeight,n as initialSplatAtlasTexturePages,r as packedGaussianSizeInU32,t as splatAtlasTextureWidth,o as splatPageSizeInU32,h as splatPageSizeInU32WithoutHeader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{makeScheduleFunction as s}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as r}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatOrderTexture as t}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as i}from"./GaussianSplatTextureAtlas.js";class a{constructor(e){this.visibleGaussians=0,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._renderer=e,this._orderTexture=new t(this._renderer.renderingContext),this._textureAtlas=new i(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache);const{resourceController:a}=this._renderer.view;this._workerHandle=new r(s(a))}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get visibleGaussianTiles(){return this._visibleGaussianTiles}updateGaussianVisibility(e){this._visibleGaussianTiles=e,this.requestSort()}requestSort(){this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>{this._isSorting=!1,this._pendingSortTask&&this.requestSort()}).catch(()=>{this._isSorting=!1,this._pendingSortTask&&this.requestSort()}))}destroy(){this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._orderTexture.destroy()}_clearBuffersAndTextures(){this._bufferCapacity=0,this._orderTexture.clear(),this._textureAtlas.clear()}_ensureBufferCapacity(s){if(this._bufferCapacity<s){const r=Math.ceil(s*e);this._atlasIndicesBuffer=new Uint32Array(r),this._sortedAtlasIndicesBuffer=new Uint32Array(r),this._bufferCapacity=r}}async _sortOnWorker(){let e=0;if(this._visibleGaussianTiles.forEach(s=>e+=s.gaussianAtlasIndices.length),0===e||e>a.maxAllowedVisibleGaussians)return this.visibleGaussians=0,this._clearBuffersAndTextures(),void this._renderer.requestRender(1);this._ensureBufferCapacity(e),this._textureAtlas.ensureTextureAtlas();const s=this._renderer.camera.ray.direction,r=s[0],t=s[1],i=s[2],n=1/Math.sqrt(r*r+t*t+i*i),o=r*n,l=t*n,u=i*n,h=this._atlasIndicesBuffer.subarray(0,e),d=new Float64Array(e);let _=0;this._visibleGaussianTiles.forEach(e=>{const s=e.gaussianAtlasIndices,r=e.positions;for(let t=0;t<s.length;t++){h[_]=s[t];const e=3*t,i=r[e],a=r[e+1],n=r[e+2];d[_]=i*o+a*l+n*u,_++}});const c=new Uint32Array(e);for(let a=0;a<e;a++)c[a]=a;const f={distances:d,sortOrderIndices:c};await(this._workerHandle?.sort(f).then(s=>{const r=this._sortedAtlasIndicesBuffer.subarray(0,e);for(let t=0;t<e;t++)r[t]=h[s.sortedOrderIndices[t]];this._orderTexture.setData(r,e),this.visibleGaussians=e,this._renderer.requestRender(1)}))}static{this.maxAllowedVisibleGaussians=4194304}}export{a as GaussianSplatDataStore};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as r}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as s,SizedPixelFormat as i}from"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{TextureDescriptor as o}from"../../../webgl/TextureDescriptor.js";class a{constructor(e){this.texture=null,this._orderTextureCapacity=0,this._rctx=e}ensureCapacity(t){if(this._orderTextureCapacity<t){this.texture?.dispose();const a=Math.ceil(t*e),c=this._evalTextureSize(a),u=c[0]*c[1];this._orderBuffer=new Uint32Array(u);const h=new o;h.height=c[0],h.width=c[1],h.pixelFormat=36244,h.dataType=s.UNSIGNED_INT,h.internalFormat=i.R32UI,h.wrapMode=33071,h.samplingMode=9728,this.texture=new r(this._rctx,h),this._orderTextureCapacity=u}}setData(e,t){this.ensureCapacity(t),this._orderBuffer?.set(e),this.texture?.setData(this._orderBuffer)}clear(){this._orderTextureCapacity=0,this.texture?.dispose(),this.texture=null}destroy(){this.texture?.dispose()}_evalTextureSize(e){const r=Math.ceil(Math.sqrt(e)),s=Math.ceil(e/r);return t(r,s)}}export{a as GaussianSplatOrderTexture};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import"../../../webgl/BufferObject.js";import{FramebufferObject as e}from"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as r}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as s,SizedPixelFormat as a}from"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{initialSplatAtlasTextureHeight as i,GaussianSplatAtlasPages as o,splatAtlasTextureWidth as l,elementsPerSplatPage as h}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class p{constructor(t,e,r){this._splatAtlasTextureHeight=i,this.texture=null,this._rctx=t,this._fboCache=r,this.pageAllocator=new o,this._cache=e.newCache("gaussian texture cache",t=>t.dispose())}ensureTextureAtlas(){if(this.texture)return;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=l,e.pixelFormat=36249,e.dataType=s.UNSIGNED_INT,e.internalFormat=a.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,this.texture=new r(this._rctx,e),this._updatePageAllocator()}growTextureAtlas(){if(!this.texture)return void this.ensureTextureAtlas();const r=Math.floor(this._splatAtlasTextureHeight*t),s=new e(this._rctx,this.texture),a=this._fboCache.acquire(l,r,"gaussian splat atlas resize",11);this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,l,this._splatAtlasTextureHeight,0,0,l,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=a.fbo?.detachColorTexture(),a.dispose(),this._splatAtlasTextureHeight=r,this._updatePageAllocator()}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&(this.growTextureAtlas(),t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,r){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,h,1,r)}_updatePageAllocator(){const t=l*this._splatAtlasTextureHeight/h;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this.texture?.dispose()}}export{p as GaussianSplatTextureAtlas};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{splatPageSizeInU32 as i}from"./GaussianSplatAtlasPages.js";class t{constructor(t,a,e,o,h,r,l){this.handle=t,this.obb=a,this.gaussianAtlasIndices=e,this.pageIds=o,this.positions=h,this.squaredScales=r,this.maxScale=l,this.isVisible=!1,this.usedMemory=s(this.gaussianAtlasIndices,this.positions,this.squaredScales)+this.pageIds.length*i*4}}export{t as GaussianTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{Cyclical as r,cyclicalPI as s}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as i,deg2rad as a}from"../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as o,sync as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as u,d as p,c as m,j as y}from"../../../chunks/vec32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as _,c as f,h as v}from"../../../chunks/vec42.js";import{fromValues as x,create as S}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as R}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as w}from"../../../geometry/projection/projectVectorToVector.js";import{create as O,width as P,center as T,height as D,copy as M,intersection as b,contains as j,intersects as I,offset as C}from"../../../geometry/support/aaBoundingRect.js";import{create as E,wrap as U}from"../../../geometry/support/ray.js";import{l as A,b as q,t as V}from"../../../chunks/sphere.js";import{angleAroundAxis as F}from"../../../geometry/support/vector.js";import{y2lat as G}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as H}from"../state/utils/viewUtils.js";import{debugFlags as L}from"../support/debugFlags.js";import{DebugPoint as z}from"../support/debugUtils.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{Intersector as B}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as Y}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as N,ensureTextureSize as X}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as K}from"../../support/Scheduler.js";import{Yield as Q}from"../../support/Yield.js";const $=1.3,ee=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let te,re=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new B(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([o(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),o(()=>e.state.camera.pixelRatio,t),o(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.terrainSurface.requestRender()),o(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),o(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),l),this.terrainSurface.on("elevation-change",()=>this.setPlacementDirty()),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(J.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,n(this.renderer)),te&&(te.hide(),te=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=e.isWebMercator?new r(-20037508.342787,20037508.342787):new r(-180,180))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||L.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&(this.terrainSurface.ready||!this.terrainSurface.enabled)}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?R(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return $/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.terrainSurface.enabled&&this.terrainSurface.suspended}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(){return this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new Y({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Q;const s=this._computeOverlayHeight(t);this._computeOverlayExtents(t,s,oe),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,oe.stretch);const i=this._updateOverlay(0,oe.inner,s,1*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel),a=P(oe.inner)/P(oe.outer),n=this._updateOverlay(1,oe.outer,s,a*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel);1!==i&&1!==n||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.updateOverlayParameters(r)),0===i&&0===n||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s)),{maxPreferredTexturePixels:a,maxTextureSize:n}=this.view.stage.renderView.renderingContext.parameters,o=.5*n;return N(X({width:i,height:i},{maxPreferredTexturePixels:2*a,maxTextureSize:o})[1],o)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return 0;const a=this.renderer.overlays[e],n=a.mapUnitsPerPixel;if(a.mapUnitsPerPixel=i,a.pixelRatio=s,se(t,a.extent)&&r===a.resolution)return n===i?0:2;a.setExtent(t),a.resolution=r;const o=T(a.extent);return a.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),1}updateOverlayParameters(e){this.terrainSurface.allTiles.forAll(e=>this.updateTileOverlayParameters(e)),this.terrainSurface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,0,t),this._setTileOverlayData(i,1,t)):(this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],s=this.renderer.overlays[1],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=P(s),a=D(s);let n=e[0];if(this._longitudeCyclical){n=this._longitudeCyclical.minimalMonotonic(s[0],n);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);n>t&&(n=t-(e[2]-e[0]))}r.setScale(t,P(e)/i,D(e)/a),r.setOffset(t,(n-s[0])/i,(e[1]-s[1])/a)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(K)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const a=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,ce,t,r);if(null==a)return!1;const n=a.origin,o=u(ne,a.origin,a.direction);this._groundIntersector.reset(n,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,n,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let r=.5;const a=.55,n=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:n+l,e.aboveGround?n-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=ne;A(q(V,R(this.view.spatialReference).radius+h),U(e.eye,e.viewForward),t),p(t,t,e.eye);const i=s.normalize(F(e.viewForward,t,e.viewRight))/e.fovY+.5,n=i<=0||i>=1?.5:a;r=c?n*i:i+n*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),s=Math.tan(t),n=x(0,s,1,0),o=_(n,n,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);r=1===l||0===l?.5:c?l*a:1-(1-l)*a}return this._intersectGroundFromView(e,.5,r,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,i=g();this._findHorizonBasedPointOfInterest(e,i)||m(i,s),L.OVERLAY_SHOW_CENTER?(null==te&&(te=new z(this.view.graphics,"red")),te.show(i,this._renderSR)):null!=te&&te.hide();const n=Math.max(.1,y(e.eye,i)),o=H(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||w(i,this._renderSR,i,this._spatialReference);const l=this.terrainSurface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,c=h&&this._spatialReference?1/R(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,p=e.perScreenPixelRatio/u*n*c;r.mapUnitsPerPixel=p/this.worldToPCSRatio,r.stretch=this._overlayStretch;let _=t*p/2*r.stretch,x=!1,S=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(_/=Math.cos(G(i[1])),S=l[3]):(x=!0,_/=R(this._spatialReference).metersPerDegree,S=90),_>=S&&(_=S,i[1]=0,this._spatialReference.isWebMercator&&(i[0]=0)));let O=1;x&&(O=1/Math.max(.2,Math.cos(Math.abs(a(i[1])))),_*O>180&&(O=180/_),r.mapUnitsPerPixel*=O);const T=Math.log(2)/12;_=Math.exp(Math.round(Math.log(_)/T)*T);const D=_*O,I=32,C=.5*t/(I*D),E=.5*t/(I*_);i[0]=Math.round(i[0]*C)/C,i[1]=Math.round(i[1]*E)/E;const U=r.inner;U[0]=i[0]-D,U[1]=i[1]-_,U[2]=i[0]+D,U[3]=i[1]+_,this._isSpherical&&this._shiftExtentToFitBounds(U,1/0,S);const A=r.outer;if(6*D>P(l))M(A,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)A[0]=U[0]-D,A[1]=U[1]-_,A[2]=U[2]+D,A[3]=U[3]+_;else{w(e.eye,this._renderSR,ne,this._spatialReference),d(ae,i,ne);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(ae,ee[r],2*_),ae[0]*=O,ae[2]*=O,v(A,U,ae)}}if(this._isSpherical)A[0]=this._longitudeCyclical.clamp(A[0]),A[2]=this._longitudeCyclical.clamp(A[2]),A[1]=Math.max(A[1],-S),A[3]=Math.min(A[3],S);else{const e=b(U,l,le),t=b(A,l,he);j(e,t)&&(A[2]=A[0],A[3]=A[1])}const q=Math.abs(U[2]-U[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,q),r.pixelRatioAdjustment=r.mapUnitsPerPixel/q}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&this.updateOverlayParameters(1),this.terrainSurface.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):I(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:j(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),C(e,s,i)}get test(){}};function se(e,t){const r=1e-5,s=L.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],re.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],re.prototype,"readyToRun",null),e([h()],re.prototype,"_placementDirty",void 0),e([h()],re.prototype,"_contentUpdated",void 0),e([h()],re.prototype,"_isSpherical",null),e([h()],re.prototype,"worldToPCSRatio",null),e([h()],re.prototype,"renderer",void 0),e([h({constructOnly:!0})],re.prototype,"view",void 0),e([h({constructOnly:!0})],re.prototype,"terrainSurface",void 0),e([h()],re.prototype,"suspended",null),e([h()],re.prototype,"updating",null),re=e([c("esri.views.3d.terrain.OverlayManager")],re);class ie{constructor(){this.inner=O(),this.outer=O(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=$}}const ae=S(),ne=g(),oe=new ie,le=O(),he=O(),ce=E();export{re as OverlayManager};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{cyclicalPI as r}from"../../../core/Cyclical.js";import"../../../core/has.js";import{clamp as s,deg2rad as i}from"../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{watch as n,sync as o}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as d,d as u,c as p,j as m}from"../../../chunks/vec32.js";import{create as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as g,c as _,h as f}from"../../../chunks/vec42.js";import{fromValues as v,create as x}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as S}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as R}from"../../../geometry/projection/projectVectorToVector.js";import{create as w,width as O,center as P,height as T,copy as D,intersection as M,contains as j,intersects as b,offset as I}from"../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as C}from"../../../geometry/support/normalizeUtils.js";import{create as U,wrap as E}from"../../../geometry/support/ray.js";import{l as A,b as q,t as V}from"../../../chunks/sphere.js";import{angleAroundAxis as F}from"../../../geometry/support/vector.js";import{y2lat as G}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as H}from"../state/utils/viewUtils.js";import{debugFlags as z}from"../support/debugFlags.js";import{DebugPoint as L}from"../support/debugUtils.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{Intersector as B}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as Y}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as N,ensureTextureSize as X}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as K}from"../../support/Scheduler.js";import{Yield as Q}from"../../support/Yield.js";const $=1.3,ee=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let te,re=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new B(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([n(()=>this.renderer.hasHighlights,t),this.renderer.events.on("has-water",()=>e.stage?.renderer.updateHasFlags()),this.renderer.events.on("content-changed",t),n(()=>e.state.camera.pixelRatio,t),n(()=>e.state.alignPixelEnabled,t),this.renderer.events.on("textures-disposed",()=>this.terrainSurface.requestRender()),n(()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location],()=>this.setPlacementDirty()),n(()=>[e.state?.pixelRatio,e.state?.contentPixelRatio],()=>this.setPlacementDirty(),o),this.terrainSurface.on("elevation-change",()=>this.setPlacementDirty()),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(J.OVERLAY,this)]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null,a(this.renderer)),te&&(te.hide(),te=null),this.renderer=null}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=C(e))):this.renderer.disposeOverlays()}get readyToRun(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||z.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&(this.terrainSurface.ready||!this.terrainSurface.enabled)}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?S(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return $/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.terrainSurface.enabled&&this.terrainSurface.suspended}get updating(){return this.readyToRun||!!this.renderer?.updating||this._contentUpdated}render(){return this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.precompileShaders(this.view.state)?this._drawOverlays():null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("readyToRun")}registerGeometryDrapeSource(e){const t=new Y({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("readyToRun"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this.updateOverlays(e,this.view.state.contentCamera,1)}updateOverlays(e,t,r){if(!this._spatialReference)return Q;const s=this._computeOverlayHeight(t);this._computeOverlayExtents(t,s,oe),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,oe.stretch);const i=this._updateOverlay(0,oe.inner,s,1*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel),a=O(oe.inner)/O(oe.outer),n=this._updateOverlay(1,oe.outer,s,a*oe.pixelRatioAdjustment,oe.mapUnitsPerPixel);1!==i&&1!==n||(this._drapeSources.forEach(e=>this._updateDrapeSourceExtent(e)),this.updateOverlayParameters(r)),0===i&&0===n||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayHeight(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s)),{maxPreferredTexturePixels:a,maxTextureSize:n}=this.view.stage.renderView.renderingContext.parameters,o=.5*n;return N(X({width:i,height:i},{maxPreferredTexturePixels:2*a,maxTextureSize:o})[1],o)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return 0;const a=this.renderer.overlays[e],n=a.mapUnitsPerPixel;if(a.mapUnitsPerPixel=i,a.pixelRatio=s,se(t,a.extent)&&r===a.resolution)return n===i?0:2;a.setExtent(t),a.resolution=r;const o=P(a.extent);return a.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),1}updateOverlayParameters(e){this.terrainSurface.allTiles.forAll(e=>this.updateTileOverlayParameters(e)),this.terrainSurface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,0,t),this._setTileOverlayData(i,1,t)):(this._clearTileOverlayData(0,t),this._clearTileOverlayData(1,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[0],s=this.renderer.overlays[1],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=O(s),a=T(s);let n=e[0];if(this._longitudeCyclical){n=this._longitudeCyclical.minimalMonotonic(s[0],n);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);n>t&&(n=t-(e[2]-e[0]))}r.setScale(t,O(e)/i,T(e)/a),r.setOffset(t,(n-s[0])/i,(e[1]-s[1])/a)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(K)}requestRender(e=1){this.renderer.hasOverlays?(1===e?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const a=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,ce,t,r);if(null==a)return!1;const n=a.origin,o=d(ne,a.origin,a.direction);this._groundIntersector.reset(n,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,n,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let i=.5;const a=.55,n=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=s(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:n+l,e.aboveGround?n-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=ne;A(q(V,S(this.view.spatialReference).radius+h),E(e.eye,e.viewForward),t),u(t,t,e.eye);const s=r.normalize(F(e.viewForward,t,e.viewRight))/e.fovY+.5,n=s<=0||s>=1?.5:a;i=c?n*s:s+n*(1-s)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),r=Math.tan(t),n=v(0,r,1,0),o=g(n,n,e.projectionMatrix)[1],l=s(.5+.5*o,0,1);i=1===l||0===l?.5:c?l*a:1-(1-l)*a}return this._intersectGroundFromView(e,.5,i,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,a=y();this._findHorizonBasedPointOfInterest(e,a)||p(a,s),z.OVERLAY_SHOW_CENTER?(null==te&&(te=new L(this.view.graphics,"red")),te.show(a,this._renderSR)):null!=te&&te.hide();const n=Math.max(.1,m(e.eye,a)),o=H(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||R(a,this._renderSR,a,this._spatialReference);const l=this.terrainSurface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,d=h&&this._spatialReference?1/S(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,g=e.perScreenPixelRatio/u*n*d;r.mapUnitsPerPixel=g/this.worldToPCSRatio,r.stretch=this._overlayStretch;let v=t*g/2*r.stretch,x=!1,w=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(v/=Math.cos(G(a[1])),w=l[3]):(x=!0,v/=S(this._spatialReference).metersPerDegree,w=90),v>=w&&(v=w,a[1]=0,this._spatialReference.isWebMercator&&(a[0]=0)));let P=1;x&&(P=1/Math.max(.2,Math.cos(Math.abs(i(a[1])))),v*P>180&&(P=180/v),r.mapUnitsPerPixel*=P);const T=Math.log(2)/12;v=Math.exp(Math.round(Math.log(v)/T)*T);const b=v*P,I=32,C=.5*t/(I*b),U=.5*t/(I*v);a[0]=Math.round(a[0]*C)/C,a[1]=Math.round(a[1]*U)/U;const E=r.inner;E[0]=a[0]-b,E[1]=a[1]-v,E[2]=a[0]+b,E[3]=a[1]+v,this._isSpherical&&this._shiftExtentToFitBounds(E,1/0,w);const A=r.outer;if(6*b>O(l))D(A,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)A[0]=E[0]-b,A[1]=E[1]-v,A[2]=E[2]+b,A[3]=E[3]+v;else{R(e.eye,this._renderSR,ne,this._spatialReference),c(ae,a,ne);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));_(ae,ee[r],2*v),ae[0]*=P,ae[2]*=P,f(A,E,ae)}}if(this._isSpherical)A[0]=this._longitudeCyclical.clamp(A[0]),A[2]=this._longitudeCyclical.clamp(A[2]),A[1]=Math.max(A[1],-w),A[3]=Math.min(A[3],w);else{const e=M(E,l,le),t=M(A,l,he);j(e,t)&&(A[2]=A[0],A[3]=A[1])}const q=Math.abs(E[2]-E[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,q),r.pixelRatioAdjustment=r.mapUnitsPerPixel/q}_drawOverlays(e=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const t=!this._drawTexturesDirty&&this._drawTexturesAnimateDirty?0:1;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const r=this.renderer.computeValidity();this.renderer.releaseRenderTargets(t),this.renderer.drawOverlays(e,t);return r!==this.renderer.computeValidity()&&this.updateOverlayParameters(1),this.terrainSurface.requestRender(t),1===t&&this.terrainSurface.requestUpdate(),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):b(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:j(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),I(e,s,i)}get test(){}};function se(e,t){const r=1e-5,s=z.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([l()],re.prototype,"_spatialReference",void 0),e([l({readOnly:!0})],re.prototype,"readyToRun",null),e([l()],re.prototype,"_placementDirty",void 0),e([l()],re.prototype,"_contentUpdated",void 0),e([l()],re.prototype,"_isSpherical",null),e([l()],re.prototype,"worldToPCSRatio",null),e([l()],re.prototype,"renderer",void 0),e([l({constructOnly:!0})],re.prototype,"view",void 0),e([l({constructOnly:!0})],re.prototype,"terrainSurface",void 0),e([l()],re.prototype,"suspended",null),e([l()],re.prototype,"updating",null),re=e([h("esri.views.3d.terrain.OverlayManager")],re);class ie{constructor(){this.inner=w(),this.outer=w(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=$}}const ae=x(),ne=y(),oe=new ie,le=w(),he=w(),ce=U();export{re as OverlayManager};