@arcgis/core 5.2.0-next.62 → 5.2.0-next.64

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 (530) hide show
  1. package/WebDocument2D.d.ts +17 -1
  2. package/WebDocument2D.js +1 -1
  3. package/WebLinkChart.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/Feature.js +1 -1
  7. package/arcade/ImmutableArray.js +1 -1
  8. package/arcade/ImmutablePathArray.js +1 -1
  9. package/arcade/ImmutablePointArray.js +1 -1
  10. package/arcade/Pixel.js +1 -1
  11. package/arcade/Voxel.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeRuntime.js +1 -1
  15. package/arcade/containerUtils.js +1 -1
  16. package/arcade/debug.js +1 -1
  17. package/arcade/deepClone.js +1 -1
  18. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  19. package/arcade/functions/convertdirection.js +1 -1
  20. package/arcade/functions/date.js +1 -1
  21. package/arcade/functions/feature.js +1 -1
  22. package/arcade/functions/featuresetbase.js +1 -1
  23. package/arcade/functions/featuresetgeom.js +1 -1
  24. package/arcade/functions/featuresetstats.js +1 -1
  25. package/arcade/functions/featuresetstring.js +1 -1
  26. package/arcade/functions/fieldStats.js +1 -1
  27. package/arcade/functions/geomasync.js +1 -1
  28. package/arcade/functions/geometry.js +1 -1
  29. package/arcade/functions/geomsync.js +1 -1
  30. package/arcade/functions/knowledgegraph.js +1 -1
  31. package/arcade/functions/maths.js +1 -1
  32. package/arcade/functions/stats.js +1 -1
  33. package/arcade/functions/string.js +1 -1
  34. package/arcade/functions/track.js +1 -1
  35. package/arcade/geometry/functions.js +1 -1
  36. package/arcade/languageUtils.js +1 -1
  37. package/arcade.js +1 -1
  38. package/arcgisGlobal.d.ts +14 -0
  39. package/assets/esri/core/workers/RemoteClient.js +1 -1
  40. package/assets/esri/core/workers/chunks/{44e64186318728d1be51.js → 067b00498ae85f635f60.js} +1 -1
  41. package/assets/esri/core/workers/chunks/0977f4d77c36175c2895.js +1 -0
  42. package/assets/esri/core/workers/chunks/09c43bcb09aad02e83a9.js +1 -0
  43. package/assets/esri/core/workers/chunks/0b20f92bae2b4c40d299.js +1 -0
  44. package/assets/esri/core/workers/chunks/0c3c311400ee352187ea.js +1 -0
  45. package/assets/esri/core/workers/chunks/0c582abc8d25249eb530.js +1 -0
  46. package/assets/esri/core/workers/chunks/0d6776055e9b34c14151.js +1 -0
  47. package/assets/esri/core/workers/chunks/0d7d54e74b5639a0be6e.js +1 -0
  48. package/assets/esri/core/workers/chunks/0da5b27b070ab780f8b3.js +1 -0
  49. package/assets/esri/core/workers/chunks/0e6b6fcc55cc43ede1fc.js +1 -0
  50. package/assets/esri/core/workers/chunks/{bcb5017500d144b73908.js → 126f1f6b355723db6c4f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/12a64eca4c571926d9d4.js +1 -0
  52. package/assets/esri/core/workers/chunks/{b2c0262c4a76b8a86200.js → 149284464115981694ff.js} +1 -1
  53. package/assets/esri/core/workers/chunks/1642fa1263d8f4a45101.js +1 -0
  54. package/assets/esri/core/workers/chunks/1840d74ebae777a0200b.js +1 -0
  55. package/assets/esri/core/workers/chunks/19bf6826e7d9a4d52035.js +1 -0
  56. package/assets/esri/core/workers/chunks/1bfbdec791e19f5a2534.js +1 -0
  57. package/assets/esri/core/workers/chunks/1d8280f63a6698e74f20.js +1 -0
  58. package/assets/esri/core/workers/chunks/{1b68b1b724ad30396723.js → 2426601b8cae7f06af4d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{a12803108c3b12808698.js → 242cad472fbc38b24dbc.js} +2 -2
  60. package/assets/esri/core/workers/chunks/25197ecb324d6f08e03e.js +1 -0
  61. package/assets/esri/core/workers/chunks/253c231b5a52f1d2d3a5.js +1 -0
  62. package/assets/esri/core/workers/chunks/25999b6f96ec305a7679.js +1 -0
  63. package/assets/esri/core/workers/chunks/259bdacfb7b0f866a8d0.js +1 -0
  64. package/assets/esri/core/workers/chunks/28565756f884d0851003.js +1 -0
  65. package/assets/esri/core/workers/chunks/2a5a165848413764381b.js +1 -0
  66. package/assets/esri/core/workers/chunks/2e7a5bb740281ef59199.js +1 -0
  67. package/assets/esri/core/workers/chunks/{285a5bd708f0fe1c620c.js → 2ea3ca68cfa4d34e8f3b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/2f87a49bdd00f899d81d.js +1 -0
  69. package/assets/esri/core/workers/chunks/{37a95f097533bad1b338.js → 302d91b7c480c6c9304b.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{3d6d2b42ba2ad7086d5d.js → 3b493e8043ec1a2a5d96.js} +1 -1
  71. package/assets/esri/core/workers/chunks/40e48b720d89cd067892.js +1 -0
  72. package/assets/esri/core/workers/chunks/{a833fc9250635eb4152f.js → 41f7f3615d3ecb87c59a.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{17acbf40e7c1cb42d9bd.js → 44b1cdf28269b4fa8a39.js} +1 -1
  74. package/assets/esri/core/workers/chunks/44e8cd4b3dad777ab0c9.js +1 -0
  75. package/assets/esri/core/workers/chunks/{95b3b8fe45ef4ac6b277.js → 450bc48a7389607bce1e.js} +1 -1
  76. package/assets/esri/core/workers/chunks/465a050fd838ee8eddf3.js +1 -0
  77. package/assets/esri/core/workers/chunks/46d8a1d6f7341ad20749.js +1 -0
  78. package/assets/esri/core/workers/chunks/4710f21b138a2c9a0345.js +1 -0
  79. package/assets/esri/core/workers/chunks/48a0dfaabb9b4bce4191.js +1 -0
  80. package/assets/esri/core/workers/chunks/49a3888bf9e2481642ac.js +1 -0
  81. package/assets/esri/core/workers/chunks/{4ee900e5dbb130fa0c7b.js → 4a40b894ec89b0a4f9bf.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{d847c3cb2043a983145b.js → 4addea2e35b0c845743e.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{e0a4d0288abd334b0673.js → 4ae626868e14bedd7fc5.js} +1 -1
  84. package/assets/esri/core/workers/chunks/529ee4670940720e888b.js +1 -0
  85. package/assets/esri/core/workers/chunks/{a3c882fe7599dc0f4f27.js → 59d1708ae13c6e7e6e55.js} +1 -1
  86. package/assets/esri/core/workers/chunks/59dd83e5aee2908c7eca.js +1 -0
  87. package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +1 -0
  88. package/assets/esri/core/workers/chunks/{b8bdacebd4d24ba90f3f.js → 5fde1234c5cccaee6763.js} +1 -1
  89. package/assets/esri/core/workers/chunks/60f9b37dd738d884c48d.js +1 -0
  90. package/assets/esri/core/workers/chunks/6123894e2ae9233cdf89.js +1 -0
  91. package/assets/esri/core/workers/chunks/62c8413f3bbc1378273d.js +1 -0
  92. package/assets/esri/core/workers/chunks/6501ee40bf25f9f75d02.js +1 -0
  93. package/assets/esri/core/workers/chunks/663cf8bff17c894cd5f8.js +1 -0
  94. package/assets/esri/core/workers/chunks/6b536d03b4bef408035b.js +1 -0
  95. package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +1 -0
  96. package/assets/esri/core/workers/chunks/6d1371b521c7f94fd77e.js +1 -0
  97. package/assets/esri/core/workers/chunks/6d5038d4351fe29e2718.js +1 -0
  98. package/assets/esri/core/workers/chunks/6f102c90908c9900cdaa.js +1 -0
  99. package/assets/esri/core/workers/chunks/6f39545710d1b35d922c.js +1 -0
  100. package/assets/esri/core/workers/chunks/7278fdf6bfcdffa10a7f.js +1 -0
  101. package/assets/esri/core/workers/chunks/72eb0ac55026a4f5d6a7.js +1 -0
  102. package/assets/esri/core/workers/chunks/73cb499d7d68c59ba34e.js +1 -0
  103. package/assets/esri/core/workers/chunks/{b8d788e110c212a879ab.js → 73f228d966b89c73c9e9.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{e7402dfd683f82878360.js → 752343d92ed48e674351.js} +1 -1
  105. package/assets/esri/core/workers/chunks/7538a0fe0cec3156769e.js +1 -0
  106. package/assets/esri/core/workers/chunks/76bccc318d7cc33829a7.js +1 -0
  107. package/assets/esri/core/workers/chunks/771ead806efbe9c91fdc.js +1 -0
  108. package/assets/esri/core/workers/chunks/777eafdb86b26b35c803.js +1 -0
  109. package/assets/esri/core/workers/chunks/7821aeba3e414b318a75.js +1 -0
  110. package/assets/esri/core/workers/chunks/78b80da3bbc1b608fe83.js +1 -0
  111. package/assets/esri/core/workers/chunks/7b531feba4fd662575f9.js +1 -0
  112. package/assets/esri/core/workers/chunks/7c57354d026e27e056d4.js +1 -0
  113. package/assets/esri/core/workers/chunks/7d163d9d90393e491ee5.js +1 -0
  114. package/assets/esri/core/workers/chunks/7d4c65311064a5c2e0b1.js +1 -0
  115. package/assets/esri/core/workers/chunks/{0474af7687466d8befd2.js → 7e2794705b4e679fcb3f.js} +1 -1
  116. package/assets/esri/core/workers/chunks/7ebbb90d80600d9ba889.js +1 -0
  117. package/assets/esri/core/workers/chunks/7f125963555dc1ce63ad.js +1 -0
  118. package/assets/esri/core/workers/chunks/{763cbb6716e398436a6d.js → 7f6eee102871769fdf8f.js} +1 -1
  119. package/assets/esri/core/workers/chunks/805c97b875d3066fb8df.js +1 -0
  120. package/assets/esri/core/workers/chunks/8566449c39eba55147f5.js +1 -0
  121. package/assets/esri/core/workers/chunks/86ed75b7169b8ee43025.js +1 -0
  122. package/assets/esri/core/workers/chunks/{9482a6d7baa24bbf5693.js → 89132395eca329b9ab92.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{28bc5e8e82f188b30eb9.js → 894343e415639df88243.js} +1 -1
  124. package/assets/esri/core/workers/chunks/8b4759cef5ae5e43253b.js +1 -0
  125. package/assets/esri/core/workers/chunks/8ba4175f5e9a24ffecf7.js +1 -0
  126. package/assets/esri/core/workers/chunks/8be707044d992ef5f1d8.js +1 -0
  127. package/assets/esri/core/workers/chunks/{bd862382f72ebd446b46.js → 8d2cac1952e817daaf1f.js} +1 -1
  128. package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +1 -0
  129. package/assets/esri/core/workers/chunks/8e38c5e63aae42bdf5a4.js +29 -0
  130. package/assets/esri/core/workers/chunks/{02ab09285a5c4ca98066.js → 8f785b722b1a131bf370.js} +1 -1
  131. package/assets/esri/core/workers/chunks/8f9874f42f21a4cb3acd.js +1 -0
  132. package/assets/esri/core/workers/chunks/90f4b81c6034253b70d7.js +1 -0
  133. package/assets/esri/core/workers/chunks/917c11cb40a7742d7f98.js +1 -0
  134. package/assets/esri/core/workers/chunks/93ab247ff34694ac60eb.js +1 -0
  135. package/assets/esri/core/workers/chunks/{6e45d0db97ffa4509177.js → 94bf7f0da6ad3f7ea277.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{580451761cadfe308919.js → 9954149def644c371894.js} +1 -1
  137. package/assets/esri/core/workers/chunks/9c57161ad48d8d546dc7.js +1 -0
  138. package/assets/esri/core/workers/chunks/{33bd9785bd0b6ccef21b.js → 9c5dff4f13102871786e.js} +1 -1
  139. package/assets/esri/core/workers/chunks/9d0bda096cdbd7e22f4b.js +1 -0
  140. package/assets/esri/core/workers/chunks/9dfb7d120195991e9672.js +1 -0
  141. package/assets/esri/core/workers/chunks/9ed5e6b06afea6c85330.js +1 -0
  142. package/assets/esri/core/workers/chunks/9f65cc6d9f7390bb1d5b.js +1 -0
  143. package/assets/esri/core/workers/chunks/{79b857bb301f9c4169d6.js → 9fee8441fbac9f723f77.js} +1 -1
  144. package/assets/esri/core/workers/chunks/a108f276659d5f25352c.js +1 -0
  145. package/assets/esri/core/workers/chunks/a2d8bc0efddd2e13b1ad.js +1 -0
  146. package/assets/esri/core/workers/chunks/{b32ede7805c7c6644e4c.js → a3bf8aa81ee398da5b52.js} +1 -1
  147. package/assets/esri/core/workers/chunks/{5b30231ae0a8f4b8435f.js → a504fa17d83facf1c01f.js} +1 -1
  148. package/assets/esri/core/workers/chunks/{538fe46dfd685a490e23.js → a7f42ada0aa69873a938.js} +1 -1
  149. package/assets/esri/core/workers/chunks/a97e0b9b057664911c14.js +1 -0
  150. package/assets/esri/core/workers/chunks/{cb58aff1ff186fa18345.js → a9f616f22042b0dce8b9.js} +1 -1
  151. package/assets/esri/core/workers/chunks/{128799741dd3c6fc69b9.js → ac4131121230cfc14f21.js} +1 -1
  152. package/assets/esri/core/workers/chunks/afd63c18ce4656271c8e.js +1 -0
  153. package/assets/esri/core/workers/chunks/{f04cb48fc73635d0572f.js → b059dabb1c732829487c.js} +1 -1
  154. package/assets/esri/core/workers/chunks/b13d2da33ec07e9d41ff.js +1 -0
  155. package/assets/esri/core/workers/chunks/b313464b987db8a3987a.js +1 -0
  156. package/assets/esri/core/workers/chunks/b318823aefcefad6fad5.js +1 -0
  157. package/assets/esri/core/workers/chunks/b378e504a5b1afc8d0ce.js +1 -0
  158. package/assets/esri/core/workers/chunks/{9fb87a7dba62b527c0ba.js → b3a1a93c6dc9247cb048.js} +1 -1
  159. package/assets/esri/core/workers/chunks/b5397dc03fa0bd654ba6.js +1 -0
  160. package/assets/esri/core/workers/chunks/b5b698008b8f3f4d5d61.js +1 -0
  161. package/assets/esri/core/workers/chunks/b7bcb31737b01d7736d0.js +1 -0
  162. package/assets/esri/core/workers/chunks/b9a1046ca2cd0cca5da5.js +1 -0
  163. package/assets/esri/core/workers/chunks/{cda04571d7623c17ada2.js → b9c7aa04861f545a559c.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{7df795bc4fa1d433463b.js → ba030767cf935f967454.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{53d165b4f30fd64e5d8a.js → bd311c85437743cf7d2f.js} +1 -1
  166. package/assets/esri/core/workers/chunks/bd88228f781a0399d8bd.js +1 -0
  167. package/assets/esri/core/workers/chunks/bfb626805405646a0419.js +1 -0
  168. package/assets/esri/core/workers/chunks/{61d3fcb419d6bf7e355e.js → c1e45e24f5ef719a714c.js} +18 -18
  169. package/assets/esri/core/workers/chunks/c203df41f9d2e4b80889.js +1 -0
  170. package/assets/esri/core/workers/chunks/{278409028bc5af45b507.js → c4c83b5129c279c3615b.js} +1 -1
  171. package/assets/esri/core/workers/chunks/c53b2be005721591e29b.js +1 -0
  172. package/assets/esri/core/workers/chunks/c6ef0636073e28350c91.js +1 -0
  173. package/assets/esri/core/workers/chunks/c7e391df714839484cd1.js +1 -0
  174. package/assets/esri/core/workers/chunks/{e287113777a94ded8de6.js → c82ab4f0908290e70ee9.js} +1 -1
  175. package/assets/esri/core/workers/chunks/cded485ad893a7dd2948.js +1 -0
  176. package/assets/esri/core/workers/chunks/{1cf8fb704c48ac3d3b15.js → cf360767310fb45660a8.js} +1 -1
  177. package/assets/esri/core/workers/chunks/{8f2fecd8a0a972d68590.js → cf8ce63711488f2e677c.js} +1 -1
  178. package/assets/esri/core/workers/chunks/d214ac457ac970479536.js +1 -0
  179. package/assets/esri/core/workers/chunks/d4058352db1e8255b52e.js +1 -0
  180. package/assets/esri/core/workers/chunks/d456520e4b119a2816b6.js +1 -0
  181. package/assets/esri/core/workers/chunks/d4d385d19e62ef1c286f.js +1 -0
  182. package/assets/esri/core/workers/chunks/d4f005dadba75422b401.js +1 -0
  183. package/assets/esri/core/workers/chunks/{52c4b4dabcb0d162be72.js → d5e15021928e95c11463.js} +1 -1
  184. package/assets/esri/core/workers/chunks/{fc639c730115e07a4a1a.js → d6500f6b2ff115d9eb09.js} +1 -1
  185. package/assets/esri/core/workers/chunks/e02f02040b63d9c2e654.js +1 -0
  186. package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +1 -0
  187. package/assets/esri/core/workers/chunks/e1492d2404c3ed82931e.js +1 -0
  188. package/assets/esri/core/workers/chunks/e2ddfc96ddba92302e0c.js +1 -0
  189. package/assets/esri/core/workers/chunks/e34ed3b818b2eb4116c5.js +1 -0
  190. package/assets/esri/core/workers/chunks/e7149d23615fee31ab7e.js +1 -0
  191. package/assets/esri/core/workers/chunks/ec774f5d6ea5c29536e5.js +1 -0
  192. package/assets/esri/core/workers/chunks/{35cbf00f0c37a86517af.js → ed1de8b7406269e217b9.js} +1 -1
  193. package/assets/esri/core/workers/chunks/ed4ac5568dc2815b066d.js +1 -0
  194. package/assets/esri/core/workers/chunks/ed71a4e353715db0a6e9.js +1 -0
  195. package/assets/esri/core/workers/chunks/{f4891345507df63cff3c.js → ef27bf1d7941ae265ca4.js} +3 -3
  196. package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +1 -0
  197. package/assets/esri/core/workers/chunks/{1e342d532925569daadb.js → f475672ff4c2ec9367c2.js} +1 -1
  198. package/assets/esri/core/workers/chunks/{cc414fd2e313d89d524d.js → f54eba484f40d5eeb590.js} +1 -1
  199. package/assets/esri/core/workers/chunks/f5c9659fc5d571d501c9.js +1 -0
  200. package/assets/esri/core/workers/chunks/f622b27ebdf1c918fd6d.js +1 -0
  201. package/assets/esri/core/workers/chunks/{dd95f50dac3f33cdb6d2.js → f6a13f07a5f7b781a9a8.js} +1 -1
  202. package/assets/esri/core/workers/chunks/{d849bdaf5bdfdc37531a.js → f6f7d885b4d6080e3f58.js} +1 -1
  203. package/assets/esri/core/workers/chunks/f8b8d3d2710c83acccf3.js +1 -0
  204. package/assets/esri/core/workers/chunks/f95870bb4d8e4e13e69e.js +1 -0
  205. package/assets/esri/core/workers/chunks/fa377112ef3b78f6ed18.js +1 -0
  206. package/assets/esri/core/workers/chunks/fa59f10ed0f182a2a7f3.js +1 -0
  207. package/assets/esri/core/workers/chunks/faa55265020591fd2224.js +1 -0
  208. package/assets/esri/core/workers/chunks/fc827f58db3194922056.js +1 -0
  209. package/chunks/VolumeMask.glsl.js +3 -0
  210. package/chunks/_commonjsHelpers.js +1 -1
  211. package/chunks/aiServices.js +1 -1
  212. package/chunks/array.js +1 -1
  213. package/chunks/languageUtils.js +1 -1
  214. package/chunks/persistableUrlUtils.js +1 -1
  215. package/config.js +1 -1
  216. package/core/Collection.d.ts +42 -6
  217. package/core/Collection.js +1 -1
  218. package/form/ExpressionInfo.d.ts +1 -1
  219. package/form/ExpressionInfo.js +1 -1
  220. package/form/elements/FieldElement.d.ts +3 -2
  221. package/form/elements/inputs/ComboBoxInput.d.ts +4 -15
  222. package/form/elements/inputs/ComboBoxInput.js +1 -1
  223. package/form/elements/inputs/DynamicChoiceInput.d.ts +31 -0
  224. package/form/elements/inputs/DynamicChoiceInput.js +2 -0
  225. package/form/elements/inputs/Input.d.ts +1 -1
  226. package/form/elements/inputs/RadioButtonsInput.d.ts +4 -15
  227. package/form/elements/inputs/RadioButtonsInput.js +1 -1
  228. package/form/elements/inputs/SingleChoiceInput.d.ts +18 -0
  229. package/form/elements/inputs/SingleChoiceInput.js +2 -0
  230. package/form/elements/inputs.d.ts +11 -2
  231. package/form/elements/inputs.js +1 -1
  232. package/geometry/SpatialReference.d.ts +1 -4
  233. package/geometry/support/normalizeUtils.d.ts +1 -1
  234. package/kernel.js +1 -1
  235. package/layers/BaseElevationLayer.js +1 -1
  236. package/layers/ElevationLayer.js +1 -1
  237. package/layers/ImageryTileLayer.d.ts +1 -1
  238. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  239. package/layers/KnowledgeGraphLayer.js +1 -1
  240. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  241. package/layers/RouteLayer.d.ts +1 -1
  242. package/layers/StreamLayer.js +1 -1
  243. package/layers/VoxelWasmPerSceneView.js +1 -1
  244. package/layers/graphics/sources/connections/createConnection.js +1 -1
  245. package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
  246. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  247. package/layers/graphics/sources/support/QueryTask.js +1 -1
  248. package/layers/mixins/ArcGISImageService.d.ts +24 -24
  249. package/layers/mixins/SceneService.js +1 -1
  250. package/layers/mixins/TiledImagery.d.ts +1 -1
  251. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  252. package/layers/raster/datasets/BaseRaster.js +1 -1
  253. package/layers/save/groupLayerUtils.js +1 -1
  254. package/layers/save/mediaLayerUtils.js +1 -1
  255. package/layers/support/ElevationQueryTileCache.js +1 -1
  256. package/layers/video/VideoController.js +1 -1
  257. package/layers/video/types.d.ts +17 -1
  258. package/linkChart/LinkChartProperties.js +1 -1
  259. package/networks/support/CircuitExportJobInfo.d.ts +1 -1
  260. package/networks/support/CircuitVerifyJobInfo.d.ts +1 -1
  261. package/networks/support/TopologyValidationJobInfo.d.ts +1 -1
  262. package/networks/support/TraceJobInfo.d.ts +1 -1
  263. package/package.json +2 -2
  264. package/portal/jsonTypes.d.ts +1 -1
  265. package/portal/support/jsonContext.js +1 -1
  266. package/rest/closestFacility.d.ts +1 -1
  267. package/rest/find.d.ts +1 -1
  268. package/rest/geometryService.d.ts +21 -21
  269. package/rest/geoprocessor.d.ts +2 -2
  270. package/rest/identify.d.ts +1 -1
  271. package/rest/imageService.d.ts +19 -19
  272. package/rest/lastMileDelivery.d.ts +8 -8
  273. package/rest/locator.d.ts +4 -4
  274. package/rest/networkService.d.ts +1 -1
  275. package/rest/networks/queryAssociations.d.ts +1 -1
  276. package/rest/networks/synthesizeAssociationGeometries.d.ts +1 -1
  277. package/rest/networks/trace.d.ts +1 -1
  278. package/rest/networks/traverseAssociations.d.ts +1 -1
  279. package/rest/places.d.ts +3 -3
  280. package/rest/print.d.ts +1 -1
  281. package/rest/query.d.ts +11 -11
  282. package/rest/route.d.ts +1 -1
  283. package/rest/serviceArea.d.ts +1 -1
  284. package/rest/support/JobInfo.d.ts +5 -5
  285. package/rest/symbolService.d.ts +1 -1
  286. package/support/persistableUrlUtils.js +1 -1
  287. package/support/revision.js +1 -1
  288. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  289. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
  290. package/views/3d/GroundView3D.js +1 -1
  291. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  292. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  293. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  294. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  295. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  296. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  297. package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
  298. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  299. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  300. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  301. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  302. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  303. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +1 -1
  304. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  305. package/views/3d/support/hitTest.js +1 -1
  306. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  307. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  308. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  309. package/views/3d/terrain/TerrainRenderer.js +1 -1
  310. package/views/3d/terrain/TerrainSurface.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  313. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  314. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
  315. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +49 -32
  316. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +5 -5
  317. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +23 -23
  318. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
  319. package/views/3d/webgl-engine/lib/CutFillVisualization.js +1 -1
  320. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  321. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  322. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  323. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  324. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  325. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  326. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  327. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  328. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  329. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  330. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  331. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  332. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  333. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  334. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  335. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  336. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  337. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  338. package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +1 -1
  339. package/views/3d/webgl-engine/shaders/{CutFillMask.glsl.js → VolumeMask.glsl.js} +1 -1
  340. package/views/3d/webgl-engine/shaders/VolumeMaskTechnique.js +2 -0
  341. package/views/draw/support/InteractiveHandle.js +1 -1
  342. package/views/draw/support/managers/SurfaceManager.js +1 -1
  343. package/views/interactive/Tooltip.d.ts +3 -3
  344. package/views/interactive/Tooltip.js +1 -1
  345. package/views/interactive/options/ElevationOptions.d.ts +20 -0
  346. package/views/interactive/options/ElevationOptions.js +2 -0
  347. package/views/interactive/options/LabelOptions.d.ts +74 -0
  348. package/views/interactive/options/LabelOptions.js +2 -0
  349. package/views/interactive/options/SnappingOptions.d.ts +157 -0
  350. package/views/interactive/options/SnappingOptions.js +2 -0
  351. package/views/interactive/options/TooltipOptions.d.ts +152 -0
  352. package/views/interactive/options/TooltipOptions.js +2 -0
  353. package/views/interactive/options/TooltipVisibleElements.d.ts +105 -0
  354. package/views/interactive/options/TooltipVisibleElements.js +2 -0
  355. package/views/interactive/options/ValueOptions.d.ts +63 -0
  356. package/views/interactive/options/ValueOptions.js +2 -0
  357. package/views/interactive/sketch/SketchLabelOptions.d.ts +7 -9
  358. package/views/interactive/sketch/SketchLabelOptions.js +1 -1
  359. package/views/interactive/sketch/SketchTooltipElevationOptions.js +1 -1
  360. package/views/interactive/sketch/SketchTooltipOptions.d.ts +8 -50
  361. package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
  362. package/views/interactive/sketch/SketchTooltipVisibleElements.d.ts +10 -95
  363. package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
  364. package/views/interactive/sketch/SketchValueOptions.d.ts +7 -45
  365. package/views/interactive/sketch/SketchValueOptions.js +1 -1
  366. package/views/interactive/sketch/Units.d.ts +10 -29
  367. package/views/interactive/sketch/Units.js +1 -1
  368. package/views/interactive/snapping/SnappingOptions.d.ts +7 -78
  369. package/views/interactive/snapping/SnappingOptions.js +1 -1
  370. package/views/interactive/support/Units.d.ts +33 -0
  371. package/views/interactive/support/Units.js +2 -0
  372. package/views/interactive/support/types.d.ts +33 -0
  373. package/views/interactive/tooltip/types.d.ts +6 -2
  374. package/webdoc/support/resourceUtils.js +1 -1
  375. package/webdoc/support/types.d.ts +2 -0
  376. package/webdoc/support/utils.js +2 -0
  377. package/webdoc/support/webdocLoadUtils.js +1 -1
  378. package/webdoc/support/webdocSaveUtils.js +1 -1
  379. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  380. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  381. package/widgets/BatchAttributeForm/expressions/ArcadeExecutorProvider.js +1 -1
  382. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  383. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  384. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  385. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  386. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  387. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  388. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  389. package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
  390. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  391. package/widgets/BatchAttributeForm.js +1 -1
  392. package/widgets/Editor/UpdateWorkflow.js +1 -1
  393. package/widgets/Editor.js +1 -1
  394. package/widgets/FeatureForm.js +1 -1
  395. package/widgets/FeatureTable/Grid/Column.d.ts +6 -0
  396. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  397. package/widgets/Sketch/SketchViewModel.js +1 -1
  398. package/widgets/support/SelectionList/FeatureItem.d.ts +116 -0
  399. package/widgets/support/SelectionList/GroupLayerItem.d.ts +94 -0
  400. package/widgets/support/SelectionList/ItemBase.d.ts +70 -0
  401. package/widgets/support/SelectionList/LayerItem.d.ts +140 -0
  402. package/widgets/support/SelectionList/LayerItem.js +1 -1
  403. package/widgets/support/SelectionList/SelectionListViewModel.d.ts +265 -0
  404. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  405. package/widgets/support/SelectionList/types.d.ts +42 -0
  406. package/widgets/support/forms/formUtils.js +1 -1
  407. package/assets/esri/core/workers/chunks/003a87b16f8a4b476e14.js +0 -1
  408. package/assets/esri/core/workers/chunks/069b6d8bdb34ee88d437.js +0 -1
  409. package/assets/esri/core/workers/chunks/0790bf0eb276cd9166f6.js +0 -1
  410. package/assets/esri/core/workers/chunks/0a50efb07eee36237e21.js +0 -1
  411. package/assets/esri/core/workers/chunks/0ae0483b72f5e8d00d55.js +0 -1
  412. package/assets/esri/core/workers/chunks/0d1224693a62a26a0e72.js +0 -1
  413. package/assets/esri/core/workers/chunks/10b367563f894ceb9864.js +0 -1
  414. package/assets/esri/core/workers/chunks/11e00ca5ac1b004f4ecc.js +0 -1
  415. package/assets/esri/core/workers/chunks/129fdd1636e67997337c.js +0 -1
  416. package/assets/esri/core/workers/chunks/12e0c5b7cc5c3f9e6f0f.js +0 -1
  417. package/assets/esri/core/workers/chunks/13033178de9f637a2356.js +0 -1
  418. package/assets/esri/core/workers/chunks/13c893e448bedc5c1cef.js +0 -1
  419. package/assets/esri/core/workers/chunks/147a89553188cc6aabf4.js +0 -1
  420. package/assets/esri/core/workers/chunks/15c2d9bec0455fc363a9.js +0 -1
  421. package/assets/esri/core/workers/chunks/246cd372d4184233f48e.js +0 -1
  422. package/assets/esri/core/workers/chunks/268ab65afc3fce775ad2.js +0 -1
  423. package/assets/esri/core/workers/chunks/26a2d4b95cda0a41d980.js +0 -1
  424. package/assets/esri/core/workers/chunks/26f1fd3f2be5102aae1d.js +0 -1
  425. package/assets/esri/core/workers/chunks/279a9a38b04a21cdfd11.js +0 -1
  426. package/assets/esri/core/workers/chunks/3406a01dad6338e3c548.js +0 -1
  427. package/assets/esri/core/workers/chunks/34fbeeeeef4bd01672c6.js +0 -1
  428. package/assets/esri/core/workers/chunks/36781219ca9ba5d7fe52.js +0 -1
  429. package/assets/esri/core/workers/chunks/36999a2e383c8eb3c398.js +0 -1
  430. package/assets/esri/core/workers/chunks/36f8a912842181e1f0aa.js +0 -1
  431. package/assets/esri/core/workers/chunks/36fe6adf6517d8f80125.js +0 -1
  432. package/assets/esri/core/workers/chunks/3f1a7f8a9ead64bf0b7b.js +0 -1
  433. package/assets/esri/core/workers/chunks/403f08e0c1a9203f7fba.js +0 -1
  434. package/assets/esri/core/workers/chunks/461c2de938bf4c9b1442.js +0 -1
  435. package/assets/esri/core/workers/chunks/478540265c86436da05e.js +0 -1
  436. package/assets/esri/core/workers/chunks/479f486ec1797629ec70.js +0 -1
  437. package/assets/esri/core/workers/chunks/484b3e2a220c440ccbb4.js +0 -1
  438. package/assets/esri/core/workers/chunks/4a340836ddbc856993f2.js +0 -1
  439. package/assets/esri/core/workers/chunks/4f2170609742b51bd7b8.js +0 -1
  440. package/assets/esri/core/workers/chunks/4f59357f535f30a6b5cc.js +0 -1
  441. package/assets/esri/core/workers/chunks/5133083222588799493f.js +0 -1
  442. package/assets/esri/core/workers/chunks/52993a9dc0c56e9bda19.js +0 -1
  443. package/assets/esri/core/workers/chunks/57b07448da06d0302a46.js +0 -1
  444. package/assets/esri/core/workers/chunks/5a9ff50fdcc99ae28cce.js +0 -1
  445. package/assets/esri/core/workers/chunks/5dc17b76c6ecc24e7b9a.js +0 -1
  446. package/assets/esri/core/workers/chunks/5e35828216020f33e26b.js +0 -1
  447. package/assets/esri/core/workers/chunks/5eb6f37c74a217772eca.js +0 -1
  448. package/assets/esri/core/workers/chunks/5f0d6c853873a7f32527.js +0 -1
  449. package/assets/esri/core/workers/chunks/6121cd0264b6841a5bac.js +0 -1
  450. package/assets/esri/core/workers/chunks/6210fb6cd31844f23964.js +0 -1
  451. package/assets/esri/core/workers/chunks/638ed1297efdb24f4711.js +0 -1
  452. package/assets/esri/core/workers/chunks/64247e439ef3e1f712e9.js +0 -1
  453. package/assets/esri/core/workers/chunks/661a59133ae34f172174.js +0 -1
  454. package/assets/esri/core/workers/chunks/6823ba1688dfedba0107.js +0 -1
  455. package/assets/esri/core/workers/chunks/6c2b5087a9df65267f4e.js +0 -1
  456. package/assets/esri/core/workers/chunks/6d247ff53421d27628ce.js +0 -1
  457. package/assets/esri/core/workers/chunks/700c08dd2e734c15e621.js +0 -1
  458. package/assets/esri/core/workers/chunks/70452f6d63e9be8d03dd.js +0 -1
  459. package/assets/esri/core/workers/chunks/705d6b108fd121cea887.js +0 -1
  460. package/assets/esri/core/workers/chunks/733b2e181683d5fc7c95.js +0 -1
  461. package/assets/esri/core/workers/chunks/73aa1bfa6e1dc271c9d7.js +0 -1
  462. package/assets/esri/core/workers/chunks/7659391f952d134164cf.js +0 -1
  463. package/assets/esri/core/workers/chunks/7889f4a17cf249f2acc5.js +0 -1
  464. package/assets/esri/core/workers/chunks/7a2dcd57849048c6e00d.js +0 -1
  465. package/assets/esri/core/workers/chunks/7a2dfa42610fe8414ed7.js +0 -1
  466. package/assets/esri/core/workers/chunks/7ce52b850dd785bfa33f.js +0 -1
  467. package/assets/esri/core/workers/chunks/81accb1820e2735fa376.js +0 -1
  468. package/assets/esri/core/workers/chunks/8210fc9e072209e26fa9.js +0 -1
  469. package/assets/esri/core/workers/chunks/825eb845216762a1ed2f.js +0 -1
  470. package/assets/esri/core/workers/chunks/83991475aa54fd5aa008.js +0 -1
  471. package/assets/esri/core/workers/chunks/84fa102a93b2144c28fb.js +0 -1
  472. package/assets/esri/core/workers/chunks/85ce7673d42526a79fd2.js +0 -1
  473. package/assets/esri/core/workers/chunks/8722e2790272e90a1897.js +0 -1
  474. package/assets/esri/core/workers/chunks/88df19742edb0cdc3e67.js +0 -1
  475. package/assets/esri/core/workers/chunks/8977c85aecc7e08ab13c.js +0 -1
  476. package/assets/esri/core/workers/chunks/8a1970e68bc1e833cb7f.js +0 -1
  477. package/assets/esri/core/workers/chunks/8bb20ef549ec1c86b38e.js +0 -1
  478. package/assets/esri/core/workers/chunks/8bdca809dd88eab9e5d8.js +0 -29
  479. package/assets/esri/core/workers/chunks/8c5726c7ce40a92901e6.js +0 -1
  480. package/assets/esri/core/workers/chunks/8c5e65982c3f9295e844.js +0 -1
  481. package/assets/esri/core/workers/chunks/8ce649e55fefc8eca55c.js +0 -1
  482. package/assets/esri/core/workers/chunks/90ae80b797642bff0efa.js +0 -1
  483. package/assets/esri/core/workers/chunks/94e9cf8e729ec36de5be.js +0 -1
  484. package/assets/esri/core/workers/chunks/97c758f736f28c5dab84.js +0 -1
  485. package/assets/esri/core/workers/chunks/98b27cf8acbfa4259758.js +0 -1
  486. package/assets/esri/core/workers/chunks/9a6208ab670ad74e6f7d.js +0 -1
  487. package/assets/esri/core/workers/chunks/a10f63a08d976be058be.js +0 -1
  488. package/assets/esri/core/workers/chunks/a494abeb026d536d9fae.js +0 -1
  489. package/assets/esri/core/workers/chunks/a5f058567419ea70dff6.js +0 -1
  490. package/assets/esri/core/workers/chunks/a8ade34612e73862de6f.js +0 -1
  491. package/assets/esri/core/workers/chunks/a9d391071803b1e9e8a0.js +0 -1
  492. package/assets/esri/core/workers/chunks/aa3abc07de2921ef6ca1.js +0 -1
  493. package/assets/esri/core/workers/chunks/b03f09ee2224f0cc526a.js +0 -1
  494. package/assets/esri/core/workers/chunks/b3f1a442d6b7826e917f.js +0 -1
  495. package/assets/esri/core/workers/chunks/b5c7813495657f844171.js +0 -1
  496. package/assets/esri/core/workers/chunks/b7170816736769d3b7b0.js +0 -1
  497. package/assets/esri/core/workers/chunks/b819a9187426d0c146df.js +0 -1
  498. package/assets/esri/core/workers/chunks/b8e5d7aefddddbd0a10c.js +0 -1
  499. package/assets/esri/core/workers/chunks/b958f87f23f984131d09.js +0 -1
  500. package/assets/esri/core/workers/chunks/b9f40681af1fa00b5bbe.js +0 -1
  501. package/assets/esri/core/workers/chunks/c4c25db769a78e677e33.js +0 -1
  502. package/assets/esri/core/workers/chunks/c85ba0700eafdc8d6f9e.js +0 -1
  503. package/assets/esri/core/workers/chunks/ca118c42c0f609ca7912.js +0 -1
  504. package/assets/esri/core/workers/chunks/cb17cd8aaf77238c0236.js +0 -1
  505. package/assets/esri/core/workers/chunks/d03f427442bb0c287d05.js +0 -1
  506. package/assets/esri/core/workers/chunks/d08d3c6f21e6ba8268ca.js +0 -1
  507. package/assets/esri/core/workers/chunks/d37a72111dffc4c4db70.js +0 -1
  508. package/assets/esri/core/workers/chunks/d41ab2abcfacc87809b5.js +0 -1
  509. package/assets/esri/core/workers/chunks/d4ed094962a41d756c95.js +0 -1
  510. package/assets/esri/core/workers/chunks/d51c41c1944df0cbab3e.js +0 -1
  511. package/assets/esri/core/workers/chunks/dc24e80d061f7b063608.js +0 -1
  512. package/assets/esri/core/workers/chunks/df30053a10d4930924d5.js +0 -1
  513. package/assets/esri/core/workers/chunks/e3623e557ab463580fd2.js +0 -1
  514. package/assets/esri/core/workers/chunks/e5bb7ee670a3ba5ba3fe.js +0 -1
  515. package/assets/esri/core/workers/chunks/e5c75459de85a6dd2f14.js +0 -1
  516. package/assets/esri/core/workers/chunks/e798ca23f02a2dd65bd4.js +0 -1
  517. package/assets/esri/core/workers/chunks/f0225829f7d941914815.js +0 -1
  518. package/assets/esri/core/workers/chunks/f1299b4fc760ccca1518.js +0 -1
  519. package/assets/esri/core/workers/chunks/f65adaaa33d9f3b131f6.js +0 -1
  520. package/assets/esri/core/workers/chunks/f7fa932ade85cb2847b6.js +0 -1
  521. package/assets/esri/core/workers/chunks/f9b654f801cb416e9e17.js +0 -1
  522. package/assets/esri/core/workers/chunks/fb34d6d96c8c0d53fcf6.js +0 -1
  523. package/assets/esri/core/workers/chunks/fdec3a2e100688c42e41.js +0 -1
  524. package/assets/esri/core/workers/chunks/fefbde2c2e527bb716ee.js +0 -1
  525. package/chunks/CutFillMask.glsl.js +0 -3
  526. package/chunks/FocusAreaMask.glsl.js +0 -3
  527. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +0 -2
  528. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +0 -2
  529. package/views/3d/webgl-engine/shaders/CutFillMaskTechnique.js +0 -2
  530. /package/assets/esri/core/workers/chunks/{a12803108c3b12808698.js.LICENSE.txt → 242cad472fbc38b24dbc.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{floatSubArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as i,compactIndices as s}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{compressNormal as o,encodeInt16 as n}from"./Normals.js";import{PathEvaluator as h}from"./PathEvaluator.js";import{encodePathVertexInfo as a}from"./PathVertexInfo.js";class u{constructor(s,o,n,a,u){this.path=s,this.profile=o,this.extruder=n,this.cap=a,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const p=this.path.vertices.length-2;this.numExtrusionProfiles=n.numProfilesPerJoin()*p+2,this.numVerticesTotal=o.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;const m=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=m,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=m,this.profileRightAxes=r(2*this.numExtrusionFrames),this.profileUpAxes=r(2*this.numExtrusionFrames);const l=1===u;this.profileRotationFrameUpAxes=l?r(2*this.numExtrusionFrames):null,this.pathMaxStretchDistances=e(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=i(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=t(s.positions,s.offset,3*s.vertices.length),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new h(this,o,this.extruder.numBendSubdivisions,a.type,n.cutoffAngle,u)}emitVertexDescriptor(t){const e=this._extrusionVertexCount;this.pathVertexInfos[e]=a(t),++this._extrusionVertexCount}emitExtrusionFrame(t,e){const{frame:i,rotationFrameUp:s,rotationAngle:r,maxStretchDistance:h}=t,a=this._extrusionFrameCount;return o(this.profileRightAxes,a,i.right[0],i.right[1],i.right[2]),o(this.profileUpAxes,a,i.up[0],i.up[1],i.up[2]),this.profileRotations[a]=n(r/Math.PI),this.profileRotationFrameUpAxes&&o(this.profileRotationFrameUpAxes,a,s[0],s[1],s[2]),this.pathMaxStretchDistances[a]=h,this.framePositionIndices[a]=e,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{vertices:t}=this.path,{profile:e}=this;this._updatePositions();for(let r=0;r<t.length;++r)this.emitExtrusionFrame(t[r],r);for(let r=0;r<e.vertices.length;++r)this.emitVertexDescriptor({frameIndex:0,sourceIndex:r,subdivision:0,type:1,capSide:0});const i=(t,e,i)=>{this.emitVertexDescriptor({frameIndex:t,sourceIndex:e,subdivision:i,type:0,capSide:0})};for(let r=1;r<t.length-1;++r)this.extruder.extrude(r,this.profile,i);const s=t.length-1;for(let r=0;r<e.vertices.length;++r)this.emitVertexDescriptor({frameIndex:s,sourceIndex:r,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:t,subdivision:e,type:i,capSide:0})),this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({frameIndex:s,sourceIndex:t,subdivision:e,type:i,capSide:1}))}_updatePositions(){const{positions:t,offset:e,vertices:i}=this.path;if(!Array.isArray(t))return;const s=3*i.length,r=this.positions;for(let o=0;o<s;++o)r[o]=t[e+o]}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1,r=0,o=t*(this.numExtrusionProfiles-1),n=new Array,h=(t,e,i)=>{n.push(t),n.push(e),n.push(i)};for(let s=0;s<e;++s){const e=this.profile.indices[2*s],r=this.profile.indices[2*s+1];for(let s=0;s<i;++s){const i=s*t+e,o=(s+1)*t+r,n=s*t+r;h(i,(s+1)*t+e,o),h(i,o,n)}}this.cap.buildTopology(h,0,this.startCapVertexBufferStart,r),this.cap.buildTopology(h,1,this.endCapVertexBufferStart,o),this.vertexIndices=s(n)}onPathChanged(){this._rebuildGeometry()}}export{u as PathBuilder};
2
+ import{floatSubArray as t}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as e}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as i,compactIndices as s}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{pathNumProfilesPerJoin as o}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as n,encodeInt16 as h}from"./Normals.js";import{PathEvaluator as a}from"./PathEvaluator.js";import{encodePathVertexInfo as p}from"./PathVertexInfo.js";class u{constructor(s,n,h,p,u){this.path=s,this.profile=n,this.extruder=h,this.cap=p,this._extrusionVertexCount=0,this._extrusionFrameCount=0;const m=this.path.vertices.length-2;this.numExtrusionProfiles=o*m+2,this.numVerticesTotal=n.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;const l=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=l,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=l,this.profileRightAxes=r(2*this.numExtrusionFrames),this.profileUpAxes=r(2*this.numExtrusionFrames);const c=1===u;this.profileRotationFrameUpAxes=c?r(2*this.numExtrusionFrames):null,this.pathMaxStretchDistances=e(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=i(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=t(s.positions,s.offset,3*s.vertices.length),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new a(this,n,h,p.type,u)}emitVertexDescriptor(t){const e=this._extrusionVertexCount;this.pathVertexInfos[e]=p(t),++this._extrusionVertexCount}emitExtrusionFrame(t,e){const{frame:i,rotationFrameUp:s,rotationAngle:r,maxStretchDistance:o}=t,a=this._extrusionFrameCount;return n(this.profileRightAxes,a,i.right[0],i.right[1],i.right[2]),n(this.profileUpAxes,a,i.up[0],i.up[1],i.up[2]),this.profileRotations[a]=h(r/Math.PI),this.profileRotationFrameUpAxes&&n(this.profileRotationFrameUpAxes,a,s[0],s[1],s[2]),this.pathMaxStretchDistances[a]=o,this.framePositionIndices[a]=e,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;const{vertices:t}=this.path,{profile:e}=this;this._updatePositions();for(let r=0;r<t.length;++r)this.emitExtrusionFrame(t[r],r);for(let r=0;r<e.vertices.length;++r)this.emitVertexDescriptor({frameIndex:0,sourceIndex:r,subdivision:0,type:1,capSide:0});const i=(t,e,i)=>{this.emitVertexDescriptor({frameIndex:t,sourceIndex:e,subdivision:i,type:0,capSide:0})};for(let r=1;r<t.length-1;++r)this.extruder.extrude(r,this.profile,i);const s=t.length-1;for(let r=0;r<e.vertices.length;++r)this.emitVertexDescriptor({frameIndex:s,sourceIndex:r,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:t,subdivision:e,type:i,capSide:0})),this.cap.rebuildCapGeometry((t,e,i)=>this.emitVertexDescriptor({frameIndex:s,sourceIndex:t,subdivision:e,type:i,capSide:1}))}_updatePositions(){const{positions:t,offset:e,vertices:i}=this.path;if(!Array.isArray(t))return;const s=3*i.length,r=this.positions;for(let o=0;o<s;++o)r[o]=t[e+o]}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1,r=0,o=t*(this.numExtrusionProfiles-1),n=new Array,h=(t,e,i)=>{n.push(t),n.push(e),n.push(i)};for(let s=0;s<e;++s){const e=this.profile.indices[2*s],r=this.profile.indices[2*s+1];for(let s=0;s<i;++s){const i=s*t+e,o=(s+1)*t+r,n=s*t+r;h(i,(s+1)*t+e,o),h(i,o,n)}}this.cap.buildTopology(h,0,this.startCapVertexBufferStart,r),this.cap.buildTopology(h,1,this.endCapVertexBufferStart,o),this.vertexIndices=s(n)}onPathChanged(){this._rebuildGeometry()}}export{u as PathBuilder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{reciprocalClamped as t}from"../../../../core/mathUtils.js";import{set as e}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as i}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as o,copy as a,length as c,scale as n,set as f,dot as p,add as m,subtract as l,normalize as h,transformMat2 as u}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as x,ZEROS as d,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as g,set as V,transformQuat as I,dot as v,scale as P,add as j,normalize as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumRoundCapExtrusionSubdivisions as C}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decodeInt16 as A,decompressNormal as O}from"./Normals.js";import{PathFrame2D as k}from"./PathFrame2D.js";import{decodePathVertexInfo as D}from"./PathVertexInfo.js";class R{constructor(t,e,s,i,r,o){this.builder=t,this.profile=e,this.numJoinSubdivisions=s,this.capType=i,this.miterCutoffAngle=r,this.upVectorAlignment=o}evaluateVertexPosition(t,e,s,i){const{framePositionIndices:r,positions:l}=this.builder,h=Q;this._evaluateExtrudedVertex(h,s);const u=G;let x=0;const d=h.frameIndex,b=h.frame.right,I=h.frame.up,v=3*r[d],P=o(L,h.profileVertex,e);if(h.isCap)g(u,I,b),x=h.capPositionOffset*e[0];else{const t=N,s=B;a(t,h.rotationRight);const i=h.maxDistance;o(t,t,e);const r=c(t);r>0?n(t,t,1/r):f(t,0,0);const l=p(P,t);if(Math.abs(l)>i){f(s,-t[1],t[0]);const e=p(P,s);n(t,t,i*Math.sign(l)),n(s,s,e),m(P,t,s)}V(u,0,0,0)}const j=b[0]*P[0]+I[0]*P[1],M=b[1]*P[0]+I[1]*P[1],y=b[2]*P[0]+I[2]*P[1],C=3*i;t[C]=l[v]+j+u[0]*x,t[C+1]=l[v+1]+M+u[1]*x,t[C+2]=l[v+2]+y+u[2]*x}_evaluateExtrudedVertex(t,e){const{profileRotations:s,profileUpAxes:r,profileRightAxes:o,profileRotationFrameUpAxes:c,pathMaxStretchDistances:f,pathVertexInfos:u}=this.builder,{miterCutoffAngle:b,profile:g,upVectorAlignment:V}=this,v=S[V],P=1===this.upVectorAlignment,j=D(u[e]),M=j.frameIndex;t.frameIndex=M;const y=A(s[M])*Math.PI,k=f[M];switch(O(t.frame.right,o,M),O(t.frame.up,r,M),t.maxDistance=0,j.type){case 0:{t.isCap=!1;const e=g.vertices[j.sourceIndex],s=Math.abs(y)>=b,r=P?O(H,c,M):t.frame.up,o=null!=c?T(J,t.frame,r):x,n=p(e,o)*y>=0;if(s&&n){a(t.profileVertex,e);const s=.5*-y+j.subdivision*y/this.numJoinSubdivisions;0!==s&&(i(K,r,s),P&&I(t.frame.up,t.frame.up,K),I(t.frame.right,t.frame.right,K))}else{const s=v(E,e,y,o);a(t.profileVertex,s)}a(t.rotationRight,n?d:o),t.maxDistance=n?0:k;break}case 1:{t.isCap=!0;const e=g.vertices[j.sourceIndex];switch(a(t.profileVertex,e),this.capType){case 0:case 1:case 3:t.capPositionOffset=0;break;case 2:t.capPositionOffset=w(j)?.5:-.5}break}case 2:{t.isCap=!0;const e=w(j)?1:-1;switch(this.capType){case 1:case 2:{const s=g.vertices[j.sourceIndex],i=2===this.capType?.5*e:0;a(t.profileVertex,s),t.capPositionOffset=i;break}case 3:{const s=.5*e,i=g.poles[j.sourceIndex],r=i.position;i.normal;a(t.profileVertex,r),t.capPositionOffset=s;break}}break}case 3:{t.isCap=!0;const e=.5*(w(j)?1:-1),s=(1-(j.subdivision+1)/C)*Math.PI*.5,i=Math.sin(s),r=Math.cos(s),o=g.poleIndices[j.sourceIndex],c=g.poles[o],f=c.position,p=c.normal,u=g.vertices[j.sourceIndex];l(E,u,f),n(E,E,i),p?(m(E,E,f),a(t.profileVertex,E),t.capPositionOffset=e*r):(h(q,E),n(q,q,i),m(E,E,f),a(t.profileVertex,E),t.capPositionOffset=e*r);break}default:j.type}}}const S={0:(e,s,i)=>{if(Math.abs(i)<=0)return s;const r=t(Math.cos(.5*i));return f(e,(r-1+1)*s[0],s[1])},1:(s,i,r,o)=>{if(0===Math.abs(r))return i;const a=t(Math.cos(.5*r)),c=e(F,1+(a-1)*o[0]*o[0],(a-1)*o[0]*o[1],(a-1)*o[0]*o[1],1+(a-1)*o[1]*o[1]);return u(s,i,c)}};function w(t){return 1===t.capSide}function T(t,e,s){const i=v(s,e.up),r=v(s,e.right);return P(_,e.up,-r),P(z,e.right,i),j(_,_,z),M(_,_),U(t,e,_),t}function U(t,e,s){f(t,v(s,e.right),v(s,e.up))}const q=b(),E=b(),F=s(),J=b(),_=y(),z=y(),G=y(),L=b(),N=b(),B=b(),H=y(),K=r(),Q={profileVertex:b(),rotationRight:b(),maxDistance:0,capPositionOffset:0,isCap:!1,frame:new k,frameIndex:0};export{R as PathEvaluator};
2
+ import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as o,copy as a,length as c,scale as n,set as f,dot as p,add as m,subtract as l,normalize as h,transformMat2 as u}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as x,ZEROS as d,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as g,set as V,transformQuat as I,dot as P,scale as j,add as v,normalize as M}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumJoinSubdivisions as O,pathNumRoundCapExtrusionSubdivisions as k}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decodeInt16 as A,decompressNormal as C}from"./Normals.js";import{PathFrame2D as D}from"./PathFrame2D.js";import{decodePathVertexInfo as R}from"./PathVertexInfo.js";class w{constructor(e,t,s,r,i){this.builder=e,this.profile=t,this.extruder=s,this.capType=r,this.upVectorAlignment=i}evaluateVertexPosition(e,t,s,r){const{framePositionIndices:i,positions:l}=this.builder,h=W;this._evaluateExtrudedVertex(h,s);const u=N;let x=0;const d=h.frameIndex,b=h.frame.right,I=h.frame.up,P=3*i[d],j=o(B,h.profileVertex,t);if(h.isCap)g(u,I,b),x=h.capPositionOffset*t[0];else{const e=H,s=J;a(e,h.rotationRight);const r=h.maxDistance;o(e,e,t);const i=c(e);i>0?n(e,e,1/i):f(e,0,0);const l=p(j,e);if(Math.abs(l)>r){f(s,-e[1],e[0]);const t=p(j,s);n(e,e,r*Math.sign(l)),n(s,s,t),m(j,e,s)}V(u,0,0,0)}const v=b[0]*j[0]+I[0]*j[1],M=b[1]*j[0]+I[1]*j[1],y=b[2]*j[0]+I[2]*j[1],O=3*r;e[O]=l[P]+v+u[0]*x,e[O+1]=l[P+1]+M+u[1]*x,e[O+2]=l[P+2]+y+u[2]*x}_evaluateExtrudedVertex(e,t){const{profileRotations:s,profileUpAxes:i,profileRightAxes:o,profileRotationFrameUpAxes:c,pathMaxStretchDistances:f,pathVertexInfos:u}=this.builder,{extruder:b,profile:g,upVectorAlignment:V}=this,{cutoffAngle:P,join:j}=b,v=T[V],M=1===this.upVectorAlignment,y=R(u[t]),D=y.frameIndex;e.frameIndex=D;const w=A(s[D])*Math.PI,q=f[D];switch(C(e.frame.right,o,D),C(e.frame.up,i,D),e.maxDistance=0,y.type){case 0:{e.isCap=!1;const t=g.vertices[y.sourceIndex],s=Math.abs(w)>=P,i=M?C(K,c,D):e.frame.up,o=null!=c?U(z,e.frame,i):x,n=p(t,o)*w>=0;if(s&&n){a(e.profileVertex,t);const s=2===j?(y.subdivision/O-.5)*w:(-.5+Math.floor(y.subdivision/2))*w;0!==s&&(r(Q,i,s),M&&I(e.frame.up,e.frame.up,Q),I(e.frame.right,e.frame.right,Q))}else{const s=v(F,t,w,o);a(e.profileVertex,s)}a(e.rotationRight,n?d:o),e.maxDistance=n?0:q;break}case 1:{e.isCap=!0;const t=g.vertices[y.sourceIndex];switch(a(e.profileVertex,t),this.capType){case 0:case 1:case 3:e.capPositionOffset=0;break;case 2:e.capPositionOffset=S(y)?.5:-.5}break}case 2:{e.isCap=!0;const t=S(y)?1:-1;switch(this.capType){case 1:case 2:{const s=g.vertices[y.sourceIndex],r=2===this.capType?.5*t:0;a(e.profileVertex,s),e.capPositionOffset=r;break}case 3:{const s=.5*t,r=g.poles[y.sourceIndex],i=r.position;r.normal;a(e.profileVertex,i),e.capPositionOffset=s;break}}break}case 3:{e.isCap=!0;const t=.5*(S(y)?1:-1),s=(1-(y.subdivision+1)/k)*Math.PI*.5,r=Math.sin(s),i=Math.cos(s),o=g.poleIndices[y.sourceIndex],c=g.poles[o],f=c.position,p=c.normal,u=g.vertices[y.sourceIndex];l(F,u,f),n(F,F,r),p?(m(F,F,f),a(e.profileVertex,F),e.capPositionOffset=t*i):(h(E,F),n(E,E,r),m(F,F,f),a(e.profileVertex,F),e.capPositionOffset=t*i);break}default:y.type}}}const T={0:(t,s,r)=>{if(Math.abs(r)<=0)return s;const i=e(Math.cos(.5*r));return f(t,(i-1+1)*s[0],s[1])},1:(s,r,i,o)=>{if(0===Math.abs(i))return r;const a=e(Math.cos(.5*i)),c=t(_,1+(a-1)*o[0]*o[0],(a-1)*o[0]*o[1],(a-1)*o[0]*o[1],1+(a-1)*o[1]*o[1]);return u(s,r,c)}};function S(e){return 1===e.capSide}function U(e,t,s){const r=P(s,t.up),i=P(s,t.right);return j(G,t.up,-i),j(L,t.right,r),v(G,G,L),M(G,G),q(e,t,G),e}function q(e,t,s){f(e,P(s,t.right),P(s,t.up))}const E=b(),F=b(),_=s(),z=b(),G=y(),L=y(),N=y(),B=b(),H=b(),J=b(),K=y(),Q=i(),W={profileVertex:b(),rotationRight:b(),maxDistance:0,capPositionOffset:0,isCap:!1,frame:new D,frameIndex:0};export{w as PathEvaluator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- class i{constructor(i,e){this.cutoffAngle=i,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(i,e,n){for(let s=0;s<this.numBendSubdivisions+1;++s)for(let t=0;t<e.vertices.length;++t)n(i,t,s)}}export{i as MiterExtruder};
2
+ import{pathNumProfilesPerJoin as t}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class r{constructor(t){this.join=t,this.cutoffAngle=0===this.join?.8*Math.PI:0}extrude(r,s,o){for(let e=0;e<t;++e)for(let t=0;t<s.vertices.length;++t)o(r,t,e)}}export{r as PathExtruder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{sub as n,set as t,cross as o,normalize as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as c,create as r}from"../../../../geometry/support/aaBoundingBox.js";import{boundingInfoSubdivisionThreshold as s}from"./intersectionConstants.js";import{assert as u}from"./Util.js";class f{constructor(n=0,t=!1,o=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=o}}const a=r();function l(t,o,i,e,c,r){if(!t.visible)return;const s=n(z,e,i),{tolerance:a}=o,l=new f(a,!1,o.options.normalRequired);if(t.boundingInfo)u(0===t.type),p(t.readPrimitivePosition,t.boundingInfo,i,s,a,c,l,r);else{const n=t.readPrimitivePosition;v(i,s,0,t.faceCount,n,c,l,r)}}const m=e();function p(n,t,o,i,e,r,u,f){if(null==t)return;const l=B(i,m);if(c(a,t.box),null!=r&&r.applyToAabb(a),w(a,o,l,e)){const{primitiveIndices:c}=t,a=c.length;if(a>s){const c=t.children;if(void 0!==c){for(const t of c)p(n,t,o,i,e,r,u,f);return}}g(o,i,0,a,n,c,r,u,f)}}const h=e();function x(t,o,i,e,c,r,s,u){v(t,n(z,o,t),i,e,c,r,s,u)}function M(n,t,o,i){if(!o.visible)return;const{boundingInfo:e}=o;if(e){const{box:o}=e;if(n<o[0]||n>o[3]||t<o[1]||t>o[4])return}b(n,t,0,o.faceCount,o.readPrimitivePosition,i)}function b(n,t,o,i,e,c){for(let r=o;r<i;++r){const o=3*r,[i,s]=e(F,o),[u,f]=e(F,o+1),[a,l]=e(F,o+2),m=i-n,p=s-t,h=u-n,x=f-t,M=a-n,b=l-t,d=M*x-b*h,y=m*b-p*M,g=h*p-x*m;(d<0||y<0||g<0)&&(d>0||y>0||g>0)||c(0,null,r)}}function d(n,t,o,i,e,c,r,s,u,f=null,a=0){const l=n[0],m=n[1],p=n[2],x=t[0],M=t[1],b=t[2];for(let d=o;d<i;++d){const n=a+(f?.[d]??d),t=3*n,o=r*e[t],i=c[o],y=c[o+1],g=c[o+2],v=r*e[t+1],q=c[v],T=c[v+1],V=c[v+2],j=r*e[t+2],R=q-i,I=T-y,C=V-g,B=c[j]-i,w=c[j+1]-y,A=c[j+2]-g,U=M*A-w*b,z=b*B-A*x,D=x*w-B*M,E=R*U+I*z+C*D,F=E*E;if(F<=k)continue;const G=l-i,H=m-y,J=p-g,K=(G*U+H*z+J*D)*E;if(K<0||K>F)continue;const L=H*C-I*J,N=J*R-C*G,O=G*I-R*H,Q=(x*L+M*N+b*O)*E;if(Q<0||K+Q>F)continue;const S=(B*L+w*N+A*O)/E;if(S>=0){u(S,s?P(R,I,C,B,w,A,h):null,n)}}}function y(n,t,o,i,e,c,r,s,u,f,a,l=null,m=0){const p=n[0],x=n[1],M=n[2],b=t[0],d=t[1],y=t[2];for(let g=o;g<i;++g){const n=m+(l?.[g]??g),t=3*n,o=r*e[t],i=c[o],v=c[o+1],q=c[o+2],T=r*e[t+1],V=c[T],j=c[T+1],R=c[T+2],I=r*e[t+2],C=c[I],B=c[I+1],w=c[I+2],A=q-u,U=s/Math.sqrt(i*i+v*v+A*A),z=i+i*U,D=v+v*U,E=q+A*U,F=R-u,G=s/Math.sqrt(V*V+j*j+F*F),H=V+V*G,J=j+j*G,K=R+F*G,L=w-u,N=s/Math.sqrt(C*C+B*B+L*L),O=H-z,Q=J-D,S=K-E,W=C+C*N-z,X=B+B*N-D,Y=w+L*N-E,Z=d*Y-X*y,$=y*W-Y*b,_=b*X-W*d,nn=O*Z+Q*$+S*_,tn=nn*nn;if(tn<=k)continue;const on=p-z,en=x-D,cn=M-E,rn=(on*Z+en*$+cn*_)*nn;if(rn<0||rn>tn)continue;const sn=en*S-Q*cn,un=cn*O-S*on,fn=on*Q-O*en,an=(b*sn+d*un+y*fn)*nn;if(an<0||rn+an>tn)continue;const ln=(W*sn+X*un+Y*fn)/nn;if(ln>=0){a(ln,f?P(O,Q,S,W,X,Y,h):null,n)}}}function g(n,t,o,i,e,c,r,s,u){const f=n[0],a=n[1],l=n[2],m=t[0],p=t[1],x=t[2],{normalRequired:M}=s;for(let b=o;b<i;++b){const n=c[b],t=3*n;let[o,i,s]=e(F,t),[d,y,g]=e(F,t+1),[v,q,T]=e(F,t+2);null!=r&&([o,i,s]=r.applyToVertex(E,o,i,s,b),[d,y,g]=r.applyToVertex(E,d,y,g,b),[v,q,T]=r.applyToVertex(E,v,q,T,b));const V=d-o,j=y-i,R=g-s,I=v-o,C=q-i,B=T-s,w=p*B-C*x,A=x*I-B*m,U=m*C-I*p,z=V*w+j*A+R*U,D=z*z;if(D<=k)continue;const G=f-o,H=a-i,J=l-s,K=(G*w+H*A+J*U)*z;if(K<0||K>D)continue;const L=H*R-j*J,N=J*V-R*G,O=G*j-V*H,Q=(m*L+p*N+x*O)*z;if(Q<0||K+Q>D)continue;const S=(I*L+C*N+B*O)/z;if(S>=0){u(S,M?P(V,j,R,I,C,B,h):null,n)}}}function v(t,o,i,e,c,r,s,u){const f=o,a=D,l=Math.abs(f[0]),m=Math.abs(f[1]),p=Math.abs(f[2]),h=l>=m?l>=p?0:2:m>=p?1:2,x=h,M=f[x]<0?2:1,b=(h+M)%3,d=(h+(3-M))%3,y=f[b]/f[x],g=f[d]/f[x],v=1/f[x],P=q,R=T,I=V,{normalRequired:C}=s;for(let q=i;q<e;++q){const o=3*q;c(a[0],o),c(a[1],o+1),c(a[2],o+2),r&&(r.applyToVertex(a[0],a[0][0],a[0][1],a[0][2],q),r.applyToVertex(a[1],a[1][0],a[1][1],a[1][2],q),r.applyToVertex(a[2],a[2][0],a[2][1],a[2][2],q)),n(P,a[0],t),n(R,a[1],t),n(I,a[2],t);const i=P[b]-y*P[x],e=P[d]-g*P[x],s=R[b]-y*R[x],f=R[d]-g*R[x],l=I[b]-y*I[x],m=I[d]-g*I[x],p=l*f-m*s,h=i*m-e*l,M=s*e-f*i;if((p<0||h<0||M<0)&&(p>0||h>0||M>0))continue;const T=p+h+M;if(0===T)continue;const V=p*(v*P[x])+h*(v*R[x])+M*(v*I[x]);if(V*Math.sign(T)<0)continue;const B=V/T;if(B>=0){u(B,C?j(a):null,q)}}}const q=e(),T=e(),V=e();function P(n,e,c,r,s,u,f){return t(R,n,e,c),t(I,r,s,u),o(f,R,I),i(f,f),f}function j(t){return n(R,t[1],t[0]),n(I,t[2],t[0]),o(h,R,I),i(h,h),h}const R=e(),I=e();function C(n,o,i){return t(i,1/(o[0]-n[0]),1/(o[1]-n[1]),1/(o[2]-n[2]))}function B(n,o){return t(o,1/n[0],1/n[1],1/n[2])}function w(n,t,o,i){return A(n,t,o,i,1/0)}function A(n,t,o,i,e){const c=(n[0]-i-t[0])*o[0],r=(n[3]+i-t[0])*o[0];let s=Math.min(c,r),u=Math.max(c,r);const f=(n[1]-i-t[1])*o[1],a=(n[4]+i-t[1])*o[1];if(u=Math.min(u,Math.max(f,a)),u<0)return!1;if(s=Math.max(s,Math.min(f,a)),s>u)return!1;const l=(n[2]-i-t[2])*o[2],m=(n[5]+i-t[2])*o[2];return u=Math.min(u,Math.max(l,m)),!(u<0)&&(s=Math.max(s,Math.min(l,m)),!(s>u)&&s<e)}const U=1e-7,k=U*U,z=e(),D=[e(),e(),e()],E=e(),F=e();export{f as MeshIntersectionOptions,C as computeInvDir,w as intersectAabbInvDir,A as intersectAabbInvDirBefore,d as intersectRayTriangles,v as intersectRayTrianglesWithDisplacementWatertight,y as intersectRayTrianglesWithVerticalOffsetENUGlobal,l as intersectTriangleGeometry,M as intersectTriangleGeometry2D,x as intersectTriangles,b as intersectTriangles2d,U as triangleRayParallelTolerance};
2
+ import{sub as n,set as t,cross as o,normalize as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as e,create as r}from"../../../../geometry/support/aaBoundingBox.js";import{boundingInfoSubdivisionThreshold as s}from"./intersectionConstants.js";import{assert as f}from"./Util.js";class u{constructor(n=0,t=!1,o=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=o}}const a=r();function l(t,o,i,c,e,r){if(!t.visible)return;const s=n(D,c,i),{tolerance:a}=o,l=new u(a,!1,o.options.normalRequired);if(t.boundingInfo)f(0===t.type),p(t.readPrimitivePosition,t.boundingInfo,i,s,a,e,l,r);else{const n=t.readPrimitivePosition;q(i,s,0,t.faceCount,n,e,l,r)}}const m=c();function p(n,t,o,i,c,r,f,u){if(null==t)return;const l=w(i,m);if(e(a,t.box),null!=r&&r.applyToAabb(a),A(a,o,l,c)){const{primitiveIndices:e}=t,a=e.length;if(a>s){const e=t.children;if(void 0!==e){for(const t of e)p(n,t,o,i,c,r,f,u);return}}v(o,i,0,a,n,e,r,f,u)}}const h=c();function x(t,o,i,c,e,r,s,f){q(t,n(D,o,t),i,c,e,r,s,f)}function M(n,t,o,i){if(!o.visible)return;const{boundingInfo:c}=o;if(c){const{box:o}=c;if(n<o[0]||n>o[3]||t<o[1]||t>o[4])return}b(n,t,0,o.faceCount,o.readPrimitivePosition,i)}function b(n,t,o,i,c,e){for(let r=o;r<i;++r){const o=3*r,[i,s]=c(G,o),[f,u]=c(G,o+1),[a,l]=c(G,o+2),m=i-n,p=s-t,h=f-n,x=u-t,M=a-n,b=l-t,d=M*x-b*h,y=m*b-p*M,g=h*p-x*m;(d<0||y<0||g<0)&&(d>0||y>0||g>0)||e(0,0,null,r)}}function d(n,t,o,i,c,e,r,s,f,u=null,a=0){const l=n[0],m=n[1],p=n[2],x=t[0],M=t[1],b=t[2];for(let d=o;d<i;++d){const n=a+(u?.[d]??d),t=3*n,o=r*c[t],i=e[o],y=e[o+1],g=e[o+2],v=r*c[t+1],q=e[v],T=e[v+1],V=e[v+2],P=r*c[t+2],R=q-i,I=T-y,C=V-g,B=e[P]-i,w=e[P+1]-y,A=e[P+2]-g,U=M*A-w*b,k=b*B-A*x,D=x*w-B*M,E=R*U+I*k+C*D,F=E*E;if(F<=z)continue;const G=l-i,H=m-y,J=p-g,K=(G*U+H*k+J*D)*E;if(K<0||K>F)continue;const L=H*C-I*J,N=J*R-C*G,O=G*I-R*H,Q=(x*L+M*N+b*O)*E;if(Q<0||K+Q>F)continue;const S=(B*L+w*N+A*O)/E;if(S>=0){f(S,S,s?j(R,I,C,B,w,A,h):null,n)}}}function y(n,t,o,i,c,e,r,s){const f=n[0],u=n[1],a=n[2],l=t[0],m=t[1],p=t[2];for(let x=o;x<i;++x){const n=3*x,t=n+1,o=n+2,i=e*n,M=c[i],b=c[i+1],d=c[i+2],y=e*t,g=e*o,v=c[y]-M,q=c[y+1]-b,T=c[y+2]-d,V=c[g]-M,P=c[g+1]-b,R=c[g+2]-d,I=m*R-P*p,C=p*V-R*l,B=l*P-V*m,w=v*I+q*C+T*B,A=w*w;if(A<=z)continue;const U=f-M,k=u-b,D=a-d,E=(U*I+k*C+D*B)*w;if(E<0||E>A)continue;const F=k*T-q*D,G=D*v-T*U,H=U*q-v*k,J=(l*F+m*G+p*H)*w;if(J<0||E+J>A)continue;const K=(V*F+P*G+R*H)/w;if(K>=0){s(K,K,r?j(v,q,T,V,P,R,h):null,x)}}}function g(n,t,o,i,c,e,r,s,f,u,a,l=null,m=0){const p=n[0],x=n[1],M=n[2],b=t[0],d=t[1],y=t[2];for(let g=o;g<i;++g){const n=m+(l?.[g]??g),t=3*n,o=r*c[t],i=e[o],v=e[o+1],q=e[o+2],T=r*c[t+1],V=e[T],P=e[T+1],R=e[T+2],I=r*c[t+2],C=e[I],B=e[I+1],w=e[I+2],A=q-f,U=s/Math.sqrt(i*i+v*v+A*A),k=i+i*U,D=v+v*U,E=q+A*U,F=R-f,G=s/Math.sqrt(V*V+P*P+F*F),H=V+V*G,J=P+P*G,K=R+F*G,L=w-f,N=s/Math.sqrt(C*C+B*B+L*L),O=H-k,Q=J-D,S=K-E,W=C+C*N-k,X=B+B*N-D,Y=w+L*N-E,Z=d*Y-X*y,$=y*W-Y*b,_=b*X-W*d,nn=O*Z+Q*$+S*_,tn=nn*nn;if(tn<=z)continue;const on=p-k,cn=x-D,en=M-E,rn=(on*Z+cn*$+en*_)*nn;if(rn<0||rn>tn)continue;const sn=cn*S-Q*en,fn=en*O-S*on,un=on*Q-O*cn,an=(b*sn+d*fn+y*un)*nn;if(an<0||rn+an>tn)continue;const ln=(W*sn+X*fn+Y*un)/nn;if(ln>=0){a(ln,ln,u?j(O,Q,S,W,X,Y,h):null,n)}}}function v(n,t,o,i,c,e,r,s,f){const u=n[0],a=n[1],l=n[2],m=t[0],p=t[1],x=t[2],{normalRequired:M}=s;for(let b=o;b<i;++b){const n=e[b],t=3*n;let[o,i,s]=c(G,t),[d,y,g]=c(G,t+1),[v,q,T]=c(G,t+2);null!=r&&([o,i,s]=r.applyToVertex(F,o,i,s,b),[d,y,g]=r.applyToVertex(F,d,y,g,b),[v,q,T]=r.applyToVertex(F,v,q,T,b));const V=d-o,P=y-i,R=g-s,I=v-o,C=q-i,B=T-s,w=p*B-C*x,A=x*I-B*m,U=m*C-I*p,k=V*w+P*A+R*U,D=k*k;if(D<=z)continue;const E=u-o,H=a-i,J=l-s,K=(E*w+H*A+J*U)*k;if(K<0||K>D)continue;const L=H*R-P*J,N=J*V-R*E,O=E*P-V*H,Q=(m*L+p*N+x*O)*k;if(Q<0||K+Q>D)continue;const S=(I*L+C*N+B*O)/k;if(S>=0){f(S,S,M?j(V,P,R,I,C,B,h):null,n)}}}function q(t,o,i,c,e,r,s,f){const u=o,a=E,l=Math.abs(u[0]),m=Math.abs(u[1]),p=Math.abs(u[2]),h=l>=m?l>=p?0:2:m>=p?1:2,x=h,M=u[x]<0?2:1,b=(h+M)%3,d=(h+(3-M))%3,y=u[b]/u[x],g=u[d]/u[x],v=1/u[x],q=T,j=V,I=P,{normalRequired:C}=s;for(let T=i;T<c;++T){const o=3*T;e(a[0],o),e(a[1],o+1),e(a[2],o+2),r&&(r.applyToVertex(a[0],a[0][0],a[0][1],a[0][2],T),r.applyToVertex(a[1],a[1][0],a[1][1],a[1][2],T),r.applyToVertex(a[2],a[2][0],a[2][1],a[2][2],T)),n(q,a[0],t),n(j,a[1],t),n(I,a[2],t);const i=q[b]-y*q[x],c=q[d]-g*q[x],s=j[b]-y*j[x],u=j[d]-g*j[x],l=I[b]-y*I[x],m=I[d]-g*I[x],p=l*u-m*s,h=i*m-c*l,M=s*c-u*i;if((p<0||h<0||M<0)&&(p>0||h>0||M>0))continue;const V=p+h+M;if(0===V)continue;const P=p*(v*q[x])+h*(v*j[x])+M*(v*I[x]);if(P*Math.sign(V)<0)continue;const B=P/V;if(B>=0){f(B,B,C?R(a):null,T)}}}const T=c(),V=c(),P=c();function j(n,c,e,r,s,f,u){return t(I,n,c,e),t(C,r,s,f),o(u,I,C),i(u,u),u}function R(t){return n(I,t[1],t[0]),n(C,t[2],t[0]),o(h,I,C),i(h,h),h}const I=c(),C=c();function B(n,o,i){return t(i,1/(o[0]-n[0]),1/(o[1]-n[1]),1/(o[2]-n[2]))}function w(n,o){return t(o,1/n[0],1/n[1],1/n[2])}function A(n,t,o,i){return U(n,t,o,i,1/0)}function U(n,t,o,i,c){const e=(n[0]-i-t[0])*o[0],r=(n[3]+i-t[0])*o[0];let s=Math.min(e,r),f=Math.max(e,r);const u=(n[1]-i-t[1])*o[1],a=(n[4]+i-t[1])*o[1];if(f=Math.min(f,Math.max(u,a)),f<0)return!1;if(s=Math.max(s,Math.min(u,a)),s>f)return!1;const l=(n[2]-i-t[2])*o[2],m=(n[5]+i-t[2])*o[2];return f=Math.min(f,Math.max(l,m)),!(f<0)&&(s=Math.max(s,Math.min(l,m)),!(s>f)&&s<c)}const k=1e-7,z=k*k,D=c(),E=[c(),c(),c()],F=c(),G=c();export{u as MeshIntersectionOptions,B as computeInvDir,A as intersectAabbInvDir,U as intersectAabbInvDirBefore,d as intersectRayTriangles,q as intersectRayTrianglesWithDisplacementWatertight,g as intersectRayTrianglesWithVerticalOffsetENUGlobal,y as intersectRenderGeometryTriangles,l as intersectTriangleGeometry,M as intersectTriangleGeometry2D,x as intersectTriangles,b as intersectTriangles2d,k as triangleRayParallelTolerance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as r,sync as a}from"../../../../core/reactiveUtils.js";import{signal as o}from"../../../../core/signal.js";import{property as n,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{copy as c,equals as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{F as _}from"../../../../chunks/FocusAreaMask.glsl.js";import{volumeToVao as d}from"../effects/focusArea/focusAreaMaskUtils.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b}from"./ShadowCastRenderer.js";import{ShadowMap as v}from"./ShadowMap.js";import{S as y}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as S}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as w}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as A}from"../shaders/ShadowCastClearTechnique.js";import{ShadowCastMaskTechnique as x}from"../shaders/ShadowCastMaskTechnique.js";import{PrimitiveType as C,DepthStencilAttachment as R,PixelType as F}from"../../../webgl/enums.js";import{DisposableFramebufferObject as q}from"../../../webgl/FramebufferObject.js";import{noParameters as V}from"../../../webgl/NoParameters.js";let H=class extends t{constructor(e,t,i,s,o){super({}),this._fbos=e,this._techniques=t,this._renderToShadowMap=s,this._requestRender=o,this.fullyRecompute=!1,this._analysisVolumeGeometry=null,this._primarySet=new D(new w(0),()=>this._requestRenderIfEnabled()),this._contextSet=new D(new w(1),()=>this._requestRenderIfEnabled()),this._passParameters=new m,this._maskParameters=new _,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=f.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new p(e.rctx,new v(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(e.rctx),this._accumulationRenderer=new b({view:i.view,data:this}),this._tmpReadFbo=new q(e.rctx),this.addHandles([r(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},a),r(()=>this._numActive,()=>this._numActiveChanged(),a)],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._fboHandle=s(this._fboHandle),this._vao=s(this._vao),this._volumeVao=s(this._volumeVao),this._tmpReadFbo=s(this._tmpReadFbo),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&(this._previewing||this._refining||this.fullyRecompute)}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&this._accumulationSets().some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.Zero&&this._accumulationRenderer.isAboveElevationThreshold}get _doneAccumulating(){return this._accumulationSets().every(e=>e.doneAccumulating)}get _numActive(){return this._accumulationSets().reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=s(this._volumeVao),this._volumeVertexCount=0;const t=null!=e;for(const s of this._accumulationSets())s.configuration.useMask=t;if(!t)return;const i=e.geometryVolume,{vao:r,vertexCount:a}=d(this._rctx,i);this._volumeVao=r,this._volumeVertexCount=a}get requiresDepth(){return this.accumulating||null!=this._volumeVao}renderAccumulation(e){if(!this.active)return!1;if(this._bindParameters.contentCamera=e.contentCamera,this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,!this.canAccumulate)return this._bindParameters.depth=null,!1;if(this._renderAreaMask(),!this.accumulating)return this._bindParameters.depth=null,!1;(this._previewing||this.fullyRecompute)&&this._reset(),this._clearBuffersOnAccumulationStart(this._bindParameters);const t=this._accumulateSetsForRenderFrame(this._previewing&&!this.fullyRecompute,this._bindParameters);return this._bindParameters.depth=null,t}_renderAreaMask(){const e=this._techniques.getCompiled(x),t=this._volumeVao,i=this._volumeVertexCount,s=this._fboHandle,r=this._analysisVolume;if(s?.detachDepth(),!e||!t||i<1||!s||!r)return;s.acquireDepth(14);const a=this._rctx,o=this._bindParameters,n=o.depth,h=this._tmpReadFbo;h.attachDepthStencil(n?.attachment),a.blitFramebuffer(h,s.fbo,256),h.detachDepthStencilTexture(),a.bindFramebuffer(s.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const c=a.bindTechnique(e,o,V);this._maskParameters.origin=r.origin,c.bindDraw(o,V,this._maskParameters),a.bindVAO(t),a.drawArrays(C.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(e){if(this._accumulationSets().every(e=>0===e.progress))this._clearFramebuffer();else for(const t of this._accumulationSets())0===t.progress&&this._clearFramebufferForSet(this._fboHandle,t,e)}_accumulateSetsForRenderFrame(e,t){let i=!1;for(const s of this._accumulationSets())this._accumulateSet(s,e,t),i=!0;return i&&this._requestRender(),i}_accumulateSet(e,t,i){const s=t?Math.min(j,e.sampleCount)-e.progress:e.sampleCount-e.progress;for(let r=0;r<s;++r)this._accumulateShadow(e,i)}precompilePrepass(){if(this.accumulating){for(const e of this._accumulationSets())this._techniques.precompile(S,e.configuration),this._techniques.precompile(A,e.configuration);this._techniques.precompile(x)}}precompile(){this._accumulationRenderer.precompile()}updateMask(){this._accumulationRenderer.setStencilMask(this._fboHandle?.getAttachment(R))}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,F.UNSIGNED_BYTE,P),P[0]/i)}updateCamera(e){if(!this.active)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._isAccumulationValid(e)||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight),this._reset()),this._accumulationRenderer.setOpacityFromElevation(e.relativeElevation)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,s=this._createFBO(t,i);e&&(this._clearFramebuffer(s),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,s.fbo),this._fboHandle.dispose(),this._fboHandle=s,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=s(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t,i){if(!e)return;const s=this._techniques.get(A,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(s,i,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e,t){this._renderToShadowMap(t,e.lightDirections[e.progress++],this._depthRange);const i=this._techniques.get(S,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(i,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_isAccumulationValid(e){return this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e,this._invalidateAccumulationSets())}get test(){}};e([n()],H.prototype,"_refining",null),e([n()],H.prototype,"active",null),e([n()],H.prototype,"_doneAccumulating",null),e([n()],H.prototype,"_numActive",null),e([n()],H.prototype,"_colorFormat",null),e([n()],H.prototype,"_depthRange",void 0),e([n()],H.prototype,"_enabled",void 0),e([n()],H.prototype,"_previewing",void 0),e([n()],H.prototype,"_accumulationRenderer",void 0),H=e([h("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],H);const j=6,P=new Uint8Array(4);class D{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=o(0),this._sampleCount=o(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,s=Math.min(y,e.length);if(!i(t,0,t.length,e,0,s,u)){t.length=s,this._sampleCount.value=s;for(let i=0;i<s;++i)t[i]=c(t[i]??l(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(S,this.configuration),e.precompile(A,this.configuration)}}export{H as ShadowAccumulator};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as r,sync as a}from"../../../../core/reactiveUtils.js";import{signal as o}from"../../../../core/signal.js";import{property as n,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{copy as c,equals as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{volumeToVao as _}from"../effects/focusArea/focusAreaMaskUtils.js";import{BindParameters as d}from"./BindParameters.js";import{DepthRange as p}from"./DepthRange.js";import{createQuadVAO as f}from"./glUtil3D.js";import{ShadowCastRenderer as g}from"./ShadowCastRenderer.js";import{ShadowMap as b}from"./ShadowMap.js";import{S as v}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as y}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as S}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as w}from"../shaders/ShadowCastClearTechnique.js";import{ShadowCastMaskTechnique as A}from"../shaders/ShadowCastMaskTechnique.js";import{V as x}from"../../../../chunks/VolumeMask.glsl.js";import{PrimitiveType as C,DepthStencilAttachment as R,PixelType as V}from"../../../webgl/enums.js";import{DisposableFramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{noParameters as q}from"../../../webgl/NoParameters.js";let H=class extends t{constructor(e,t,i,s,o){super({}),this._fbos=e,this._techniques=t,this._renderToShadowMap=s,this._requestRender=o,this.fullyRecompute=!1,this._analysisVolumeGeometry=null,this._primarySet=new D(new S(0),()=>this._requestRenderIfEnabled()),this._contextSet=new D(new S(1),()=>this._requestRenderIfEnabled()),this._passParameters=new m,this._maskParameters=new x,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=p.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new d(e.rctx,new b(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=f(e.rctx),this._accumulationRenderer=new g({view:i.view,data:this}),this._tmpReadFbo=new F(e.rctx),this.addHandles([r(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},a),r(()=>this._numActive,()=>this._numActiveChanged(),a)],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._fboHandle=s(this._fboHandle),this._vao=s(this._vao),this._volumeVao=s(this._volumeVao),this._tmpReadFbo=s(this._tmpReadFbo),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&(this._previewing||this._refining||this.fullyRecompute)}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&this._accumulationSets().some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==p.Zero&&this._accumulationRenderer.isAboveElevationThreshold}get _doneAccumulating(){return this._accumulationSets().every(e=>e.doneAccumulating)}get _numActive(){return this._accumulationSets().reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=s(this._volumeVao),this._volumeVertexCount=0;const t=null!=e;for(const s of this._accumulationSets())s.configuration.useMask=t;if(!t)return;const i=e.geometryVolume,{vao:r,vertexCount:a}=_(this._rctx,i);this._volumeVao=r,this._volumeVertexCount=a}get requiresDepth(){return this.accumulating||null!=this._volumeVao}renderAccumulation(e){if(!this.active)return!1;if(this._bindParameters.contentCamera=e.contentCamera,this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,!this.canAccumulate)return this._bindParameters.depth=null,!1;if(this._renderAreaMask(),!this.accumulating)return this._bindParameters.depth=null,!1;(this._previewing||this.fullyRecompute)&&this._reset(),this._clearBuffersOnAccumulationStart(this._bindParameters);const t=this._accumulateSetsForRenderFrame(this._previewing&&!this.fullyRecompute,this._bindParameters);return this._bindParameters.depth=null,t}_renderAreaMask(){const e=this._techniques.getCompiled(A),t=this._volumeVao,i=this._volumeVertexCount,s=this._fboHandle,r=this._analysisVolume;if(s?.detachDepth(),!e||!t||i<1||!s||!r)return;s.acquireDepth(14);const a=this._rctx,o=this._bindParameters,n=o.depth,h=this._tmpReadFbo;h.attachDepthStencil(n?.attachment),a.blitFramebuffer(h,s.fbo,256),h.detachDepthStencilTexture(),a.bindFramebuffer(s.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const c=a.bindTechnique(e,o,q);this._maskParameters.origin=r.origin,c.bindDraw(o,q,this._maskParameters),a.bindVAO(t),a.drawArrays(C.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(e){if(this._accumulationSets().every(e=>0===e.progress))this._clearFramebuffer();else for(const t of this._accumulationSets())0===t.progress&&this._clearFramebufferForSet(this._fboHandle,t,e)}_accumulateSetsForRenderFrame(e,t){let i=!1;for(const s of this._accumulationSets())this._accumulateSet(s,e,t),i=!0;return i&&this._requestRender(),i}_accumulateSet(e,t,i){const s=t?Math.min(j,e.sampleCount)-e.progress:e.sampleCount-e.progress;for(let r=0;r<s;++r)this._accumulateShadow(e,i)}precompilePrepass(){if(this.accumulating){for(const e of this._accumulationSets())this._techniques.precompile(y,e.configuration),this._techniques.precompile(w,e.configuration);this._techniques.precompile(A)}}precompile(){this._accumulationRenderer.precompile()}updateMask(){this._accumulationRenderer.setStencilMask(this._fboHandle?.getAttachment(R))}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,V.UNSIGNED_BYTE,P),P[0]/i)}updateCamera(e){if(!this.active)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._isAccumulationValid(e)||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight),this._reset()),this._accumulationRenderer.setOpacityFromElevation(e.relativeElevation)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,s=this._createFBO(t,i);e&&(this._clearFramebuffer(s),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,s.fbo),this._fboHandle.dispose(),this._fboHandle=s,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=s(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t,i){if(!e)return;const s=this._techniques.get(w,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(s,i,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e,t){this._renderToShadowMap(t,e.lightDirections[e.progress++],this._depthRange);const i=this._techniques.get(y,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(i,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_isAccumulationValid(e){return this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e,this._invalidateAccumulationSets())}get test(){}};e([n()],H.prototype,"_refining",null),e([n()],H.prototype,"active",null),e([n()],H.prototype,"_doneAccumulating",null),e([n()],H.prototype,"_numActive",null),e([n()],H.prototype,"_colorFormat",null),e([n()],H.prototype,"_depthRange",void 0),e([n()],H.prototype,"_enabled",void 0),e([n()],H.prototype,"_previewing",void 0),e([n()],H.prototype,"_accumulationRenderer",void 0),H=e([h("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],H);const j=6,P=new Uint8Array(4);class D{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=o(0),this._sampleCount=o(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,s=Math.min(v,e.length);if(!i(t,0,t.length,e,0,s,u)){t.length=s,this._sampleCount.value=s;for(let i=0;i<s;++i)t[i]=c(t[i]??l(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(y,this.configuration),e.precompile(w,this.configuration)}}export{H as ShadowAccumulator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as m}from"./ChangeSet.js";import{IntersectorResultRay as g}from"./IntersectorResult.js";import{RendererBase as p}from"./RendererBase.js";import{noBudget as u}from"../../../support/Scheduler.js";let y=class extends p{constructor(e){super(e),this._pending=new f,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,u,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}addRenderer(){this._sortedRenderers.clear()}removeRenderer(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new m;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersectRay(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;if(o){const s=n.boundingSphere.center,a=this._effectiveGeometryRadius(n);s[0]-a<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),s[0]+a>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)}i++}return i}*intersectScreenPolygon(e,r,t,s){for(const i of this._geometries.values()){if(!t(i))continue;this._intersectScreenPolygonRenderGeometry(i,r,0,e,s);const n=this.rendererContext.longitudeCyclical;if(n){const t=i.boundingSphere.center,o=this._effectiveGeometryRadius(i);t[0]-o<n.min&&this._intersectScreenPolygonRenderGeometry(i,r,n.range,e,s),t[0]+o>n.max&&this._intersectScreenPolygonRenderGeometry(i,r,-n.range,e,s)}s++,yield}return s}_effectiveGeometryRadius(e){const r=e.boundingSphere.radius;return r||e.screenToWorldRatio*C}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectRayDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],G[0]=t[0]-s,G[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectRayDraped(e,i,G,(t,s,o)=>{_(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_intersectScreenPolygonRenderGeometry(e,r,t,s,i){if(e.visible&&e.material.visible&&e.material.intersectScreenPolygonDraped){d(v,t+e.transformation[12],e.transformation[13]),e.screenToWorldRatio=this.rendererContext.screenToWorldRatio;for(const t of r){const r=e.material.intersectScreenPolygonDraped(e,v,s,t);if(r)return void R(t.distance,r.primitiveIndex,i,e.material.renderPriority,s,e.layerViewUid,e.graphicUid)}}}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([a("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class f{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function _(e,r,t,s,i,n,o){const a=new c(n,o,r),d=r=>{r.set(5,a,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&d(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&d(i.results.max),2===i.options.store){const e=new g(i.ray);d(e),i.results.all.push(e)}}function R(e,r,t,s,i,n,o){i.polygonResults.add(5,new c(n,o,r),e,t,s)}const G=h(),v=h(),C=128;export{y as SortedRenderGeometryRenderer};
2
+ import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as m}from"./ChangeSet.js";import{IntersectorResultRay as g}from"./IntersectorResult.js";import{RendererBase as p}from"./RendererBase.js";import{noBudget as u}from"../../../support/Scheduler.js";let y=class extends p{constructor(e){super(e),this._pending=new f,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,u,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}addRenderer(){this._sortedRenderers.clear()}removeRenderer(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new m;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersectRay(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;if(o){const s=n.boundingSphere.center,a=this._effectiveGeometryRadius(n);s[0]-a<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),s[0]+a>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)}i++}return i}*intersectScreenPolygon(e,r,t,s){for(const i of this._geometries.values()){if(!t(i))continue;this._intersectScreenPolygonRenderGeometry(i,r,0,e,s);const n=this.rendererContext.longitudeCyclical;if(n){const t=i.boundingSphere.center,o=this._effectiveGeometryRadius(i);t[0]-o<n.min&&this._intersectScreenPolygonRenderGeometry(i,r,n.range,e,s),t[0]+o>n.max&&this._intersectScreenPolygonRenderGeometry(i,r,-n.range,e,s)}s++,yield}return s}_effectiveGeometryRadius(e){const r=e.boundingSphere.radius;return r||e.screenToWorldRatio*C}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectRayDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],G[0]=t[0]-s,G[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectRayDraped(e,i,G,(t,s,o,a)=>{_(r,a,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_intersectScreenPolygonRenderGeometry(e,r,t,s,i){if(e.visible&&e.material.visible&&e.material.intersectScreenPolygonDraped){d(v,t+e.transformation[12],e.transformation[13]),e.screenToWorldRatio=this.rendererContext.screenToWorldRatio;for(const t of r){const r=e.material.intersectScreenPolygonDraped(e,v,s,t);if(r)return void R(t.distance,r.primitiveIndex,i,e.material.renderPriority,s,e.layerViewUid,e.graphicUid)}}}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([a("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class f{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function _(e,r,t,s,i,n,o){const a=new c(n,o,r),d=r=>{r.set(5,a,e.distance,e.renderDistance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.renderDistance||i.results.ground.renderDistance<=i.results.min.renderDistance)&&d(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.renderDistance||i.results.ground.renderDistance>i.results.max.renderDistance)&&d(i.results.max),2===i.options.store){const e=new g(i.ray);d(e),i.results.all.push(e)}}function R(e,r,t,s,i,n,o){i.polygonResults.add(5,new c(n,o,r),e,t,s)}const G=h(),v=h(),C=128;export{y as SortedRenderGeometryRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{hasNativeFloat16Array as e}from"../../../../../geometry/support/float16.js";import{BufferViewMat3f as t,BufferViewVec4f as o,BufferViewVec3f as n,BufferViewVec2f as f,BufferViewFloat as r,BufferViewVec4f16 as u,BufferViewFloat16 as m,BufferViewVec2Snorm16 as s,BufferViewSnorm16 as l,BufferViewVec4Unorm8 as w,BufferViewUnorm8 as a,BufferViewVec4u8 as i,BufferViewUint32 as c,BufferViewUint8 as p}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as v}from"../../../../../geometry/support/buffer/types.js";class y{constructor(e,t,o){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=o,this.byteSize=b(o)}}function b(e){return v(e.ElementType)*e.ElementCount}const h={u8:new y(1,"uint",p),u32:new y(1,"uint",c),vec4u8:new y(4,"uint",i),unorm8:new y(1,"float",a),vec4unorm8:new y(4,"float",w),snorm16:new y(1,"float",l),vec2snorm16:new y(2,"float",s),f16:new y(1,"float",e?m:r),vec4f16:new y(4,"float",e?u:o),f32:new y(1,"float",r),vec2f32:new y(2,"float",f),vec3f32:new y(3,"float",n),vec4f32:new y(4,"float",o),mat3f32:new y(9,"float",t)};export{y as FieldCreationInfo,h as typeToCreationInfoMap};
2
+ import{hasNativeFloat16Array as e}from"../../../../../geometry/support/float16.js";import{BufferViewMat3f as t,BufferViewVec4f as o,BufferViewVec3f as n,BufferViewVec2f as f,BufferViewFloat as r,BufferViewVec4f16 as u,BufferViewFloat16 as m,BufferViewVec2Snorm16 as s,BufferViewSnorm16 as l,BufferViewVec4Unorm8 as w,BufferViewUnorm8 as i,BufferViewVec4u8 as a,BufferViewVec4u32 as c,BufferViewUint32 as p,BufferViewUint8 as v}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as y}from"../../../../../geometry/support/buffer/types.js";class b{constructor(e,t,o){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=o,this.byteSize=h(o)}}function h(e){return y(e.ElementType)*e.ElementCount}const g={u8:new b(1,"uint",v),u32:new b(1,"uint",p),vec4u32:new b(4,"uint",c),vec4u8:new b(4,"uint",a),unorm8:new b(1,"float",i),vec4unorm8:new b(4,"float",w),snorm16:new b(1,"float",l),vec2snorm16:new b(2,"float",s),f16:new b(1,"float",e?m:r),vec4f16:new b(4,"float",e?u:o),f32:new b(1,"float",r),vec2f32:new b(2,"float",f),vec3f32:new b(3,"float",n),vec4f32:new b(4,"float",o),mat3f32:new b(9,"float",t)};export{b as FieldCreationInfo,g as typeToCreationInfoMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{unique as e}from"../../../../../core/arrayUtils.js";import{estimateNumberArrayMemory as t,baseTypedArrayMemory as r}from"../../../../../core/memoryEstimations.js";import{IntersectorResultRay as s}from"../IntersectorResult.js";import{LodTarget as n}from"./Intersector.js";class i{constructor(e,t,r,s){this.material=e,this.buffer=t,this.numVertices=r,this.boundingInfo=s,this.bufferWriter=e.createBufferWriter()}get layout(){return this.bufferWriter.layout}get numTriangles(){return this.numVertices/3}computeUsedMemory(){return this.buffer.byteLength+r}get renderGeometry(){return this}}class o{constructor(e){this.engineGeometry=e;const t=this.material,r=this.engineGeometry,s=r.attributes,n=r.boundingInfo,o=t.createBufferWriter(),a=o.layout,m=o.elementCount(s),u=a.createBuffer(m);o.write(null,null,s,null,{buffer:u,offset:0}),this.renderGeometry=new i(t,u.buffer,m,n)}get material(){return this.engineGeometry.material}get numVertices(){return this.engineGeometry.indexCount}get numTriangles(){return this.numVertices/3}get boundingInfo(){return this.engineGeometry.boundingInfo}computeUsedMemory(){return this.engineGeometry.attributes.values().reduce((e,r)=>e+t(r.data,r.indices),0)}intersect(e,t,r,s,n,i,o,m){const u=this.engineGeometry;this.material.intersectRay(u,e.transform.transform,e,r,s,(r,s,u)=>a(r,s,u,e,t,i,o,n,m))}intersectScreenPolygon(e,t,r,s,i,o){const a=this.engineGeometry,m=this.material.intersectScreenPolygon?.(a,e.transform.transform,e,t);m?.valid&&e.polygonResults.add(3,new n(s.layerViewUid,s.graphicUid(r),m.primitiveIndex,i,o),m.distance)}}function a(e,t,r,i,o,a,m,u,c){if(e<0)return;if(o&&!o(i.rayBegin,i.rayEnd,e))return;const l=new n(a.layerViewUid,a.graphicUid(u),r,m,c);if((null==i.results.min.distance||e<i.results.min.distance)&&i.results.min.set(3,l,e,t,i.transform.transform),(null==i.results.max.distance||e>i.results.max.distance)&&i.results.max.set(3,l,e,t,i.transform.transform),2===i.options.store){const r=new s(i.results.min.ray);r.set(3,l,e,t,i.transform.transform),i.results.all.push(r)}}class m{constructor(e,t=null){this.geometry=e,this.textures=t}get material(){return this.geometry.material}get numTriangles(){return this.geometry.numTriangles}}class u{constructor(t,r,s){this.components=t,this.minScreenSpaceRadius=r,this.pivotOffset=s;const n=e(this.components.map(e=>e.geometry));this.numVertices=n.reduce((e,t)=>e+t.numVertices,0)}}class c{constructor(e){this.levels=e,this.levels.sort((e,t)=>e.minScreenSpaceRadius===t.minScreenSpaceRadius?e.numVertices-t.numVertices:e.minScreenSpaceRadius-t.minScreenSpaceRadius)}get materialParameters(){return this.levels[0].components[0].geometry.material.parameters}getMaterials(){const t=[];return this.levels.forEach(e=>e.components.forEach(e=>t.push(e.geometry.material))),e(t)}getTextures(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{null!=e.textures&&t.push(...e.textures)})),e(t)}getGeometries(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{t.push(e.geometry)})),e(t)}getEngineGeometries(){return this.getGeometries().map(e=>e.engineGeometry).filter(e=>null!=e)}computeUsedMemory(){const e=this.getGeometries(),t=this.getTextures(),r=e.reduce((e,t)=>e+t.computeUsedMemory(),0);return t.reduce((e,t)=>e+t.usedMemory,0)+r}}export{o as LodComponentEngineGeometry,i as LodComponentRenderGeometry,m as LodComponentResources,u as LodLevelResources,c as LodResources};
2
+ import{unique as e}from"../../../../../core/arrayUtils.js";import{estimateNumberArrayMemory as t,baseTypedArrayMemory as r}from"../../../../../core/memoryEstimations.js";import{IntersectorResultRay as s}from"../IntersectorResult.js";import{LodTarget as n}from"./Intersector.js";class i{constructor(e,t,r,s){this.material=e,this.buffer=t,this.numVertices=r,this.boundingInfo=s,this.bufferWriter=e.createBufferWriter()}get layout(){return this.bufferWriter.layout}get numTriangles(){return this.numVertices/3}computeUsedMemory(){return this.buffer.byteLength+r}get renderGeometry(){return this}}class o{constructor(e){this.engineGeometry=e;const t=this.material,r=this.engineGeometry,s=r.attributes,n=r.boundingInfo,o=t.createBufferWriter(),a=o.layout,m=o.elementCount(s),u=a.createBuffer(m);o.write(null,null,s,null,{buffer:u,offset:0}),this.renderGeometry=new i(t,u.buffer,m,n)}get material(){return this.engineGeometry.material}get numVertices(){return this.engineGeometry.indexCount}get numTriangles(){return this.numVertices/3}get boundingInfo(){return this.engineGeometry.boundingInfo}computeUsedMemory(){return this.engineGeometry.attributes.values().reduce((e,r)=>e+t(r.data,r.indices),0)}intersect(e,t,r,s,n,i,o,m){const u=this.engineGeometry;this.material.intersectRay(u,e.transform.transform,e,r,s,(r,s,u,c)=>a(r,s,u,c,e,t,i,o,n,m))}intersectScreenPolygon(e,t,r,s,i,o){const a=this.engineGeometry,m=this.material.intersectScreenPolygon?.(a,e.transform.transform,e,t);m?.valid&&e.polygonResults.add(3,new n(s.layerViewUid,s.graphicUid(r),m.primitiveIndex,i,o),m.distance)}}function a(e,t,r,i,o,a,m,u,c,l){if(e<0)return;if(a&&!a(o.rayBegin,o.rayEnd,e))return;const h=new n(m.layerViewUid,m.graphicUid(c),i,u,l);if((null==o.results.min.renderDistance||t<o.results.min.renderDistance)&&o.results.min.set(3,h,e,t,r,o.transform.transform),(null==o.results.max.renderDistance||t>o.results.max.renderDistance)&&o.results.max.set(3,h,e,t,r,o.transform.transform),2===o.options.store){const n=new s(o.results.min.ray);n.set(3,h,e,t,r,o.transform.transform),o.results.all.push(n)}}class m{constructor(e,t=null){this.geometry=e,this.textures=t}get material(){return this.geometry.material}get numTriangles(){return this.geometry.numTriangles}}class u{constructor(t,r,s){this.components=t,this.minScreenSpaceRadius=r,this.pivotOffset=s;const n=e(this.components.map(e=>e.geometry));this.numVertices=n.reduce((e,t)=>e+t.numVertices,0)}}class c{constructor(e){this.levels=e,this.levels.sort((e,t)=>e.minScreenSpaceRadius===t.minScreenSpaceRadius?e.numVertices-t.numVertices:e.minScreenSpaceRadius-t.minScreenSpaceRadius)}get materialParameters(){return this.levels[0].components[0].geometry.material.parameters}getMaterials(){const t=[];return this.levels.forEach(e=>e.components.forEach(e=>t.push(e.geometry.material))),e(t)}getTextures(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{null!=e.textures&&t.push(...e.textures)})),e(t)}getGeometries(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{t.push(e.geometry)})),e(t)}getEngineGeometries(){return this.getGeometries().map(e=>e.engineGeometry).filter(e=>null!=e)}computeUsedMemory(){const e=this.getGeometries(),t=this.getTextures(),r=e.reduce((e,t)=>e+t.computeUsedMemory(),0);return t.reduce((e,t)=>e+t.usedMemory,0)+r}}export{o as LodComponentEngineGeometry,i as LodComponentRenderGeometry,m as LodComponentResources,u as LodLevelResources,c as LodResources};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{fromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as a,set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as h,length as p,scale as u,distance as d,transformMat4 as m,set as g,normalize as S,subtract as x,transformMat3 as b,scaleAndAdd as v,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as V,ONES as R,create as D}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as C,empty as w,expandPointInPlace as A}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as j}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as U}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as M}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as T,isColor as _,isOIT as L}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as I,GLTextureMaterial as E}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{screenPolygonIntersectsBounds as H,screenPolygonIntersectsTriangle as W}from"../lib/screenPolygonOverlapUtils.js";import{DrapedHit as N,Hit as G}from"../lib/screenPolygonTriangleIntersections.js";import{SeparateScreenSizePerspectiveEvaluators as q}from"../lib/screenSizePerspectiveUtils.js";import{assert as X}from"../lib/Util.js";import{writePosition as Y,writeNormal as k,writeColor as J,writeBufferVec2 as K,writeBufferFloat as Q,writeBufferVec3 as Z,writeBufferZeros as $,writeBufferVec4 as ee,writeOlidColor as te}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as se}from"./internal/MaterialUtil.js";import{a as re}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as ie,getInstanceLayout as ae,HUDMaterialTechnique as ne}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as oe}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as le}from"../../../../webscene/support/AlphaCutoff.js";class ce extends B{constructor(e,t,s=!1){super(e,Ne),this.produces=new Map([[12,e=>T(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>T(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>T(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&T(e)]]),this._visible=!0,this._configuration=new oe(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,_(e.output)&&(s.debugDrawLabelBorder=!!M.LABELS_SHOW_BORDER),s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&L(e.output)}intersectRay(e,t,s,r,i,a){const{options:{selectionMode:n,hud:o,excludeLabels:l},point:c,camera:f}=s,{parameters:g}=this;if(n&&o&&(!l||!g.isLabel)&&e.visible&&c&&f)for(const{renderScreenPosition:S,screenSize:x,pixelRatioTolerance:b,halfOutlineSize:v,rotationAngle:O,anchor:z,centerView:P}of this._forEachScreenSpaceHUDInstance(Le,e,t,f))if(ue(c,S[0],S[1],x,b,v,O,g,z)){const e=s.ray;if(ve[0]=c[0],ve[1]=c[1],ve[2]=S[2],f.unprojectFromRenderScreen(ve,Se)){const t=y();h(t,e.direction);const s=1/p(t);u(t,t,s);const r=d(e.origin,Se)*s,i=y();m(i,P,f.inverseViewMatrix),a(r,t,-1,i)}}}*_forEachScreenSpaceHUDInstance(e,t,s,i){const{parameters:n}=this,o=t.attributes.get("featureAttribute"),l=null==o?null:V(o.data,De),{scaleX:c,scaleY:f}=qe(l,n,i.pixelRatio),p=t.attributes.get("position"),d=t.attributes.get("size"),O=t.attributes.get("normal"),z=t.attributes.get("rotation"),y=t.attributes.get("centerOffset"),P=n.size,R=r(Pe,s);X(p.size>=3);const D="screen"===n.centerOffsetUnits;for(let r=0;r<p.data.length/p.size;r++){const t=r*p.size;if(g(Se,p.data[t],p.data[t+1],p.data[t+2]),m(Se,Se,s),m(Se,Se,i.viewMatrix),y){const e=r*y.size;g(Ve,y.data[e],y.data[e+1],y.data[e+2])}else g(Ve,0,0,0);if(!D&&(Se[0]+=Ve[0],Se[1]+=Ve[1],0!==Ve[2])){const e=Ve[2];S(Ve,Se),x(Se,Se,u(Ve,Ve,e))}const o=r*O.size;g(xe,O.data[o],O.data[o+1],O.data[o+2]),b(xe,xe,R);const{normal:l,cosAngle:V}=pe(xe,i,Ie),C=Ye(n,Se,V,i,ge);if(v(Se,Se,l,C),i.applyProjection(Se,be),be[0]>-1){if(D&&(Ve[0]||Ve[1])&&(be[0]+=Ve[0]*i.pixelRatio,0!==Ve[1]&&(be[1]+=ge.alignmentEvaluator.apply(Ve[1])*i.pixelRatio),i.unapplyProjection(be,Se)),be[0]+=n.screenOffset[0]*i.pixelRatio,be[1]+=n.screenOffset[1]*i.pixelRatio,be[0]=Math.floor(be[0]),be[1]=Math.floor(be[1]),He[0]=P[0],He[1]=P[1],null!=d){const e=r*d.size;He[0]*=d.data[e],He[1]*=d.data[e+1]}ge.evaluator.applyVec2(He,He);let t=0;if(n.textureIsSignedDistanceField){t=Math.min(n.outlineSize,.5*He[0])*i.pixelRatio/2}He[0]*=c,He[1]*=f,h(e.centerView,Se),g(e.renderScreenPosition,be[0],be[1],be[2]),a(e.screenSize,He),e.pixelRatioTolerance=Ee*i.pixelRatio,e.halfOutlineSize=t,e.rotationAngle=n.rotation+(null!=z?z.data[r*z.size]:0),e.anchor=re(n),yield e}}}*_forEachDrapedHUDInstance(e,t){const s=t.attributes.get("position"),r=t.attributes.get("size"),i=t.attributes.get("rotation"),n=this.parameters,o=n.size,l=t.attributes.get("featureAttribute"),c=null==l?null:V(l.data,De),{scaleX:f,scaleY:h}=qe(c,n,t.screenToWorldRatio);e.pixelRatioTolerance=Be*t.screenToWorldRatio,e.anchor=re(n);for(let p=0;p<s.data.length/s.size;p++){const l=p*s.size;if(e.x=s.data[l],e.y=s.data[l+1],He[0]=o[0],He[1]=o[1],null!=r){const e=p*r.size;He[0]*=r.data[e],He[1]*=r.data[e+1]}if(e.halfOutlineSize=0,n.textureIsSignedDistanceField){const s=Math.min(n.outlineSize,.5*He[0]);e.halfOutlineSize=s*t.screenToWorldRatio/2}He[0]*=f,He[1]*=h,a(e.screenSize,He),e.rotationAngle=n.rotation+(null!=i?i.data[p*i.size]:0),yield e}}intersectRayDraped(e,t,s,r,i){const a=this.parameters;for(const{x:n,y:o,screenSize:l,pixelRatioTolerance:c,halfOutlineSize:f,rotationAngle:h,anchor:p}of this._forEachDrapedHUDInstance(Fe,e))ue(s,n,o,l,c,f,h,a,p)&&r(i.distance,i.normal,-1)}intersectScreenPolygonDraped(e,t,s,r){if(!s.options.selectionMode||s.options.excludeLabels&&this.parameters.isLabel)return null;const i=this.parameters;for(const{x:a,y:n,screenSize:o,pixelRatioTolerance:l,halfOutlineSize:c,rotationAngle:f,anchor:h}of this._forEachDrapedHUDInstance(Fe,e))if(de(r,a+t[0],n+t[1],o,l,c,f,i,h,!1))return new N(-1);return null}intersectScreenPolygon(e,t,s,r){const{options:{selectionMode:i,hud:a,excludeLabels:n},camera:o}=s,{parameters:l}=this;if(!i||!a||n&&l.isLabel||!e.visible||null==t)return null;const c=new G(1),f=1/o.pixelRatio;for(const{renderScreenPosition:h,screenSize:p,pixelRatioTolerance:u,halfOutlineSize:g,rotationAngle:S,anchor:x,centerView:b}of this._forEachScreenSpaceHUDInstance(Le,e,t,o)){const e=m(Se,b,o.inverseViewMatrix);if(!s.screenPolygonPrimitiveProcessor?.validatePoint(e))continue;const t=h[0]*f,i=(o.fullHeight-h[1])*f;if(Me[0]=p[0]*f,Me[1]=p[1]*f,de(r,t,i,Me,u*f,g*f,S,l,x,!0)){const t=d(o.eye,e);c.updateIfCloserFromValues(t,-1,e,null)}}return c.valid?c:null}createBufferWriter(){return new Ge(this.parameters)}applyShaderOffsets(e,t,s,i,a,n,o,l){b(Oe,s,r(Pe,i));const c=pe(Oe,o,Ie),f=Xe(p(t),o),h=Ye(this.parameters,t,c.cosAngle,o,l);v(t,t,c.normal,h+f),v(e,e,Oe,h+f);const u=n+h;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&h(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const c=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/i.viewport[2];return u(a,t,l>0?f:1/f),a}_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]&&(S(xe,s),O(s,s,u(xe,xe,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);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=le||t>=le&&s[3]>=le;return this._visible&&r}createGLMaterial(e){return new fe(e)}calculateRelativeScreenBounds(e,t,s=C()){return he(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class fe extends E{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ne,e)}}function he(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function pe(e,t,s){return m(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,We),s}function ue(e,s,r,i,a,l,c,f,h){const p=me(s,r,i,a,l,f,h,Ce);return n(ye,s,r),o(ze,e,ye,t(c)),ze[0]>p[0]&&ze[0]<p[2]&&ze[1]>p[1]&&ze[1]<p[3]}function de(e,s,r,i,a,l,c,f,h,p){const u=me(s,r,i,a,l,f,h,Ce,p);if(n(we,u[0],u[1]),n(Ae,u[2],u[1]),n(je,u[2],u[3]),n(Ue,u[0],u[3]),0!==c){const e=t(c);n(ye,s,r),o(we,we,ye,e),o(Ae,Ae,ye,e),o(je,je,ye,e),o(Ue,Ue,ye,e),w(u),A(u,we),A(u,Ae),A(u,je),A(u,Ue)}return!!H(e,u)&&(W(e,we,Ae,je)||W(e,we,je,Ue))}function me(e,t,s,r,i,a,n,o,l=!1){let c=e-r-s[0]*n[0],f=c+s[0]+2*r;const h=l?1-n[1]:n[1];let p=t-r-s[1]*h,u=p+s[1]+2*r;const d=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=d&&(c+=s[0]*d[0],p+=s[1]*(l?1-d[3]:d[1]),f-=s[0]*(1-d[2]),u-=s[1]*(l?d[1]:1-d[3]),c-=i,f+=i,p-=i,u+=i),o[0]=c,o[1]=p,o[2]=f,o[3]=u,o}const ge=new q,Se=y(),xe=y(),be=D(),ve=s(),Oe=y(),ze=f(),ye=f(),Pe=i(),Ve=y(),Re=y(),De=D(),Ce=C(),we=f(),Ae=f(),je=f(),Ue=f(),Me=f();class Te{constructor(){this.renderScreenPosition=y(),this.screenSize=f(),this.centerView=y(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=f()}}class _e{constructor(){this.x=0,this.y=0,this.screenSize=f(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=f()}}const Le=new Te,Fe=new _e,Ie={normal:y(),cosAngle:0},Ee=1,Be=2,He=c(0,0),We=P(0,0,1);class Ne extends I{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=R,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=R,this.outlineSize=0,this.distanceFieldBoundingBox=D(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ge{constructor(e){this.baseInstanceLayout=ie,this.layout=ae(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i){if(null==i)return;const{buffer:a,offset:n}=i,{position:o,normal:l,color:c,size:f,rotation:h,centerOffset:p,groundDistance:u,featureAttribute:d,uvi:m}=a;Y(s.get("position"),e,o,n),k(s.get("normal"),t,l,n);const g=s.get("position").indices.length;if(m){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<g;++e){const a=n+e;m.setValues(a,t,s,r,i)}}}if(c&&J(s.get("color"),4,c,n),f&&K(s.get("size"),f,n),h&&Q(s.get("rotation"),h,n),p&&(s.get("centerOffset")?Z(s.get("centerOffset"),p,n):$(p,n,g)),s.get("groundDistance")?Q(s.get("groundDistance"),u,n):$(u,n,g),d&&(s.get("featureAttribute")?ee(s.get("featureAttribute"),d,n):$(d,n,g)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=a.getField("olidColor",j);te(r,s,t,n)}}}writeBaseInstance(e,t){const{uv0:s}=t;K(e.get("uv0"),s,0)}}function qe(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(U(Re,t,e),{scaleX:Re[0]*s,scaleY:Re[1]*s})}function Xe(e,t){const s=t.computeRenderPixelSizeAtDist(e)*F;return(t.aboveGround?1:-1)*s}function Ye(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=p(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=p(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=se(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{ce as HUDMaterial,Ne as Parameters};
2
+ import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{fromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as a,set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as h,length as p,scale as u,distance as d,transformMat4 as m,set as g,normalize as S,subtract as x,transformMat3 as b,scaleAndAdd as v,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as V,ONES as D,create as R}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as C,empty as w,expandPointInPlace as A}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as j}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as U}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as M}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as T,isColor as _,isOIT as L}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as I,GLTextureMaterial as E}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{screenPolygonIntersectsBounds as H,screenPolygonIntersectsTriangle as W}from"../lib/screenPolygonOverlapUtils.js";import{DrapedHit as N,Hit as G}from"../lib/screenPolygonTriangleIntersections.js";import{SeparateScreenSizePerspectiveEvaluators as q}from"../lib/screenSizePerspectiveUtils.js";import{assert as X}from"../lib/Util.js";import{writePosition as Y,writeNormal as k,writeColor as J,writeBufferVec2 as K,writeBufferFloat as Q,writeBufferVec3 as Z,writeBufferZeros as $,writeBufferVec4 as ee,writeOlidColor as te}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as se}from"./internal/MaterialUtil.js";import{a as re}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as ie,getInstanceLayout as ae,HUDMaterialTechnique as ne}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as oe}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as le}from"../../../../webscene/support/AlphaCutoff.js";class ce extends B{constructor(e,t,s=!1){super(e,Ne),this.produces=new Map([[12,e=>T(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>T(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>T(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&T(e)]]),this._visible=!0,this._configuration=new oe(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,_(e.output)&&(s.debugDrawLabelBorder=!!M.LABELS_SHOW_BORDER),s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&L(e.output)}intersectRay(e,t,s,r,i,a){const{options:{selectionMode:n,hud:o,excludeLabels:l},point:c,camera:f}=s,{parameters:g}=this;if(n&&o&&(!l||!g.isLabel)&&e.visible&&c&&f)for(const{renderScreenPosition:S,screenSize:x,pixelRatioTolerance:b,halfOutlineSize:v,rotationAngle:O,anchor:z,centerView:P}of this._forEachScreenSpaceHUDInstance(Le,e,t,f))if(ue(c,S[0],S[1],x,b,v,O,g,z)){const e=s.ray;if(ve[0]=c[0],ve[1]=c[1],ve[2]=S[2],f.unprojectFromRenderScreen(ve,Se)){const t=y();h(t,e.direction);const s=1/p(t);u(t,t,s);const r=d(e.origin,Se)*s,i=y();m(i,P,f.inverseViewMatrix),a(r,r,t,-1,i)}}}*_forEachScreenSpaceHUDInstance(e,t,s,i){const{parameters:n}=this,o=t.attributes.get("featureAttribute"),l=null==o?null:V(o.data,Re),{scaleX:c,scaleY:f}=qe(l,n,i.pixelRatio),p=t.attributes.get("position"),d=t.attributes.get("size"),O=t.attributes.get("normal"),z=t.attributes.get("rotation"),y=t.attributes.get("centerOffset"),P=n.size,D=r(Pe,s);X(p.size>=3);const R="screen"===n.centerOffsetUnits;for(let r=0;r<p.data.length/p.size;r++){const t=r*p.size;if(g(Se,p.data[t],p.data[t+1],p.data[t+2]),m(Se,Se,s),m(Se,Se,i.viewMatrix),y){const e=r*y.size;g(Ve,y.data[e],y.data[e+1],y.data[e+2])}else g(Ve,0,0,0);if(!R&&(Se[0]+=Ve[0],Se[1]+=Ve[1],0!==Ve[2])){const e=Ve[2];S(Ve,Se),x(Se,Se,u(Ve,Ve,e))}const o=r*O.size;g(xe,O.data[o],O.data[o+1],O.data[o+2]),b(xe,xe,D);const{normal:l,cosAngle:V}=pe(xe,i,Ie),C=Ye(n,Se,V,i,ge);if(v(Se,Se,l,C),i.applyProjection(Se,be),be[0]>-1){if(R&&(Ve[0]||Ve[1])&&(be[0]+=Ve[0]*i.pixelRatio,0!==Ve[1]&&(be[1]+=ge.alignmentEvaluator.apply(Ve[1])*i.pixelRatio),i.unapplyProjection(be,Se)),be[0]+=n.screenOffset[0]*i.pixelRatio,be[1]+=n.screenOffset[1]*i.pixelRatio,be[0]=Math.floor(be[0]),be[1]=Math.floor(be[1]),He[0]=P[0],He[1]=P[1],null!=d){const e=r*d.size;He[0]*=d.data[e],He[1]*=d.data[e+1]}ge.evaluator.applyVec2(He,He);let t=0;if(n.textureIsSignedDistanceField){t=Math.min(n.outlineSize,.5*He[0])*i.pixelRatio/2}He[0]*=c,He[1]*=f,h(e.centerView,Se),g(e.renderScreenPosition,be[0],be[1],be[2]),a(e.screenSize,He),e.pixelRatioTolerance=Ee*i.pixelRatio,e.halfOutlineSize=t,e.rotationAngle=n.rotation+(null!=z?z.data[r*z.size]:0),e.anchor=re(n),yield e}}}*_forEachDrapedHUDInstance(e,t){const s=t.attributes.get("position"),r=t.attributes.get("size"),i=t.attributes.get("rotation"),n=this.parameters,o=n.size,l=t.attributes.get("featureAttribute"),c=null==l?null:V(l.data,Re),{scaleX:f,scaleY:h}=qe(c,n,t.screenToWorldRatio);e.pixelRatioTolerance=Be*t.screenToWorldRatio,e.anchor=re(n);for(let p=0;p<s.data.length/s.size;p++){const l=p*s.size;if(e.x=s.data[l],e.y=s.data[l+1],He[0]=o[0],He[1]=o[1],null!=r){const e=p*r.size;He[0]*=r.data[e],He[1]*=r.data[e+1]}if(e.halfOutlineSize=0,n.textureIsSignedDistanceField){const s=Math.min(n.outlineSize,.5*He[0]);e.halfOutlineSize=s*t.screenToWorldRatio/2}He[0]*=f,He[1]*=h,a(e.screenSize,He),e.rotationAngle=n.rotation+(null!=i?i.data[p*i.size]:0),yield e}}intersectRayDraped(e,t,s,r,i){const a=this.parameters;for(const{x:n,y:o,screenSize:l,pixelRatioTolerance:c,halfOutlineSize:f,rotationAngle:h,anchor:p}of this._forEachDrapedHUDInstance(Fe,e))ue(s,n,o,l,c,f,h,a,p)&&r(i.distance,i.renderDistance,i.normal,-1)}intersectScreenPolygonDraped(e,t,s,r){if(!s.options.selectionMode||s.options.excludeLabels&&this.parameters.isLabel)return null;const i=this.parameters;for(const{x:a,y:n,screenSize:o,pixelRatioTolerance:l,halfOutlineSize:c,rotationAngle:f,anchor:h}of this._forEachDrapedHUDInstance(Fe,e))if(de(r,a+t[0],n+t[1],o,l,c,f,i,h,!1))return new N(-1);return null}intersectScreenPolygon(e,t,s,r){const{options:{selectionMode:i,hud:a,excludeLabels:n},camera:o}=s,{parameters:l}=this;if(!i||!a||n&&l.isLabel||!e.visible||null==t)return null;const c=new G(1),f=1/o.pixelRatio;for(const{renderScreenPosition:h,screenSize:p,pixelRatioTolerance:u,halfOutlineSize:g,rotationAngle:S,anchor:x,centerView:b}of this._forEachScreenSpaceHUDInstance(Le,e,t,o)){const e=m(Se,b,o.inverseViewMatrix);if(!s.screenPolygonPrimitiveProcessor?.validatePoint(e))continue;const t=h[0]*f,i=(o.fullHeight-h[1])*f;if(Me[0]=p[0]*f,Me[1]=p[1]*f,de(r,t,i,Me,u*f,g*f,S,l,x,!0)){const t=d(o.eye,e);c.updateIfCloserFromValues(t,-1,e,null)}}return c.valid?c:null}createBufferWriter(){return new Ge(this.parameters)}applyShaderOffsets(e,t,s,i,a,n,o,l){b(Oe,s,r(Pe,i));const c=pe(Oe,o,Ie),f=Xe(p(t),o),h=Ye(this.parameters,t,c.cosAngle,o,l);v(t,t,c.normal,h+f),v(e,e,Oe,h+f);const u=n+h;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&h(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return h(a,t);const c=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/i.viewport[2];return u(a,t,l>0?f:1/f),a}_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]&&(S(xe,s),O(s,s,u(xe,xe,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);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=le||t>=le&&s[3]>=le;return this._visible&&r}createGLMaterial(e){return new fe(e)}calculateRelativeScreenBounds(e,t,s=C()){return he(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class fe extends E{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ne,e)}}function he(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function pe(e,t,s){return m(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,We),s}function ue(e,s,r,i,a,l,c,f,h){const p=me(s,r,i,a,l,f,h,Ce);return n(ye,s,r),o(ze,e,ye,t(c)),ze[0]>p[0]&&ze[0]<p[2]&&ze[1]>p[1]&&ze[1]<p[3]}function de(e,s,r,i,a,l,c,f,h,p){const u=me(s,r,i,a,l,f,h,Ce,p);if(n(we,u[0],u[1]),n(Ae,u[2],u[1]),n(je,u[2],u[3]),n(Ue,u[0],u[3]),0!==c){const e=t(c);n(ye,s,r),o(we,we,ye,e),o(Ae,Ae,ye,e),o(je,je,ye,e),o(Ue,Ue,ye,e),w(u),A(u,we),A(u,Ae),A(u,je),A(u,Ue)}return!!H(e,u)&&(W(e,we,Ae,je)||W(e,we,je,Ue))}function me(e,t,s,r,i,a,n,o,l=!1){let c=e-r-s[0]*n[0],f=c+s[0]+2*r;const h=l?1-n[1]:n[1];let p=t-r-s[1]*h,u=p+s[1]+2*r;const d=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=d&&(c+=s[0]*d[0],p+=s[1]*(l?1-d[3]:d[1]),f-=s[0]*(1-d[2]),u-=s[1]*(l?d[1]:1-d[3]),c-=i,f+=i,p-=i,u+=i),o[0]=c,o[1]=p,o[2]=f,o[3]=u,o}const ge=new q,Se=y(),xe=y(),be=R(),ve=s(),Oe=y(),ze=f(),ye=f(),Pe=i(),Ve=y(),De=y(),Re=R(),Ce=C(),we=f(),Ae=f(),je=f(),Ue=f(),Me=f();class Te{constructor(){this.renderScreenPosition=y(),this.screenSize=f(),this.centerView=y(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=f()}}class _e{constructor(){this.x=0,this.y=0,this.screenSize=f(),this.pixelRatioTolerance=0,this.halfOutlineSize=0,this.rotationAngle=0,this.anchor=f()}}const Le=new Te,Fe=new _e,Ie={normal:y(),cosAngle:0},Ee=1,Be=2,He=c(0,0),We=P(0,0,1);class Ne extends I{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=D,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=D,this.outlineSize=0,this.distanceFieldBoundingBox=R(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ge{constructor(e){this.baseInstanceLayout=ie,this.layout=ae(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i){if(null==i)return;const{buffer:a,offset:n}=i,{position:o,normal:l,color:c,size:f,rotation:h,centerOffset:p,groundDistance:u,featureAttribute:d,uvi:m}=a;Y(s.get("position"),e,o,n),k(s.get("normal"),t,l,n);const g=s.get("position").indices.length;if(m){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<g;++e){const a=n+e;m.setValues(a,t,s,r,i)}}}if(c&&J(s.get("color"),4,c,n),f&&K(s.get("size"),f,n),h&&Q(s.get("rotation"),h,n),p&&(s.get("centerOffset")?Z(s.get("centerOffset"),p,n):$(p,n,g)),s.get("groundDistance")?Q(s.get("groundDistance"),u,n):$(u,n,g),d&&(s.get("featureAttribute")?ee(s.get("featureAttribute"),d,n):$(d,n,g)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=a.getField("olidColor",j);te(r,s,t,n)}}}writeBaseInstance(e,t){const{uv0:s}=t;K(e.get("uv0"),s,0)}}function qe(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(U(De,t,e),{scaleX:De[0]*s,scaleY:De[1]*s})}function Xe(e,t){const s=t.computeRenderPixelSizeAtDist(e)*F;return(t.aboveGround?1:-1)*s}function Ye(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=p(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=p(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=se(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{ce as HUDMaterial,Ne as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as u,instanceLayout as c,HeatmapDensityPassParameters as l,HeatmapDensityTechnique as f,baseLayout as p}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as m}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class d extends l{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class b extends a{constructor(t){super(t,d),this.visible=!0,this.produces=new Map([[18,t=>s(t)]]),this.intersectScreenPolygonDraped=void 0,this._configuration=new m}updateConfiguration(t){super.updateConfiguration(t),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats}createGLMaterial(t){return new g(t)}intersectRay(){}intersectRayDraped(r,s,i,a,n){const o=r.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=r,f=c*l+h*l,p=f*f,m=o.data.length/o.size;for(let h=0;h<m;h++){const r=h*o.size,s=t(y,o.data[r],o.data[r+1]);e(s,i)<p&&a(n.distance,n.normal,-1)}}intersectScreenPolygon(){return null}createBufferWriter(){return new v(this.parameters.isAttributeDriven?u:c)}}class g extends i{beginSlot(t){return this.getTechnique(f,t)}}class v{constructor(t){this.layout=t,this.baseInstanceLayout=p}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,r,s,i){if(null==i)return;const{buffer:a,offset:u}=i;n(r.get("position"),t,a.position,u);const c="featureAttribute"in a?a.featureAttribute:null;c&&o(r.get("featureAttribute"),c,u)}writeBaseInstance(t,e){const r=e.uv0;r.setValues(0,-1,-1),r.setValues(1,-1,1),r.setValues(2,1,-1),r.setValues(3,1,1)}}const y=r();export{b as HeatmapDensityMaterial,d as Parameters};
2
+ import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as n}from"../lib/Material.js";import{writePosition as a,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as u,instanceLayout as c,HeatmapDensityPassParameters as l,HeatmapDensityTechnique as f,baseLayout as p}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as m}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class d extends l{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class b extends n{constructor(t){super(t,d),this.visible=!0,this.produces=new Map([[18,t=>s(t)]]),this.intersectScreenPolygonDraped=void 0,this._configuration=new m}updateConfiguration(t){super.updateConfiguration(t),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats}createGLMaterial(t){return new g(t)}intersectRay(){}intersectRayDraped(r,s,i,n,a){const o=r.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=r,f=c*l+h*l,p=f*f,m=o.data.length/o.size;for(let h=0;h<m;h++){const r=h*o.size,s=t(y,o.data[r],o.data[r+1]);e(s,i)<p&&n(a.distance,a.renderDistance,a.normal,-1)}}intersectScreenPolygon(){return null}createBufferWriter(){return new v(this.parameters.isAttributeDriven?u:c)}}class g extends i{beginSlot(t){return this.getTechnique(f,t)}}class v{constructor(t){this.layout=t,this.baseInstanceLayout=p}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,r,s,i){if(null==i)return;const{buffer:n,offset:u}=i;a(r.get("position"),t,n.position,u);const c="featureAttribute"in n?n.featureAttribute:null;c&&o(r.get("featureAttribute"),c,u)}writeBaseInstance(t,e){const r=e.uv0;r.setValues(0,-1,-1),r.setValues(1,-1,1),r.setValues(2,1,-1),r.setValues(3,1,1)}}const y=r();export{b as HeatmapDensityMaterial,d as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as S,signedDistance as L,getNormal as w,create as M}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as P}from"../core/shaderLibrary/ShaderOutput.js";import T from"../lib/GLMaterial.js";import{Material as C,MaterialParameters as R}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as V,screenPolygonIntersectsBufferedSegment as _}from"../lib/screenPolygonOverlapUtils.js";import{Hit as A,DrapedHit as N}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as U}from"../lib/Util.js";import{DefaultBufferWriter as D}from"./DefaultBufferWriter.js";import{PositionColorLayout as E,PositionLayout as O}from"./DefaultLayouts.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as B}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class X extends C{constructor(e){super(e,k),this._configuration=new B,this.produces=new Map([[2,e=>P(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=e.hasOccludees}get visible(){return this.parameters.color[3]>=W}intersectRay(r,t,o,s,n,h){const{options:d,camera:v,rayBegin:x,rayEnd:M}=o;if(!d.selectionMode||!r.visible||!v)return;if(!U(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const P=r.attributes.get("position").data,T=oe;i(T,o.point);const C=ge*v.pixelRatio;a(ce[0],T[0]-C,T[1]+C,0),a(ce[1],T[0]+C,T[1]+C,0),a(ce[2],T[0]+C,T[1]-C,0),a(ce[3],T[0]-C,T[1]-C,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(ce[e],le[e]))return;S(v.eye,le[0],le[1],fe),S(v.eye,le[1],le[2],me),S(v.eye,le[2],le[3],ue),S(v.eye,le[3],le[0],pe);let R=Number.MAX_VALUE,V=0;for(const e of G(H,J,P,t)){if(L(fe,H)<0&&L(fe,J)<0||L(me,H)<0&&L(me,J)<0||L(ue,H)<0&&L(ue,J)<0||L(pe,H)<0&&L(pe,J)<0)continue;const r=v.projectToRenderScreen(H,Y),t=v.projectToRenderScreen(J,Z);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){c(K,H,J);const e=v.frustum,t=-L(e[4],H)/l(K,w(e[4]));if(f(K,K,t),m(H,H,K),!v.projectToRenderScreen(H,r))continue}else if(r[2]>0&&t[2]<0){c(K,J,H);const e=v.frustum,r=-L(e[4],J)/l(K,w(e[4]));if(f(K,K,r),m(J,J,K),!v.projectToRenderScreen(J,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=j(b(r,t,re),T);o<R&&(R=o,u($,H),u(ee,J),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(y(b($,ee,re),b(x,M,te),Q)){c(Q,Q,x);const r=p(Q);f(Q,Q,1/r),e=r/g(x,M)}h(e,Q,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!U(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new A(4);for(const e of G(H,J,c,t))for(const[r,t]of a.processLineSegment(he,H,J))V(n,r,t,Y,Z)&&(n.renderToScreen(Y,ie),n.renderToScreen(Z,se),_(i,ie,se,ge)&&(v(b(r,t,te),n.eye,oe),l.updateIfCloserFromValues(g(n.eye,oe),e,oe,null)));return l}intersectRayDraped(e,t,o,i,s){if(!t.options.selectionMode)return;const n=o[0],a=o[1],c=I(e);let l=Number.MAX_VALUE,f=0;for(const m of z(ne,ae,e)){const e=n-ne[0],t=a-ne[1],o=ae[0]-ne[0],i=ae[1]-ne[1],s=r((o*e+i*t)/(o*o+i*i),0,1),c=o*s-e,u=i*s-t,p=c*c+u*u;p<l&&(l=p,f=m)}l<c*c&&i(s.distance,s.normal,f)}intersectScreenPolygonDraped(e,r,t,o){if(!t.options.selectionMode)return null;const i=I(e);for(const s of z(ne,ae,e,r))if(_(o,ne,ae,i))return new N(s);return null}createGLMaterial(e){return new F(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?E:O;return new D(e)}}class F extends T{beginSlot(e){return this.getTechnique(q,e)}}function*G(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}function I(e){const r=e.attributes.get("size");return(((r?r.data[0]:0)+1)/2+4)*e.screenToWorldRatio}function*z(e,r,t,o){const n=t.attributes.get("position").data,a=o?.[0]??0,c=o?.[1]??0;s(e,n[0]+a,n[1]+c);for(let l=3;l<n.length-2;l+=3){const t=l%n.length;s(r,n[t]+a,n[t+1]+c),yield l/3,i(e,r)}}class k extends R{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const H=h(),J=h(),K=h(),Q=h(),Y=t(),Z=t(),$=h(),ee=h(),re=x(),te=x(),oe=h(),ie=o(),se=o(),ne=n(),ae=n(),ce=[t(),t(),t(),t()],le=[h(),h(),h(),h()],fe=M(),me=M(),ue=M(),pe=M(),ge=2,he=[h(),h()];export{X as NativeLineMaterial,k as Parameters};
2
+ import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as S,signedDistance as L,getNormal as w,create as M}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as P}from"../core/shaderLibrary/ShaderOutput.js";import T from"../lib/GLMaterial.js";import{Material as C,MaterialParameters as R}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as V,screenPolygonIntersectsBufferedSegment as _}from"../lib/screenPolygonOverlapUtils.js";import{Hit as A,DrapedHit as N}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as U}from"../lib/Util.js";import{DefaultBufferWriter as D}from"./DefaultBufferWriter.js";import{PositionColorLayout as E,PositionLayout as O}from"./DefaultLayouts.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as B}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class X extends C{constructor(e){super(e,k),this._configuration=new B,this.produces=new Map([[2,e=>P(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=e.hasOccludees}get visible(){return this.parameters.color[3]>=W}intersectRay(r,t,o,s,n,h){const{options:d,camera:v,rayBegin:x,rayEnd:M}=o;if(!d.selectionMode||!r.visible||!v)return;if(!U(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const P=r.attributes.get("position").data,T=oe;i(T,o.point);const C=ge*v.pixelRatio;a(ce[0],T[0]-C,T[1]+C,0),a(ce[1],T[0]+C,T[1]+C,0),a(ce[2],T[0]+C,T[1]-C,0),a(ce[3],T[0]-C,T[1]-C,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(ce[e],le[e]))return;S(v.eye,le[0],le[1],fe),S(v.eye,le[1],le[2],me),S(v.eye,le[2],le[3],ue),S(v.eye,le[3],le[0],pe);let R=Number.MAX_VALUE,V=0;for(const e of G(H,J,P,t)){if(L(fe,H)<0&&L(fe,J)<0||L(me,H)<0&&L(me,J)<0||L(ue,H)<0&&L(ue,J)<0||L(pe,H)<0&&L(pe,J)<0)continue;const r=v.projectToRenderScreen(H,Y),t=v.projectToRenderScreen(J,Z);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){c(K,H,J);const e=v.frustum,t=-L(e[4],H)/l(K,w(e[4]));if(f(K,K,t),m(H,H,K),!v.projectToRenderScreen(H,r))continue}else if(r[2]>0&&t[2]<0){c(K,J,H);const e=v.frustum,r=-L(e[4],J)/l(K,w(e[4]));if(f(K,K,r),m(J,J,K),!v.projectToRenderScreen(J,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=j(b(r,t,re),T);o<R&&(R=o,u($,H),u(ee,J),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(y(b($,ee,re),b(x,M,te),Q)){c(Q,Q,x);const r=p(Q);f(Q,Q,1/r),e=r/g(x,M)}h(e,e,Q,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!U(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new A(4);for(const e of G(H,J,c,t))for(const[r,t]of a.processLineSegment(he,H,J))V(n,r,t,Y,Z)&&(n.renderToScreen(Y,ie),n.renderToScreen(Z,se),_(i,ie,se,ge)&&(v(b(r,t,te),n.eye,oe),l.updateIfCloserFromValues(g(n.eye,oe),e,oe,null)));return l}intersectRayDraped(e,t,o,i,s){if(!t.options.selectionMode)return;const n=o[0],a=o[1],c=I(e);let l=Number.MAX_VALUE,f=0;for(const m of z(ne,ae,e)){const e=n-ne[0],t=a-ne[1],o=ae[0]-ne[0],i=ae[1]-ne[1],s=r((o*e+i*t)/(o*o+i*i),0,1),c=o*s-e,u=i*s-t,p=c*c+u*u;p<l&&(l=p,f=m)}l<c*c&&i(s.distance,s.renderDistance,s.normal,f)}intersectScreenPolygonDraped(e,r,t,o){if(!t.options.selectionMode)return null;const i=I(e);for(const s of z(ne,ae,e,r))if(_(o,ne,ae,i))return new N(s);return null}createGLMaterial(e){return new F(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?E:O;return new D(e)}}class F extends T{beginSlot(e){return this.getTechnique(q,e)}}function*G(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}function I(e){const r=e.attributes.get("size");return(((r?r.data[0]:0)+1)/2+4)*e.screenToWorldRatio}function*z(e,r,t,o){const n=t.attributes.get("position").data,a=o?.[0]??0,c=o?.[1]??0;s(e,n[0]+a,n[1]+c);for(let l=3;l<n.length-2;l+=3){const t=l%n.length;s(r,n[t]+a,n[t+1]+c),yield l/3,i(e,r)}}class k extends R{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const H=h(),J=h(),K=h(),Q=h(),Y=t(),Z=t(),$=h(),ee=h(),re=x(),te=x(),oe=h(),ie=o(),se=o(),ne=n(),ae=n(),ce=[t(),t(),t(),t()],le=[h(),h(),h(),h()],fe=M(),me=M(),ue=M(),pe=M(),ge=2,he=[h(),h()];export{X as NativeLineMaterial,k as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{BufferViewUint32 as t,BufferViewVec3f as e,BufferViewVec2Snorm16 as i,BufferViewSnorm16 as r,BufferViewFloat16 as s,BufferViewFloat as o,BufferViewVec2f as a,BufferViewVec4Unorm8 as n,BufferViewUnorm8 as h}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as c}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as u,is3DGeometry as f,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import g from"../lib/GLMaterial.js";import{offsetPathVertexInfoFrameIndex as m}from"../lib/PathVertexInfo.js";import{intersectTriangleGeometry as d}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as b}from"../lib/screenPolygonTriangleIntersections.js";import{assert as y}from"../lib/Util.js";import{applyPolygonOffsetToHit as _}from"./intersectWithPolygonOffset.js";import{getLayout as S,getTextureLayout as F}from"./PathLayouts.js";import{PathPassParameters as w,PathTechnique as P}from"./PathTechnique.js";import{PathTechniqueConfiguration as V}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as x}from"./TriangleMaterial.js";import{writeAttributes as C,writePosition as j,writeBufferVec2 as z,writeBufferInt16 as O,writeBufferFloat16 as B,writeBufferFloat as R,writeColor as T,writeBufferUint8 as A,writeOlidColor as v}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as I}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as M}from"../../../../webscene/support/AlphaCutoff.js";class U extends x{constructor(t,e){super(t,D),this.supportsEdges=!0,this.produces=new Map([[2,t=>(this.parameters.castShadows&&u(t)||f(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&u(t)||f(t))&&this.transparent]]),this._configuration=new V(e.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,p(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=I(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=M}intersectRay(t,e,i,r,s,o){d(t,i,r,s,null,o)}intersectRayDraped(){}intersectScreenPolygonDraped(){return null}intersectScreenPolygon(t,e,i,r){return _(b(t,i,e,r,null),this._configuration,i.camera.eye)}createBufferWriter(){return new q(S(),F(this.parameters))}createGLMaterial(t){return new L(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class L extends g{beginSlot(t){return this.getTechnique(P,t)}}class D extends w{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class q{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=c}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(e,i,r,s,o){C(r,null,this.layout,e,i,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",t),h=r.get("pathVertexInfo");if(n&&h){y(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,m(o,a))}}}_writeTextureBuffer(t,c,u,f){const p=f.offset,g=f.buffer.getField("position",e),m=c.get("position");g&&m&&(y(3===m.size),j(m,t,g,p));const d=f.buffer.getField("profileRight",i),b=c.get("profileRight");d&&b&&(y(2===b.size),z(b,d,p));const _=f.buffer.getField("profileUp",i),S=c.get("profileUp");_&&S&&(y(2===S.size),z(S,_,p));const F=f.buffer.getField("profileRotation",r),w=c.get("profileRotation");F&&w&&(y(1===w.size),O(w,F,p));const P=f.buffer.getField("pathRotationUp",i),V=c.get("pathRotationUp");P&&V&&(y(2===V.size),z(V,P,p));const x=f.buffer.getField("pathMaxStretchDistance",s),C=c.get("pathMaxStretchDistance");x&&C&&(y(1===C.size),B(C,x,p));const I=f.buffer.getField("sizeFeatureAttribute",o),M=c.get("sizeFeatureAttribute");I&&M&&R(M,I,p);const U=f.buffer.getField("size",a),L=c.get("size");U&&L&&(y(2===L.size),z(L,U,p));const D=f.buffer.getField("colorFeatureAttribute",o),q=c.get("colorFeatureAttribute");D&&q&&R(q,D,p);const G=f.buffer.getField("color",n),W=c.get("color");G&&W&&T(W,4,G,p);const H=f.buffer.getField("opacityFeatureAttribute",o),k=c.get("opacityFeatureAttribute");H&&k&&R(k,H,p);const E=f.buffer.getField("opacity",h),J=c.get("opacity");if(E&&J&&(y(1===J.size),A(J,E,p)),l()){const t=f.buffer.getField("olidColor",n),e=m?.indices.length??0;u&&t&&e&&v(u,t,e,p)}}}export{D as Parameters,q as PathBufferWriter,U as PathMaterial};
2
+ import{BufferViewUint32 as t,BufferViewVec3f as e,BufferViewVec2Snorm16 as i,BufferViewSnorm16 as r,BufferViewFloat16 as s,BufferViewFloat as o,BufferViewVec2f as a,BufferViewVec4Unorm8 as n,BufferViewUnorm8 as h}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as c}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as u,is3DGeometry as f,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import g from"../lib/GLMaterial.js";import{offsetPathVertexInfoFrameIndex as m}from"../lib/PathVertexInfo.js";import{intersectTriangleGeometry as d}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as y}from"../lib/screenPolygonTriangleIntersections.js";import{assert as b}from"../lib/Util.js";import{applyPolygonOffsetToHit as _}from"./intersectWithPolygonOffset.js";import{getLayout as S,getTextureLayout as F}from"./PathLayouts.js";import{PathPassParameters as w,PathTechnique as P}from"./PathTechnique.js";import{PathTechniqueConfiguration as V}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as x}from"./TriangleMaterial.js";import{writeAttributes as C,writePosition as j,writeBufferVec2 as z,writeBufferInt16 as T,writeBufferFloat16 as O,writeBufferFloat as B,writeColor as R,writeBufferUint8 as A,writeOlidColor as v}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as I}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as M}from"../../../../webscene/support/AlphaCutoff.js";class U extends x{constructor(t,e){super(t,D),this.supportsEdges=!0,this.produces=new Map([[2,t=>(this.parameters.castShadows&&u(t)||f(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&u(t)||f(t))&&this.transparent]]),this._configuration=new V(e.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.pathJoinType=this.parameters.pathJoinType,this._configuration.offsetBackfaces=this.transparent,p(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=I(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=M}intersectRay(t,e,i,r,s,o){d(t,i,r,s,null,o)}intersectRayDraped(){}intersectScreenPolygonDraped(){return null}intersectScreenPolygon(t,e,i,r){return _(y(t,i,e,r,null),this._configuration,i.camera.eye)}createBufferWriter(){return new q(S(),F(this.parameters))}createGLMaterial(t){return new L(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class L extends g{beginSlot(t){return this.getTechnique(P,t)}}class D extends w{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2,this.pathJoinType=1}}class q{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=c}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(e,i,r,s,o){C(r,null,this.layout,e,i,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",t),h=r.get("pathVertexInfo");if(n&&h){b(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,m(o,a))}}}_writeTextureBuffer(t,c,u,f){const p=f.offset,g=f.buffer.getField("position",e),m=c.get("position");g&&m&&(b(3===m.size),j(m,t,g,p));const d=f.buffer.getField("profileRight",i),y=c.get("profileRight");d&&y&&(b(2===y.size),z(y,d,p));const _=f.buffer.getField("profileUp",i),S=c.get("profileUp");_&&S&&(b(2===S.size),z(S,_,p));const F=f.buffer.getField("profileRotation",r),w=c.get("profileRotation");F&&w&&(b(1===w.size),T(w,F,p));const P=f.buffer.getField("pathRotationUp",i),V=c.get("pathRotationUp");P&&V&&(b(2===V.size),z(V,P,p));const x=f.buffer.getField("pathMaxStretchDistance",s),C=c.get("pathMaxStretchDistance");x&&C&&(b(1===C.size),O(C,x,p));const I=f.buffer.getField("sizeFeatureAttribute",o),M=c.get("sizeFeatureAttribute");I&&M&&B(M,I,p);const U=f.buffer.getField("size",a),L=c.get("size");U&&L&&(b(2===L.size),z(L,U,p));const D=f.buffer.getField("colorFeatureAttribute",o),q=c.get("colorFeatureAttribute");D&&q&&B(q,D,p);const G=f.buffer.getField("color",n),J=c.get("color");G&&J&&R(J,4,G,p);const W=f.buffer.getField("opacityFeatureAttribute",o),H=c.get("opacityFeatureAttribute");W&&H&&B(H,W,p);const k=f.buffer.getField("opacity",h),E=c.get("opacity");if(k&&E&&(b(1===E.size),A(E,k,p)),l()){const t=f.buffer.getField("olidColor",n),e=m?.indices.length??0;u&&t&&e&&v(u,t,e,p)}}}export{D as Parameters,q as PathBufferWriter,U as PathMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";class i extends e{constructor(t){super(),this.spherical=t,this.offsetBackfaces=!1,this.cullFace=0,this.pbrMode=0,this.emissionSource=0,this.upVectorAlignment=0,this.pathCapType=3,this.pathProfileType=0,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasPathSize=!1,this.hasPathColor=!1,this.hasPathOpacity=!1,this.hasOccludees=!1,this.snowCover=!1,this.receiveGlobalIllumination=!1,this.supportNaN=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1,this.doubleSidedMode=0,this.renderOccluded=!1}}t([o()],i.prototype,"offsetBackfaces",void 0),t([o({count:3})],i.prototype,"cullFace",void 0),t([o({count:8})],i.prototype,"pbrMode",void 0),t([o({count:8})],i.prototype,"emissionSource",void 0),t([o({count:2})],i.prototype,"upVectorAlignment",void 0),t([o({count:4})],i.prototype,"pathCapType",void 0),t([o({count:2})],i.prototype,"pathProfileType",void 0),t([o()],i.prototype,"receiveShadows",void 0),t([o()],i.prototype,"hasShadowHighlights",void 0),t([o()],i.prototype,"receiveAmbientOcclusion",void 0),t([o()],i.prototype,"hasVVSize",void 0),t([o()],i.prototype,"hasVVColor",void 0),t([o()],i.prototype,"hasVVOpacity",void 0),t([o()],i.prototype,"hasPathSize",void 0),t([o()],i.prototype,"hasPathColor",void 0),t([o()],i.prototype,"hasPathOpacity",void 0),t([o()],i.prototype,"hasOccludees",void 0),t([o()],i.prototype,"snowCover",void 0),t([o()],i.prototype,"receiveGlobalIllumination",void 0);export{i as PathTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";class i extends e{constructor(t){super(),this.spherical=t,this.offsetBackfaces=!1,this.cullFace=0,this.pbrMode=0,this.emissionSource=0,this.upVectorAlignment=0,this.pathCapType=3,this.pathProfileType=0,this.pathJoinType=1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasPathSize=!1,this.hasPathColor=!1,this.hasPathOpacity=!1,this.hasOccludees=!1,this.snowCover=!1,this.receiveGlobalIllumination=!1,this.supportNaN=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1,this.doubleSidedMode=0,this.renderOccluded=!1}}t([o()],i.prototype,"offsetBackfaces",void 0),t([o({count:3})],i.prototype,"cullFace",void 0),t([o({count:8})],i.prototype,"pbrMode",void 0),t([o({count:8})],i.prototype,"emissionSource",void 0),t([o({count:2})],i.prototype,"upVectorAlignment",void 0),t([o({count:4})],i.prototype,"pathCapType",void 0),t([o({count:2})],i.prototype,"pathProfileType",void 0),t([o({count:3})],i.prototype,"pathJoinType",void 0),t([o()],i.prototype,"receiveShadows",void 0),t([o()],i.prototype,"hasShadowHighlights",void 0),t([o()],i.prototype,"receiveAmbientOcclusion",void 0),t([o()],i.prototype,"hasVVSize",void 0),t([o()],i.prototype,"hasVVColor",void 0),t([o()],i.prototype,"hasVVOpacity",void 0),t([o()],i.prototype,"hasPathSize",void 0),t([o()],i.prototype,"hasPathColor",void 0),t([o()],i.prototype,"hasPathOpacity",void 0),t([o()],i.prototype,"hasOccludees",void 0),t([o()],i.prototype,"snowCover",void 0),t([o()],i.prototype,"receiveGlobalIllumination",void 0);export{i as PathTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as o,set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as v}from"../../../../geometry/support/float16.js";import{create as w,fromPoints as E,distance2 as x,closestLineSegmentPoint as T,projectPoint as j,projectPointFraction as L}from"../../../../geometry/support/lineSegment.js";import{create as z,fromPoints as C,signedDistance as A,getNormal as M}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as R,BufferViewFloat as V,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as U,isColor as I,isDepth as N,isColorHighlightOLIDOrDepth as W,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as D}from"../effects/geometry/olidUtils.js";import Y from"../lib/GLMaterial.js";import{Material as J}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as q,screenPolygonIntersectsBufferedSegment as X}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as H}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as K}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as Q,assert as Z}from"../lib/Util.js";import{isImagePattern as $}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ee}from"./VisualVariablePassParameters.js";import{writeOlidColor as te}from"./internal/bufferWriterUtils.js";import{r as re}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ne}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as oe}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class le extends J{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>U(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>N(e)],[10,e=>W(e)&&8===this.parameters.renderOccluded],[11,e=>W(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new oe(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=_e(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ge(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,n,o){if(!i.options.selectionMode)return;const a=this._getLineSize(e,!0),l=s[0],c=s[1],p=fe(a,r);let u=Number.MAX_VALUE,m=0;for(const h of de(ye,ve,this.parameters,e)){const e=l-ye[0],r=c-ye[1],i=ve[0]-ye[0],s=ve[1]-ye[1],n=t((i*e+s*r)/(i*i+s*s),0,1),o=i*n-e,a=s*n-r,p=o*o+a*a;p<u&&(u=p,m=h)}u<p*p&&n(o.distance,o.normal,m)}intersectRay(t,r,i,s,n,a){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!Q(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=Le;o(w,i.point);const j=v*_.pixelRatio,L=Je*_.pixelRatio,z=j/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;C(_.eye,Ne[0],Ne[1],We),C(_.eye,Ne[1],Ne[2],ke),C(_.eye,Ne[2],Ne[3],De),C(_.eye,Ne[3],Ne[0],Ye);let R=Number.MAX_VALUE,V=0;for(const e of this._forEachTransformedLineSegment(Se,Pe,y,r,he(this.parameters,P))){if(A(We,Se)<0&&A(We,Pe)<0||A(ke,Se)<0&&A(ke,Pe)<0||A(De,Se)<0&&A(De,Pe)<0||A(Ye,Se)<0&&A(Ye,Pe)<0)continue;const t=_.projectToRenderScreen(Se,ze),r=_.projectToRenderScreen(Pe,Ce);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,Se,Pe);const e=_.frustum,r=-A(e[4],Se)/u(Te,M(e[4]));if(m(Te,Te,r),h(Se,Se,Te),!_.projectToRenderScreen(Se,t))continue}else if(t[2]>0&&r[2]<0){p(Te,Pe,Se);const e=_.frustum,t=-A(e[4],Pe)/u(Te,M(e[4]));if(m(Te,Te,t),h(Pe,Pe,Te),!_.projectToRenderScreen(Pe,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Fe),s=x(i,w);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,Se,Pe,w,_,v,L);if(s>=e*e)continue}R=s,f(Re,Se),f(Ve,Pe),V=e}}if(R<z*z){let e=Number.MAX_VALUE;if(T(E(Re,Ve,Fe),E(b,S,Oe),je)){p(je,je,b);const t=d(je);m(je,je,1/t),e=t/g(b,S)}a(e,je,V)}}intersectScreenPolygon(t,r,i,s){const{options:n,camera:o,screenPolygonPrimitiveProcessor:a}=i;if(!n.selectionMode||!t.visible)return null;if(!Q(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Je,m=u*o.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(Se,Pe,c,r,he(this.parameters,l)))for(const[t,r]of a.processLineSegment(qe,Se,Pe)){if(!q(o,t,r,ze,Ce))continue;const i=E(ze,Ce,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(Le,ze,Ce,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(i,t,r,Le,o,p,m)/o.pixelRatio)),o.renderToScreen(ze,Ae),o.renderToScreen(Ce,Me),X(s,Ae,Me,n)&&(j(E(t,r,Oe),o.eye,we),h.updateIfCloserFromValues(g(o.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const n=fe(this._getLineSize(e,!0),t);for(const o of de(ye,ve,this.parameters,e,r))if(X(s,ye,ve,n))return new H(o);return null}createBufferWriter(){return new ue(ie(this.parameters),se(this.parameters),this.parameters)}createGLMaterial(e){return new ce(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,n,o){const a=L(e,i);_(we,t,r,a),b(Ee,we,s.viewMatrix);const l=d(Ee),c=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,r){return r?S(je,e):c(je,0,0,1),p(xe,e,t.eye),S(xe,xe),Math.abs(u(je,xe))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const n=s?r.length-2:r.length-5;for(let o=0;o<n;o+=3){e[0]=r[o]+i[12],e[1]=r[o+1]+i[13],e[2]=r[o+2]+i[14];const s=(o+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield o/3}}}class ce extends Y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ne,e)}}class pe extends ee{constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return $(this.stipplePattern)&&null!=this.stippleTexture}}class ue{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=_e(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return he(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,n,o){null!=o&&this._writeTextureBuffer(e,r,i,o),null!=s&&this._writeVertexBuffer(e,r,i,s,n)}_writeTextureBuffer(e,t,r,i){const s=t.get("position"),n=s.data.length/3,o=this._isClosed(t),{buffer:a,offset:l}=i,c=a.getField("position",R),p=a.getField("u0",V),u=a.getField("sizeFeatureAttribute",V),m=a.getField("size",V),h=a.getField("colorFeatureAttribute",V),d=a.getField("color",F),_=a.getField("olidColor",F),b=a.getField("timeStamps",O),S=a.getField("opacityFeatureAttribute",V),P=t.get("sizeFeatureAttribute")?.data,y=t.get("size")?.data,v=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,x=t.get("distanceToStart")?.data,T=t.get("timeStamps");Z(null!==c,"Expected valid position field in texture buffer"),Z(null!==p,"Expected valid u0 field in texture buffer");let j=0;for(let L=0;L<n;++L){this._getTransformedPosition(Ue,s.data,L,e),L>0&&(null!=x?j=x[L]??j:j+=g(Be,Ue));const t=l+L+1;if(c.setVec(t,Ue),p.set(t,j),f(Be,Ue),u&&u.set(t,1===P?.length?P[0]:P?.[L]??0),m&&m.set(t,1===y?.length?y[0]:y?.[L]??1),h&&h.set(t,1===v?.length?v[0]:v?.[L]??0),d)if(null!=w){const e=Math.min(4*L,w.length-4);d.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else d.setValues(t,1,1,1,1);S&&S.set(t,1===E?.length?E[0]:E?.[L]??0)}if(null!=b&&null!=T){Z(4===T.size);const e=T.data;for(let t=0;t<n;++t){const r=4*t,i=l+t+1;b.set(i,0,e[r]),b.set(i,1,e[r+1]),b.set(i,2,e[r+2]),b.set(i,3,e[r+3])}}if(o){const e=l,t=l+1,r=l+2,i=l+n,s=i+1,o=i+2;a.copyItem(i,e),a.copyItem(t,s),a.copyItem(r,o),c.getVec(i,Be),c.getVec(t,Ue);const u=j+g(Be,Ue);p.set(s,u)}else{const e=l,t=l+1,r=l+n,i=r+1;a.copyItem(t,e),a.copyItem(r,i)}D()&&null!=r&&null!=_&&te(r,_,n+(o?3:2),l)}_writeVertexBuffer(e,t,r,i,s){const{buffer:n,offset:o}=i,{layout:a}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,u=this._isClosed(t),m=p+(u?3:2);c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const h=n.getField("textureElementIndex",B);Z(null!=h,"Missing texture buffer index field"),Z(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const f=s.from;Z(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const d=new Float32Array(n.buffer),g=v(n.buffer),_=new Uint32Array(n.buffer),b=a.stride/4;let S=o*b;const P=S,y=d.BYTES_PER_ELEMENT/g.BYTES_PER_ELEMENT,w=(e,t,r)=>{const i=r+1;_[S]=f+i,S++;let s=S*y;g[s++]=e,g[s++]=t,S=Math.ceil(s/y)};S+=b;let E=0,x=0;u?(E=0,x=p):(w(1,-4,0),w(1,4,0),E=1,x=p-1);for(let v=E;v<x;v++){w(0,-1,v),w(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const r=(t+1)/(e+1);w(r,-1,v),w(r,1,v)}w(1,-2,v),w(1,2,v)}u?(w(0,-1,x),w(0,1,x)):(w(0,-5,x),w(0,5,x)),me(d,P+b,d,P,b);S=me(d,S-b,d,S,b),this._parameters.wireframe&&this._addWireframeVertices(n,P,S,b)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),o=i*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=me(n,e,s,a,o);for(let c=0;c<=n.length-4*o;c+=2*o)l(c),l(c+2*o),l(c+1*o),l(c+2*o),l(c+1*o),l(c+3*o)}}function me(e,t,r,i,s){for(let n=0;n<s;n++)r[i++]=e[t++];return i}function he(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function fe(e,t){return(e/2+Je)*t}function*de(e,t,r,i,s){const n=i.get("position").data,l=he(r,i)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;a(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const r=u%n.length;a(t,n[r]+c,n[r+1]+p),yield u/3,o(e,t)}}function ge(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function _e(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return re+r}}const be=new K,Se=P(),Pe=P(),ye=l(),ve=l(),we=P(),Ee=P(),xe=P(),Te=P(),je=P(),Le=P(),ze=r(),Ce=r(),Ae=i(),Me=i(),Re=P(),Ve=P(),Fe=w(),Oe=w(),Be=P(),Ue=P(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],We=z(),ke=z(),De=z(),Ye=z(),Je=4,qe=[P(),P()];export{pe as Parameters,le as RibbonLineMaterial};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as o,set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as v}from"../../../../geometry/support/float16.js";import{create as w,fromPoints as E,distance2 as x,closestLineSegmentPoint as T,projectPoint as j,projectPointFraction as L}from"../../../../geometry/support/lineSegment.js";import{create as z,fromPoints as C,signedDistance as A,getNormal as M}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as R,BufferViewFloat as V,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as U,isColor as I,isDepth as N,isColorHighlightOLIDOrDepth as W,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as D}from"../effects/geometry/olidUtils.js";import Y from"../lib/GLMaterial.js";import{Material as J}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as q,screenPolygonIntersectsBufferedSegment as X}from"../lib/screenPolygonOverlapUtils.js";import{Hit as G,DrapedHit as H}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as K}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as Q,assert as Z}from"../lib/Util.js";import{isImagePattern as $}from"./lineStippleUtils.js";import{VisualVariablePassParameters as ee}from"./VisualVariablePassParameters.js";import{writeOlidColor as te}from"./internal/bufferWriterUtils.js";import{r as re}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as se}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ne}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as oe}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class le extends J{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>U(e)||I(e)&&8===this.parameters.renderOccluded],[3,e=>N(e)],[10,e=>W(e)&&8===this.parameters.renderOccluded],[11,e=>W(e)&&8===this.parameters.renderOccluded],[4,e=>I(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>I(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new oe(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=_e(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&ge(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,n,o){if(!i.options.selectionMode)return;const a=this._getLineSize(e,!0),l=s[0],c=s[1],p=fe(a,r);let u=Number.MAX_VALUE,m=0;for(const h of de(ye,ve,this.parameters,e)){const e=l-ye[0],r=c-ye[1],i=ve[0]-ye[0],s=ve[1]-ye[1],n=t((i*e+s*r)/(i*i+s*s),0,1),o=i*n-e,a=s*n-r,p=o*o+a*a;p<u&&(u=p,m=h)}u<p*p&&n(o.distance,o.renderDistance,o.normal,m)}intersectRay(t,r,i,s,n,a){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!Q(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=Le;o(w,i.point);const j=v*_.pixelRatio,L=Je*_.pixelRatio,z=j/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;C(_.eye,Ne[0],Ne[1],We),C(_.eye,Ne[1],Ne[2],ke),C(_.eye,Ne[2],Ne[3],De),C(_.eye,Ne[3],Ne[0],Ye);let R=Number.MAX_VALUE,V=0;for(const e of this._forEachTransformedLineSegment(Se,Pe,y,r,he(this.parameters,P))){if(A(We,Se)<0&&A(We,Pe)<0||A(ke,Se)<0&&A(ke,Pe)<0||A(De,Se)<0&&A(De,Pe)<0||A(Ye,Se)<0&&A(Ye,Pe)<0)continue;const t=_.projectToRenderScreen(Se,ze),r=_.projectToRenderScreen(Pe,Ce);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,Se,Pe);const e=_.frustum,r=-A(e[4],Se)/u(Te,M(e[4]));if(m(Te,Te,r),h(Se,Se,Te),!_.projectToRenderScreen(Se,t))continue}else if(t[2]>0&&r[2]<0){p(Te,Pe,Se);const e=_.frustum,t=-A(e[4],Pe)/u(Te,M(e[4]));if(m(Te,Te,t),h(Pe,Pe,Te),!_.projectToRenderScreen(Pe,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Fe),s=x(i,w);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,Se,Pe,w,_,v,L);if(s>=e*e)continue}R=s,f(Re,Se),f(Ve,Pe),V=e}}if(R<z*z){let e=Number.MAX_VALUE;if(T(E(Re,Ve,Fe),E(b,S,Oe),je)){p(je,je,b);const t=d(je);m(je,je,1/t),e=t/g(b,S)}a(e,e,je,V)}}intersectScreenPolygon(t,r,i,s){const{options:n,camera:o,screenPolygonPrimitiveProcessor:a}=i;if(!n.selectionMode||!t.visible)return null;if(!Q(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),u=Je,m=u*o.pixelRatio,h=new G(4);for(const e of this._forEachTransformedLineSegment(Se,Pe,c,r,he(this.parameters,l)))for(const[t,r]of a.processLineSegment(qe,Se,Pe)){if(!q(o,t,r,ze,Ce))continue;const i=E(ze,Ce,Fe);let n=p/2+u;this.parameters.screenSizePerspective&&(_(Le,ze,Ce,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(i,t,r,Le,o,p,m)/o.pixelRatio)),o.renderToScreen(ze,Ae),o.renderToScreen(Ce,Me),X(s,Ae,Me,n)&&(j(E(t,r,Oe),o.eye,we),h.updateIfCloserFromValues(g(o.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const n=fe(this._getLineSize(e,!0),t);for(const o of de(ye,ve,this.parameters,e,r))if(X(s,ye,ve,n))return new H(o);return null}createBufferWriter(){return new ue(ie(this.parameters),se(this.parameters),this.parameters)}createGLMaterial(e){return new ce(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,n,o){const a=L(e,i);_(we,t,r,a),b(Ee,we,s.viewMatrix);const l=d(Ee),c=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,r){return r?S(je,e):c(je,0,0,1),p(xe,e,t.eye),S(xe,xe),Math.abs(u(je,xe))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const n=s?r.length-2:r.length-5;for(let o=0;o<n;o+=3){e[0]=r[o]+i[12],e[1]=r[o+1]+i[13],e[2]=r[o+2]+i[14];const s=(o+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield o/3}}}class ce extends Y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ne,e)}}class pe extends ee{constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return $(this.stipplePattern)&&null!=this.stippleTexture}}class ue{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=_e(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return he(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,n,o){null!=o&&this._writeTextureBuffer(e,r,i,o),null!=s&&this._writeVertexBuffer(e,r,i,s,n)}_writeTextureBuffer(e,t,r,i){const s=t.get("position"),n=s.data.length/3,o=this._isClosed(t),{buffer:a,offset:l}=i,c=a.getField("position",R),p=a.getField("u0",V),u=a.getField("sizeFeatureAttribute",V),m=a.getField("size",V),h=a.getField("colorFeatureAttribute",V),d=a.getField("color",F),_=a.getField("olidColor",F),b=a.getField("timeStamps",O),S=a.getField("opacityFeatureAttribute",V),P=t.get("sizeFeatureAttribute")?.data,y=t.get("size")?.data,v=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,x=t.get("distanceToStart")?.data,T=t.get("timeStamps");Z(null!==c,"Expected valid position field in texture buffer"),Z(null!==p,"Expected valid u0 field in texture buffer");let j=0;for(let L=0;L<n;++L){this._getTransformedPosition(Ue,s.data,L,e),L>0&&(null!=x?j=x[L]??j:j+=g(Be,Ue));const t=l+L+1;if(c.setVec(t,Ue),p.set(t,j),f(Be,Ue),u&&u.set(t,1===P?.length?P[0]:P?.[L]??0),m&&m.set(t,1===y?.length?y[0]:y?.[L]??1),h&&h.set(t,1===v?.length?v[0]:v?.[L]??0),d)if(null!=w){const e=Math.min(4*L,w.length-4);d.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else d.setValues(t,1,1,1,1);S&&S.set(t,1===E?.length?E[0]:E?.[L]??0)}if(null!=b&&null!=T){Z(4===T.size);const e=T.data;for(let t=0;t<n;++t){const r=4*t,i=l+t+1;b.set(i,0,e[r]),b.set(i,1,e[r+1]),b.set(i,2,e[r+2]),b.set(i,3,e[r+3])}}if(o){const e=l,t=l+1,r=l+2,i=l+n,s=i+1,o=i+2;a.copyItem(i,e),a.copyItem(t,s),a.copyItem(r,o),c.getVec(i,Be),c.getVec(t,Ue);const u=j+g(Be,Ue);p.set(s,u)}else{const e=l,t=l+1,r=l+n,i=r+1;a.copyItem(t,e),a.copyItem(r,i)}D()&&null!=r&&null!=_&&te(r,_,n+(o?3:2),l)}_writeVertexBuffer(e,t,r,i,s){const{buffer:n,offset:o}=i,{layout:a}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,u=this._isClosed(t),m=p+(u?3:2);c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const h=n.getField("textureElementIndex",B);Z(null!=h,"Missing texture buffer index field"),Z(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const f=s.from;Z(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const d=new Float32Array(n.buffer),g=v(n.buffer),_=new Uint32Array(n.buffer),b=a.stride/4;let S=o*b;const P=S,y=d.BYTES_PER_ELEMENT/g.BYTES_PER_ELEMENT,w=(e,t,r)=>{const i=r+1;_[S]=f+i,S++;let s=S*y;g[s++]=e,g[s++]=t,S=Math.ceil(s/y)};S+=b;let E=0,x=0;u?(E=0,x=p):(w(1,-4,0),w(1,4,0),E=1,x=p-1);for(let v=E;v<x;v++){w(0,-1,v),w(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const r=(t+1)/(e+1);w(r,-1,v),w(r,1,v)}w(1,-2,v),w(1,2,v)}u?(w(0,-1,x),w(0,1,x)):(w(0,-5,x),w(0,5,x)),me(d,P+b,d,P,b);S=me(d,S-b,d,S,b),this._parameters.wireframe&&this._addWireframeVertices(n,P,S,b)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),o=i*Float32Array.BYTES_PER_ELEMENT;let a=0;const l=e=>a=me(n,e,s,a,o);for(let c=0;c<=n.length-4*o;c+=2*o)l(c),l(c+2*o),l(c+1*o),l(c+2*o),l(c+1*o),l(c+3*o)}}function me(e,t,r,i,s){for(let n=0;n<s;n++)r[i++]=e[t++];return i}function he(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function fe(e,t){return(e/2+Je)*t}function*de(e,t,r,i,s){const n=i.get("position").data,l=he(r,i)?n.length-2:n.length-5,c=s?.[0]??0,p=s?.[1]??0;a(e,n[0]+c,n[1]+p);for(let u=3;u<l+3;u+=3){const r=u%n.length;a(t,n[r]+c,n[r+1]+p),yield u/3,o(e,t)}}function ge(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function _e(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return re+r}}const be=new K,Se=P(),Pe=P(),ye=l(),ve=l(),we=P(),Ee=P(),xe=P(),Te=P(),je=P(),Le=P(),ze=r(),Ce=r(),Ae=i(),Me=i(),Re=P(),Ve=P(),Fe=w(),Oe=w(),Be=P(),Ue=P(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],We=z(),ke=z(),De=z(),Ye=z(),Je=4,qe=[P(),P()];export{pe as Parameters,le as RibbonLineMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{direction as t,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{polygonOffset as r}from"./PolygonOffset.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";function f(n,o,e,f){c.output=o.transparent?1:0,c.polygonOffset=o.polygonOffset,c.enableOITOffset=o.enableOITOffset;const s=r(c);if(!s)return n;const i=t(m,f,e);return(t,o,r)=>n(a(s,i,t,o),o,r)}function s(n,o,e,f,s){const i=r(e);return i?a(i,t(m,s,f),n,o):n}function i(t,n,o){return null==t?null:(t.distance=s(t.distance,t.hasNormal?t.normal:null,n,o,t.point),t)}function a({units:t,factor:o},r,e,f){const s=u*t;return e+((f?1-Math.abs(n(r,f)):0)*o*l+s)}const c=new e,l=2e-5,u=2e-6,m=o();export{s as applyPolygonOffsetToDistance,i as applyPolygonOffsetToHit,f as intersectWithPolygonOffset};
2
+ import{direction as t,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{polygonOffset as r}from"./PolygonOffset.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";function s(o,e,s,f){c.output=e.transparent?1:0,c.polygonOffset=e.polygonOffset,c.enableOITOffset=e.enableOITOffset;const i=r(c);if(!i)return o;const a=l*i.units,p=t(m,f,s);return(t,r,e,s)=>{const f=(e?1-Math.abs(n(p,e)):0)*i.factor*u+a;return o(t,r+f,e,s)}}function f(n,o,e,s,f){const i=r(e);return i?a(i,t(m,f,s),n,o):n}function i(t,n,o){return null==t?null:(t.distance=f(t.distance,t.hasNormal?t.normal:null,n,o,t.point),t)}function a({units:t,factor:o},r,e,s){const f=l*t;return e+((s?1-Math.abs(n(r,s)):0)*o*u+f)}const c=new e,u=2e-5,l=2e-6,m=o();export{f as applyPolygonOffsetToDistance,i as applyPolygonOffsetToHit,s as intersectWithPolygonOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as r}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../chunks/FocusAreaMask.glsl.js";import{PrimitiveType as a}from"../../../webgl/enums.js";import{makePipelineState as t,separateStencilTestParams as c}from"../../../webgl/renderState.js";let l=class extends i{constructor(){super(...arguments),this.shader=new r(o,()=>import("../effects/focusArea/FocusAreaMask.glsl.js")),this.ignoreUnused=!0,this.primitiveType=a.TRIANGLE_STRIP}initializePipeline(){return t({depthTest:{func:513},stencilTest:c(0,255,{compare:519,fail:7680,zFail:34055,zPass:7680},{compare:519,fail:7680,zFail:34056,zPass:7680}),stencilWrite:{mask:255}})}};l=e([s("esri.views.3d.webgl-engine.shaders.ShadowCastMaskTechnique")],l);export{l as ShadowCastMaskTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as s}from"../../../../core/accessorSupport/decorators.js";import{VolumeMaskTechnique as i}from"./VolumeMaskTechnique.js";import{PrimitiveType as r}from"../../../webgl/enums.js";import{makePipelineState as t,separateStencilTestParams as o}from"../../../webgl/renderState.js";let a=class extends i{constructor(){super(...arguments),this.ignoreUnused=!0,this.primitiveType=r.TRIANGLE_STRIP}initializePipeline(){return t({depthTest:{func:513},stencilTest:o(0,255,{compare:519,fail:7680,zFail:34055,zPass:7680},{compare:519,fail:7680,zFail:34056,zPass:7680}),stencilWrite:{mask:255}})}};a=e([s("esri.views.3d.webgl-engine.shaders.ShadowCastMaskTechnique")],a);export{a as ShadowCastMaskTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillMaskDrawParameters,b as build}from"../../../../chunks/CutFillMask.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{V as VolumeMaskDrawParameters,b as build}from"../../../../chunks/VolumeMask.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{Pos3 as t}from"../lib/DefaultVertexBufferLayouts.js";import{a as i}from"../../../../chunks/VolumeMask.glsl.js";import{makePipelineState as a,defaultColorWrite as l}from"../../../webgl/renderState.js";let m=class extends o{constructor(e,r){super(e,r,t),this.shader=new s(i,()=>import("./VolumeMask.glsl.js"))}initializePipeline(){return a({colorWrite:l,depthTest:{func:515}})}};m=e([r("esri.views.3d.webgl-engine.shaders.VolumeMaskTechnique")],m);export{m as VolumeMaskTechnique};