@arcgis/core 4.28.0-next.20230821 → 4.28.0-next.20230823

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 (668) hide show
  1. package/Basemap.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/arcade/functions/geomasync.js +1 -1
  4. package/arcade/portalUtils.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0746319459dbcd3ab6f7.js +1 -0
  7. package/assets/esri/core/workers/chunks/{587437526ea77f764986.js → 0759d4ab9695096d2bbd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d0c4367a197b193e95d4.js → 10c014a6d8767ae8a666.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{5ffabd1a90c5b08109aa.js → 196937631ac20795e0ae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e05b54a0b834b4e4268e.js → 1c2b69dfcd0db58150e2.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1c2f7c95825fdac790be.js +1 -0
  12. package/assets/esri/core/workers/chunks/1f9c80815f90fd0886d7.js +1 -0
  13. package/assets/esri/core/workers/chunks/217910f88fe2c03e6bdd.js +1 -0
  14. package/assets/esri/core/workers/chunks/238966b2fc6cc3dfcc05.js +1 -0
  15. package/assets/esri/core/workers/chunks/2c9f709d64954b3c1650.js +1 -0
  16. package/assets/esri/core/workers/chunks/35faede04d4539aab6e8.js +1 -0
  17. package/assets/esri/core/workers/chunks/3e3edcbacf8eaf275b97.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b78dc6cbe14e5817b4d9.js → 4968018bc693c053fdd2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{c35b850fbfcb28133235.js → 49a1ba3e7ea204adeddb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{12b8fe0374fa9ab4ca09.js → 49cf3ae224f56f45f65b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5330040eeacc9c03fbdb.js +1 -0
  22. package/assets/esri/core/workers/chunks/54aaa21144431b29b6ed.js +1 -0
  23. package/assets/esri/core/workers/chunks/{6c40f16e6d10321295d8.js → 5b13d28cf5efc312a21c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{d6c96a20e9640b433719.js → 67c6618339d323460d45.js} +57 -57
  25. package/assets/esri/core/workers/chunks/{dd86f43505b636eb41c0.js → 7714c16f9c8860efd461.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{752d389c7bdcbe7004dc.js → 83e0af5522a672c2c73b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{873111ddf4813cdd4903.js → 872d0d4bf364be43a92e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/8a784ddd5607f1ddbb5b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0cad2b991d0d0fd07846.js → 8c9c4162617f31e3f5f2.js} +1 -1
  30. package/assets/esri/core/workers/chunks/8db3ee2931be5cca3f5e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{fd3920159ab9748402a2.js → 92350664e2719a9e860e.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{ff755962fd1c771f5be5.js → a3b461174984a1cb92b3.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{dd4c6d000222798a0317.js → a47aff9c97c5ce52d0dc.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{028534e3d4e13c9ea687.js → a645f08a7678f2ca037c.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{d9fe6cfbc9ad2920ca9c.js → aca45e54ec925002df9a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{40ff0e7c948615b8bfc0.js → b07d32a60307d04391fc.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fdc703330bf194a48e0e.js → b086e798f43dacb0175f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/bd0b9647880cbbec95e2.js +1 -0
  39. package/assets/esri/core/workers/chunks/{ab420bacdd63ee8fbd8b.js → bf9b5e2803a5444bd944.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c58ca2685eb7e559f428.js → c0a2a737a3085690afc5.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e04e8af4224fff8c3ec3.js → c34615c0b7ad83d1ad24.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{05ab09713d599687afa3.js → d105ee2e394e2c48303c.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{ef03b78659c72de93076.js → d183144fa504064d23d3.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{4f5207abb034375927c7.js → d8495c6dcd4d9bec8dd6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1a485d63330f5e7fe4e3.js → dba61fa8cbb57dde54b2.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{8a306e3aa210861b8c17.js → deb0bd575c63d9dbcde5.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d0a2f9ca338b60f2ba2a.js → e302fe771d92ccf945a3.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{cb0a5bc6deaa98026bb5.js → ed0dea88b2865fc6e06b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/ed733eea5d065131b159.js +1 -0
  50. package/assets/esri/core/workers/chunks/{1c51c52fb2233153d7ae.js → f3ec53ee9567bb7e4d2f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{4922a0fed7cbc6895882.js → f701a5afa1b730c51a49.js} +1 -1
  52. package/assets/esri/t9n/common.json +1 -1
  53. package/assets/esri/t9n/common_ar.json +1 -1
  54. package/assets/esri/t9n/common_bg.json +1 -1
  55. package/assets/esri/t9n/common_ca.json +1 -1
  56. package/assets/esri/t9n/common_cs.json +1 -1
  57. package/assets/esri/t9n/common_da.json +1 -1
  58. package/assets/esri/t9n/common_de.json +1 -1
  59. package/assets/esri/t9n/common_el.json +1 -1
  60. package/assets/esri/t9n/common_en.json +1 -1
  61. package/assets/esri/t9n/common_es.json +1 -1
  62. package/assets/esri/t9n/common_et.json +1 -1
  63. package/assets/esri/t9n/common_fi.json +1 -1
  64. package/assets/esri/t9n/common_fr.json +1 -1
  65. package/assets/esri/t9n/common_he.json +1 -1
  66. package/assets/esri/t9n/common_hr.json +1 -1
  67. package/assets/esri/t9n/common_hu.json +1 -1
  68. package/assets/esri/t9n/common_id.json +1 -1
  69. package/assets/esri/t9n/common_it.json +1 -1
  70. package/assets/esri/t9n/common_ja.json +1 -1
  71. package/assets/esri/t9n/common_ko.json +1 -1
  72. package/assets/esri/t9n/common_lt.json +1 -1
  73. package/assets/esri/t9n/common_lv.json +1 -1
  74. package/assets/esri/t9n/common_nb.json +1 -1
  75. package/assets/esri/t9n/common_nl.json +1 -1
  76. package/assets/esri/t9n/common_pl.json +1 -1
  77. package/assets/esri/t9n/common_pt-BR.json +1 -1
  78. package/assets/esri/t9n/common_pt-PT.json +1 -1
  79. package/assets/esri/t9n/common_ro.json +1 -1
  80. package/assets/esri/t9n/common_ru.json +1 -1
  81. package/assets/esri/t9n/common_sk.json +1 -1
  82. package/assets/esri/t9n/common_sl.json +1 -1
  83. package/assets/esri/t9n/common_sr.json +1 -1
  84. package/assets/esri/t9n/common_sv.json +1 -1
  85. package/assets/esri/t9n/common_th.json +1 -1
  86. package/assets/esri/t9n/common_tr.json +1 -1
  87. package/assets/esri/t9n/common_uk.json +1 -1
  88. package/assets/esri/t9n/common_vi.json +1 -1
  89. package/assets/esri/t9n/common_zh-CN.json +1 -1
  90. package/assets/esri/t9n/common_zh-TW.json +1 -1
  91. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +10 -17
  92. package/assets/esri/themes/dark/main.css +1 -1
  93. package/assets/esri/themes/light/main.css +1 -1
  94. package/assets/esri/themes/light/view.css +1 -1
  95. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ar.json +1 -0
  96. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bg.json +1 -0
  97. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bs.json +1 -0
  98. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ca.json +1 -0
  99. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_cs.json +1 -0
  100. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_da.json +1 -0
  101. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_de.json +1 -0
  102. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_el.json +1 -0
  103. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_es.json +1 -0
  104. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_et.json +1 -0
  105. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fi.json +1 -0
  106. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fr.json +1 -0
  107. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_he.json +1 -0
  108. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hr.json +1 -0
  109. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hu.json +1 -0
  110. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_id.json +1 -0
  111. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_it.json +1 -0
  112. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ja.json +1 -0
  113. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ko.json +1 -0
  114. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lt.json +1 -0
  115. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lv.json +1 -0
  116. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nb.json +1 -0
  117. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nl.json +1 -0
  118. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pl.json +1 -0
  119. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-BR.json +1 -0
  120. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-PT.json +1 -0
  121. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ro.json +1 -0
  122. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ru.json +1 -0
  123. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sk.json +1 -0
  124. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sl.json +1 -0
  125. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sr.json +1 -0
  126. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sv.json +1 -0
  127. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_th.json +1 -0
  128. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_tr.json +1 -0
  129. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_uk.json +1 -0
  130. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_vi.json +1 -0
  131. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-CN.json +1 -0
  132. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-HK.json +1 -0
  133. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-TW.json +1 -0
  134. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  135. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  136. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  137. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  138. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  139. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  173. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  174. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  175. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  176. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  177. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  178. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  179. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  180. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  181. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  182. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  183. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  184. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  185. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  186. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  187. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  188. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  189. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  190. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  191. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  192. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  193. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  194. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  195. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  196. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  197. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  198. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  199. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  200. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  201. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  202. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  203. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  204. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  205. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  206. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  207. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  208. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  209. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  210. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  211. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  212. package/chunks/ChapmanAtmosphere.glsl.js +1 -1
  213. package/chunks/Clouds.glsl.js +1 -1
  214. package/chunks/CloudsComposition.glsl.js +2 -2
  215. package/chunks/ComponentShader.glsl.js +36 -36
  216. package/chunks/Fog.glsl.js +1 -1
  217. package/chunks/LaserlinePath.glsl.js +1 -1
  218. package/chunks/Laserlines.glsl.js +1 -1
  219. package/chunks/LineSeries.js +1 -1
  220. package/chunks/NativeLine.glsl.js +8 -20
  221. package/chunks/PointRenderer.glsl.js +1 -1
  222. package/chunks/Precipitation.glsl.js +2 -2
  223. package/chunks/SSAOBlur.glsl.js +1 -1
  224. package/chunks/ShadowCastAccumulate.glsl.js +1 -1
  225. package/chunks/ShadowCastVisualize.glsl.js +2 -2
  226. package/chunks/ShadowHighlight.glsl.js +1 -1
  227. package/chunks/Stars.glsl.js +1 -1
  228. package/chunks/Terrain.glsl.js +35 -35
  229. package/chunks/TextureOnly.glsl.js +1 -1
  230. package/chunks/Theme.js +1 -1
  231. package/chunks/boundedPlane.js +1 -1
  232. package/chunks/cameraUtilsPlanar.js +1 -1
  233. package/chunks/cameraUtilsSpherical.js +1 -1
  234. package/chunks/chartUtilsAm5.js +1 -1
  235. package/chunks/mat3.js +1 -1
  236. package/chunks/mat3f64.js +1 -1
  237. package/chunks/mat4.js +1 -1
  238. package/chunks/mat4f64.js +1 -1
  239. package/chunks/quat.js +1 -1
  240. package/chunks/quat2.js +1 -1
  241. package/chunks/quatf64.js +1 -1
  242. package/chunks/sphere.js +1 -1
  243. package/chunks/terrainUtilsPlanar.js +1 -1
  244. package/chunks/vec3.js +1 -1
  245. package/chunks/vec3f64.js +1 -1
  246. package/chunks/vec4.js +1 -1
  247. package/chunks/vec4f64.js +1 -1
  248. package/core/VectorStack.js +1 -1
  249. package/core/accessorSupport/decorators/persistable.js +1 -1
  250. package/core/accessorSupport/testSupport.js +1 -1
  251. package/core/colorUtils.js +1 -1
  252. package/core/libs/gl-matrix-2/factories/mat3f64.js +1 -1
  253. package/core/libs/gl-matrix-2/factories/mat4f64.js +1 -1
  254. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  255. package/core/libs/gl-matrix-2/factories/vec3f64.js +1 -1
  256. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  257. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  258. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  259. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  260. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  261. package/core/mathUtils.js +1 -1
  262. package/core/perspectiveUtils.js +1 -1
  263. package/form/elements/inputs/DatePickerInput.d.ts +4 -0
  264. package/form/elements/inputs/DatePickerInput.js +5 -0
  265. package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +4 -0
  266. package/form/elements/inputs/DateTimeOffsetPickerInput.js +5 -0
  267. package/form/elements/inputs/TimePickerInput.d.ts +4 -0
  268. package/form/elements/inputs/TimePickerInput.js +5 -0
  269. package/form/elements/support/inputs.js +1 -1
  270. package/geometry/projection/computeTranslationToOriginAndRotation.js +1 -1
  271. package/geometry/projection/projectDirection.js +1 -1
  272. package/geometry/support/MeshTransform.js +1 -1
  273. package/geometry/support/axisAngle.js +1 -1
  274. package/geometry/support/axisAngleDegrees.js +1 -1
  275. package/geometry/support/clipRay.js +1 -1
  276. package/geometry/support/coordinateSystem.js +1 -1
  277. package/geometry/support/frustum.js +1 -1
  278. package/geometry/support/lineSegment.js +1 -1
  279. package/geometry/support/meshUtils/centerAt.js +1 -1
  280. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  281. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  282. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  283. package/geometry/support/meshUtils/georeference.js +1 -1
  284. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  285. package/geometry/support/meshUtils/merge.js +1 -1
  286. package/geometry/support/meshUtils/offset.js +1 -1
  287. package/geometry/support/meshUtils/primitives.js +1 -1
  288. package/geometry/support/meshUtils/projection.js +1 -1
  289. package/geometry/support/meshUtils/rotate.js +1 -1
  290. package/geometry/support/meshUtils/scale.js +1 -1
  291. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  292. package/geometry/support/plane.js +1 -1
  293. package/geometry/support/ray.js +1 -1
  294. package/geometry/support/triangle.js +1 -1
  295. package/geometry/support/vector.js +1 -1
  296. package/interfaces.d.ts +405 -7
  297. package/layers/VoxelWasmPerSceneView.js +1 -1
  298. package/layers/mixins/SceneService.js +1 -1
  299. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  300. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  301. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  302. package/layers/orientedImagery/transformations/utils.js +1 -1
  303. package/layers/support/ControlPointsGeoreference.js +1 -1
  304. package/layers/support/ImageElement.js +1 -1
  305. package/layers/support/SceneFilter.js +1 -1
  306. package/layers/support/layerUtils.js +1 -1
  307. package/layers/video/VideoCameraSensorModel.js +1 -1
  308. package/layers/voxel/VoxelVolume.js +1 -1
  309. package/layers/voxel/voxelPlaneUtils.js +1 -1
  310. package/package.json +1 -1
  311. package/portal/support/resourceExtension.js +1 -1
  312. package/portal/support/resourceUtils.js +1 -1
  313. package/portal/support/utils.js +5 -0
  314. package/smartMapping/popup/support/utils.js +1 -1
  315. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  316. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  317. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  318. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  319. package/support/revision.js +1 -1
  320. package/symbols/cim/CIMImageColorSubstitutionHelper.js +1 -1
  321. package/symbols/support/previewSymbol3D.js +1 -1
  322. package/views/2d/ViewState.js +1 -1
  323. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  324. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  325. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  326. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  327. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  328. package/views/2d/engine/webgl/Overlay.js +1 -1
  329. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  330. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  331. package/views/2d/engine/webgl/WGLTile.js +1 -1
  332. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  333. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  334. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  335. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  336. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  337. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  338. package/views/2d/layers/support/DebugOverlay.js +1 -1
  339. package/views/2d/navigation/actions/Pan.js +1 -1
  340. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  341. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  342. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  343. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  344. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  345. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  346. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  347. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  348. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  349. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  350. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  351. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  352. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  353. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  354. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  355. package/views/3d/analysis/images/Factory.js +5 -0
  356. package/views/3d/analysis/support/measurementUtils.js +1 -1
  357. package/views/3d/analysis/support/viewUtils.js +1 -1
  358. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  359. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  360. package/views/3d/camera/constraintUtils/altitude.js +1 -1
  361. package/views/3d/camera/constraintUtils/common.js +1 -1
  362. package/views/3d/camera/constraintUtils/distance.js +1 -1
  363. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  364. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  365. package/views/3d/camera/intersectionUtils.js +1 -1
  366. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  367. package/views/3d/environment/CloudsGenerator.js +1 -1
  368. package/views/3d/environment/CloudsParameters.js +1 -1
  369. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  370. package/views/3d/environment/Fog.js +1 -1
  371. package/views/3d/environment/LocalAtmosphere.js +1 -1
  372. package/views/3d/environment/MarsAtmosphere.js +1 -1
  373. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  374. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  375. package/views/3d/environment/Stars.js +1 -1
  376. package/views/3d/environment/StarsTechnique.js +1 -1
  377. package/views/3d/externalRenderers.js +1 -1
  378. package/views/3d/glTF/internal/Resource.js +1 -1
  379. package/views/3d/interactive/Manipulator3D.js +1 -1
  380. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  381. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  382. package/views/3d/interactive/editingTools/lineGraphicVisualElementUtils.js +1 -1
  383. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  384. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  385. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  386. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  387. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  388. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  389. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  390. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  391. package/views/3d/interactive/editingTools/transformGraphic/undoRecords.js +1 -1
  392. package/views/3d/interactive/manipulatorUtils.js +1 -1
  393. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  394. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  395. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  396. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  397. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  398. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  399. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  400. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  401. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  402. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  403. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  404. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  405. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  406. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  407. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  408. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  409. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  410. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  411. package/views/3d/layers/I3SMeshView3D.js +1 -1
  412. package/views/3d/layers/MediaLayerView3D.js +1 -1
  413. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  414. package/views/3d/layers/PointCloudWorker.js +1 -1
  415. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  416. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  417. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  418. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  419. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  420. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  421. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  422. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  423. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  424. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  425. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  426. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  427. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  428. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  429. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  430. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  431. package/views/3d/layers/graphics/LabelParameters.js +1 -1
  432. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  433. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  434. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  435. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  436. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  437. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  438. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  439. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  440. package/views/3d/layers/i3s/I3SProjectionUtil.js +1 -1
  441. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  442. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  443. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  444. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  445. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  446. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  447. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  448. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  449. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  450. package/views/3d/layers/support/edgeUtils.js +1 -1
  451. package/views/3d/layers/support/patternUtils.js +1 -1
  452. package/views/3d/layers/support/uvUtils.js +1 -1
  453. package/views/3d/state/Frustum.js +1 -1
  454. package/views/3d/state/NearFarHeuristic.js +1 -1
  455. package/views/3d/state/ViewStateManager.js +1 -1
  456. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  457. package/views/3d/state/controllers/RotateController.js +1 -1
  458. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  459. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  460. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  461. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  462. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  463. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  464. package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
  465. package/views/3d/state/controllers/momentum/PanSphericalMomentumController.js +1 -1
  466. package/views/3d/state/controllers/momentum/RotationMomentumController.js +1 -1
  467. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  468. package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
  469. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  470. package/views/3d/state/utils/navigationUtils.js +1 -1
  471. package/views/3d/state/utils/viewUtils.js +1 -1
  472. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  473. package/views/3d/support/LaserLineRenderer.js +1 -1
  474. package/views/3d/support/LaserlinePathData.js +1 -1
  475. package/views/3d/support/RenderCoordsHelper.js +1 -1
  476. package/views/3d/support/StreamTextureCollection.js +1 -1
  477. package/views/3d/support/TextureCollection.js +1 -1
  478. package/views/3d/support/cameraUtils.js +1 -1
  479. package/views/3d/support/cameraUtilsInternal.js +1 -1
  480. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  481. package/views/3d/support/geometryUtils/ray.js +1 -1
  482. package/views/3d/support/intersectionUtils.js +1 -1
  483. package/views/3d/support/mathUtils.js +1 -1
  484. package/views/3d/support/orientedBoundingBox.js +1 -1
  485. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  486. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  487. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  488. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  489. package/views/3d/support/sunUtils.js +1 -1
  490. package/views/3d/support/viewpointUtils.js +1 -1
  491. package/views/3d/terrain/Overlay.js +1 -1
  492. package/views/3d/terrain/OverlayContent.js +5 -0
  493. package/views/3d/terrain/OverlayManager.js +1 -1
  494. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchGeometry.js +1 -1
  497. package/views/3d/terrain/PatchRenderData.js +1 -1
  498. package/views/3d/terrain/SphericalPatch.js +1 -1
  499. package/views/3d/terrain/TerrainRenderer.js +1 -1
  500. package/views/3d/terrain/TerrainSurface.js +1 -1
  501. package/views/3d/terrain/TextureReference.js +1 -1
  502. package/views/3d/terrain/Tile.js +1 -1
  503. package/views/3d/terrain/TileCompositor.js +1 -1
  504. package/views/3d/terrain/TileOverlayData.js +1 -1
  505. package/views/3d/terrain/TileRenderInfo.js +1 -1
  506. package/views/3d/terrain/interfaces.js +1 -1
  507. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  508. package/views/3d/webgl-engine/Stage.js +1 -1
  509. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  510. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  511. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  512. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  514. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  515. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  516. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  517. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +1 -1
  518. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  519. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +32 -53
  520. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +6 -6
  521. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  522. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +9 -9
  523. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  524. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  525. package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
  526. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  527. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  528. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  529. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  530. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  531. package/views/3d/webgl-engine/lib/CascadeCamera.js +1 -1
  532. package/views/3d/webgl-engine/lib/ContentObject.js +1 -1
  533. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  534. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  535. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  536. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  537. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  538. package/views/3d/webgl-engine/lib/ITexture.js +5 -0
  539. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  540. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  541. package/views/3d/webgl-engine/lib/LocalOriginManager.js +1 -1
  542. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  543. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  544. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  545. package/views/3d/webgl-engine/lib/Path.js +1 -1
  546. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  547. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  548. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  549. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  550. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  551. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  552. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  553. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  554. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  555. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  556. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  557. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  558. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  559. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderParameters.js +1 -1
  560. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  561. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  562. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  563. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  564. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  565. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  566. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  567. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  568. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  569. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  570. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  571. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  572. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  573. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  574. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  575. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  576. package/views/3d/webgl-engine/materials/LineDrawParameters.js +1 -1
  577. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  578. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  579. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  580. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  581. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  582. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  583. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  584. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  585. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  586. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  587. package/views/3d/webgl-engine/parts/Model.js +1 -1
  588. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  589. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  590. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  591. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  592. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  593. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  594. package/views/GroundView.js +1 -1
  595. package/views/SceneView.js +1 -1
  596. package/views/draw/DrawManipulator.js +1 -1
  597. package/views/draw/support/createUtils.js +1 -1
  598. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  599. package/views/interactive/GraphicManipulator.js +1 -1
  600. package/views/interactive/ManipulatorCollection.js +1 -1
  601. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  602. package/views/interactive/coordinateHelper.js +1 -1
  603. package/views/interactive/dragEventPipeline.js +1 -1
  604. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  605. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  606. package/views/interactive/sketch/constraints.js +1 -1
  607. package/views/interactive/sketch/normalizedPoint.js +1 -1
  608. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  609. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  610. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  611. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  612. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  613. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  614. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  615. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  616. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  617. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  618. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  619. package/views/interactive/support/viewUtils.js +1 -1
  620. package/views/interactive/tooltip/constraintUtils.js +1 -1
  621. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  622. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  623. package/views/navigation/gamepadAndKeyboardUtils.js +1 -1
  624. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  625. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  626. package/views/support/geometry3dUtils.js +1 -1
  627. package/views/support/layerViewUtils.js +1 -1
  628. package/webdoc/support/saveUtils.js +1 -1
  629. package/webscene/Slide.js +1 -1
  630. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  631. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  632. package/widgets/Editor/EditorViewModel.js +1 -1
  633. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  634. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  635. package/widgets/Editor/UpdateWorkflow.js +1 -1
  636. package/widgets/Editor/workflowUtils.js +1 -1
  637. package/widgets/Editor.js +1 -1
  638. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  639. package/widgets/ElevationProfile/support/constants.js +1 -1
  640. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  641. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  642. package/widgets/OrientedImageryViewer.js +1 -1
  643. package/widgets/Sketch.js +1 -1
  644. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +4 -0
  645. package/widgets/smartMapping/BinaryColorSizeSlider.d.ts +4 -0
  646. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  647. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  648. package/widgets/support/templateUtils.js +5 -0
  649. package/assets/esri/core/workers/chunks/19857e5420cdf23c5f2e.js +0 -1
  650. package/assets/esri/core/workers/chunks/26289742b9280f0b5247.js +0 -1
  651. package/assets/esri/core/workers/chunks/46f6b77e586d78aeb75c.js +0 -1
  652. package/assets/esri/core/workers/chunks/4e39252f40bc57be9d12.js +0 -1
  653. package/assets/esri/core/workers/chunks/54513578f735d274a20e.js +0 -1
  654. package/assets/esri/core/workers/chunks/8dab0acdbbd5c282645a.js +0 -1
  655. package/assets/esri/core/workers/chunks/8e4b01a0cb8c8926f2b6.js +0 -1
  656. package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +0 -1
  657. package/assets/esri/core/workers/chunks/b2d4a56197dcabdbae35.js +0 -1
  658. package/assets/esri/core/workers/chunks/be0565d923afba7ca300.js +0 -1
  659. package/assets/esri/core/workers/chunks/c99fa4189a114370b004.js +0 -1
  660. package/assets/esri/core/workers/chunks/daa79c14150c12d8bc3d.js +0 -1
  661. package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +0 -1
  662. package/assets/esri/core/workers/chunks/f67388c4b7103fda6633.js +0 -1
  663. package/views/3d/analysis/Slice/images/Factory.js +0 -5
  664. /package/assets/esri/views/3d/analysis/{Slice/images → images}/heading-rotate.ts.svg +0 -0
  665. /package/assets/esri/views/3d/analysis/{Slice/images → images}/tilt-rotate.ts.svg +0 -0
  666. /package/views/3d/analysis/{Slice/images → images}/generateTextures.js +0 -0
  667. /package/views/3d/analysis/{Slice/images → images}/heading-rotate-svg.js +0 -0
  668. /package/views/3d/analysis/{Slice/images → images}/tilt-rotate-svg.js +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as e}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{t,e as s}from"../../../../../chunks/mat3.js";import{c as i}from"../../../../../chunks/mat3f32.js";import{s as n}from"../../../../../chunks/vec3.js";import{debugFlags as a}from"../../../support/debugFlags.js";import{TwoVectorPosition as o}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as d}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as h}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as l}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as c}from"./interfaces.js";import{EdgeUtilMode as u}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as _}from"../../../../webgl/enums.js";const m=8,g=128,f={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},b={solid:u.SOLID,sketch:u.SKETCH,uber:u.MIXED};class T{constructor(e,t,s){this._rctx=e,this._shaderTechniqueRepository=t,this._configuration=new l,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[c.TRANSPARENT]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r},[c.OPAQUE]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r}},this._renderablesDirty=!1,this._drawParameters=new d,this._settings={...f,...s},this.key=T.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=b[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=e.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=s.spherical}dispose(){this._technique=e(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){if(this._renderablesDirty&&this._sortRenderables(),r!==c.INVISIBLE){const t=this._sortedRenderables[r];t[c.TRANSPARENT].forAll(e),t[c.OPAQUE].forAll(e)}}updateTechnique(e,r){return this._configuration.multipassEnabled=!!e.multipassEnabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=r,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(h,this._configuration,this._technique),this._technique}bindRegularEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!1),e,r)}bindSilhouetteEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!0),e,r)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}_render(e,r,t,s,i,n){n>0&&(this._bindDraw(e,r,s,i),this._rctx.bindVAO(t),this._rctx.drawArraysInstanced(_.TRIANGLE_FAN,0,4,n))}_bindDraw(e,r,i,a){if(this._drawParameters.componentDataTexture=r.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in r.transform)this._lastOriginId!==r.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",r.transform.origin.viewMatrix),this._lastOriginId=r.transform.origin.origin.id),e.setUniformMatrix4fv("model",r.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.transform.origin.origin.vec3;else{const e=new o(r.transform.position),i=t(R,s(R,r.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=r.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=i;const d=a.camera.viewInverseTransposeMatrix;n(this._drawParameters.slicePlaneLocalOrigin,d[3],d[7],d[11])}e.bindDraw(this._drawParameters,a,i)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[c.TRANSPARENT][c.TRANSPARENT].clear(),this._sortedRenderables[c.TRANSPARENT][c.OPAQUE].clear(),this._sortedRenderables[c.OPAQUE][c.TRANSPARENT].clear(),this._sortedRenderables[c.OPAQUE][c.OPAQUE].clear(),this._renderables.forEach((e=>{e.objectTransparency!==c.INVISIBLE&&e.edgeTransparency!==c.INVISIBLE&&this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)}));const e=(e,r)=>"origin"in e.transform?"origin"in r.transform?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[c.TRANSPARENT][c.TRANSPARENT].sort(e),this._sortedRenderables[c.TRANSPARENT][c.OPAQUE].sort(e),this._sortedRenderables[c.OPAQUE][c.TRANSPARENT].sort(e),this._sortedRenderables[c.OPAQUE][c.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const R=i();export{g as EXTENSION_LENGTH_OFFSET,T as EdgeRenderer,m as LINE_WIDTH_FRACTION_FACTOR};
5
+ import{releaseMaybe as e}from"../../../../../core/maybe.js";import r from"../../../../../core/PooledArray.js";import{t,d as s}from"../../../../../chunks/mat3.js";import{c as i}from"../../../../../chunks/mat3f32.js";import{s as n}from"../../../../../chunks/vec3.js";import{debugFlags as a}from"../../../support/debugFlags.js";import{TwoVectorPosition as o}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as d}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as h}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as l}from"./EdgeShaderTechniqueConfiguration.js";import{Transparency as c}from"./interfaces.js";import{EdgeUtilMode as u}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as _}from"../../../../webgl/enums.js";const m=8,g=128,f={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},b={solid:u.SOLID,sketch:u.SKETCH,uber:u.MIXED};class T{constructor(e,t,s){this._rctx=e,this._shaderTechniqueRepository=t,this._configuration=new l,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[c.TRANSPARENT]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r},[c.OPAQUE]:{[c.TRANSPARENT]:new r,[c.OPAQUE]:new r}},this._renderablesDirty=!1,this._drawParameters=new d,this._settings={...f,...s},this.key=T.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:a.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=b[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=e.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=s.spherical}dispose(){this._technique=e(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){if(this._renderablesDirty&&this._sortRenderables(),r!==c.INVISIBLE){const t=this._sortedRenderables[r];t[c.TRANSPARENT].forAll(e),t[c.OPAQUE].forAll(e)}}updateTechnique(e,r){return this._configuration.multipassEnabled=!!e.multipassEnabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=r,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(h,this._configuration,this._technique),this._technique}bindRegularEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!1),e,r)}bindSilhouetteEdges(e,r){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(r,!0),e,r)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}_render(e,r,t,s,i,n){n>0&&(this._bindDraw(e,r,s,i),this._rctx.bindVAO(t),this._rctx.drawArraysInstanced(_.TRIANGLE_FAN,0,4,n))}_bindDraw(e,r,i,a){if(this._drawParameters.componentDataTexture=r.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in r.transform)this._lastOriginId!==r.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",r.transform.origin.viewMatrix),this._lastOriginId=r.transform.origin.origin.id),e.setUniformMatrix4fv("model",r.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.transform.origin.origin.vec3;else{const e=new o(r.transform.position),i=t(R,s(R,r.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=e.low,this._drawParameters.transformWorldFromModelTH=e.high,this._drawParameters.transformWorldFromModelRS=r.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=i;const d=a.camera.viewInverseTransposeMatrix;n(this._drawParameters.slicePlaneLocalOrigin,d[3],d[7],d[11])}e.bindDraw(this._drawParameters,a,i)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[c.TRANSPARENT][c.TRANSPARENT].clear(),this._sortedRenderables[c.TRANSPARENT][c.OPAQUE].clear(),this._sortedRenderables[c.OPAQUE][c.TRANSPARENT].clear(),this._sortedRenderables[c.OPAQUE][c.OPAQUE].clear(),this._renderables.forEach((e=>{e.objectTransparency!==c.INVISIBLE&&e.edgeTransparency!==c.INVISIBLE&&this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)}));const e=(e,r)=>"origin"in e.transform?"origin"in r.transform?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[c.TRANSPARENT][c.TRANSPARENT].sort(e),this._sortedRenderables[c.TRANSPARENT][c.OPAQUE].sort(e),this._sortedRenderables[c.OPAQUE][c.TRANSPARENT].sort(e),this._sortedRenderables[c.OPAQUE][c.OPAQUE].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const R=i();export{g as EXTENSION_LENGTH_OFFSET,T as EdgeRenderer,m as LINE_WIDTH_FRACTION_FACTOR};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{c as r}from"../../../../../chunks/mat3f64.js";import{c as s}from"../../../../../chunks/vec3f64.js";import{VertexPositionPassParameters as o,VertexPositionDrawParameters as t}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";class a extends o{constructor(s,o){super(),this.distanceFalloffFactor=s,this.transparency=o,this.transformNormalViewFromGlobal=r()}}class e extends t{constructor(){super(...arguments),this.transformNormalViewFromGlobal=r(),this.slicePlaneLocalOrigin=s(),this.transformNormalGlobalFromModel=r()}}export{e as EdgeDrawParameters,a as EdgePassParameters};
5
+ import{a as r}from"../../../../../chunks/mat3f64.js";import{c as s}from"../../../../../chunks/vec3f64.js";import{VertexPositionPassParameters as o,VertexPositionDrawParameters as t}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";class a extends o{constructor(s,o){super(),this.distanceFalloffFactor=s,this.transparency=o,this.transformNormalViewFromGlobal=r()}}class e extends t{constructor(){super(...arguments),this.transformNormalViewFromGlobal=r(),this.slicePlaneLocalOrigin=s(),this.transformNormalGlobalFromModel=r()}}export{e as EdgeDrawParameters,a as EdgePassParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as a}from"../../../../../core/maybe.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as d,t as u,e as h}from"../../../../../chunks/mat3.js";import{c as m}from"../../../../../chunks/mat3f64.js";import{c as g}from"../../../../../chunks/mat4f64.js";import{s as p,i as f,A as _,d as b}from"../../../../../chunks/vec3.js";import{c as y}from"../../../../../chunks/vec3f64.js";import{UpdatingHandles as O}from"../../../../../core/support/UpdatingHandles.js";import{g as j,a as w}from"../../../../../chunks/sphere.js";import{c as E}from"../../../../../chunks/vec33.js";import{ViewingMode as v}from"../../../../ViewingMode.js";import{encodeElevationOffset as R}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as T}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as M}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexArrayObject as S}from"../VertexArrayObject.js";import{VertexAttribute as A}from"../VertexAttribute.js";import{VertexLayout as D,EdgeInputBufferLayout as U,EdgeShaderAttributeLocations as B,glVertexLayout as k}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as I,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as H}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as G}from"./EdgeRenderer.js";import{EdgePassParameters as q}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as z}from"./EdgeWorkerHandle.js";import{Transparency as W}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as F,determineEdgeTransparency as Q,determineObjectTransparency as J,fillComponenBufferIndices as X}from"./util.js";import{BufferManager as Y}from"../TextureBackedBuffer/BufferManager.js";import{EdgeSilhouette as Z}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BufferObject as $}from"../../../../webgl/BufferObject.js";import{Usage as ee}from"../../../../webgl/enums.js";let te=class extends t{constructor(e){super(e),this._updatingHandles=new O,this._perObjectData=new Map,this._perObjectDataEvictionCache=new Set,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=y(),this._localOrigins=new M(new T(e.renderSR))}initialize(){this._worker=new z(this.schedule),this._componentColorManager=new Y(this.rctx,3);const e=D.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this._verticesBufferObject=$.createVertex(this.rctx,ee.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this._perObjectData.forEach((e=>this._discardObjectEntry(e))),this._perObjectData.clear(),this._strokesTexture=i(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=i(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",fe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,o,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const l=new ne(new Promise((e=>c=e)),r.center,r.radius);this._perObjectData.set(e,l);const d=await this._updatingHandles.addPromise(this._addComponentGeometry(t,l,s,n,o,i,a));return this.setNeedsRender(),c(),d}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const o=this._perObjectData.get(e);let i;o?.renderables.length>0&&this._perObjectDataEvictionCache.add(o);const a=e.boundingVolumeWorldSpace.bounds,c=new ne(new Promise((e=>i=e)),j(a),w(a));this._perObjectData.set(e,c);const l=new Array;if(r.mergeGeometries&&e.geometries.length>1&&se(e))l.push(this._addObjectMergedGeometries(e,c,t,r,s));else for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];o.material.supportsEdges&&l.push(this._addGeometry(e,c,o,t[0],r,s))}await this._updatingHandles.addPromise(Promise.all(l)),this._perObjectDataEvictionCache.delete(c),this._discardObjectEntry(o),this.setNeedsRender(),i()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=t instanceof Array?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),n=e.components.meta[r],o=n.index;n.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(o,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return null!=t?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof P,o=!!r.hasSlicePlane,i=F(t),a=V.getKey(i,o,n),c=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=c&&(c.renderables.forEach((e=>{if(a!==e.rendererKey){const t=this._renderers.get(e.rendererKey),r=this._acquireRenderer(i,o,n);t.removeRenderable(e),--t.refCount,e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;this._updateComponentBuffer(e.components)})),this.setNeedsRender())}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}removeObject(e){const t=this._perObjectData.get(e);t&&(this._perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this._perObjectData.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=y(),n=new x;let o=0,i=0;if(this._renderers.forEach((r=>{if(0===r.refCount)this._renderers.delete(r.key),r.dispose();else{let s=!0,n=!0;r.forEachRenderable((t=>{t.visible&&(o+=t.statistics.averageEdgeLength,i++,s&&t.regular&&(r.updateTechnique(e,!1),s=!1),n&&t.silhouette&&(r.updateTechnique(e,!0),n=!1))}),t)}})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===i)return;const a=new q(40*o/i,t);p(s,r[3],r[7],r[11]),n.set(s),f(a.transformWorldFromViewTH,n.high),f(a.transformWorldFromViewTL,n.low),d(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(pe,a.transformViewFromCameraRelativeRS),h(a.transformNormalViewFromGlobal,pe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{this._renderRegularEdges(t,e,a),this._renderSilhouetteEdges(t,e,a)}))}_updateTransparency(e){const t=Q(e.components.meta),r=J(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(p(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_updateComponentBuffer(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let n=0;n<t.length;n++){const e=t[n].material,i=t[n].index,a=o(Math.round(e.size*N),0,255),c=o(e.extensionLength,-G,255-G)+G,l="solid"===e.type?H.SOLID:H.SKETCH,d=255*e.opacity,u=e.color,h=255*u[0],m=255*u[1],g=255*u[2],p=255*u[3];r.textureBuffer.setData(i,0,h,m,g,p),r.textureBuffer.setData(i,1,a,c,l,d),R(t[n].verticalOffset,s),r.textureBuffer.setData(i,2,s[0],s[1],s[2],s[3])}}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let n=0;n<e.length;n++){const s=e[n],o=r.acquireIndex();t.push({index:o,verticalOffset:0,material:s})}const s=new oe(r,t);return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,n,o=n.length){return this._worker.process({data:t,indices:n,indicesLength:o,writerSettings:e,skipDeduplicate:r},this._workerAbort.signal,s)}_createRenderable(e,t,r,s,n){const o=t=>null!=this._verticesBufferObject?new ie(new S(this.rctx,B,{vertices:k,instances:t===Z.REGULAR?I.glLayout:L.glLayout},{vertices:this._verticesBufferObject,instances:$.createVertex(this.rctx,ee.STATIC_DRAW,t===Z.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)}),t===Z.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo):null,i=e.regular.lodInfo.lengths.length>0?o(Z.REGULAR):null,a=e.silhouette.lodInfo.lengths.length>0?o(Z.SILHOUETTE):null,c=(i?.vao.memoryUsage??0)+(a?.vao.memoryUsage??0);return new ce(i,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,Q(t.meta),J(t.meta),t,s)}async _addGeometry(e,t,r,s,n,o){const i=r.vertexAttributes.get(A.POSITION),a=r.indices.get(A.POSITION),c=g(),l=this._computeModelTransformWithLocalOrigin(e,r,c),d=new ge(i,a,c,l);return this._addPositionData(t,d,r.edgeIndicesLength,s,n,o)}async _addPositionData(e,t,r,s,n,o=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(null==i||r<=0)return;const a=this._acquireRenderer(s.type,!!n.hasSlicePlane,!0),{modelTransform:c,origin:l}=t,d=t.indices,u=t.position,h=u.data.length/u.size,m=U.createBuffer(h);for(let f=0;f<h;f++)m.position.set(f,0,u.data[f*u.size]),m.position.set(f,1,u.data[f*u.size+1]),m.position.set(f,2,u.data[f*u.size+2]);X(i.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(a.writerSettings,m,!1,o,d,r));if(null==e.loaded)return;const p=this._createRenderable(g,i,new ae(c,l),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,o,i){if(null==t.loaded)return 0;const a=this._createComponentBuffers(o);if(null==a)return 0;const c=F(o),l=this._acquireRenderer(c,i.hasSlicePlane||!1,!1),d=U.createBuffer(r.length/3);E(d.position.typedBuffer,r,d.position.typedBufferStride,3),X(a.meta,n,d.componentIndex,s);const u=!0,h=l.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(h,d,u,!1,s));if(null==t.loaded)return 0;const g=this._createRenderable(m,a,e,l.key,!0);return t.renderables.push(g),l.addRenderable(g),g.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const o=new Map;let i=0,a=null,c=0;for(let g=0;g<e.geometries.length;g++){const t=e.geometries[g];if(!t.material.supportsEdges)continue;!a&&t.localOrigin&&(a=t);const r=t.vertexAttributes.get(A.POSITION);c+=r.data.length/r.size,i+=t.edgeIndicesLength}const l=c>=65536?Uint32Array:Uint16Array,d=i?new l(i):null,u=[];let h=0;for(let g=0;g<e.geometries.length;g++){const t=e.geometries[g];if(!t.material.supportsEdges)continue;const r=t.vertexAttributes.get(A.POSITION),s=t.indices.get(A.POSITION);let n=o.get(r.data);if(null==n){n=u.length/3;for(let e=0;e<r.data.length;e+=r.size)u.push(r.data[e]),u.push(r.data[e+1]),u.push(r.data[e+2]);o.set(r.data,n)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)d[h++]=n+s[e]}const m=a||e.geometries[0],p=g(),f=this._computeModelTransformWithLocalOrigin(e,m,p);for(let g=0;g<e.geometries.length;g++)e.geometries[g].localOrigin=f.origin;const _=new ge({data:u,size:3},d,p,f);await this._updatingHandles.addPromise(this._addPositionData(t,_,d.length,r[0],s,n))}_acquireRenderer(e,t,r){const s=V.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=K(this.rctx)),n||(n=new V(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===v.Global}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){re(e.regular),re(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,"origin"in e.transform&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=y(),n=e=>{_(s,e.center,t);const n=b(s,r),o=e.radius,i=n<-o?1/0:n<o?0:n-o;e.renderables.forEach((e=>e.distanceToCamera=i))};this._perObjectData.forEach(n),this._perObjectDataEvictionCache.forEach(n)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!de(n)||!n.visible)return;const i=me(n.regular.lod.lengths,n.distanceToCamera,o);e.renderRegularEdges(s,n,r,t,i)}),n)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!he(n)||!n.visible)return;const i=me(n.silhouette.lod.lengths,n.distanceToCamera,o);e.renderSilhouetteEdges(s,n,r,t,i)}),n)}get test(){return{hasRenderedPrimitives:e=>{let t=!1;const r=e.perScreenPixelRatio,s=(e,s)=>e.forEachRenderable((e=>{e.visible&&!t&&(de(e)&&(t=me(e.regular.lod.lengths,e.distanceToCamera,r)>0),!t&&he(e)&&(t=me(e.silhouette.lod.lengths,e.distanceToCamera,r)>0))}),s);return this._renderers.forEach((e=>{t||(s(e,W.OPAQUE),s(e,W.TRANSPARENT))})),t}}}};function re(e){null!=e&&(e.vao.vertexBuffers.instances.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function se(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];if(o.material.supportsEdges){if(t){if(!r(t,o.transformation))return!1}else t=o.transformation;if(s||null==o.localOrigin){if(s&&null!=s.localOrigin&&null!=o.localOrigin&&s.localOrigin.id!==o.localOrigin.id)return!1}else s=o}}return!0}e([c({constructOnly:!0})],te.prototype,"rctx",void 0),e([c({constructOnly:!0})],te.prototype,"renderSR",void 0),e([c({constructOnly:!0})],te.prototype,"viewingMode",void 0),e([c({constructOnly:!0})],te.prototype,"techniqueRepository",void 0),e([c({constructOnly:!0})],te.prototype,"setNeedsRender",void 0),e([c({constructOnly:!0})],te.prototype,"schedule",void 0),e([c({readOnly:!0})],te.prototype,"_updatingHandles",void 0),e([c({readOnly:!0})],te.prototype,"updating",null),te=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],te);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}class oe{constructor(e,t){this.buffer=e,this.meta=t}}class ie{constructor(e,t){this.vao=e,this.lod=t}}class ae{constructor(e,t){this.modelMatrix=e,this.origin=t}}class ce{constructor(e,t,r,s,n,o,i,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=o,this.components=i,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class le extends ce{}function de(e){return null!=e.regular}class ue extends ce{}function he(e){return null!=e.silhouette}function me(e,t,r){const n=t*r,o=s(e,n,!0);return-1===o?n<e[0]?e.length:0:e.length-o}class ge{constructor(e,t,r,s){this.position=e,this.indices=t,this.modelTransform=r,this.origin=s}}const pe=m(),fe=()=>Promise.reject();export{te as EdgeView,ae as LegacyTransform,le as RegularRenderable,ce as Renderable,ue as SilhouetteRenderable};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as a}from"../../../../../core/maybe.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as d,t as u,d as h}from"../../../../../chunks/mat3.js";import{a as m}from"../../../../../chunks/mat3f64.js";import{a as g}from"../../../../../chunks/mat4f64.js";import{s as p,c as f,r as _,j as b}from"../../../../../chunks/vec3.js";import{c as y}from"../../../../../chunks/vec3f64.js";import{UpdatingHandles as O}from"../../../../../core/support/UpdatingHandles.js";import{g as j,a as w}from"../../../../../chunks/sphere.js";import{c as E}from"../../../../../chunks/vec33.js";import{ViewingMode as v}from"../../../../ViewingMode.js";import{encodeElevationOffset as R}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as T}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as M}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexArrayObject as S}from"../VertexArrayObject.js";import{VertexAttribute as D}from"../VertexAttribute.js";import{VertexLayout as A,EdgeInputBufferLayout as U,EdgeShaderAttributeLocations as B,glVertexLayout as k}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as I,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as H}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as G}from"./EdgeRenderer.js";import{EdgePassParameters as q}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as z}from"./EdgeWorkerHandle.js";import{Transparency as W}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as F,determineEdgeTransparency as Q,determineObjectTransparency as J,fillComponenBufferIndices as X}from"./util.js";import{BufferManager as Y}from"../TextureBackedBuffer/BufferManager.js";import{EdgeSilhouette as Z}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BufferObject as $}from"../../../../webgl/BufferObject.js";import{Usage as ee}from"../../../../webgl/enums.js";let te=class extends t{constructor(e){super(e),this._updatingHandles=new O,this._perObjectData=new Map,this._perObjectDataEvictionCache=new Set,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=y(),this._localOrigins=new M(new T(e.renderSR))}initialize(){this._worker=new z(this.schedule),this._componentColorManager=new Y(this.rctx,3);const e=A.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this._verticesBufferObject=$.createVertex(this.rctx,ee.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this._perObjectData.forEach((e=>this._discardObjectEntry(e))),this._perObjectData.clear(),this._strokesTexture=i(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=i(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",fe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,o,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const l=new ne(new Promise((e=>c=e)),r.center,r.radius);this._perObjectData.set(e,l);const d=await this._updatingHandles.addPromise(this._addComponentGeometry(t,l,s,n,o,i,a));return this.setNeedsRender(),c(),d}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const o=this._perObjectData.get(e);let i;o?.renderables.length>0&&this._perObjectDataEvictionCache.add(o);const a=e.boundingVolumeWorldSpace.bounds,c=new ne(new Promise((e=>i=e)),j(a),w(a));this._perObjectData.set(e,c);const l=new Array;if(r.mergeGeometries&&e.geometries.length>1&&se(e))l.push(this._addObjectMergedGeometries(e,c,t,r,s));else for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];o.material.supportsEdges&&l.push(this._addGeometry(e,c,o,t[0],r,s))}await this._updatingHandles.addPromise(Promise.all(l)),this._perObjectDataEvictionCache.delete(c),this._discardObjectEntry(o),this.setNeedsRender(),i()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=t instanceof Array?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),n=e.components.meta[r],o=n.index;n.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(o,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return null!=t?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof P,o=!!r.hasSlicePlane,i=F(t),a=V.getKey(i,o,n),c=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=c&&(c.renderables.forEach((e=>{if(a!==e.rendererKey){const t=this._renderers.get(e.rendererKey),r=this._acquireRenderer(i,o,n);t.removeRenderable(e),--t.refCount,e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;this._updateComponentBuffer(e.components)})),this.setNeedsRender())}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}removeObject(e){const t=this._perObjectData.get(e);t&&(this._perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this._perObjectData.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=y(),n=new x;let o=0,i=0;if(this._renderers.forEach((r=>{if(0===r.refCount)this._renderers.delete(r.key),r.dispose();else{let s=!0,n=!0;r.forEachRenderable((t=>{t.visible&&(o+=t.statistics.averageEdgeLength,i++,s&&t.regular&&(r.updateTechnique(e,!1),s=!1),n&&t.silhouette&&(r.updateTechnique(e,!0),n=!1))}),t)}})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===i)return;const a=new q(40*o/i,t);p(s,r[3],r[7],r[11]),n.set(s),f(a.transformWorldFromViewTH,n.high),f(a.transformWorldFromViewTL,n.low),d(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(pe,a.transformViewFromCameraRelativeRS),h(a.transformNormalViewFromGlobal,pe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{this._renderRegularEdges(t,e,a),this._renderSilhouetteEdges(t,e,a)}))}_updateTransparency(e){const t=Q(e.components.meta),r=J(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(p(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,C(s.origin.vec3,r),s}_updateComponentBuffer(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let n=0;n<t.length;n++){const e=t[n].material,i=t[n].index,a=o(Math.round(e.size*N),0,255),c=o(e.extensionLength,-G,255-G)+G,l="solid"===e.type?H.SOLID:H.SKETCH,d=255*e.opacity,u=e.color,h=255*u[0],m=255*u[1],g=255*u[2],p=255*u[3];r.textureBuffer.setData(i,0,h,m,g,p),r.textureBuffer.setData(i,1,a,c,l,d),R(t[n].verticalOffset,s),r.textureBuffer.setData(i,2,s[0],s[1],s[2],s[3])}}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let n=0;n<e.length;n++){const s=e[n],o=r.acquireIndex();t.push({index:o,verticalOffset:0,material:s})}const s=new oe(r,t);return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,n,o=n.length){return this._worker.process({data:t,indices:n,indicesLength:o,writerSettings:e,skipDeduplicate:r},this._workerAbort.signal,s)}_createRenderable(e,t,r,s,n){const o=t=>null!=this._verticesBufferObject?new ie(new S(this.rctx,B,{vertices:k,instances:t===Z.REGULAR?I.glLayout:L.glLayout},{vertices:this._verticesBufferObject,instances:$.createVertex(this.rctx,ee.STATIC_DRAW,t===Z.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)}),t===Z.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo):null,i=e.regular.lodInfo.lengths.length>0?o(Z.REGULAR):null,a=e.silhouette.lodInfo.lengths.length>0?o(Z.SILHOUETTE):null,c=(i?.vao.memoryUsage??0)+(a?.vao.memoryUsage??0);return new ce(i,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,Q(t.meta),J(t.meta),t,s)}async _addGeometry(e,t,r,s,n,o){const i=r.vertexAttributes.get(D.POSITION),a=r.indices.get(D.POSITION),c=g(),l=this._computeModelTransformWithLocalOrigin(e,r,c),d=new ge(i,a,c,l);return this._addPositionData(t,d,r.edgeIndicesLength,s,n,o)}async _addPositionData(e,t,r,s,n,o=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(null==i||r<=0)return;const a=this._acquireRenderer(s.type,!!n.hasSlicePlane,!0),{modelTransform:c,origin:l}=t,d=t.indices,u=t.position,h=u.data.length/u.size,m=U.createBuffer(h);for(let f=0;f<h;f++)m.position.set(f,0,u.data[f*u.size]),m.position.set(f,1,u.data[f*u.size+1]),m.position.set(f,2,u.data[f*u.size+2]);X(i.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(a.writerSettings,m,!1,o,d,r));if(null==e.loaded)return;const p=this._createRenderable(g,i,new ae(c,l),a.key,!1);e.renderables.push(p),a.addRenderable(p),this._gpuMemoryUsage+=p.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,o,i){if(null==t.loaded)return 0;const a=this._createComponentBuffers(o);if(null==a)return 0;const c=F(o),l=this._acquireRenderer(c,i.hasSlicePlane||!1,!1),d=U.createBuffer(r.length/3);E(d.position.typedBuffer,r,d.position.typedBufferStride,3),X(a.meta,n,d.componentIndex,s);const u=!0,h=l.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(h,d,u,!1,s));if(null==t.loaded)return 0;const g=this._createRenderable(m,a,e,l.key,!0);return t.renderables.push(g),l.addRenderable(g),g.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const o=new Map;let i=0,a=null,c=0;for(let g=0;g<e.geometries.length;g++){const t=e.geometries[g];if(!t.material.supportsEdges)continue;!a&&t.localOrigin&&(a=t);const r=t.vertexAttributes.get(D.POSITION);c+=r.data.length/r.size,i+=t.edgeIndicesLength}const l=c>=65536?Uint32Array:Uint16Array,d=i?new l(i):null,u=[];let h=0;for(let g=0;g<e.geometries.length;g++){const t=e.geometries[g];if(!t.material.supportsEdges)continue;const r=t.vertexAttributes.get(D.POSITION),s=t.indices.get(D.POSITION);let n=o.get(r.data);if(null==n){n=u.length/3;for(let e=0;e<r.data.length;e+=r.size)u.push(r.data[e]),u.push(r.data[e+1]),u.push(r.data[e+2]);o.set(r.data,n)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)d[h++]=n+s[e]}const m=a||e.geometries[0],p=g(),f=this._computeModelTransformWithLocalOrigin(e,m,p);for(let g=0;g<e.geometries.length;g++)e.geometries[g].localOrigin=f.origin;const _=new ge({data:u,size:3},d,p,f);await this._updatingHandles.addPromise(this._addPositionData(t,_,d.length,r[0],s,n))}_acquireRenderer(e,t,r){const s=V.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=K(this.rctx)),n||(n=new V(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===v.Global}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){re(e.regular),re(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,"origin"in e.transform&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=y(),n=e=>{_(s,e.center,t);const n=b(s,r),o=e.radius,i=n<-o?1/0:n<o?0:n-o;e.renderables.forEach((e=>e.distanceToCamera=i))};this._perObjectData.forEach(n),this._perObjectDataEvictionCache.forEach(n)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!de(n)||!n.visible)return;const i=me(n.regular.lod.lengths,n.distanceToCamera,o);e.renderRegularEdges(s,n,r,t,i)}),n)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),n=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((n=>{if(!he(n)||!n.visible)return;const i=me(n.silhouette.lod.lengths,n.distanceToCamera,o);e.renderSilhouetteEdges(s,n,r,t,i)}),n)}get test(){return{hasRenderedPrimitives:e=>{let t=!1;const r=e.perScreenPixelRatio,s=(e,s)=>e.forEachRenderable((e=>{e.visible&&!t&&(de(e)&&(t=me(e.regular.lod.lengths,e.distanceToCamera,r)>0),!t&&he(e)&&(t=me(e.silhouette.lod.lengths,e.distanceToCamera,r)>0))}),s);return this._renderers.forEach((e=>{t||(s(e,W.OPAQUE),s(e,W.TRANSPARENT))})),t}}}};function re(e){null!=e&&(e.vao.vertexBuffers.instances.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function se(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){const o=e.geometries[n];if(o.material.supportsEdges){if(t){if(!r(t,o.transformation))return!1}else t=o.transformation;if(s||null==o.localOrigin){if(s&&null!=s.localOrigin&&null!=o.localOrigin&&s.localOrigin.id!==o.localOrigin.id)return!1}else s=o}}return!0}e([c({constructOnly:!0})],te.prototype,"rctx",void 0),e([c({constructOnly:!0})],te.prototype,"renderSR",void 0),e([c({constructOnly:!0})],te.prototype,"viewingMode",void 0),e([c({constructOnly:!0})],te.prototype,"techniqueRepository",void 0),e([c({constructOnly:!0})],te.prototype,"setNeedsRender",void 0),e([c({constructOnly:!0})],te.prototype,"schedule",void 0),e([c({readOnly:!0})],te.prototype,"_updatingHandles",void 0),e([c({readOnly:!0})],te.prototype,"updating",null),te=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],te);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}class oe{constructor(e,t){this.buffer=e,this.meta=t}}class ie{constructor(e,t){this.vao=e,this.lod=t}}class ae{constructor(e,t){this.modelMatrix=e,this.origin=t}}class ce{constructor(e,t,r,s,n,o,i,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=o,this.components=i,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class le extends ce{}function de(e){return null!=e.regular}class ue extends ce{}function he(e){return null!=e.silhouette}function me(e,t,r){const n=t*r,o=s(e,n,!0);return-1===o?n<e[0]?e.length:0:e.length-o}class ge{constructor(e,t,r,s){this.position=e,this.indices=t,this.modelTransform=r,this.origin=s}}const pe=m(),fe=()=>Promise.reject();export{te as EdgeView,ae as LegacyTransform,le as RegularRenderable,ce as Renderable,ue as SilhouetteRenderable};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/RandomLCG.js";import{e as o,n as e}from"../../../../../chunks/vec3.js";import{c as n}from"../../../../../chunks/vec3f64.js";import{glLayout as i}from"../../../support/buffer/glUtil.js";import{RegularEdgeInstancesLayout as r,SilhouetteEdgeInstancesLayout as s}from"./bufferLayouts.js";class a{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?f:p}write(t,o,e){const n=this._edgeHashFunction(e);y.seed=n;const i=y.getIntRange(0,255),r=y.getIntRange(0,this.settings.variants-1),s=.7,a=y.getFloat(),c=255*(.5*g(-(1-Math.min(a/s,1))+Math.max(0,a-s)/(1-s),1.2)+.5);t.position0.setVec(o,e.position0),t.position1.setVec(o,e.position1),t.componentIndex.set(o,e.componentIndex),t.variantOffset.set(o,i),t.variantStroke.set(o,r),t.variantExtension.set(o,c)}trim(t,o){return t.slice(0,o)}}const c=new Float32Array(6),m=new Uint32Array(c.buffer),u=new Uint32Array(1);function p(t){const o=c;o[0]=t.position0[0],o[1]=t.position0[1],o[2]=t.position0[2],o[3]=t.position1[0],o[4]=t.position1[1],o[5]=t.position1[2],u[0]=5381;for(let e=0;e<m.length;e++)u[0]=31*u[0]+m[e];return u[0]}function f(t){const o=c;o[0]=h(t.position0[0]),o[1]=h(t.position0[1]),o[2]=h(t.position0[2]),o[3]=h(t.position1[0]),o[4]=h(t.position1[1]),o[5]=h(t.position1[2]),u[0]=5381;for(let e=0;e<m.length;e++)u[0]=31*u[0]+m[e];return u[0]}const l=1e4;function h(t){return Math.round(t*l)/l}function g(t,o){const e=t<0?-1:1;return Math.abs(t)**o*e}class d{constructor(){this._commonWriter=new a}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return r.createBuffer(t)}write(t,n,i){this._commonWriter.write(t,n,i),o(_,i.faceNormal0,i.faceNormal1),e(_,_),t.normal.setVec(n,_)}trim(t,o){return this._commonWriter.trim(t,o)}}d.Layout=r,d.glLayout=i(r,1);class w{constructor(){this._commonWriter=new a}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return s.createBuffer(t)}write(t,o,e){this._commonWriter.write(t,o,e),t.normalA.setVec(o,e.faceNormal0),t.normalB.setVec(o,e.faceNormal1)}trim(t,o){return this._commonWriter.trim(t,o)}}w.Layout=s,w.glLayout=i(s,1);const _=n(),y=new t;export{a as CommonBufferWriter,d as RegularEdgeBufferWriter,w as SilhouetteEdgeBufferWriter};
5
+ import t from"../../../../../core/RandomLCG.js";import{g as o,n as e}from"../../../../../chunks/vec3.js";import{c as n}from"../../../../../chunks/vec3f64.js";import{glLayout as i}from"../../../support/buffer/glUtil.js";import{RegularEdgeInstancesLayout as r,SilhouetteEdgeInstancesLayout as s}from"./bufferLayouts.js";class a{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?f:p}write(t,o,e){const n=this._edgeHashFunction(e);y.seed=n;const i=y.getIntRange(0,255),r=y.getIntRange(0,this.settings.variants-1),s=.7,a=y.getFloat(),c=255*(.5*g(-(1-Math.min(a/s,1))+Math.max(0,a-s)/(1-s),1.2)+.5);t.position0.setVec(o,e.position0),t.position1.setVec(o,e.position1),t.componentIndex.set(o,e.componentIndex),t.variantOffset.set(o,i),t.variantStroke.set(o,r),t.variantExtension.set(o,c)}trim(t,o){return t.slice(0,o)}}const c=new Float32Array(6),m=new Uint32Array(c.buffer),u=new Uint32Array(1);function p(t){const o=c;o[0]=t.position0[0],o[1]=t.position0[1],o[2]=t.position0[2],o[3]=t.position1[0],o[4]=t.position1[1],o[5]=t.position1[2],u[0]=5381;for(let e=0;e<m.length;e++)u[0]=31*u[0]+m[e];return u[0]}function f(t){const o=c;o[0]=h(t.position0[0]),o[1]=h(t.position0[1]),o[2]=h(t.position0[2]),o[3]=h(t.position1[0]),o[4]=h(t.position1[1]),o[5]=h(t.position1[2]),u[0]=5381;for(let e=0;e<m.length;e++)u[0]=31*u[0]+m[e];return u[0]}const l=1e4;function h(t){return Math.round(t*l)/l}function g(t,o){const e=t<0?-1:1;return Math.abs(t)**o*e}class d{constructor(){this._commonWriter=new a}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return r.createBuffer(t)}write(t,n,i){this._commonWriter.write(t,n,i),o(_,i.faceNormal0,i.faceNormal1),e(_,_),t.normal.setVec(n,_)}trim(t,o){return this._commonWriter.trim(t,o)}}d.Layout=r,d.glLayout=i(r,1);class w{constructor(){this._commonWriter=new a}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return s.createBuffer(t)}write(t,o,e){this._commonWriter.write(t,o,e),t.normalA.setVec(o,e.faceNormal0),t.normalB.setVec(o,e.faceNormal1)}trim(t,o){return this._commonWriter.trim(t,o)}}w.Layout=s,w.glLayout=i(s,1);const _=n(),y=new t;export{a as CommonBufferWriter,d as RegularEdgeBufferWriter,w as SilhouetteEdgeBufferWriter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{range as e}from"../../../../../core/arrayUtils.js";import{deg2rad as t,acosClamped as n}from"../../../../../core/mathUtils.js";import{h as o,s as c,i as r,d as s,x as a,c as i,g as l,n as g}from"../../../../../chunks/vec3.js";import{c as f}from"../../../../../chunks/vec3f64.js";const m=-1;var u;function h(n,a,i,l=V){const g=n.vertices.position,f=n.vertices.componentIndex,u=t(l.anglePlanar),h=t(l.angleSignificantEdge),y=Math.cos(h),x=Math.cos(u),E=I.edge,N=E.position0,S=E.position1,j=E.faceNormal0,D=E.faceNormal1,F=w(n),L=A(n),k=L.length/4,C=a.allocate(k);let H=0;const K=k,M=i.allocate(K);let O=0,P=0,T=0;const U=e(0,k),b=new Float32Array(k);b.forEach(((e,t,n)=>{g.getVec(L[4*t],N),g.getVec(L[4*t+1],S),n[t]=o(N,S)})),U.sort(((e,t)=>b[t]-b[e]));const q=new Array,z=new Array;for(let e=0;e<k;e++){const t=U[e],n=b[t],o=L[4*t],l=L[4*t+1],h=L[4*t+2],A=L[4*t+3],w=A===m;if(g.getVec(o,N),g.getVec(l,S),w)c(j,F[3*h],F[3*h+1],F[3*h+2]),r(D,j),E.componentIndex=f.get(o),E.cosAngle=s(j,D);else{if(c(j,F[3*h],F[3*h+1],F[3*h+2]),c(D,F[3*A],F[3*A+1],F[3*A+2]),E.componentIndex=f.get(o),E.cosAngle=s(j,D),v(E,x))continue;E.cosAngle<-.9999&&r(D,j)}P+=n,T++,w||p(E,y)?(a.write(C,H++,E),q.push(n)):d(E,u)&&(i.write(M,O++,E),z.push(n))}const B=new Float32Array(q.reverse()),G=new Float32Array(z.reverse());return{regular:{instancesData:a.trim(C,H),lodInfo:{lengths:B}},silhouette:{instancesData:i.trim(M,O),lodInfo:{lengths:G}},averageEdgeLength:P/T}}function p(e,t){return e.cosAngle<t}function v(e,t){return e.cosAngle>t}function d(e,t){const o=n(e.cosAngle),c=I.fwd,r=I.ortho;a(c,e.position1,e.position0);return o*(s(i(r,e.faceNormal0,e.faceNormal1),c)>0?-1:1)>t}function A(e){const t=e.faces.length/3,n=e.faces,o=e.neighbors;let c=0;for(let a=0;a<t;a++){const e=o[3*a],t=o[3*a+1],r=o[3*a+2],s=n[3*a],i=n[3*a+1],l=n[3*a+2];c+=e===m||s<i?1:0,c+=t===m||i<l?1:0,c+=r===m||l<s?1:0}const r=new Int32Array(4*c);let s=0;for(let a=0;a<t;a++){const e=o[3*a],t=o[3*a+1],c=o[3*a+2],i=n[3*a],l=n[3*a+1],g=n[3*a+2];(e===m||i<l)&&(r[s++]=i,r[s++]=l,r[s++]=a,r[s++]=e),(t===m||l<g)&&(r[s++]=l,r[s++]=g,r[s++]=a,r[s++]=t),(c===m||g<i)&&(r[s++]=g,r[s++]=i,r[s++]=a,r[s++]=c)}return r}function w(e){const t=e.faces.length/3,n=e.vertices.position,o=e.faces,c=y.v0,r=y.v1,s=y.v2,a=new Float32Array(3*t);for(let f=0;f<t;f++){const e=o[3*f],t=o[3*f+1],m=o[3*f+2];n.getVec(e,c),n.getVec(t,r),n.getVec(m,s),l(r,r,c),l(s,s,c),i(c,r,s),g(c,c),a[3*f]=c[0],a[3*f+1]=c[1],a[3*f+2]=c[2]}return a}!function(e){e[e.SOLID=0]="SOLID",e[e.SKETCH=1]="SKETCH"}(u||(u={}));const I={edge:{position0:f(),position1:f(),faceNormal0:f(),faceNormal1:f(),componentIndex:0,cosAngle:0},ortho:f(),fwd:f()},y={v0:f(),v1:f(),v2:f()},V={anglePlanar:4,angleSignificantEdge:35};export{u as EdgeType,h as extractEdges};
5
+ import{range as e}from"../../../../../core/arrayUtils.js";import{deg2rad as t,acosClamped as n}from"../../../../../core/mathUtils.js";import{m as o,s as c,c as r,j as s,C as a,b as i,f as l,n as f}from"../../../../../chunks/vec3.js";import{c as g}from"../../../../../chunks/vec3f64.js";const m=-1;var u;function p(n,a,i,l=V){const f=n.vertices.position,g=n.vertices.componentIndex,u=t(l.anglePlanar),p=t(l.angleSignificantEdge),y=Math.cos(p),E=Math.cos(u),N=I.edge,S=N.position0,j=N.position1,x=N.faceNormal0,D=N.faceNormal1,F=w(n),C=d(n),L=C.length/4,b=a.allocate(L);let k=0;const H=L,K=i.allocate(H);let M=0,O=0,P=0;const T=e(0,L),U=new Float32Array(L);U.forEach(((e,t,n)=>{f.getVec(C[4*t],S),f.getVec(C[4*t+1],j),n[t]=o(S,j)})),T.sort(((e,t)=>U[t]-U[e]));const q=new Array,z=new Array;for(let e=0;e<L;e++){const t=T[e],n=U[t],o=C[4*t],l=C[4*t+1],p=C[4*t+2],d=C[4*t+3],w=d===m;if(f.getVec(o,S),f.getVec(l,j),w)c(x,F[3*p],F[3*p+1],F[3*p+2]),r(D,x),N.componentIndex=g.get(o),N.cosAngle=s(x,D);else{if(c(x,F[3*p],F[3*p+1],F[3*p+2]),c(D,F[3*d],F[3*d+1],F[3*d+2]),N.componentIndex=g.get(o),N.cosAngle=s(x,D),v(N,E))continue;N.cosAngle<-.9999&&r(D,x)}O+=n,P++,w||h(N,y)?(a.write(b,k++,N),q.push(n)):A(N,u)&&(i.write(K,M++,N),z.push(n))}const B=new Float32Array(q.reverse()),G=new Float32Array(z.reverse());return{regular:{instancesData:a.trim(b,k),lodInfo:{lengths:B}},silhouette:{instancesData:i.trim(K,M),lodInfo:{lengths:G}},averageEdgeLength:O/P}}function h(e,t){return e.cosAngle<t}function v(e,t){return e.cosAngle>t}function A(e,t){const o=n(e.cosAngle),c=I.fwd,r=I.ortho;a(c,e.position1,e.position0);return o*(s(i(r,e.faceNormal0,e.faceNormal1),c)>0?-1:1)>t}function d(e){const t=e.faces.length/3,n=e.faces,o=e.neighbors;let c=0;for(let a=0;a<t;a++){const e=o[3*a],t=o[3*a+1],r=o[3*a+2],s=n[3*a],i=n[3*a+1],l=n[3*a+2];c+=e===m||s<i?1:0,c+=t===m||i<l?1:0,c+=r===m||l<s?1:0}const r=new Int32Array(4*c);let s=0;for(let a=0;a<t;a++){const e=o[3*a],t=o[3*a+1],c=o[3*a+2],i=n[3*a],l=n[3*a+1],f=n[3*a+2];(e===m||i<l)&&(r[s++]=i,r[s++]=l,r[s++]=a,r[s++]=e),(t===m||l<f)&&(r[s++]=l,r[s++]=f,r[s++]=a,r[s++]=t),(c===m||f<i)&&(r[s++]=f,r[s++]=i,r[s++]=a,r[s++]=c)}return r}function w(e){const t=e.faces.length/3,n=e.vertices.position,o=e.faces,c=y.v0,r=y.v1,s=y.v2,a=new Float32Array(3*t);for(let g=0;g<t;g++){const e=o[3*g],t=o[3*g+1],m=o[3*g+2];n.getVec(e,c),n.getVec(t,r),n.getVec(m,s),l(r,r,c),l(s,s,c),i(c,r,s),f(c,c),a[3*g]=c[0],a[3*g+1]=c[1],a[3*g+2]=c[2]}return a}!function(e){e[e.SOLID=0]="SOLID",e[e.SKETCH=1]="SKETCH"}(u||(u={}));const I={edge:{position0:g(),position1:g(),faceNormal0:g(),faceNormal1:g(),componentIndex:0,cosAngle:0},ortho:g(),fwd:g()},y={v0:g(),v1:g(),v2:g()},V={anglePlanar:4,angleSignificantEdge:35};export{u as EdgeType,p as extractEdges};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,e as n,b as e,j as r}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{areaPoints3d as s}from"../../../../geometry/support/triangle.js";function c(r,o,c){if(!r||!o)return!1;const{size:f,data:i}=r;t(c,0,0,0),t(m,0,0,0);let g=0,h=0;for(let p=0;p<o.length-2;p+=3){const r=o[p]*f,j=o[p+1]*f,d=o[p+2]*f;t(a,i[r],i[r+1],i[r+2]),t(u,i[j],i[j+1],i[j+2]),t(l,i[d],i[d+1],i[d+2]);const z=s(a,u,l);z?(n(a,a,u),n(a,a,l),e(a,a,1/3*z),n(c,c,a),g+=z):(n(m,m,a),n(m,m,u),n(m,m,l),h+=3)}return(0!==h||0!==g)&&(0!==g?(e(c,c,1/g),!0):0!==h&&(e(c,m,1/h),!0))}function f(n,r,o){if(!n||!r)return!1;const{size:s,data:c}=n;t(o,0,0,0);let f=-1,i=0;for(let t=0;t<r.length;t++){const n=r[t]*s;f!==n&&(o[0]+=c[n],o[1]+=c[n+1],o[2]+=c[n+2],i++),f=n}return i>1&&e(o,o,1/i),i>0}function i(o,s,c,f){if(!o)return!1;t(f,0,0,0),t(m,0,0,0);let i=0,l=0;const{size:g,data:h}=o,p=s?s.length-1:h.length/g-1,j=p+(c?2:0);for(let t=0;t<j;t+=2){const o=t<p?t:p,c=t<p?t+1:0,j=(s?s[o]:o)*g,d=(s?s[c]:c)*g;a[0]=h[j],a[1]=h[j+1],a[2]=h[j+2],u[0]=h[d],u[1]=h[d+1],u[2]=h[d+2],e(a,n(a,a,u),.5);const z=r(a,u);z>0?(n(f,f,e(a,a,z)),i+=z):0===i&&(n(m,m,a),l++)}return 0!==i?(e(f,f,1/i),!0):0!==l&&(e(f,m,1/l),!0)}const a=o(),u=o(),l=o(),m=o();export{i as computeAttachmentOriginLines,f as computeAttachmentOriginPoints,c as computeAttachmentOriginTriangles};
5
+ import{s as t,g as n,i as e,q as r}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{areaPoints3d as s}from"../../../../geometry/support/triangle.js";function c(r,o,c){if(!r||!o)return!1;const{size:i,data:f}=r;t(c,0,0,0),t(g,0,0,0);let m=0,h=0;for(let p=0;p<o.length-2;p+=3){const r=o[p]*i,d=o[p+1]*i,j=o[p+2]*i;t(a,f[r],f[r+1],f[r+2]),t(u,f[d],f[d+1],f[d+2]),t(l,f[j],f[j+1],f[j+2]);const z=s(a,u,l);z?(n(a,a,u),n(a,a,l),e(a,a,1/3*z),n(c,c,a),m+=z):(n(g,g,a),n(g,g,u),n(g,g,l),h+=3)}return(0!==h||0!==m)&&(0!==m?(e(c,c,1/m),!0):0!==h&&(e(c,g,1/h),!0))}function i(n,r,o){if(!n||!r)return!1;const{size:s,data:c}=n;t(o,0,0,0);let i=-1,f=0;for(let t=0;t<r.length;t++){const n=r[t]*s;i!==n&&(o[0]+=c[n],o[1]+=c[n+1],o[2]+=c[n+2],f++),i=n}return f>1&&e(o,o,1/f),f>0}function f(o,s,c,i){if(!o)return!1;t(i,0,0,0),t(g,0,0,0);let f=0,l=0;const{size:m,data:h}=o,p=s?s.length-1:h.length/m-1,d=p+(c?2:0);for(let t=0;t<d;t+=2){const o=t<p?t:p,c=t<p?t+1:0,d=(s?s[o]:o)*m,j=(s?s[c]:c)*m;a[0]=h[d],a[1]=h[d+1],a[2]=h[d+2],u[0]=h[j],u[1]=h[j+1],u[2]=h[j+2],e(a,n(a,a,u),.5);const z=r(a,u);z>0?(n(i,i,e(a,a,z)),f+=z):0===f&&(n(g,g,a),l++)}return 0!==f?(e(i,i,1/f),!0):0!==l&&(e(i,g,1/l),!0)}const a=o(),u=o(),l=o(),g=o();export{f as computeAttachmentOriginLines,i as computeAttachmentOriginPoints,c as computeAttachmentOriginTriangles};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{f as t}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{e as n}from"../../../../chunks/boundedPlane.js";import{IntersectorType as e}from"./IntersectorInterfaces.js";function o(t){return null!=t&&null!=t.dist}function c(r){return(e,o,c)=>(t(i,e,o,c),!n(r,i))}function s(t){return o(t)&&t.intersector===e.OBJECT&&!!t.target}function u(t){return o(t)&&t.intersector===e.HUD&&!!t.target&&"center"in t.target&&null!=t.target.center}const i=r();export{u as isHudIntersectorResult,s as isObjectIntersectorResult,o as isValidIntersectorResult,c as sliceFilterPredicate};
5
+ import{p as t}from"../../../../chunks/vec3.js";import{c as r}from"../../../../chunks/vec3f64.js";import{e as n}from"../../../../chunks/boundedPlane.js";import{IntersectorType as e}from"./IntersectorInterfaces.js";function o(t){return null!=t&&null!=t.dist}function c(r){return(e,o,c)=>(t(i,e,o,c),!n(r,i))}function s(t){return o(t)&&t.intersector===e.OBJECT&&!!t.target}function u(t){return o(t)&&t.intersector===e.HUD&&!!t.target&&"center"in t.target&&null!=t.target.center}const i=r();export{u as isHudIntersectorResult,s as isObjectIntersectorResult,o as isValidIntersectorResult,c as sliceFilterPredicate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{ReallocGrowthFactor as s}from"../../../../../core/arrayUtils.js";import i from"../../../../../core/Evented.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as o,e as n,t as l}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{m as c}from"../../../../../chunks/mat4.js";import{c as m}from"../../../../../chunks/mat4f64.js";import{s as f}from"../../../../../chunks/vec3.js";import{c as g}from"../../../../../chunks/vec3f64.js";import{BufferViewMat4f64 as d,BufferViewVec3f64 as T,BufferViewMat3f as u,BufferViewVec2f as _,BufferViewVec4f64 as p,BufferViewVec4f as L,BufferViewVec4u8 as A,BufferViewUint8 as E}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as O}from"../../../support/mathUtils.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import{assert as I}from"../Util.js";import{VertexAttribute as F}from"../VertexAttribute.js";import{INITIAL_CAPACITY as S}from"./RenderInstanceData.js";var M;function C(t){let e=v().mat4f64(F.LOCALTRANSFORM).mat4f64(F.GLOBALTRANSFORM).vec4f64(F.BOUNDINGSPHERE).vec3f64(F.MODELORIGIN).mat3f(F.INSTANCEMODEL).mat3f(F.INSTANCEMODELNORMAL).vec2f(F.MODELSCALEFACTORS);return t.includes(F.FEATUREATTRIBUTE)&&(e=e.vec4f(F.FEATUREATTRIBUTE)),t.includes(F.COLOR)&&(e=e.vec4u8(F.COLOR)),t.includes(F.OBJECTANDLAYERIDCOLOR)&&(e=e.vec4u8(F.OBJECTANDLAYERIDCOLOR)),e=e.u8(F.STATE).u8(F.LODLEVEL),e}!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"}(M||(M={}));class R{constructor(t){this.localTransform=t.getField(F.LOCALTRANSFORM,d),this.globalTransform=t.getField(F.GLOBALTRANSFORM,d),this.modelOrigin=t.getField(F.MODELORIGIN,T),this.model=t.getField(F.INSTANCEMODEL,u),this.modelNormal=t.getField(F.INSTANCEMODELNORMAL,u),this.modelScaleFactors=t.getField(F.MODELSCALEFACTORS,_),this.boundingSphere=t.getField(F.BOUNDINGSPHERE,p),this.featureAttribute=t.getField(F.FEATUREATTRIBUTE,L),this.color=t.getField(F.COLOR,A),this.objectAndLayerIdColor=t.getField(F.OBJECTANDLAYERIDCOLOR,A),this.state=t.getField(F.STATE,E),this.lodLevel=t.getField(F.LODLEVEL,E)}}let y=class extends e{constructor(t,e){super(t),this.events=new i,this._capacity=0,this._size=0,this._next=0,this._layout=C(e),this._capacity=S,this._buffer=this._layout.createBuffer(this._capacity),this._view=new R(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const t=this._findSlot();return this._view.state.set(t,M.ALLOCATED),this._size++,this.events.emit("instances-changed"),t}removeInstance(t){const e=this._view.state;I(t>=0&&t<this._capacity&&0!=(e.get(t)&M.ALLOCATED),"invalid instance handle"),this._getStateFlag(t,M.ACTIVE)?this._setStateFlags(t,M.REMOVE):this.freeInstance(t),this.events.emit("instances-changed")}freeInstance(t){const e=this._view.state;I(t>=0&&t<this._capacity&&0!=(e.get(t)&M.ALLOCATED),"invalid instance handle"),e.set(t,0),this._size--}setLocalTransform(t,e,s=!0){this._view.localTransform.setMat(t,e),s&&this.updateModelTransform(t)}getLocalTransform(t,e){this._view.localTransform.getMat(t,e)}setGlobalTransform(t,e,s=!0){this._view.globalTransform.setMat(t,e),s&&this.updateModelTransform(t)}getGlobalTransform(t,e){this._view.globalTransform.getMat(t,e)}updateModelTransform(t){const e=this._view,s=w,i=D;e.localTransform.getMat(t,N),e.globalTransform.getMat(t,V);const a=c(V,V,N);f(s,a[12],a[13],a[14]),e.modelOrigin.setVec(t,s),o(i,a),e.model.setMat(t,i);const r=O(w,a);r.sort(),e.modelScaleFactors.set(t,0,r[1]),e.modelScaleFactors.set(t,1,r[2]),n(i,i),l(i,i),e.modelNormal.setMat(t,i),this._setStateFlags(t,M.TRANSFORM_CHANGED),this.events.emit("instance-transform-changed",{index:t})}getModelTransform(t,e){const s=this._view;s.model.getMat(t,D),s.modelOrigin.getVec(t,w),e[0]=D[0],e[1]=D[1],e[2]=D[2],e[3]=0,e[4]=D[3],e[5]=D[4],e[6]=D[5],e[7]=0,e[8]=D[6],e[9]=D[7],e[10]=D[8],e[11]=0,e[12]=w[0],e[13]=w[1],e[14]=w[2],e[15]=1}applyShaderTransformation(t,e){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e)}getCombinedModelTransform(t,e){return this.getModelTransform(t,e),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e),e}getCombinedLocalTransform(t,e){this._view.localTransform.getMat(t,e),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e)}getCombinedMaxScaleFactor(t){let e=this._view.modelScaleFactors.get(t,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(w,this,t),e*=Math.max(w[0],w[1],w[2])),e}getCombinedMedianScaleFactor(t){let e=this._view.modelScaleFactors.get(t,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(w,this,t),e*=b(w[0],w[1],w[2])),e}getModel(t,e){this._view.model.getMat(t,e)}setFeatureAttribute(t,e){this._view.featureAttribute.setVec(t,e)}getFeatureAttribute(t,e){this._view.featureAttribute.getVec(t,e)}setColor(t,e){this._view.color.setVec(t,e)}setObjectAndLayerIdColor(t,e){this._view.objectAndLayerIdColor.setVec(t,e)}setVisible(t,e){e!==this.getVisible(t)&&(this._setStateFlag(t,M.VISIBLE,e),this.events.emit("instance-visibility-changed",{index:t}))}getVisible(t){return this._getStateFlag(t,M.VISIBLE)}setHighlight(t,e){e!==this.getHighlight(t)&&(this._setStateFlag(t,M.HIGHLIGHT,e),this.events.emit("instance-highlight-changed"))}getHighlight(t){return this._getStateFlag(t,M.HIGHLIGHT)}getState(t){return this._view.state.get(t)}getLodLevel(t){return this._view.lodLevel.get(t)}countFlags(t){let e=0;for(let s=0;s<this._capacity;++s){this.getState(s)&t&&++e}return e}_setStateFlags(t,e){const s=this._view.state;e=s.get(t)|e,s.set(t,e)}_clearStateFlags(t,e){const s=this._view.state;e=s.get(t)&~e,s.set(t,e)}_setStateFlag(t,e,s){s?this._setStateFlags(t,e):this._clearStateFlags(t,e)}_getStateFlag(t,e){return!!(this._view.state.get(t)&e)}_grow(){this._capacity=Math.max(S,Math.floor(this._capacity*s)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new R(this._buffer)}_findSlot(){const t=this._view.state;let e=this._next;for(;t.get(e)&M.ALLOCATED;)e=e+1===this._capacity?0:e+1;return this._next=e+1===this._capacity?0:e+1,e}};function b(t,e,s){return Math.max(Math.min(t,e),Math.min(Math.max(t,e),s))}t([a({constructOnly:!0})],y.prototype,"shaderTransformation",void 0),t([a()],y.prototype,"_size",void 0),t([a({readOnly:!0})],y.prototype,"size",null),y=t([r("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],y);const w=g(),D=h(),N=m(),V=m();export{y as InstanceData,R as InstanceDataView,M as StateFlags};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Accessor.js";import{ReallocGrowthFactor as s}from"../../../../../core/arrayUtils.js";import i from"../../../../../core/Evented.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as o,d as n,t as l}from"../../../../../chunks/mat3.js";import{a as h}from"../../../../../chunks/mat3f64.js";import{m as c}from"../../../../../chunks/mat4.js";import{a as m}from"../../../../../chunks/mat4f64.js";import{s as f}from"../../../../../chunks/vec3.js";import{c as g}from"../../../../../chunks/vec3f64.js";import{BufferViewMat4f64 as d,BufferViewVec3f64 as T,BufferViewMat3f as u,BufferViewVec2f as _,BufferViewVec4f64 as p,BufferViewVec4f as L,BufferViewVec4u8 as A,BufferViewUint8 as E}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as O}from"../../../support/mathUtils.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import{assert as I}from"../Util.js";import{VertexAttribute as F}from"../VertexAttribute.js";import{INITIAL_CAPACITY as S}from"./RenderInstanceData.js";var M;function C(t){let e=v().mat4f64(F.LOCALTRANSFORM).mat4f64(F.GLOBALTRANSFORM).vec4f64(F.BOUNDINGSPHERE).vec3f64(F.MODELORIGIN).mat3f(F.INSTANCEMODEL).mat3f(F.INSTANCEMODELNORMAL).vec2f(F.MODELSCALEFACTORS);return t.includes(F.FEATUREATTRIBUTE)&&(e=e.vec4f(F.FEATUREATTRIBUTE)),t.includes(F.COLOR)&&(e=e.vec4u8(F.COLOR)),t.includes(F.OBJECTANDLAYERIDCOLOR)&&(e=e.vec4u8(F.OBJECTANDLAYERIDCOLOR)),e=e.u8(F.STATE).u8(F.LODLEVEL),e}!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"}(M||(M={}));class R{constructor(t){this.localTransform=t.getField(F.LOCALTRANSFORM,d),this.globalTransform=t.getField(F.GLOBALTRANSFORM,d),this.modelOrigin=t.getField(F.MODELORIGIN,T),this.model=t.getField(F.INSTANCEMODEL,u),this.modelNormal=t.getField(F.INSTANCEMODELNORMAL,u),this.modelScaleFactors=t.getField(F.MODELSCALEFACTORS,_),this.boundingSphere=t.getField(F.BOUNDINGSPHERE,p),this.featureAttribute=t.getField(F.FEATUREATTRIBUTE,L),this.color=t.getField(F.COLOR,A),this.objectAndLayerIdColor=t.getField(F.OBJECTANDLAYERIDCOLOR,A),this.state=t.getField(F.STATE,E),this.lodLevel=t.getField(F.LODLEVEL,E)}}let y=class extends e{constructor(t,e){super(t),this.events=new i,this._capacity=0,this._size=0,this._next=0,this._layout=C(e),this._capacity=S,this._buffer=this._layout.createBuffer(this._capacity),this._view=new R(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const t=this._findSlot();return this._view.state.set(t,M.ALLOCATED),this._size++,this.events.emit("instances-changed"),t}removeInstance(t){const e=this._view.state;I(t>=0&&t<this._capacity&&0!=(e.get(t)&M.ALLOCATED),"invalid instance handle"),this._getStateFlag(t,M.ACTIVE)?this._setStateFlags(t,M.REMOVE):this.freeInstance(t),this.events.emit("instances-changed")}freeInstance(t){const e=this._view.state;I(t>=0&&t<this._capacity&&0!=(e.get(t)&M.ALLOCATED),"invalid instance handle"),e.set(t,0),this._size--}setLocalTransform(t,e,s=!0){this._view.localTransform.setMat(t,e),s&&this.updateModelTransform(t)}getLocalTransform(t,e){this._view.localTransform.getMat(t,e)}setGlobalTransform(t,e,s=!0){this._view.globalTransform.setMat(t,e),s&&this.updateModelTransform(t)}getGlobalTransform(t,e){this._view.globalTransform.getMat(t,e)}updateModelTransform(t){const e=this._view,s=w,i=D;e.localTransform.getMat(t,N),e.globalTransform.getMat(t,V);const a=c(V,V,N);f(s,a[12],a[13],a[14]),e.modelOrigin.setVec(t,s),o(i,a),e.model.setMat(t,i);const r=O(w,a);r.sort(),e.modelScaleFactors.set(t,0,r[1]),e.modelScaleFactors.set(t,1,r[2]),n(i,i),l(i,i),e.modelNormal.setMat(t,i),this._setStateFlags(t,M.TRANSFORM_CHANGED),this.events.emit("instance-transform-changed",{index:t})}getModelTransform(t,e){const s=this._view;s.model.getMat(t,D),s.modelOrigin.getVec(t,w),e[0]=D[0],e[1]=D[1],e[2]=D[2],e[3]=0,e[4]=D[3],e[5]=D[4],e[6]=D[5],e[7]=0,e[8]=D[6],e[9]=D[7],e[10]=D[8],e[11]=0,e[12]=w[0],e[13]=w[1],e[14]=w[2],e[15]=1}applyShaderTransformation(t,e){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e)}getCombinedModelTransform(t,e){return this.getModelTransform(t,e),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e),e}getCombinedLocalTransform(t,e){this._view.localTransform.getMat(t,e),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,t,e)}getCombinedMaxScaleFactor(t){let e=this._view.modelScaleFactors.get(t,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(w,this,t),e*=Math.max(w[0],w[1],w[2])),e}getCombinedMedianScaleFactor(t){let e=this._view.modelScaleFactors.get(t,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(w,this,t),e*=b(w[0],w[1],w[2])),e}getModel(t,e){this._view.model.getMat(t,e)}setFeatureAttribute(t,e){this._view.featureAttribute.setVec(t,e)}getFeatureAttribute(t,e){this._view.featureAttribute.getVec(t,e)}setColor(t,e){this._view.color.setVec(t,e)}setObjectAndLayerIdColor(t,e){this._view.objectAndLayerIdColor.setVec(t,e)}setVisible(t,e){e!==this.getVisible(t)&&(this._setStateFlag(t,M.VISIBLE,e),this.events.emit("instance-visibility-changed",{index:t}))}getVisible(t){return this._getStateFlag(t,M.VISIBLE)}setHighlight(t,e){e!==this.getHighlight(t)&&(this._setStateFlag(t,M.HIGHLIGHT,e),this.events.emit("instance-highlight-changed"))}getHighlight(t){return this._getStateFlag(t,M.HIGHLIGHT)}getState(t){return this._view.state.get(t)}getLodLevel(t){return this._view.lodLevel.get(t)}countFlags(t){let e=0;for(let s=0;s<this._capacity;++s){this.getState(s)&t&&++e}return e}_setStateFlags(t,e){const s=this._view.state;e=s.get(t)|e,s.set(t,e)}_clearStateFlags(t,e){const s=this._view.state;e=s.get(t)&~e,s.set(t,e)}_setStateFlag(t,e,s){s?this._setStateFlags(t,e):this._clearStateFlags(t,e)}_getStateFlag(t,e){return!!(this._view.state.get(t)&e)}_grow(){this._capacity=Math.max(S,Math.floor(this._capacity*s)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new R(this._buffer)}_findSlot(){const t=this._view.state;let e=this._next;for(;t.get(e)&M.ALLOCATED;)e=e+1===this._capacity?0:e+1;return this._next=e+1===this._capacity?0:e+1,e}};function b(t,e,s){return Math.max(Math.min(t,e),Math.min(Math.max(t,e),s))}t([a({constructOnly:!0})],y.prototype,"shaderTransformation",void 0),t([a()],y.prototype,"_size",void 0),t([a({readOnly:!0})],y.prototype,"size",null),y=t([r("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],y);const w=g(),D=h(),N=m(),V=m();export{y as InstanceData,R as InstanceDataView,M as StateFlags};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{c as t}from"../../../../../chunks/mat4f64.js";import{m as e}from"../../../../../chunks/vec3.js";import{w as s,c as i}from"../../../../../chunks/sphere.js";import{maxScale as r}from"../../../support/mathUtils.js";import h from"../Octree.js";class n extends h{constructor(e,r){super((t=>s(this._instanceData.view.boundingSphere.getVec(t,this._tmpSphere))),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=r,this._tmpSphere=i(),this._tmpMat4=t()}addInstance(t){const s=this._instanceData.view.boundingSphere,i=this._instanceData.getCombinedModelTransform(t,this._tmpMat4);e(this._tmpSphere,this._boundingSphere.center,i),this._tmpSphere[3]=this._boundingSphere.radius*r(i),s.setVec(t,this._tmpSphere),this.add([t])}removeInstance(t){this.remove([t])}}export{n as InstanceOctree};
5
+ import{a as t}from"../../../../../chunks/mat4f64.js";import{e}from"../../../../../chunks/vec3.js";import{w as s,c as i}from"../../../../../chunks/sphere.js";import{maxScale as r}from"../../../support/mathUtils.js";import h from"../Octree.js";class n extends h{constructor(e,r){super((t=>s(this._instanceData.view.boundingSphere.getVec(t,this._tmpSphere))),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=r,this._tmpSphere=i(),this._tmpMat4=t()}addInstance(t){const s=this._instanceData.view.boundingSphere,i=this._instanceData.getCombinedModelTransform(t,this._tmpMat4);e(this._tmpSphere,this._boundingSphere.center,i),this._tmpSphere[3]=this._boundingSphere.radius*r(i),s.setVec(t,this._tmpSphere),this.add([t])}removeInstance(t){this.remove([t])}}export{n as InstanceOctree};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{isSome as t}from"../../../../../core/arrayUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{isAborted as a,throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{property as n}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{g as l,d as c,m as h}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{c as u,f as m}from"../../../../../chunks/vec4f64.js";import{debugFlags as p}from"../../../support/debugFlags.js";import{glLayout as f}from"../../../support/buffer/glUtil.js";import{newLayout as _}from"../../../support/buffer/InterleavedLayout.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{ASyncPreparesRenderPlugin as I}from"../../effects/RenderPlugin.js";import{Camera as y}from"../Camera.js";import{Default3D as C}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as v}from"../IntersectorInterfaces.js";import E from"../Octree.js";import{RenderSlot as A}from"../RenderSlot.js";import{assert as R}from"../Util.js";import{VertexAttribute as D}from"../VertexAttribute.js";import{InstanceData as T,StateFlags as b}from"./InstanceData.js";import{InstanceOctree as L}from"./InstanceOctree.js";import{LevelSelector as S}from"./LevelSelector.js";import{LodLevel as O}from"./LodLevel.js";import{RenderInstanceData as N}from"./RenderInstanceData.js";import{colorMixModes as j}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as x}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as M}from"../../shaders/DefaultMaterialTechnique.js";import{TaskPriority as U,noBudget as w}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as F,unbindVertexBufferLayout as V}from"../../../../webgl/Util.js";const H=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map((e=>e.minScreenSpaceRadius));return new S(t,r)};let B=class extends I{constructor(e,t){super(e),this.type=v.LOD,this.isGround=!1,this.renderSlots=[A.OPAQUE_MATERIAL,A.TRANSPARENT_MATERIAL],this._levels=[],this._defaultRenderInstanceData=[new Array],this._highlightRenderInstanceData=[new Array],this._allRenderInstanceData=[this._defaultRenderInstanceData[0],this._highlightRenderInstanceData[0]],this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new y,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this._instanceData=new T({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(U.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=q(this.optionalFields),this._glInstanceBufferLayout=f(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",(()=>this._requestUpdateCycle())),this._instanceData.events.on("instance-transform-changed",(({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)})),this._instanceData.events.on("instance-visibility-changed",(({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)})),this._instanceData.events.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0)))])}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get usedMemory(){return this._allRenderInstanceData.reduce(((e,t)=>t.reduce(((e,t)=>e+t.usedMemory),e)),0)}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,r)=>{const a=this._allRenderInstanceData[0][r].size+this._allRenderInstanceData[1][r].size,s=e.triangleCount;t.push({renderedInstances:a,renderedTriangles:a*s,trianglesPerInstance:s})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,r){this._context=e;const n=e.renderContext.rctx,i=await Promise.allSettled(this.symbol.levels.map((t=>(this._defaultRenderInstanceData[0].push(new N(n,this._instanceBufferLayout)),this._highlightRenderInstanceData[0].push(new N(n,this._instanceBufferLayout)),O.create(e,t,r))))),o=i.map((e=>"fulfilled"===e.status?e.value:null)).filter(t);if(a(r)||o.length!==i.length){o.forEach((e=>e.destroy())),s(r);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=o,this._levelSelector=H(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData[0].forEach((e=>e.destroy())),this._highlightRenderInstanceData[0].forEach((e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some((e=>e.components.some((e=>e.material.produces(A.TRANSPARENT_MATERIAL,g.Color)))))}produces(e,t){return t===g.Highlight||t===g.ShadowHighlight?this._highlightRenderInstanceData[0].some((e=>e.size>0)):e!==A.TRANSPARENT_MATERIAL||this._hasTransparentLevels()}prepareRender(e){if(!p.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bindParameters.contentCamera.equals(this._camera);this._camera.copyFrom(e.bindParameters.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(w),this._needFullCycle=!1)}}prepareTechniques(e){if(!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e.output);if(!t)return null;const r=new Array;return t.forEach((t=>this.levels.forEach(((a,s)=>{a.components.forEach((a=>r.push(this._beginComponent(e,t[s],a))))})))),r}render(e,t){const r=this._getInstanceDatas(e.output);if(!r||null==t)return;let a=0;e.rctx.bindVAO(),r.forEach((r=>this.levels.forEach(((s,n)=>{s.components.forEach((s=>this._renderComponent(e,t[a++],r[n],s,n)))}))))}_getInstanceDatas(e){const t=e!==g.Highlight&&e!==g.ShadowHighlight,r=e!==g.ShadowExcludeHighlight;return t&&r?this._allRenderInstanceData:t?this._defaultRenderInstanceData:r?this._highlightRenderInstanceData:null}intersect(e,t,r,a){if(!this.baseMaterial.isVisible()||null==this._octree)return;const s=d();l(s,a,r);const n=s=>{this._instanceData.getCombinedModelTransform(s,W),e.transform.set(W),h(K,r,e.transform.inverse),h(Y,a,e.transform.inverse);const n=this._instanceData.getState(s),i=this._instanceData.getLodLevel(s),o=this._levels.length;R(0!=(n&b.ACTIVE),"invalid instance state"),R(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,K,Y,s,this.metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(n):this._octree.forEachAlongRay(r,s,n)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new L(e,this.baseBoundingSphere);for(let r=0;r<e.capacity;++r)t.get(r)&b.ACTIVE&&this._octreeCached.addInstance(r)}return this._octreeCached}_invalidateOctree(){this._octreeCached=r(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return{near:1/0,far:-1/0};const t=e.viewForward,r=this._octree.findClosest(t,E.DepthOrder.FRONT_TO_BACK,e.frustum),a=this._octree.findClosest(t,E.DepthOrder.BACK_TO_FRONT,e.frustum);if(null==r||null==a)return{near:1/0,far:-1/0};const s=e.eye,n=this._instanceData.view;n.boundingSphere.getVec(r,k),l(k,k,s);const i=c(k,t)-k[3];n.boundingSphere.getVec(a,k),l(k,k,s);const o=c(k,t)+k[3];return{near:Math.max(e.near,i),far:Math.min(e.far,o)}}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach((e=>e.forEach((e=>e.startUpdateCycle()))))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:a}=this;this._allRenderInstanceData.forEach((e=>e.forEach((e=>e.beginUpdate()))));const s=this._instanceData,n=s.view;let i=s.size;const o=s.capacity;let l=this._instanceIndex;const c=Math.ceil(o/500);for(let h=0;h<i&&!e.done;++h){l===this._cycleStartIndex&&this._startUpdateCycle();const h=n.state.get(l);let d=0;if(!(h&b.ALLOCATED)){l=l+1===o?0:l+1,i++;continue}const u=n.lodLevel.get(l);if(h&b.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[0][u].freeTail(),h&b.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[0][u].freeTail(),h&b.REMOVE)s.freeInstance(l);else if(h&b.VISIBLE){let e=0;t&&(n.modelOrigin.getVec(l,z),e=a.selectLevel(z,s.getCombinedMedianScaleFactor(l),r)),d=h&~(b.ACTIVE|b.TRANSFORM_CHANGED),e>=0&&(h&b.HIGHLIGHT?(P(this._highlightRenderInstanceData[0][e],n,l),d|=b.HIGHLIGHT_ACTIVE):(P(this._defaultRenderInstanceData[0][e],n,l),d|=b.DEFAULT_ACTIVE)),n.state.set(l,d),n.lodLevel.set(l,e)}else d=h&~(b.ACTIVE|b.TRANSFORM_CHANGED),n.state.set(l,d);if(null!=this._octreeCached){const e=!!(h&b.ACTIVE),t=!!(d&b.ACTIVE);!e&&t?this._octreeCached.addInstance(l):e&&!t?this._octreeCached.removeInstance(l):e&&t&&h&b.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l))}l=l+1===o?0:l+1,l%c==0&&e.madeProgress()}this._instanceIndex=l,this._allRenderInstanceData.forEach((e=>e.forEach((e=>e.endUpdate())))),this._context.requestRender()}_beginComponent(e,t,r){const{bindParameters:a,rctx:s,output:n}=e;if(0===t.size||!r.material.produces(a.slot,e.output))return null;const i=r.glMaterials.load(s,a.slot,n);return null!=i?i.beginSlot(a):null}_renderComponent(e,t,r,a,s){if(!t)return;const{bindParameters:n,rctx:i}=e;i.appleAmdDriverHelper?.resetIndicesType();const o=i.bindTechnique(t,a.material.parameters,n);i.bindVAO(a.vao),t.ensureAttributeLocations(a.vao),o.bindDraw(Q,n,a.material.parameters),p.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===g.Color&&(o.setUniform4fv("externalColor",J[Math.min(s,J.length-1)]),o.setUniform1i("colorMixMode",j.replace));const l=r.capacity,c=r.headIndex,h=r.tailIndex,d=r.firstIndex,u=this._glInstanceBufferLayout,m=(e,s)=>{F(i,C,r.buffer,u,e),i.drawArraysInstanced(t.primitiveType,0,a.vertexCount,s-e),V(i,C,r.buffer,u)};a.material.parameters.transparent&&null!=d?c>h?(R(d>=h&&d<=c,"invalid firstIndex"),m(d,c),m(h,d)):c<h&&(d<=c?(R(d>=0&&d<=c,"invalid firstIndex"),m(d,c),m(h,l),m(0,d)):(R(d>=h&&d<=l,"invalid firstIndex"),m(d,l),m(0,c),m(h,d))):c>h?m(h,c):c<h&&(m(0,c),m(h,l)),i.bindVAO(null)}};function P(e,t,r){const a=e.allocateHead();G(t,r,e.view,a)}function G(e,t,r,a){x(e.modelOrigin,t,r.modelOriginHi,r.modelOriginLo,a),r.model.copyFrom(a,e.model,t),r.modelNormal.copyFrom(a,e.modelNormal,t),e.color&&r.color&&r.color.copyFrom(a,e.color,t),e.objectAndLayerIdColor&&r.objectAndLayerIdColor&&r.objectAndLayerIdColor.copyFrom(a,e.objectAndLayerIdColor,t),e.featureAttribute&&r.featureAttribute&&r.featureAttribute.copyFrom(a,e.featureAttribute,t)}function q(e){let t=_().vec3f(D.INSTANCEMODELORIGINHI).vec3f(D.INSTANCEMODELORIGINLO).mat3f(D.INSTANCEMODEL).mat3f(D.INSTANCEMODELNORMAL);return null!=e&&e.includes("featureAttribute")&&(t=t.vec4f(D.INSTANCEFEATUREATTRIBUTE)),null!=e&&e.includes("color")&&(t=t.vec4u8(D.INSTANCECOLOR)),null!=e&&e.includes("objectAndLayerIdColor")&&(t=t.vec4u8(D.INSTANCEOBJECTANDLAYERIDCOLOR)),t}e([n({constructOnly:!0})],B.prototype,"symbol",void 0),e([n({constructOnly:!0})],B.prototype,"optionalFields",void 0),e([n({constructOnly:!0})],B.prototype,"metadata",void 0),e([n({constructOnly:!0})],B.prototype,"shaderTransformation",void 0),e([n()],B.prototype,"_instanceData",void 0),e([n()],B.prototype,"_cycleStartIndex",void 0),e([n({readOnly:!0})],B.prototype,"_enableLevelSelection",null),e([n()],B.prototype,"_updateCyclesWithStaticCamera",void 0),e([n({readOnly:!0})],B.prototype,"running",null),B=e([i("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],B);const z=d(),k=u(),W=o(),K=d(),Y=d(),J=[m(1,0,1,1),m(0,0,1,1),m(0,1,0,1),m(1,1,0,1),m(1,0,0,1)],Q=new M;export{B as LodRenderer};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{isSome as t}from"../../../../../core/arrayUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{isAborted as a,throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{property as n}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import{a as o}from"../../../../../chunks/mat4f64.js";import{f as l,j as c,e as h}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{c as u,a as m}from"../../../../../chunks/vec4f64.js";import{debugFlags as p}from"../../../support/debugFlags.js";import{glLayout as f}from"../../../support/buffer/glUtil.js";import{newLayout as _}from"../../../support/buffer/InterleavedLayout.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{ASyncPreparesRenderPlugin as I}from"../../effects/RenderPlugin.js";import{Camera as y}from"../Camera.js";import{Default3D as C}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as v}from"../IntersectorInterfaces.js";import E from"../Octree.js";import{RenderSlot as A}from"../RenderSlot.js";import{assert as R}from"../Util.js";import{VertexAttribute as D}from"../VertexAttribute.js";import{InstanceData as T,StateFlags as b}from"./InstanceData.js";import{InstanceOctree as L}from"./InstanceOctree.js";import{LevelSelector as S}from"./LevelSelector.js";import{LodLevel as O}from"./LodLevel.js";import{RenderInstanceData as j}from"./RenderInstanceData.js";import{colorMixModes as N}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as x}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as M}from"../../shaders/DefaultMaterialTechnique.js";import{TaskPriority as U,noBudget as w}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as F,unbindVertexBufferLayout as V}from"../../../../webgl/Util.js";const H=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map((e=>e.minScreenSpaceRadius));return new S(t,r)};let B=class extends I{constructor(e,t){super(e),this.type=v.LOD,this.isGround=!1,this.renderSlots=[A.OPAQUE_MATERIAL,A.TRANSPARENT_MATERIAL],this._levels=[],this._defaultRenderInstanceData=[new Array],this._highlightRenderInstanceData=[new Array],this._allRenderInstanceData=[this._defaultRenderInstanceData[0],this._highlightRenderInstanceData[0]],this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new y,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this._instanceData=new T({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(U.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=q(this.optionalFields),this._glInstanceBufferLayout=f(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",(()=>this._requestUpdateCycle())),this._instanceData.events.on("instance-transform-changed",(({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)})),this._instanceData.events.on("instance-visibility-changed",(({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)})),this._instanceData.events.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0)))])}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get usedMemory(){return this._allRenderInstanceData.reduce(((e,t)=>t.reduce(((e,t)=>e+t.usedMemory),e)),0)}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,r)=>{const a=this._allRenderInstanceData[0][r].size+this._allRenderInstanceData[1][r].size,s=e.triangleCount;t.push({renderedInstances:a,renderedTriangles:a*s,trianglesPerInstance:s})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,r){this._context=e;const n=e.renderContext.rctx,i=await Promise.allSettled(this.symbol.levels.map((t=>(this._defaultRenderInstanceData[0].push(new j(n,this._instanceBufferLayout)),this._highlightRenderInstanceData[0].push(new j(n,this._instanceBufferLayout)),O.create(e,t,r))))),o=i.map((e=>"fulfilled"===e.status?e.value:null)).filter(t);if(a(r)||o.length!==i.length){o.forEach((e=>e.destroy())),s(r);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=o,this._levelSelector=H(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData[0].forEach((e=>e.destroy())),this._highlightRenderInstanceData[0].forEach((e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some((e=>e.components.some((e=>e.material.produces(A.TRANSPARENT_MATERIAL,g.Color)))))}produces(e,t){return t===g.Highlight||t===g.ShadowHighlight?this._highlightRenderInstanceData[0].some((e=>e.size>0)):e!==A.TRANSPARENT_MATERIAL||this._hasTransparentLevels()}prepareRender(e){if(!p.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bindParameters.contentCamera.equals(this._camera);this._camera.copyFrom(e.bindParameters.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(w),this._needFullCycle=!1)}}prepareTechniques(e){if(!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e.output);if(!t)return null;const r=new Array;return t.forEach((t=>this.levels.forEach(((a,s)=>{a.components.forEach((a=>r.push(this._beginComponent(e,t[s],a))))})))),r}render(e,t){const r=this._getInstanceDatas(e.output);if(!r||null==t)return;let a=0;e.rctx.bindVAO(),r.forEach((r=>this.levels.forEach(((s,n)=>{s.components.forEach((s=>this._renderComponent(e,t[a++],r[n],s,n)))}))))}_getInstanceDatas(e){const t=e!==g.Highlight&&e!==g.ShadowHighlight,r=e!==g.ShadowExcludeHighlight;return t&&r?this._allRenderInstanceData:t?this._defaultRenderInstanceData:r?this._highlightRenderInstanceData:null}intersect(e,t,r,a){if(!this.baseMaterial.isVisible()||null==this._octree)return;const s=d();l(s,a,r);const n=s=>{this._instanceData.getCombinedModelTransform(s,W),e.transform.set(W),h(K,r,e.transform.inverse),h(Y,a,e.transform.inverse);const n=this._instanceData.getState(s),i=this._instanceData.getLodLevel(s),o=this._levels.length;R(0!=(n&b.ACTIVE),"invalid instance state"),R(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,K,Y,s,this.metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(n):this._octree.forEachAlongRay(r,s,n)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new L(e,this.baseBoundingSphere);for(let r=0;r<e.capacity;++r)t.get(r)&b.ACTIVE&&this._octreeCached.addInstance(r)}return this._octreeCached}_invalidateOctree(){this._octreeCached=r(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return{near:1/0,far:-1/0};const t=e.viewForward,r=this._octree.findClosest(t,E.DepthOrder.FRONT_TO_BACK,e.frustum),a=this._octree.findClosest(t,E.DepthOrder.BACK_TO_FRONT,e.frustum);if(null==r||null==a)return{near:1/0,far:-1/0};const s=e.eye,n=this._instanceData.view;n.boundingSphere.getVec(r,k),l(k,k,s);const i=c(k,t)-k[3];n.boundingSphere.getVec(a,k),l(k,k,s);const o=c(k,t)+k[3];return{near:Math.max(e.near,i),far:Math.min(e.far,o)}}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach((e=>e.forEach((e=>e.startUpdateCycle()))))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:a}=this;this._allRenderInstanceData.forEach((e=>e.forEach((e=>e.beginUpdate()))));const s=this._instanceData,n=s.view;let i=s.size;const o=s.capacity;let l=this._instanceIndex;const c=Math.ceil(o/500);for(let h=0;h<i&&!e.done;++h){l===this._cycleStartIndex&&this._startUpdateCycle();const h=n.state.get(l);let d=0;if(!(h&b.ALLOCATED)){l=l+1===o?0:l+1,i++;continue}const u=n.lodLevel.get(l);if(h&b.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[0][u].freeTail(),h&b.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[0][u].freeTail(),h&b.REMOVE)s.freeInstance(l);else if(h&b.VISIBLE){let e=0;t&&(n.modelOrigin.getVec(l,z),e=a.selectLevel(z,s.getCombinedMedianScaleFactor(l),r)),d=h&~(b.ACTIVE|b.TRANSFORM_CHANGED),e>=0&&(h&b.HIGHLIGHT?(P(this._highlightRenderInstanceData[0][e],n,l),d|=b.HIGHLIGHT_ACTIVE):(P(this._defaultRenderInstanceData[0][e],n,l),d|=b.DEFAULT_ACTIVE)),n.state.set(l,d),n.lodLevel.set(l,e)}else d=h&~(b.ACTIVE|b.TRANSFORM_CHANGED),n.state.set(l,d);if(null!=this._octreeCached){const e=!!(h&b.ACTIVE),t=!!(d&b.ACTIVE);!e&&t?this._octreeCached.addInstance(l):e&&!t?this._octreeCached.removeInstance(l):e&&t&&h&b.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(l),this._octreeCached.addInstance(l))}l=l+1===o?0:l+1,l%c==0&&e.madeProgress()}this._instanceIndex=l,this._allRenderInstanceData.forEach((e=>e.forEach((e=>e.endUpdate())))),this._context.requestRender()}_beginComponent(e,t,r){const{bindParameters:a,rctx:s,output:n}=e;if(0===t.size||!r.material.produces(a.slot,e.output))return null;const i=r.glMaterials.load(s,a.slot,n);return null!=i?i.beginSlot(a):null}_renderComponent(e,t,r,a,s){if(!t)return;const{bindParameters:n,rctx:i}=e;i.appleAmdDriverHelper?.resetIndicesType();const o=i.bindTechnique(t,a.material.parameters,n);i.bindVAO(a.vao),t.ensureAttributeLocations(a.vao),o.bindDraw(Q,n,a.material.parameters),p.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===g.Color&&(o.setUniform4fv("externalColor",J[Math.min(s,J.length-1)]),o.setUniform1i("colorMixMode",N.replace));const l=r.capacity,c=r.headIndex,h=r.tailIndex,d=r.firstIndex,u=this._glInstanceBufferLayout,m=(e,s)=>{F(i,C,r.buffer,u,e),i.drawArraysInstanced(t.primitiveType,0,a.vertexCount,s-e),V(i,C,r.buffer,u)};a.material.parameters.transparent&&null!=d?c>h?(R(d>=h&&d<=c,"invalid firstIndex"),m(d,c),m(h,d)):c<h&&(d<=c?(R(d>=0&&d<=c,"invalid firstIndex"),m(d,c),m(h,l),m(0,d)):(R(d>=h&&d<=l,"invalid firstIndex"),m(d,l),m(0,c),m(h,d))):c>h?m(h,c):c<h&&(m(0,c),m(h,l)),i.bindVAO(null)}};function P(e,t,r){const a=e.allocateHead();G(t,r,e.view,a)}function G(e,t,r,a){x(e.modelOrigin,t,r.modelOriginHi,r.modelOriginLo,a),r.model.copyFrom(a,e.model,t),r.modelNormal.copyFrom(a,e.modelNormal,t),e.color&&r.color&&r.color.copyFrom(a,e.color,t),e.objectAndLayerIdColor&&r.objectAndLayerIdColor&&r.objectAndLayerIdColor.copyFrom(a,e.objectAndLayerIdColor,t),e.featureAttribute&&r.featureAttribute&&r.featureAttribute.copyFrom(a,e.featureAttribute,t)}function q(e){let t=_().vec3f(D.INSTANCEMODELORIGINHI).vec3f(D.INSTANCEMODELORIGINLO).mat3f(D.INSTANCEMODEL).mat3f(D.INSTANCEMODELNORMAL);return null!=e&&e.includes("featureAttribute")&&(t=t.vec4f(D.INSTANCEFEATUREATTRIBUTE)),null!=e&&e.includes("color")&&(t=t.vec4u8(D.INSTANCECOLOR)),null!=e&&e.includes("objectAndLayerIdColor")&&(t=t.vec4u8(D.INSTANCEOBJECTANDLAYERIDCOLOR)),t}e([n({constructOnly:!0})],B.prototype,"symbol",void 0),e([n({constructOnly:!0})],B.prototype,"optionalFields",void 0),e([n({constructOnly:!0})],B.prototype,"metadata",void 0),e([n({constructOnly:!0})],B.prototype,"shaderTransformation",void 0),e([n()],B.prototype,"_instanceData",void 0),e([n()],B.prototype,"_cycleStartIndex",void 0),e([n({readOnly:!0})],B.prototype,"_enableLevelSelection",null),e([n()],B.prototype,"_updateCyclesWithStaticCamera",void 0),e([n({readOnly:!0})],B.prototype,"running",null),B=e([i("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],B);const z=d(),k=u(),W=o(),K=d(),Y=d(),J=[m(1,0,1,1),m(0,0,1,1),m(0,1,0,1),m(1,1,0,1),m(1,0,0,1)],Q=new M;export{B as LodRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{a as e,c as n}from"../../../../chunks/vec3f64.js";import{g as t}from"../../../../chunks/sphere.js";import r from"./Octree.js";function s(e){const n={numNodes:0,numObjects:0,numTerminals:0,numResidents:0,numOutsiders:0,numInnerNodes:0,numTerminalNodes:0,maximumDepth:0,maxNumTerminals:0,maxNumResidents:0,maxNumObjects:0};return e.forEachNode(((t,r,s)=>{null===t.residents?n.numInnerNodes++:n.numTerminalNodes++,n.numTerminals+=t.terminals.length,n.maxNumTerminals=Math.max(t.terminals.length,n.maxNumTerminals);let i=t.terminals.length;null!==t.residents&&(n.numResidents+=t.residents.length,n.maxNumResidents=Math.max(t.residents.length,n.maxNumResidents),i+=t.residents.length),n.maxNumObjects=Math.max(i,n.maxNumObjects);const m=Math.round(Math.log(2*e.halfSize/s)*Math.LOG2E);return n.maximumDepth=Math.max(n.maximumDepth,m),!0})),n.numObjects=n.numOutsiders+n.numTerminals+n.numResidents,n.numNodes=n.numInnerNodes+n.numTerminalNodes,n}function i(n,s=!1){const m=n instanceof r?n.root:n,a={};return n instanceof r&&s&&(a.center=e(t(n.bounds)),a.size=2*n.halfSize),m.terminals.length>0&&(a.terminals=m.terminals.map((e=>e.id))),null!==m.residents&&m.residents.length>0&&(a.residents=m.residents.map((e=>e.id))),null===m.residents&&m.children.forEach(((e,n)=>{e&&(a["child"+n]=i(e))})),a}function m(e,r){return e.forEachNode(((s,i,m)=>{const l=o(t(i),-m,n()),d=o(t(i),m,n());if(s.terminals.forAll((e=>a(r(e),l,d,!0))),null!==s.residents){if(s.residents.length>e.maximumObjectsPerNode)throw new Error("[Octree Validation] Number of objects "+s.residents.length+" exceeds maximum allowed ("+e.maximumObjectsPerNode+")");s.residents.forAll((e=>a(r(e),l,d,!1)))}let u=!1;if(s.children.forEach((e=>{if(e&&(u=!0,null!==s.residents))throw new Error("[Octree Validation] Node has residents and children")})),!u&&(null===s.residents||0===s.residents.length)&&0===s.terminals.length)throw new Error("[Octree Validation] dangling empty node");return!0})),!0}function a(e,n,t,r){for(let i=0;i<3;i++)if(e[i]<n[i]||e[i]>t[i])throw new Error("[Octree Validation] Object is not within node bounds");const s=.25*(t[0]-n[0]);if(r&&e[3]<s)throw new Error("[Octree Validation] Object is too small to be a terminal");if(!r&&e[3]>s)throw new Error("[Octree Validation] Object is too large to be a resident")}function o(e,n,t){return t[0]=e[0]+n,t[1]=e[1]+n,t[2]=e[2]+n,t}export{m as assert,i as debugDump,s as stats};
5
+ import{g as e,c as n}from"../../../../chunks/vec3f64.js";import{g as t}from"../../../../chunks/sphere.js";import r from"./Octree.js";function s(e){const n={numNodes:0,numObjects:0,numTerminals:0,numResidents:0,numOutsiders:0,numInnerNodes:0,numTerminalNodes:0,maximumDepth:0,maxNumTerminals:0,maxNumResidents:0,maxNumObjects:0};return e.forEachNode(((t,r,s)=>{null===t.residents?n.numInnerNodes++:n.numTerminalNodes++,n.numTerminals+=t.terminals.length,n.maxNumTerminals=Math.max(t.terminals.length,n.maxNumTerminals);let i=t.terminals.length;null!==t.residents&&(n.numResidents+=t.residents.length,n.maxNumResidents=Math.max(t.residents.length,n.maxNumResidents),i+=t.residents.length),n.maxNumObjects=Math.max(i,n.maxNumObjects);const m=Math.round(Math.log(2*e.halfSize/s)*Math.LOG2E);return n.maximumDepth=Math.max(n.maximumDepth,m),!0})),n.numObjects=n.numOutsiders+n.numTerminals+n.numResidents,n.numNodes=n.numInnerNodes+n.numTerminalNodes,n}function i(n,s=!1){const m=n instanceof r?n.root:n,a={};return n instanceof r&&s&&(a.center=e(t(n.bounds)),a.size=2*n.halfSize),m.terminals.length>0&&(a.terminals=m.terminals.map((e=>e.id))),null!==m.residents&&m.residents.length>0&&(a.residents=m.residents.map((e=>e.id))),null===m.residents&&m.children.forEach(((e,n)=>{e&&(a["child"+n]=i(e))})),a}function m(e,r){return e.forEachNode(((s,i,m)=>{const l=o(t(i),-m,n()),d=o(t(i),m,n());if(s.terminals.forAll((e=>a(r(e),l,d,!0))),null!==s.residents){if(s.residents.length>e.maximumObjectsPerNode)throw new Error("[Octree Validation] Number of objects "+s.residents.length+" exceeds maximum allowed ("+e.maximumObjectsPerNode+")");s.residents.forAll((e=>a(r(e),l,d,!1)))}let u=!1;if(s.children.forEach((e=>{if(e&&(u=!0,null!==s.residents))throw new Error("[Octree Validation] Node has residents and children")})),!u&&(null===s.residents||0===s.residents.length)&&0===s.terminals.length)throw new Error("[Octree Validation] dangling empty node");return!0})),!0}function a(e,n,t,r){for(let i=0;i<3;i++)if(e[i]<n[i]||e[i]>t[i])throw new Error("[Octree Validation] Object is not within node bounds");const s=.25*(t[0]-n[0]);if(r&&e[3]<s)throw new Error("[Octree Validation] Object is too small to be a terminal");if(!r&&e[3]>s)throw new Error("[Octree Validation] Object is too large to be a resident")}function o(e,n,t){return t[0]=e[0]+n,t[1]=e[1]+n,t[2]=e[2]+n,t}export{m as assert,i as debugDump,s as stats};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{s as t}from"../../../../chunks/vec2.js";import{d as r,i as e,s,e as o,l as i,n as f,c as m}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{create as a,fromPositionAndNormal as u,intersectRay as c}from"../../../../geometry/support/plane.js";import{wrap as n}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as h}from"./GeometryUtil.js";function g(t,r,e){t[0]=e[0]*r.right[0]+e[1]*r.up[0],t[1]=e[0]*r.right[1]+e[1]*r.up[1],t[2]=e[0]*r.right[2]+e[1]*r.up[2]}function v(e,s,o){t(e,r(o,s.right),r(o,s.up))}function l(t,r){let g=null;const v=t.vertices.length,l=.99619469809,R=p(),y=p(),k=p(),L=p(),d=p(),q=p(),x=a();let G=t.vertices[0];e(y,r),s(R,0,1,0),h(G.vRight,y,R,R,k,y,l),e(G.frame.up,y),e(G.frame.right,k);const M=t.positions;let U=t.offset;g=G;for(let p=1;p<v;++p){G=t.vertices[p],o(d,G.vLeft,G.vRight);let r=i(d);r>0?(r=1/Math.sqrt(r),d[0]=d[0]*r,d[1]=d[1]*r,d[2]=d[2]*r):(d[0]=G.vRight[0],d[1]=G.vRight[1],d[2]=G.vRight[2]),q[0]=M[U]+g.frame.up[0],q[1]=M[U+1]+g.frame.up[1],q[2]=M[U+2]+g.frame.up[2],U+=3;const a=s(j,M[U],M[U+1],M[U+2]);u(a,d,x);c(x,n(q,G.vLeft),L)?(L[0]-=M[U],L[1]-=M[U+1],L[2]-=M[U+2],f(y,L),m(k,d,y),f(k,k)):h(d,g.frame.up,g.frame.right,R,k,y,l),e(G.frame.up,y),e(G.frame.right,k),g=G}}const j=p();export{l as computeMinimumRotationTangentFrame,g as profileSpaceToVertexSpace,v as vertexSpaceToProfileSpace};
5
+ import{s as t}from"../../../../chunks/vec2.js";import{j as r,c as e,s,g as o,l as i,n as f,b as m}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{create as a,fromPositionAndNormal as u,intersectRay as c}from"../../../../geometry/support/plane.js";import{wrap as n}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as h}from"./GeometryUtil.js";function g(t,r,e){t[0]=e[0]*r.right[0]+e[1]*r.up[0],t[1]=e[0]*r.right[1]+e[1]*r.up[1],t[2]=e[0]*r.right[2]+e[1]*r.up[2]}function v(e,s,o){t(e,r(o,s.right),r(o,s.up))}function l(t,r){let g=null;const v=t.vertices.length,l=.99619469809,R=p(),y=p(),k=p(),L=p(),b=p(),q=p(),x=a();let G=t.vertices[0];e(y,r),s(R,0,1,0),h(G.vRight,y,R,R,k,y,l),e(G.frame.up,y),e(G.frame.right,k);const M=t.positions;let U=t.offset;g=G;for(let p=1;p<v;++p){G=t.vertices[p],o(b,G.vLeft,G.vRight);let r=i(b);r>0?(r=1/Math.sqrt(r),b[0]=b[0]*r,b[1]=b[1]*r,b[2]=b[2]*r):(b[0]=G.vRight[0],b[1]=G.vRight[1],b[2]=G.vRight[2]),q[0]=M[U]+g.frame.up[0],q[1]=M[U+1]+g.frame.up[1],q[2]=M[U+2]+g.frame.up[2],U+=3;const a=s(j,M[U],M[U+1],M[U+2]);u(a,b,x);c(x,n(q,G.vLeft),L)?(L[0]-=M[U],L[1]-=M[U+1],L[2]-=M[U+2],f(y,L),m(k,b,y),f(k,k)):h(b,g.frame.up,g.frame.right,R,k,y,l),e(G.frame.up,y),e(G.frame.right,k),g=G}}const j=p();export{l as computeMinimumRotationTangentFrame,g as profileSpaceToVertexSpace,v as vertexSpaceToProfileSpace};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{n as t}from"../../../../chunks/mat3.js";import{c as s}from"../../../../chunks/mat3f64.js";import{a as r,t as e,c as o,m as i}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{s as a,e as f,l as h,q as l,r as m,u as c,v as _,w as p,m as u}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{c as O}from"../../../../chunks/sphere.js";import{ViewingMode as T}from"../../../ViewingMode.js";import{create as g,computeOffsetObb as b}from"../../support/orientedBoundingBox.js";class y{constructor(){this._transform=n(),this._transformInverse=new d({value:this._transform},r,n),this._transformInverseTranspose=new d(this._transformInverse,e,n),this._transformTranspose=new d({value:this._transform},e,n),this._transformInverseRotation=new d({value:this._transform},t,s)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(t){o(this._transform,t)}multiplyTransform(t){i(this._transform,this._transform,t)}set(t){o(this._transform,t),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(t,s){this.setTransformMatrix(t),this.multiplyTransform(s),this._invalidateLazyTransforms()}}class d{constructor(t,s,r){this._original=t,this._update=s,this._dirty=!0,this._transform=r()}invalidate(){this._dirty=!0}get value(){return this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1),this._transform}}class x{constructor(t=0){this.offset=t,this.tmpVertex=v()}applyToVertex(t,s,r){const e=a(R,t,s,r),o=f(q,e,this.localOrigin),i=this.offset/h(o);return l(this.tmpVertex,e,o,i),this.tmpVertex}applyToAabb(t){const s=B,r=G,e=S;for(let a=0;a<3;++a)s[a]=t[0+a]+this.localOrigin[a],r[a]=t[3+a]+this.localOrigin[a],e[a]=s[a];const o=this.applyToVertex(s[0],s[1],s[2]);for(let a=0;a<3;++a)t[a]=o[a],t[a+3]=o[a];const i=s=>{const r=this.applyToVertex(s[0],s[1],s[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],r[e]),t[e+3]=Math.max(t[e+3],r[e])};for(let a=1;a<8;++a){for(let t=0;t<3;++t)e[t]=0==(a&1<<t)?s[t]:r[t];i(e)}let n=0;for(let a=0;a<3;++a){s[a]*r[a]<0&&(n|=1<<a)}if(0!==n&&7!==n)for(let a=0;a<8;++a)if(0==(n&a)){for(let t=0;t<3;++t)e[t]=0!=(n&1<<t)?0:0!=(a&1<<t)?s[t]:r[t];i(e)}for(let a=0;a<3;++a)t[a]-=this.localOrigin[a],t[a+3]-=this.localOrigin[a];return t}}class V{constructor(t=0){this.componentLocalOriginLength=0,this._tmpVertex=v(),this._mbs=O(),this._obb=g(),this._totalOffset=0,this._offset=0,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=h(t)}applyToVertex(t,s,r){const e=a(R,t,s,r),o=a(q,t,s,r+this.componentLocalOriginLength),i=this._totalOffset/h(o);return l(this._tmpVertex,e,o,i),this._tmpVertex}applyToAabb(t){const s=a(R,t[0],t[1],t[2]+this.componentLocalOriginLength),r=a(q,t[3],t[4],t[5]+this.componentLocalOriginLength),e=m(B,s),o=m(G,r),i=c(S,s),n=c(C,r),f=_(D,i,n);f[0]=e[0]*o[0]<0?0:f[0],f[1]=e[1]*o[1]<0?0:f[1],f[2]=e[2]*o[2]<0?0:f[2];const l=h(f);if(l<this._totalOffset)return t[0]-=s[0]<0?this._totalOffset:0,t[1]-=s[1]<0?this._totalOffset:0,t[2]-=s[2]<0?this._totalOffset:0,t[3]+=r[0]>0?this._totalOffset:0,t[4]+=r[1]>0?this._totalOffset:0,t[5]+=r[2]>0?this._totalOffset:0,t;const u=p(D,i,n),v=h(u),O=this._totalOffset/v,T=this._totalOffset/l;return t[0]+=s[0]*(s[0]>0?O:T),t[1]+=s[1]*(s[1]>0?O:T),t[2]+=s[2]*(s[2]>0?O:T),t[3]+=r[0]*(r[0]<0?O:T),t[4]+=r[1]*(r[1]<0?O:T),t[5]+=r[2]*(r[2]<0?O:T),t}applyToMbs(t){const s=h(t),r=this._totalOffset/s;return l(this._mbs,t,t,r),this._mbs[3]=t[3]+t[3]*this._totalOffset/s,this._mbs}applyToObb(t){return b(t,this._totalOffset,this._totalOffset,T.Global,this._obb),this._obb}}class L{constructor(t=0){this.offset=t,this.sphere=O(),this.tmpVertex=v()}applyToVertex(t,s,r){const e=this.objectTransform.transform,o=a(R,t,s,r),i=u(o,o,e),n=this.offset/h(i);l(i,i,i,n);const f=this.objectTransform.inverse;return u(this.tmpVertex,i,f),this.tmpVertex}applyToMinMax(t,s){const r=this.offset/h(t);l(t,t,t,r);const e=this.offset/h(s);l(s,s,s,e)}applyToAabb(t){const s=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*s,t[1]+=t[1]*s,t[2]+=t[2]*s;const r=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*r,t[4]+=t[4]*r,t[5]+=t[5]*r,t}applyToBoundingSphere(t){const s=h(t),r=this.offset/s;return l(this.sphere,t,t,r),this.sphere[3]=t[3]+t[3]*this.offset/s,this.sphere}}const j=new L;function I(t){return null!=t?(j.offset=t,j):null}const M=new V;function w(t){return null!=t?(M.offset=t,M):null}const k=new x;function z(t){return null!=t?(k.offset=t,k):null}const A="terrain",R=v(),q=v(),B=v(),G=v(),S=v(),C=v(),D=v();export{V as I3SVerticalOffsetGlobalViewingMode,y as IntersectorTransform,L as Object3DVerticalOffsetGlobalViewingMode,A as TERRAIN_ID,x as TerrainVerticalOffsetGlobalViewingMode,w as getVerticalOffsetI3S,I as getVerticalOffsetObject3D,z as getVerticalOffsetTerrain};
5
+ import{e as t}from"../../../../chunks/mat3.js";import{a as s}from"../../../../chunks/mat3f64.js";import{i as r,t as e,h as o,m as i}from"../../../../chunks/mat4.js";import{a as n}from"../../../../chunks/mat4f64.js";import{s as a,g as f,l as h,y as l,z as m,v as c,w as _,D as p,e as u}from"../../../../chunks/vec3.js";import{c as v}from"../../../../chunks/vec3f64.js";import{c as O}from"../../../../chunks/sphere.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{create as T,computeOffsetObb as y}from"../../support/orientedBoundingBox.js";class b{constructor(){this._transform=n(),this._transformInverse=new d({value:this._transform},r,n),this._transformInverseTranspose=new d(this._transformInverse,e,n),this._transformTranspose=new d({value:this._transform},e,n),this._transformInverseRotation=new d({value:this._transform},t,s)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(t){o(this._transform,t)}multiplyTransform(t){i(this._transform,this._transform,t)}set(t){o(this._transform,t),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(t,s){this.setTransformMatrix(t),this.multiplyTransform(s),this._invalidateLazyTransforms()}}class d{constructor(t,s,r){this._original=t,this._update=s,this._dirty=!0,this._transform=r()}invalidate(){this._dirty=!0}get value(){return this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1),this._transform}}class x{constructor(t=0){this.offset=t,this.tmpVertex=v()}applyToVertex(t,s,r){const e=a(R,t,s,r),o=f(B,e,this.localOrigin),i=this.offset/h(o);return l(this.tmpVertex,e,o,i),this.tmpVertex}applyToAabb(t){const s=q,r=D,e=G;for(let a=0;a<3;++a)s[a]=t[0+a]+this.localOrigin[a],r[a]=t[3+a]+this.localOrigin[a],e[a]=s[a];const o=this.applyToVertex(s[0],s[1],s[2]);for(let a=0;a<3;++a)t[a]=o[a],t[a+3]=o[a];const i=s=>{const r=this.applyToVertex(s[0],s[1],s[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],r[e]),t[e+3]=Math.max(t[e+3],r[e])};for(let a=1;a<8;++a){for(let t=0;t<3;++t)e[t]=0==(a&1<<t)?s[t]:r[t];i(e)}let n=0;for(let a=0;a<3;++a){s[a]*r[a]<0&&(n|=1<<a)}if(0!==n&&7!==n)for(let a=0;a<8;++a)if(0==(n&a)){for(let t=0;t<3;++t)e[t]=0!=(n&1<<t)?0:0!=(a&1<<t)?s[t]:r[t];i(e)}for(let a=0;a<3;++a)t[a]-=this.localOrigin[a],t[a+3]-=this.localOrigin[a];return t}}class V{constructor(t=0){this.componentLocalOriginLength=0,this._tmpVertex=v(),this._mbs=O(),this._obb=T(),this._totalOffset=0,this._offset=0,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=h(t)}applyToVertex(t,s,r){const e=a(R,t,s,r),o=a(B,t,s,r+this.componentLocalOriginLength),i=this._totalOffset/h(o);return l(this._tmpVertex,e,o,i),this._tmpVertex}applyToAabb(t){const s=a(R,t[0],t[1],t[2]+this.componentLocalOriginLength),r=a(B,t[3],t[4],t[5]+this.componentLocalOriginLength),e=m(q,s),o=m(D,r),i=c(G,s),n=c(S,r),f=_(C,i,n);f[0]=e[0]*o[0]<0?0:f[0],f[1]=e[1]*o[1]<0?0:f[1],f[2]=e[2]*o[2]<0?0:f[2];const l=h(f);if(l<this._totalOffset)return t[0]-=s[0]<0?this._totalOffset:0,t[1]-=s[1]<0?this._totalOffset:0,t[2]-=s[2]<0?this._totalOffset:0,t[3]+=r[0]>0?this._totalOffset:0,t[4]+=r[1]>0?this._totalOffset:0,t[5]+=r[2]>0?this._totalOffset:0,t;const u=p(C,i,n),v=h(u),O=this._totalOffset/v,g=this._totalOffset/l;return t[0]+=s[0]*(s[0]>0?O:g),t[1]+=s[1]*(s[1]>0?O:g),t[2]+=s[2]*(s[2]>0?O:g),t[3]+=r[0]*(r[0]<0?O:g),t[4]+=r[1]*(r[1]<0?O:g),t[5]+=r[2]*(r[2]<0?O:g),t}applyToMbs(t){const s=h(t),r=this._totalOffset/s;return l(this._mbs,t,t,r),this._mbs[3]=t[3]+t[3]*this._totalOffset/s,this._mbs}applyToObb(t){return y(t,this._totalOffset,this._totalOffset,g.Global,this._obb),this._obb}}class L{constructor(t=0){this.offset=t,this.sphere=O(),this.tmpVertex=v()}applyToVertex(t,s,r){const e=this.objectTransform.transform,o=a(R,t,s,r),i=u(o,o,e),n=this.offset/h(i);l(i,i,i,n);const f=this.objectTransform.inverse;return u(this.tmpVertex,i,f),this.tmpVertex}applyToMinMax(t,s){const r=this.offset/h(t);l(t,t,t,r);const e=this.offset/h(s);l(s,s,s,e)}applyToAabb(t){const s=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*s,t[1]+=t[1]*s,t[2]+=t[2]*s;const r=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*r,t[4]+=t[4]*r,t[5]+=t[5]*r,t}applyToBoundingSphere(t){const s=h(t),r=this.offset/s;return l(this.sphere,t,t,r),this.sphere[3]=t[3]+t[3]*this.offset/s,this.sphere}}const j=new L;function I(t){return null!=t?(j.offset=t,j):null}const M=new V;function w(t){return null!=t?(M.offset=t,M):null}const k=new x;function z(t){return null!=t?(k.offset=t,k):null}const A="terrain",R=v(),B=v(),q=v(),D=v(),G=v(),S=v(),C=v();export{V as I3SVerticalOffsetGlobalViewingMode,b as IntersectorTransform,L as Object3DVerticalOffsetGlobalViewingMode,A as TERRAIN_ID,x as TerrainVerticalOffsetGlobalViewingMode,w as getVerticalOffsetI3S,I as getVerticalOffsetObject3D,z as getVerticalOffsetTerrain};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as i}from"../../../../core/mathUtils.js";import{i as t,b as s,e as h,f as r}from"../../../../chunks/vec3.js";import{c as n,f as a}from"../../../../chunks/vec3f64.js";import{SphericalHarmonicsAmbientLight as o,MainLight as e}from"./Lightsources.js";import{combineLights as c}from"./SphericalHarmonics.js";class g{constructor(){this.color=n(),this.intensity=1}}class m{constructor(){this.direction=n(),this.ambient=new g,this.diffuse=new g}}const l=.4;class _{constructor(){this._shOrder=2,this._legacy=new m,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o,this._mainLight=new e(n(),a(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(i){c(i,this._shOrder,this._mainLight,this._sphericalHarmonics),t(this._legacy.direction,this._mainLight.direction);const r=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*r,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*r,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*r,s(this._legacy.diffuse.color,this._mainLight.intensity,r),t(L,this._legacy.diffuse.color),s(L,L,l*this.globalFactor),h(this._legacy.ambient.color,this._legacy.ambient.color,L)}copyFrom(i){this._sphericalHarmonics.r=Array.from(i.sh.r),this._sphericalHarmonics.g=Array.from(i.sh.g),this._sphericalHarmonics.b=Array.from(i.sh.b),t(this._mainLight.direction,i.mainLight.direction),t(this._mainLight.intensity,i.mainLight.intensity),this._mainLight.castShadows=i.mainLight.castShadows,this._mainLight.specularStrength=i.mainLight.specularStrength,this._mainLight.environmentStrength=i.mainLight.environmentStrength,this.globalFactor=i.globalFactor,this.noonFactor=i.noonFactor}lerpLighting(s,h,n){if(r(this._mainLight.intensity,s.mainLight.intensity,h.mainLight.intensity,n),this._mainLight.environmentStrength=i(s.mainLight.environmentStrength,h.mainLight.environmentStrength,n),this._mainLight.specularStrength=i(s.mainLight.specularStrength,h.mainLight.specularStrength,n),t(this._mainLight.direction,h.mainLight.direction),this._mainLight.castShadows=h.mainLight.castShadows,this.globalFactor=i(s.globalFactor,h.globalFactor,n),this.noonFactor=i(s.noonFactor,h.noonFactor,n),s.sh.r.length===h.sh.r.length)for(let t=0;t<h.sh.r.length;t++)this._sphericalHarmonics.r[t]=i(s.sh.r[t],h.sh.r[t],n),this._sphericalHarmonics.g[t]=i(s.sh.g[t],h.sh.g[t],n),this._sphericalHarmonics.b[t]=i(s.sh.b[t],h.sh.b[t],n);else for(let i=0;i<h.sh.r.length;i++)this._sphericalHarmonics.r[i]=h.sh.r[i],this._sphericalHarmonics.g[i]=h.sh.g[i],this._sphericalHarmonics.b[i]=h.sh.b[i]}}const L=n();export{_ as SceneLighting,l as ambientBoost};
5
+ import{lerp as i}from"../../../../core/mathUtils.js";import{c as t,i as s,g as h,p as r}from"../../../../chunks/vec3.js";import{c as n,f as a}from"../../../../chunks/vec3f64.js";import{SphericalHarmonicsAmbientLight as o,MainLight as e}from"./Lightsources.js";import{combineLights as c}from"./SphericalHarmonics.js";class g{constructor(){this.color=n(),this.intensity=1}}class m{constructor(){this.direction=n(),this.ambient=new g,this.diffuse=new g}}const l=.4;class _{constructor(){this._shOrder=2,this._legacy=new m,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o,this._mainLight=new e(n(),a(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(i){c(i,this._shOrder,this._mainLight,this._sphericalHarmonics),t(this._legacy.direction,this._mainLight.direction);const r=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*r,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*r,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*r,s(this._legacy.diffuse.color,this._mainLight.intensity,r),t(p,this._legacy.diffuse.color),s(p,p,l*this.globalFactor),h(this._legacy.ambient.color,this._legacy.ambient.color,p)}copyFrom(i){this._sphericalHarmonics.r=Array.from(i.sh.r),this._sphericalHarmonics.g=Array.from(i.sh.g),this._sphericalHarmonics.b=Array.from(i.sh.b),t(this._mainLight.direction,i.mainLight.direction),t(this._mainLight.intensity,i.mainLight.intensity),this._mainLight.castShadows=i.mainLight.castShadows,this._mainLight.specularStrength=i.mainLight.specularStrength,this._mainLight.environmentStrength=i.mainLight.environmentStrength,this.globalFactor=i.globalFactor,this.noonFactor=i.noonFactor}lerpLighting(s,h,n){if(r(this._mainLight.intensity,s.mainLight.intensity,h.mainLight.intensity,n),this._mainLight.environmentStrength=i(s.mainLight.environmentStrength,h.mainLight.environmentStrength,n),this._mainLight.specularStrength=i(s.mainLight.specularStrength,h.mainLight.specularStrength,n),t(this._mainLight.direction,h.mainLight.direction),this._mainLight.castShadows=h.mainLight.castShadows,this.globalFactor=i(s.globalFactor,h.globalFactor,n),this.noonFactor=i(s.noonFactor,h.noonFactor,n),s.sh.r.length===h.sh.r.length)for(let t=0;t<h.sh.r.length;t++)this._sphericalHarmonics.r[t]=i(s.sh.r[t],h.sh.r[t],n),this._sphericalHarmonics.g[t]=i(s.sh.g[t],h.sh.g[t],n),this._sphericalHarmonics.b[t]=i(s.sh.b[t],h.sh.b[t],n);else for(let i=0;i<h.sh.r.length;i++)this._sphericalHarmonics.r[i]=h.sh.r[i],this._sphericalHarmonics.g[i]=h.sh.g[i],this._sphericalHarmonics.b[i]=h.sh.b[i]}}const p=n();export{_ as SceneLighting,l as ambientBoost};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../core/mathUtils.js";import{o as n,s as o,i as r}from"../../../../chunks/vec3.js";import{c as e}from"../../../../chunks/vec3f64.js";import{elementwiseProduct as s,scalarProduct as i,add as c}from"../lib/LongVectorMath.js";import{MainLight as f,FillLight as h,AmbientLight as a,SphericalHarmonicsAmbientLight as g}from"./Lightsources.js";function u(t){return(t+1)*(t+1)}function l(n){return t(Math.floor(Math.sqrt(n)-1),0,2)}function m(t,n,o){const r=t[0],e=t[1],s=t[2],i=o||[];return i.length=u(n),n>=0&&(i[0]=.28209479177),n>=1&&(i[1]=.4886025119*r,i[2]=.4886025119*s,i[3]=.4886025119*e),n>=2&&(i[4]=1.09254843059*r*e,i[5]=1.09254843059*e*s,i[6]=.31539156525*(3*s*s-1),i[7]=1.09254843059*r*s,i[8]=.54627421529*(r*r-e*e)),i}function p(t,n){const o=u(t),r=n||{r:[],g:[],b:[]};r.r.length=r.g.length=r.b.length=o;for(let e=0;e<o;e++)r.r[e]=r.g[e]=r.b[e]=0;return r}function y(t,o){const r=l(o.r.length);for(const e of t)n(P,e.direction),m(P,r,v),s(v,k),i(v,e.intensity[0],I),c(o.r,I),i(v,e.intensity[1],I),c(o.g,I),i(v,e.intensity[2],I),c(o.b,I);return o}function b(t,n){m(P,0,v);for(const o of t)n.r[0]+=v[0]*k[0]*o.intensity[0]*4*Math.PI,n.g[0]+=v[0]*k[0]*o.intensity[1]*4*Math.PI,n.b[0]+=v[0]*k[0]*o.intensity[2]*4*Math.PI;return n}function M(t,n,e,s){p(n,s),o(e.intensity,0,0,0);let i=!1;const u=S,l=d,m=j;u.length=0,l.length=0,m.length=0;for(const o of t)o instanceof f&&!i?(r(e.direction,o.direction),r(e.intensity,o.intensity),e.specularStrength=o.specularStrength,e.environmentStrength=o.environmentStrength,e.castShadows=o.castShadows,i=!0):o instanceof f||o instanceof h?u.push(o):o instanceof a?l.push(o):o instanceof g&&m.push(o);y(u,s),b(l,s);for(const o of m)c(s.r,o.r),c(s.g,o.g),c(s.b,o.b)}const S=[],d=[],j=[],v=[0],I=[0],P=e(),k=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];export{M as combineLights,m as computeCoefficients,p as initSHCoefficients,u as numberOfCoefficients,l as orderFromNumberOfCoefficients,b as projectAmbientLights,y as projectFillLights};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{E as n,s as o,c as r}from"../../../../chunks/vec3.js";import{c as e}from"../../../../chunks/vec3f64.js";import{elementwiseProduct as s,scalarProduct as i,add as c}from"../lib/LongVectorMath.js";import{MainLight as f,FillLight as h,AmbientLight as a,SphericalHarmonicsAmbientLight as g}from"./Lightsources.js";function u(t){return(t+1)*(t+1)}function l(n){return t(Math.floor(Math.sqrt(n)-1),0,2)}function m(t,n,o){const r=t[0],e=t[1],s=t[2],i=o||[];return i.length=u(n),n>=0&&(i[0]=.28209479177),n>=1&&(i[1]=.4886025119*r,i[2]=.4886025119*s,i[3]=.4886025119*e),n>=2&&(i[4]=1.09254843059*r*e,i[5]=1.09254843059*e*s,i[6]=.31539156525*(3*s*s-1),i[7]=1.09254843059*r*s,i[8]=.54627421529*(r*r-e*e)),i}function p(t,n){const o=u(t),r=n||{r:[],g:[],b:[]};r.r.length=r.g.length=r.b.length=o;for(let e=0;e<o;e++)r.r[e]=r.g[e]=r.b[e]=0;return r}function y(t,o){const r=l(o.r.length);for(const e of t)n(P,e.direction),m(P,r,v),s(v,k),i(v,e.intensity[0],I),c(o.r,I),i(v,e.intensity[1],I),c(o.g,I),i(v,e.intensity[2],I),c(o.b,I);return o}function b(t,n){m(P,0,v);for(const o of t)n.r[0]+=v[0]*k[0]*o.intensity[0]*4*Math.PI,n.g[0]+=v[0]*k[0]*o.intensity[1]*4*Math.PI,n.b[0]+=v[0]*k[0]*o.intensity[2]*4*Math.PI;return n}function M(t,n,e,s){p(n,s),o(e.intensity,0,0,0);let i=!1;const u=S,l=d,m=j;u.length=0,l.length=0,m.length=0;for(const o of t)o instanceof f&&!i?(r(e.direction,o.direction),r(e.intensity,o.intensity),e.specularStrength=o.specularStrength,e.environmentStrength=o.environmentStrength,e.castShadows=o.castShadows,i=!0):o instanceof f||o instanceof h?u.push(o):o instanceof a?l.push(o):o instanceof g&&m.push(o);y(u,s),b(l,s);for(const o of m)c(s.r,o.r),c(s.g,o.g),c(s.b,o.b)}const S=[],d=[],j=[],v=[0],I=[0],P=e(),k=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];export{M as combineLights,m as computeCoefficients,p as initSHCoefficients,u as numberOfCoefficients,l as orderFromNumberOfCoefficients,b as projectAmbientLights,y as projectFillLights};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{f as r}from"../../../../chunks/vec2f64.js";import{f as t}from"../../../../chunks/vec4f64.js";import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as i}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as a}from"./DefaultBufferWriter.js";import{PositionUVLayout as n}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{CheckerBoardTechnique as p}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as f}from"../shaders/CheckerBoardTechniqueConfiguration.js";class h extends u{constructor(r){super(r,new l),this._configuration=new f}getConfiguration(r,t){return this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}produces(r,t){if(t===e.Color||t===e.Alpha){return r===(this.parameters.transparent?this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:o.OPAQUE_MATERIAL)||r===o.DRAPED_MATERIAL}return!1}createGLMaterial(r){return new c(r)}createBufferWriter(){return new a(n)}}class c extends s{beginSlot(r){return this.ensureTechnique(p,r)}}class l extends i{constructor(){super(...arguments),this.size=r(1,1),this.color1=t(.75,.75,.75,1),this.color2=t(.5,.5,.5,1),this.transparent=!1,this.writeDepth=!0,this.polygonOffset=!1}}export{h as CheckerBoardMaterial,l as Parameters};
5
+ import{f as r}from"../../../../chunks/vec2f64.js";import{a as t}from"../../../../chunks/vec4f64.js";import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as i}from"../lib/Material.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as a}from"./DefaultBufferWriter.js";import{PositionUVLayout as n}from"./DefaultLayouts.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{CheckerBoardTechnique as p}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as f}from"../shaders/CheckerBoardTechniqueConfiguration.js";class h extends u{constructor(r){super(r,new l),this._configuration=new f}getConfiguration(r,t){return this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}produces(r,t){if(t===e.Color||t===e.Alpha){return r===(this.parameters.transparent?this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:o.OPAQUE_MATERIAL)||r===o.DRAPED_MATERIAL}return!1}createGLMaterial(r){return new c(r)}createBufferWriter(){return new a(n)}}class c extends s{beginSlot(r){return this.ensureTechnique(p,r)}}class l extends i{constructor(){super(...arguments),this.size=r(1,1),this.color1=t(.75,.75,.75,1),this.color2=t(.5,.5,.5,1),this.transparent=!1,this.writeDepth=!0,this.polygonOffset=!1}}export{h as CheckerBoardMaterial,l as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{s as e,i as t,n as r,g as s,l as a,b as i,d as o,t as n}from"../../../../chunks/vec3.js";import{c as h,f as l}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as m}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as p}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as d}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as f}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{CullFaceOptions as g}from"../lib/basicInterfaces.js";import{GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as _}from"../lib/Material.js";import{OITPolygonOffsetLimit as x}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as b}from"../lib/RenderSlot.js";import{VertexAttribute as S}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as v}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as O}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as w,intersectTriangleGeometry as M}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as C,DefaultMaterialPassParameters as A}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as y}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as R}from"../shaders/RealisticTreeTechnique.js";class I extends _{constructor(e){super(e,L),this.supportsEdges=!0,this._configuration=new y,this._vertexBufferLayout=j(this.parameters)}isVisibleForOutput(e){return e!==m.Shadow&&e!==m.ShadowExcludeHighlight&&e!==m.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:s,vvColor:a}=e,i="replace"===e.colorMixMode,o=e.opacity>0,n=e.externalColor&&e.externalColor[3]>0,h=t||a||s;return r&&h?i||o:r?i?n:o:h?i||o:i?n:o}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?g.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==m.Color&&e!==m.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=d.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?d.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?d.WindingOrder:d.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?f.Schematic:f.Normal:f.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<x,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(h,l,u,m,p,d){if(null!=this.parameters.verticalOffset){const h=u.camera;e(z,l[12],l[13],l[14]);let d=null;switch(u.viewingMode){case c.Global:d=r(B,z);break;case c.Local:d=t(B,V)}let f=0;const g=s(G,z,h.eye),T=a(g),_=i(g,g,1/T);let x=null;this.parameters.screenSizePerspective&&(x=o(d,_)),f+=w(h,T,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective),i(d,d,f),n(H,d,u.transform.inverseRotation),m=s(D,m,H),p=s(N,p,H)}M(h,u,m,p,v(u.verticalOffset),d)}produces(e,t){if(t===m.Color||t===m.Alpha||t===m.Depth||t===m.Normal||t===m.Shadow||t===m.ShadowHighlight||t===m.ShadowExcludeHighlight||t===m.Highlight||t===m.ObjectAndLayerIdColor){return e===(this.parameters.transparent?this.parameters.writeDepth?b.TRANSPARENT_MATERIAL:b.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:b.OPAQUE_MATERIAL)||e===b.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new E(e)}createBufferWriter(){return new O(this._vertexBufferLayout)}}class E extends T{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(t){this._output!==m.Color&&this._output!==m.Alpha||(this._updateShadowState(t),this._updateOccludeeState(t));const r=this._material.parameters;this.updateTexture(r.textureId);const s=t.camera.viewInverseTransposeMatrix;return e(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(r.treeRendering?R:C,t)}}class P extends A{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const L=new P;function j(e){const t=u().vec3f(S.POSITION);e.normalType===p.Compressed?t.vec2i16(S.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(S.NORMAL),e.hasVertexTangents&&t.vec4f(S.TANGENT);return(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(S.UV0),e.hasVertexColors&&t.vec4u8(S.COLOR),e.hasSymbolColors&&t.vec4u8(S.SYMBOLCOLOR),has("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(S.OBJECTANDLAYERIDCOLOR),t}const D=h(),N=h(),V=l(0,0,1),B=h(),H=h(),z=h(),G=h();export{E as DefaultGLMaterial,I as DefaultMaterial,P as DefaultMaterialParameters};
5
+ import has from"../../../../core/has.js";import{s as e,c as t,n as r,f as s,l as a,i,j as o,t as n}from"../../../../chunks/vec3.js";import{c as h,f as l}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as m}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as p}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as d}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as f}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{CullFaceOptions as g}from"../lib/basicInterfaces.js";import{GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as _}from"../lib/Material.js";import{OITPolygonOffsetLimit as x}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as b}from"../lib/RenderSlot.js";import{VertexAttribute as S}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as v}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as O}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as w,intersectTriangleGeometry as M}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as C,DefaultMaterialPassParameters as A}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as y}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as R}from"../shaders/RealisticTreeTechnique.js";class I extends _{constructor(e){super(e,j),this.supportsEdges=!0,this._configuration=new y,this._vertexBufferLayout=L(this.parameters)}isVisibleForOutput(e){return e!==m.Shadow&&e!==m.ShadowExcludeHighlight&&e!==m.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:s,vvColor:a}=e,i="replace"===e.colorMixMode,o=e.opacity>0,n=e.externalColor&&e.externalColor[3]>0,h=t||a||s;return r&&h?i||o:r?i?n:o:h?i||o:i?n:o}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?g.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==m.Color&&e!==m.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=d.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?d.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?d.WindingOrder:d.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?f.Schematic:f.Normal:f.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<x,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(h,l,u,m,p,d){if(null!=this.parameters.verticalOffset){const h=u.camera;e(z,l[12],l[13],l[14]);let d=null;switch(u.viewingMode){case c.Global:d=r(B,z);break;case c.Local:d=t(B,V)}let f=0;const g=s(G,z,h.eye),T=a(g),_=i(g,g,1/T);let x=null;this.parameters.screenSizePerspective&&(x=o(d,_)),f+=w(h,T,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective),i(d,d,f),n(H,d,u.transform.inverseRotation),m=s(D,m,H),p=s(N,p,H)}M(h,u,m,p,v(u.verticalOffset),d)}produces(e,t){if(t===m.Color||t===m.Alpha||t===m.Depth||t===m.Normal||t===m.Shadow||t===m.ShadowHighlight||t===m.ShadowExcludeHighlight||t===m.Highlight||t===m.ObjectAndLayerIdColor){return e===(this.parameters.transparent?this.parameters.writeDepth?b.TRANSPARENT_MATERIAL:b.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:b.OPAQUE_MATERIAL)||e===b.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new E(e)}createBufferWriter(){return new O(this._vertexBufferLayout)}}class E extends T{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(t){this._output!==m.Color&&this._output!==m.Alpha||(this._updateShadowState(t),this._updateOccludeeState(t));const r=this._material.parameters;this.updateTexture(r.textureId);const s=t.camera.viewInverseTransposeMatrix;return e(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(r.treeRendering?R:C,t)}}class P extends A{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const j=new P;function L(e){const t=u().vec3f(S.POSITION);e.normalType===p.Compressed?t.vec2i16(S.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(S.NORMAL),e.hasVertexTangents&&t.vec4f(S.TANGENT);return(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(S.UV0),e.hasVertexColors&&t.vec4u8(S.COLOR),e.hasSymbolColors&&t.vec4u8(S.SYMBOLCOLOR),has("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(S.OBJECTANDLAYERIDCOLOR),t}const D=h(),N=h(),V=l(0,0,1),B=h(),H=h(),z=h(),G=h();export{E as DefaultGLMaterial,I as DefaultMaterial,P as DefaultMaterialParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{f as t}from"../../../../chunks/mat3.js";import{c as s}from"../../../../chunks/mat3f64.js";import{a as r}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{j as a}from"../../../../chunks/vec2.js";import{a as n,f as o}from"../../../../chunks/vec2f64.js";import{s as c,m as l,n as f,g as u,b as p,i as h,l as m,h as d,t as g,d as O,e as S}from"../../../../chunks/vec3.js";import{c as A,f as v}from"../../../../chunks/vec3f64.js";import{b,c as T,f as I}from"../../../../chunks/vec4f64.js";import{isMat4 as _}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as x}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as E}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as P}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as y}from"../../support/debugFlags.js";import{newLayout as R}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as j,GLTextureMaterialBindParameters as L}from"../lib/GLTextureMaterial.js";import{Material as D,RenderOccludedFlag as M}from"../lib/Material.js";import{RenderSlot as z}from"../lib/RenderSlot.js";import{applyScaleFactor as w,applyPrecomputedScaleFactor as F,precomputeScaleFactor as V}from"../lib/screenSizePerspectiveUtils.js";import{assert as N}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{ScaleInfo as H}from"./ScaleInfo.js";import{writePosition as X,writeNormal as k,writeColor as G,writeBufferVec4 as W,writeBufferVec4Zeros as q,writeObjectAndLayerIdColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as Z}from"./internal/MaterialUtil.js";import{c as J}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as K}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as Q}from"../shaders/HUDMaterialTechniqueConfiguration.js";class $ extends D{constructor(e){super(e,new Te),this._configuration=new Q}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?C.Screen:C.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===z.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===U.Color||e===U.Alpha),e===U.Color&&(this._configuration.debugDrawLabelBorder=!!y.LABELS_SHOW_BORDER),e===U.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,i,a,n,o){if(!i.options.selectionMode||!i.options.hud||!e.visible)return;const g=this.parameters,O=i.point,S=i.camera;let{scaleX:v,scaleY:b}=this._getScreenScale(e);v*=S.pixelRatio,b*=S.pixelRatio,t(ue,s),e.vertexAttributes.has(B.FEATUREATTRIBUTE)&&se(ue);const T=e.vertexAttributes.get(B.POSITION),I=e.vertexAttributes.get(B.SIZE),_=e.vertexAttributes.get(B.NORMAL),x=e.vertexAttributes.get(B.AUXPOS1);N(T.size>=3);const E=J(g),P="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<T.data.length/T.size;t++){const e=t*T.size;c(ne,T.data[e],T.data[e+1],T.data[e+2]),l(ne,ne,s);const a=t*I.size;ve[0]=I.data[a]*v,ve[1]=I.data[a+1]*b,l(ne,ne,S.viewMatrix);const n=t*x.size;if(c(me,x.data[n],x.data[n+1],x.data[n+2]),!P&&(ne[0]+=me[0],ne[1]+=me[1],0!==me[2])){const e=me[2];f(me,ne),u(ne,ne,p(me,me,e))}const y=t*_.size;if(c(oe,_.data[y],_.data[y+1],_.data[y+2]),this._normalAndViewAngle(oe,ue,S,Oe),this._applyVerticalOffsetTransformationView(ne,Oe,S,ie),S.applyProjection(ne,ce),ce[0]>-1){ce[0]=Math.floor(ce[0]),ce[1]=Math.floor(ce[1]),P&&(me[0]||me[1])&&(ce[0]+=me[0],0!==me[1]&&(ce[1]+=w(me[1],ie.factorAlignment)),S.unapplyProjection(ce,ne)),ce[0]+=this.parameters.screenOffset[0],ce[1]+=this.parameters.screenOffset[1],F(ve,ie.factor,ve);const e=Se*S.pixelRatio;let t=0;if(g.textureIsSignedDistanceField&&(t=g.outlineSize*S.pixelRatio/2),O&&re(O,ce[0],ce[1],ve,e,t,g,E)){const e=i.ray;if(l(fe,ne,r(he,S.viewMatrix)),ce[0]=O[0],ce[1]=O[1],S.unprojectFromRenderScreen(ce,ne)){const t=A();h(t,e.direction);const s=1/m(t);p(t,t,s);o(d(e.origin,ne)*s,t,-1,!0,1,fe)}}}}}intersectDraped(e,t,s,r,i,a){const n=e.vertexAttributes.get(B.POSITION),o=e.vertexAttributes.get(B.SIZE),c=this.parameters,l=J(c);let{scaleX:f,scaleY:u}=this._getScreenScale(e);f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=Ae*e.screenToWorldRatio;for(let h=0;h<n.data.length/n.size;h++){const t=h*n.size,s=n.data[t],m=n.data[t+1],d=h*o.size;ve[0]=o.data[d]*f,ve[1]=o.data[d+1]*u;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,s,m,ve,p,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new xe(this)}_normalAndViewAngle(e,s,r,i){return _(s)&&(s=t(pe,s)),g(i.normal,e,s),l(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=O(le,be),i}_updateScaleInfo(e,t,s){const r=this.parameters;null!=r.screenSizePerspective?V(s,t,r.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=r.screenSizePerspectiveAlignment?V(s,t,r.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,s,r,i,a,n){const o=this._normalAndViewAngle(t,s,i,Oe);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,r[3],i,n),this._applyCenterOffsetView(n,r,n),n}applyShaderOffsetsNDC(e,t,s,r,i){return this._applyCenterOffsetNDC(e,t,s,r),null!=i&&h(i,r),this._applyPolygonOffsetNDC(r,t,s,r),r}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const l=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return p(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,s,r){const i=m(e),a=s.aboveGround?1:-1,n=.5*s.computeRenderPixelSizeAtDist(i),o=p(ne,t.normal,a*n);return S(r,e,o),r}_applyVerticalOffsetTransformationView(e,t,s,r){const i=this.parameters;if(!i.verticalOffset||!i.verticalOffset.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const s=m(e);this._updateScaleInfo(r,s,t.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return e}const a=m(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=Z(s,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(r,a,t.cosAngle),p(t.normal,t.normal,o),S(e,e,t.normal)}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&h(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(f(oe,s),S(s,s,p(oe,oe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&h(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&h(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t[3]);r[2]-=(a||e)*i}return r}produces(e,t){if(t===U.Color||t===U.Alpha||t===U.Highlight||t===U.ObjectAndLayerIdColor){if(e===z.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:s}=this.parameters;return e===(t?z.LABEL_MATERIAL:z.HUD_MATERIAL)||s&&e===z.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new ee(e)}calculateRelativeScreenBounds(e,t,s=x()){return te(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}_getScreenScale(e){const t=e.vertexAttributes.get(B.FEATUREATTRIBUTE);if(null==t)return{scaleX:1,scaleY:1};const s=b(t.data,ge),[r,i]=P(de,this.parameters,s);return{scaleX:r,scaleY:i}}}class ee extends j{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(K,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function te(e,t,s,r=ae){return a(r,e.anchorPosition),r[0]*=-t[0],r[1]*=-t[1],r[0]+=e.screenOffset[0]*s,r[1]+=e.screenOffset[1]*s,r}function se(e){const t=e[0],s=e[1],r=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+s*s+r*r),u=1/Math.sqrt(i*i+a*a+n*n),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=s*f,e[2]=r*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function re(e,t,s,r,i,a,n,o){let c=t-i-(o[0]>0?r[0]*o[0]:0),l=c+r[0]+2*i,f=s-i-(o[1]>0?r[1]*o[1]:0),u=f+r[1]+2*i;const p=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=p&&(c+=r[0]*p[0],f+=r[1]*p[1],l-=r[0]*(1-p[2]),u-=r[1]*(1-p[3]),c-=a,l+=a,f-=a,u+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const ie=new H,ae=n(),ne=A(),oe=A(),ce=T(),le=A(),fe=A(),ue=s(),pe=s(),he=i(),me=A(),de=T(),ge=T(),Oe={normal:le,cosAngle:0},Se=1,Ae=2,ve=[0,0],be=v(0,0,1);class Te extends L{constructor(){super(...arguments),this.renderOccluded=M.Occlude,this.isDecoration=!1,this.color=I(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=o(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=I(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const Ie=R().vec3f(B.POSITION).vec3f(B.NORMAL).vec2f(B.UV0).vec4u8(B.COLOR).vec2f(B.SIZE).vec4f(B.AUXPOS1).vec4f(B.FEATUREATTRIBUTE),_e=Ie.clone().vec4u8(B.OBJECTANDLAYERIDCOLOR);class xe{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?_e:Ie}elementCount(e){return 6*e.indices.get(B.POSITION).length}write(e,t,s,r,i){X(s.indices.get(B.POSITION),s.vertexAttributes.get(B.POSITION).data,e,r.position,i,6),k(s.indices.get(B.NORMAL),s.vertexAttributes.get(B.NORMAL).data,t,r.normal,i,6);const a=s.vertexAttributes.get(B.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=s.indices.get(B.POSITION).length,u=i;const p=r.uv0;for(let g=0;g<f;++g)p.set(u,0,n),p.set(u,1,o),u+=1,p.set(u,0,c),p.set(u,1,o),u+=1,p.set(u,0,c),p.set(u,1,l),u+=1,p.set(u,0,c),p.set(u,1,l),u+=1,p.set(u,0,n),p.set(u,1,l),u+=1,p.set(u,0,n),p.set(u,1,o),u+=1;G(s.indices.get(B.COLOR),s.vertexAttributes.get(B.COLOR).data,4,r.color,i,6);const h=s.indices.get(B.SIZE),m=s.vertexAttributes.get(B.SIZE).data;f=h.length;const d=r.size;u=i;for(let g=0;g<f;++g){const e=m[2*h[g]],t=m[2*h[g]+1];for(let s=0;s<6;++s)d.set(u,0,e),d.set(u,1,t),u+=1}if(s.indices.get(B.AUXPOS1)&&s.vertexAttributes.get(B.AUXPOS1)?W(s.indices.get(B.AUXPOS1),s.vertexAttributes.get(B.AUXPOS1).data,r.auxpos1,i,6):q(r.auxpos1,i,6*f),s.indices.get(B.FEATUREATTRIBUTE)&&s.vertexAttributes.get(B.FEATUREATTRIBUTE)?W(s.indices.get(B.FEATUREATTRIBUTE),s.vertexAttributes.get(B.FEATUREATTRIBUTE).data,r.featureAttribute,i,6):q(r.featureAttribute,i,6*f),null!=s.objectAndLayerIdColor){if(s.indices.get(B.POSITION)){const e=s.indices.get(B.POSITION).length,t=r.getField(B.OBJECTANDLAYERIDCOLOR,E);Y(s.objectAndLayerIdColor,t,e,i,6)}}}}export{$ as HUDMaterial,Te as Parameters};
5
+ import has from"../../../../core/has.js";import{clamp as e}from"../../../../core/mathUtils.js";import{f as t}from"../../../../chunks/mat3.js";import{a as s}from"../../../../chunks/mat3f64.js";import{i as r}from"../../../../chunks/mat4.js";import{a as i}from"../../../../chunks/mat4f64.js";import{j as a}from"../../../../chunks/vec2.js";import{a as n,f as o}from"../../../../chunks/vec2f64.js";import{s as c,e as l,n as f,f as u,i as p,c as h,l as m,m as d,t as g,j as O,g as S}from"../../../../chunks/vec3.js";import{c as A,f as v}from"../../../../chunks/vec3f64.js";import{f as b,c as T,a as I}from"../../../../chunks/vec4f64.js";import{isMat4 as _}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as x}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as E}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as P}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as y}from"../../support/debugFlags.js";import{newLayout as R}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as j}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterial as C,GLTextureMaterialBindParameters as L}from"../lib/GLTextureMaterial.js";import{Material as D,RenderOccludedFlag as M}from"../lib/Material.js";import{RenderSlot as z}from"../lib/RenderSlot.js";import{applyScaleFactor as w,applyPrecomputedScaleFactor as F,precomputeScaleFactor as V}from"../lib/screenSizePerspectiveUtils.js";import{assert as N}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{ScaleInfo as H}from"./ScaleInfo.js";import{writePosition as X,writeNormal as k,writeColor as G,writeBufferVec4 as W,writeBufferVec4Zeros as q,writeObjectAndLayerIdColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as Z}from"./internal/MaterialUtil.js";import{c as J}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as K}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as Q}from"../shaders/HUDMaterialTechniqueConfiguration.js";class $ extends D{constructor(e){super(e,new Te),this._configuration=new Q}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?j.Screen:j.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===z.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===U.Color||e===U.Alpha),e===U.Color&&(this._configuration.debugDrawLabelBorder=!!y.LABELS_SHOW_BORDER),e===U.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,i,a,n,o){if(!i.options.selectionMode||!i.options.hud||!e.visible)return;const g=this.parameters,O=i.point,S=i.camera;let{scaleX:v,scaleY:b}=this._getScreenScale(e);v*=S.pixelRatio,b*=S.pixelRatio,t(ue,s),e.vertexAttributes.has(B.FEATUREATTRIBUTE)&&se(ue);const T=e.vertexAttributes.get(B.POSITION),I=e.vertexAttributes.get(B.SIZE),_=e.vertexAttributes.get(B.NORMAL),x=e.vertexAttributes.get(B.AUXPOS1);N(T.size>=3);const E=J(g),P="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<T.data.length/T.size;t++){const e=t*T.size;c(ne,T.data[e],T.data[e+1],T.data[e+2]),l(ne,ne,s);const a=t*I.size;ve[0]=I.data[a]*v,ve[1]=I.data[a+1]*b,l(ne,ne,S.viewMatrix);const n=t*x.size;if(c(me,x.data[n],x.data[n+1],x.data[n+2]),!P&&(ne[0]+=me[0],ne[1]+=me[1],0!==me[2])){const e=me[2];f(me,ne),u(ne,ne,p(me,me,e))}const y=t*_.size;if(c(oe,_.data[y],_.data[y+1],_.data[y+2]),this._normalAndViewAngle(oe,ue,S,Oe),this._applyVerticalOffsetTransformationView(ne,Oe,S,ie),S.applyProjection(ne,ce),ce[0]>-1){ce[0]=Math.floor(ce[0]),ce[1]=Math.floor(ce[1]),P&&(me[0]||me[1])&&(ce[0]+=me[0],0!==me[1]&&(ce[1]+=w(me[1],ie.factorAlignment)),S.unapplyProjection(ce,ne)),ce[0]+=this.parameters.screenOffset[0],ce[1]+=this.parameters.screenOffset[1],F(ve,ie.factor,ve);const e=Se*S.pixelRatio;let t=0;if(g.textureIsSignedDistanceField&&(t=g.outlineSize*S.pixelRatio/2),O&&re(O,ce[0],ce[1],ve,e,t,g,E)){const e=i.ray;if(l(fe,ne,r(he,S.viewMatrix)),ce[0]=O[0],ce[1]=O[1],S.unprojectFromRenderScreen(ce,ne)){const t=A();h(t,e.direction);const s=1/m(t);p(t,t,s);o(d(e.origin,ne)*s,t,-1,!0,1,fe)}}}}}intersectDraped(e,t,s,r,i,a){const n=e.vertexAttributes.get(B.POSITION),o=e.vertexAttributes.get(B.SIZE),c=this.parameters,l=J(c);let{scaleX:f,scaleY:u}=this._getScreenScale(e);f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const p=Ae*e.screenToWorldRatio;for(let h=0;h<n.data.length/n.size;h++){const t=h*n.size,s=n.data[t],m=n.data[t+1],d=h*o.size;ve[0]=o.data[d]*f,ve[1]=o.data[d+1]*u;let g=0;c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),re(r,s,m,ve,p,g,c,l)&&i(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new xe(this)}_normalAndViewAngle(e,s,r,i){return _(s)&&(s=t(pe,s)),g(i.normal,e,s),l(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=O(le,be),i}_updateScaleInfo(e,t,s){const r=this.parameters;null!=r.screenSizePerspective?V(s,t,r.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=r.screenSizePerspectiveAlignment?V(s,t,r.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,s,r,i,a,n){const o=this._normalAndViewAngle(t,s,i,Oe);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,r[3],i,n),this._applyCenterOffsetView(n,r,n),n}applyShaderOffsetsNDC(e,t,s,r,i){return this._applyCenterOffsetNDC(e,t,s,r),null!=i&&h(i,r),this._applyPolygonOffsetNDC(r,t,s,r),r}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const l=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return p(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,s,r){const i=m(e),a=s.aboveGround?1:-1,n=.5*s.computeRenderPixelSizeAtDist(i),o=p(ne,t.normal,a*n);return S(r,e,o),r}_applyVerticalOffsetTransformationView(e,t,s,r){const i=this.parameters;if(!i.verticalOffset||!i.verticalOffset.screenLength){if(i.screenSizePerspective||i.screenSizePerspectiveAlignment){const s=m(e);this._updateScaleInfo(r,s,t.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return e}const a=m(e),n=i.screenSizePerspectiveAlignment??i.screenSizePerspective,o=Z(s,a,i.verticalOffset,t.cosAngle,n);return this._updateScaleInfo(r,a,t.cosAngle),p(t.normal,t.normal,o),S(e,e,t.normal)}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&h(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(f(oe,s),S(s,s,p(oe,oe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&h(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&h(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t[3]);r[2]-=(a||e)*i}return r}produces(e,t){if(t===U.Color||t===U.Alpha||t===U.Highlight||t===U.ObjectAndLayerIdColor){if(e===z.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:s}=this.parameters;return e===(t?z.LABEL_MATERIAL:z.HUD_MATERIAL)||s&&e===z.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new ee(e)}calculateRelativeScreenBounds(e,t,s=x()){return te(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}_getScreenScale(e){const t=e.vertexAttributes.get(B.FEATUREATTRIBUTE);if(null==t)return{scaleX:1,scaleY:1};const s=b(t.data,ge),[r,i]=P(de,this.parameters,s);return{scaleX:r,scaleY:i}}}class ee extends C{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(K,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function te(e,t,s,r=ae){return a(r,e.anchorPosition),r[0]*=-t[0],r[1]*=-t[1],r[0]+=e.screenOffset[0]*s,r[1]+=e.screenOffset[1]*s,r}function se(e){const t=e[0],s=e[1],r=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+s*s+r*r),u=1/Math.sqrt(i*i+a*a+n*n),p=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=s*f,e[2]=r*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=c*p,e[8]=l*p,e}function re(e,t,s,r,i,a,n,o){let c=t-i-(o[0]>0?r[0]*o[0]:0),l=c+r[0]+2*i,f=s-i-(o[1]>0?r[1]*o[1]:0),u=f+r[1]+2*i;const p=n.distanceFieldBoundingBox;return n.textureIsSignedDistanceField&&null!=p&&(c+=r[0]*p[0],f+=r[1]*p[1],l-=r[0]*(1-p[2]),u-=r[1]*(1-p[3]),c-=a,l+=a,f-=a,u+=a),e[0]>c&&e[0]<l&&e[1]>f&&e[1]<u}const ie=new H,ae=n(),ne=A(),oe=A(),ce=T(),le=A(),fe=A(),ue=s(),pe=s(),he=i(),me=A(),de=T(),ge=T(),Oe={normal:le,cosAngle:0},Se=1,Ae=2,ve=[0,0],be=v(0,0,1);class Te extends L{constructor(){super(...arguments),this.renderOccluded=M.Occlude,this.isDecoration=!1,this.color=I(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=o(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=I(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const Ie=R().vec3f(B.POSITION).vec3f(B.NORMAL).vec2f(B.UV0).vec4u8(B.COLOR).vec2f(B.SIZE).vec4f(B.AUXPOS1).vec4f(B.FEATUREATTRIBUTE),_e=Ie.clone().vec4u8(B.OBJECTANDLAYERIDCOLOR);class xe{constructor(e){this._material=e,this.vertexBufferLayout=has("enable-feature:objectAndLayerId-rendering")?_e:Ie}elementCount(e){return 6*e.indices.get(B.POSITION).length}write(e,t,s,r,i){X(s.indices.get(B.POSITION),s.vertexAttributes.get(B.POSITION).data,e,r.position,i,6),k(s.indices.get(B.NORMAL),s.vertexAttributes.get(B.NORMAL).data,t,r.normal,i,6);const a=s.vertexAttributes.get(B.UV0).data;let n,o,c,l;if(null==a||a.length<4){const e=this._material.parameters;n=0,o=0,c=e.texCoordScale[0],l=e.texCoordScale[1]}else n=a[0],o=a[1],c=a[2],l=a[3];c=Math.min(1.99999,c+1),l=Math.min(1.99999,l+1);let f=s.indices.get(B.POSITION).length,u=i;const p=r.uv0;for(let g=0;g<f;++g)p.set(u,0,n),p.set(u,1,o),u+=1,p.set(u,0,c),p.set(u,1,o),u+=1,p.set(u,0,c),p.set(u,1,l),u+=1,p.set(u,0,c),p.set(u,1,l),u+=1,p.set(u,0,n),p.set(u,1,l),u+=1,p.set(u,0,n),p.set(u,1,o),u+=1;G(s.indices.get(B.COLOR),s.vertexAttributes.get(B.COLOR).data,4,r.color,i,6);const h=s.indices.get(B.SIZE),m=s.vertexAttributes.get(B.SIZE).data;f=h.length;const d=r.size;u=i;for(let g=0;g<f;++g){const e=m[2*h[g]],t=m[2*h[g]+1];for(let s=0;s<6;++s)d.set(u,0,e),d.set(u,1,t),u+=1}if(s.indices.get(B.AUXPOS1)&&s.vertexAttributes.get(B.AUXPOS1)?W(s.indices.get(B.AUXPOS1),s.vertexAttributes.get(B.AUXPOS1).data,r.auxpos1,i,6):q(r.auxpos1,i,6*f),s.indices.get(B.FEATUREATTRIBUTE)&&s.vertexAttributes.get(B.FEATUREATTRIBUTE)?W(s.indices.get(B.FEATUREATTRIBUTE),s.vertexAttributes.get(B.FEATUREATTRIBUTE).data,r.featureAttribute,i,6):q(r.featureAttribute,i,6*f),null!=s.objectAndLayerIdColor){if(s.indices.get(B.POSITION)){const e=s.indices.get(B.POSITION).length,t=r.getField(B.OBJECTANDLAYERIDCOLOR,E);Y(s.objectAndLayerIdColor,t,e,i,6)}}}}export{$ as HUDMaterial,Te as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{c as r}from"../../../../chunks/mat4f64.js";import{DrawParameters as s}from"./DrawParameters.js";class t extends s{constructor(){super(...arguments),this.translatedView=r()}}export{t as LineDrawParameters};
5
+ import{a as r}from"../../../../chunks/mat4f64.js";import{DrawParameters as s}from"./DrawParameters.js";class t extends s{constructor(){super(...arguments),this.translatedView=r()}}export{t as LineDrawParameters};