@arcgis/core 6.0.0-next.56 → 6.0.0-next.58

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 (695) hide show
  1. package/WebLinkChart.d.ts +0 -12
  2. package/WebLinkChart.js +1 -1
  3. package/applications/Components/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  4. package/applications/WebEditor/sketchUtils.js +1 -1
  5. package/arcade/arcadeCompiler.js +5 -5
  6. package/arcade/containerUtils.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  10. package/arcade/featureset/support/shared.js +1 -1
  11. package/arcade/featureset/support/sqlUtils.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/00c227bcecc28fe278bb.js +1 -0
  14. package/assets/esri/core/workers/chunks/075e6c60e741482e673f.js +1 -0
  15. package/assets/esri/core/workers/chunks/076c2098570ee885d117.js +1 -0
  16. package/assets/esri/core/workers/chunks/091ce6b3de590e1d9ff6.js +1 -0
  17. package/assets/esri/core/workers/chunks/099dec4103f6e7556eb0.js +1 -0
  18. package/assets/esri/core/workers/chunks/{77267e0807cbbc00496d.js → 0be55d9bab7c3510a7f2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{da69e8cd52aa77aa4c2c.js → 0fc1facd26c9ef96e081.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{f97dc99afe3375fc8e16.js → 1179a3574c580f7ce390.js} +1 -1
  21. package/assets/esri/core/workers/chunks/129140104be2620c0382.js +1 -0
  22. package/assets/esri/core/workers/chunks/1295fcf866e7347b2d53.js +1 -0
  23. package/assets/esri/core/workers/chunks/16219f0c56d6f6213c24.js +1 -0
  24. package/assets/esri/core/workers/chunks/185b317eec95f3370970.js +1 -0
  25. package/assets/esri/core/workers/chunks/1afc8820c283ef785729.js +1 -0
  26. package/assets/esri/core/workers/chunks/1bdef2e142e78341fec0.js +1 -0
  27. package/assets/esri/core/workers/chunks/1c874f86bfd0963aa3d2.js +1 -0
  28. package/assets/esri/core/workers/chunks/1ce0bf4ff14af8a68a5c.js +1 -0
  29. package/assets/esri/core/workers/chunks/1f1515313baeecc095a2.js +1 -0
  30. package/assets/esri/core/workers/chunks/1f710c91a82f6fd3d0f6.js +1 -0
  31. package/assets/esri/core/workers/chunks/{1894c39dabc78e7a5af8.js → 1fad7a7211bb8c9b58e3.js} +1 -1
  32. package/assets/esri/core/workers/chunks/24374aaa6fb3e12960d1.js +1 -0
  33. package/assets/esri/core/workers/chunks/24aa7b81814b4e519b01.js +1 -0
  34. package/assets/esri/core/workers/chunks/294097140e349e073b7e.js +1 -0
  35. package/assets/esri/core/workers/chunks/{c8c79d21dfce5695a089.js → 2b69fdf51b6f0b2abb75.js} +1 -1
  36. package/assets/esri/core/workers/chunks/2ba9b3b4d49eb2740a42.js +1 -0
  37. package/assets/esri/core/workers/chunks/2eb3297014f063fb4bc9.js +1 -0
  38. package/assets/esri/core/workers/chunks/2eb3cec44ce7587980a4.js +1 -0
  39. package/assets/esri/core/workers/chunks/2ee3cd6b2e5274932d31.js +1 -0
  40. package/assets/esri/core/workers/chunks/2f31766bc0f9d1d70c5a.js +1 -0
  41. package/assets/esri/core/workers/chunks/31df02c6f5b04a143ae6.js +1 -0
  42. package/assets/esri/core/workers/chunks/32d5aae2e0953420216a.js +1 -0
  43. package/assets/esri/core/workers/chunks/35109db6a6be66f895f7.js +1 -0
  44. package/assets/esri/core/workers/chunks/373b140f92eda3857f82.js +1 -0
  45. package/assets/esri/core/workers/chunks/3a1510650ce8de7edec8.js +1 -0
  46. package/assets/esri/core/workers/chunks/3b0933cea2a902a26bb7.js +1 -0
  47. package/assets/esri/core/workers/chunks/3d96676b94e8ecb6a4d1.js +1 -0
  48. package/assets/esri/core/workers/chunks/3edfd8ecf000b00a4a92.js +1 -0
  49. package/assets/esri/core/workers/chunks/3fc4b7d0ee460fc96176.js +1 -0
  50. package/assets/esri/core/workers/chunks/{f053cbfe671bd14c7d5b.js → 419d8116d8e7faccfed5.js} +1 -1
  51. package/assets/esri/core/workers/chunks/41d57b45cc2361305af3.js +1 -0
  52. package/assets/esri/core/workers/chunks/42ee1f8732e644371ea9.js +1 -0
  53. package/assets/esri/core/workers/chunks/4309f3e72c6332e01d75.js +1 -0
  54. package/assets/esri/core/workers/chunks/44ca7a56fb28227fdcbf.js +1 -0
  55. package/assets/esri/core/workers/chunks/4537f0866e903d2e9bb9.js +1 -0
  56. package/assets/esri/core/workers/chunks/49f61832e0d3b24e1608.js +1 -0
  57. package/assets/esri/core/workers/chunks/4a45505fb9a40b503672.js +29 -0
  58. package/assets/esri/core/workers/chunks/4b456c1f26d70392f7d4.js +1 -0
  59. package/assets/esri/core/workers/chunks/{28fae7da8cc4ae7a83e4.js → 4c510b1caffeec80dc6b.js} +1 -1
  60. package/assets/esri/core/workers/chunks/4ce5c9b658ba79a0b668.js +1 -0
  61. package/assets/esri/core/workers/chunks/{41694ee8990e799da225.js → 4d8f23b2e6721fb5b289.js} +1 -1
  62. package/assets/esri/core/workers/chunks/4fb8708666a614df583d.js +1 -0
  63. package/assets/esri/core/workers/chunks/4feec96a312dcc137911.js +1 -0
  64. package/assets/esri/core/workers/chunks/52ad9306fd40d488376d.js +1 -0
  65. package/assets/esri/core/workers/chunks/5375bdf46b602b19fa86.js +1 -0
  66. package/assets/esri/core/workers/chunks/549a8e7313f75ea3f85b.js +1 -0
  67. package/assets/esri/core/workers/chunks/55f97942c58455f47975.js +1 -0
  68. package/assets/esri/core/workers/chunks/566d72534d694c318e30.js +1 -0
  69. package/assets/esri/core/workers/chunks/5ce00674305e5716d27b.js +1 -0
  70. package/assets/esri/core/workers/chunks/5e032d209df500fad321.js +1 -0
  71. package/assets/esri/core/workers/chunks/{dfa1b0308e5e82d1ddfe.js → 5e4de4ddd3bdc74100e0.js} +34 -33
  72. package/assets/esri/core/workers/chunks/5ea8cdc28a81744913cd.js +1 -0
  73. package/assets/esri/core/workers/chunks/61565d4674cf77cbf1dd.js +1 -0
  74. package/assets/esri/core/workers/chunks/651e33be8bb3995d749f.js +1 -0
  75. package/assets/esri/core/workers/chunks/{d296c9561f6a6aeff973.js → 68b8dff748f1ef588653.js} +1 -1
  76. package/assets/esri/core/workers/chunks/690041373d03d02a3044.js +1 -0
  77. package/assets/esri/core/workers/chunks/{6d99e7e1aa007a6f1039.js → 69316db52d7bed746879.js} +1 -1
  78. package/assets/esri/core/workers/chunks/69384a9703abee1903c5.js +1 -0
  79. package/assets/esri/core/workers/chunks/6992a7728451c5a7b673.js +1 -0
  80. package/assets/esri/core/workers/chunks/69e5efe1acbdaddee90d.js +1 -0
  81. package/assets/esri/core/workers/chunks/6b2e09e43f449020d5ad.js +1 -0
  82. package/assets/esri/core/workers/chunks/6b5f8bf8b3480910666d.js +1 -0
  83. package/assets/esri/core/workers/chunks/70fe8b90f174ec64db2e.js +1 -0
  84. package/assets/esri/core/workers/chunks/720356fc6d5e18008471.js +1 -0
  85. package/assets/esri/core/workers/chunks/721f43554b9654481de7.js +1 -0
  86. package/assets/esri/core/workers/chunks/{3869ea1be105eaad4a38.js → 7328aca34c95fd0fc752.js} +1 -1
  87. package/assets/esri/core/workers/chunks/789567124c4a15235952.js +1 -0
  88. package/assets/esri/core/workers/chunks/{a24dc5350af001db417a.js → 7affab0d0692bdb76036.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{b6e628b5d2643af4c19b.js → 7b4063f45b45ad8a7289.js} +1 -1
  90. package/assets/esri/core/workers/chunks/7c22d3669087f38c92b9.js +1 -0
  91. package/assets/esri/core/workers/chunks/7cb7bdc30f970eb9ff7f.js +1 -0
  92. package/assets/esri/core/workers/chunks/7d71cf65bbc1b3308856.js +1 -0
  93. package/assets/esri/core/workers/chunks/81cdb9705f7eee9e792f.js +1 -0
  94. package/assets/esri/core/workers/chunks/821003fe1be30d5d29aa.js +1 -0
  95. package/assets/esri/core/workers/chunks/822b9c1e172c835b9624.js +1 -0
  96. package/assets/esri/core/workers/chunks/{a7dfca326883384d2751.js → 823228f1fa6ba4e8bff2.js} +1 -1
  97. package/assets/esri/core/workers/chunks/84021d57822f374217ef.js +1 -0
  98. package/assets/esri/core/workers/chunks/847ec6b337cfb2e4a15b.js +1 -0
  99. package/assets/esri/core/workers/chunks/84f41ddd7366bfbf5b25.js +1 -0
  100. package/assets/esri/core/workers/chunks/8920d0b11951b57d6a66.js +1 -0
  101. package/assets/esri/core/workers/chunks/{c6e7c95391a54978402b.js → 893363ee500fc1288781.js} +1 -1
  102. package/assets/esri/core/workers/chunks/8b0cdbbf5c81283eae13.js +1 -0
  103. package/assets/esri/core/workers/chunks/{7850e306d7cd12653b23.js → 90de2f93b0ba1eb337fd.js} +1 -1
  104. package/assets/esri/core/workers/chunks/91b0035e3eae9e452fbc.js +1 -0
  105. package/assets/esri/core/workers/chunks/92d97e0fcc20dd5f5ac4.js +1 -0
  106. package/assets/esri/core/workers/chunks/93262d3616ac0cc4b532.js +1 -0
  107. package/assets/esri/core/workers/chunks/9748a0db6451336d51ef.js +1 -0
  108. package/assets/esri/core/workers/chunks/{69a09c6acb5ae03c67f6.js → 985ce51da8ae4984a4db.js} +1 -1
  109. package/assets/esri/core/workers/chunks/9bbff9230298b1bac46a.js +1 -0
  110. package/assets/esri/core/workers/chunks/9ca84fa9423654061d05.js +1 -0
  111. package/assets/esri/core/workers/chunks/9cae59db5b9cb37baea9.js +1 -0
  112. package/assets/esri/core/workers/chunks/{ed2626a895ca1d4a7216.js → 9dbb9e74754392b066a8.js} +1 -1
  113. package/assets/esri/core/workers/chunks/9dd3863b9d7c1a5ea20a.js +1 -0
  114. package/assets/esri/core/workers/chunks/9e62cfcb4e0188d51294.js +1 -0
  115. package/assets/esri/core/workers/chunks/a2a3edec2ee31273d609.js +1 -0
  116. package/assets/esri/core/workers/chunks/{d0e8d0f8b4e4cc13e837.js → a301aa62a03d3618eba9.js} +1 -1
  117. package/assets/esri/core/workers/chunks/a39d595fc11afedc1875.js +1 -0
  118. package/assets/esri/core/workers/chunks/a57b506c538e2186909d.js +1 -0
  119. package/assets/esri/core/workers/chunks/a722114f01e66a608cec.js +1 -0
  120. package/assets/esri/core/workers/chunks/{5bda285f6ecf725676b3.js → a7b4821fd3080cf2756f.js} +1 -1
  121. package/assets/esri/core/workers/chunks/a8d91c2654c5012400b4.js +1 -0
  122. package/assets/esri/core/workers/chunks/aa70d98e6bcbd06a8461.js +1 -0
  123. package/assets/esri/core/workers/chunks/add538f52c7bcfd154da.js +1 -0
  124. package/assets/esri/core/workers/chunks/ae0b0a562f0ab57e1883.js +1 -0
  125. package/assets/esri/core/workers/chunks/b10c534cbe311d17b7d5.js +1 -0
  126. package/assets/esri/core/workers/chunks/b2c3652c8ce9597dcf89.js +1 -0
  127. package/assets/esri/core/workers/chunks/b725d944ecd5da02fd9e.js +1 -0
  128. package/assets/esri/core/workers/chunks/b7fbbbeabaa5bfcdeabc.js +1 -0
  129. package/assets/esri/core/workers/chunks/{70ead4c231cba4084cf4.js → b856ef3a949ca06a4af5.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{ae2cd50c2b938b39417b.js → b8b4f68305a4f654fa75.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{97107e64407fa6825620.js → ba324fd300b6e6a584ae.js} +1 -1
  132. package/assets/esri/core/workers/chunks/bc40b96080346b91e507.js +1 -0
  133. package/assets/esri/core/workers/chunks/c5ca8245113576b35acc.js +1 -0
  134. package/assets/esri/core/workers/chunks/{c7a0c4ca37ebd1d98cf1.js → c629a676b707138e7a1c.js} +1 -1
  135. package/assets/esri/core/workers/chunks/c8a1aa90ec6d455ff82d.js +1 -0
  136. package/assets/esri/core/workers/chunks/c8dd8b67100177109619.js +1 -0
  137. package/assets/esri/core/workers/chunks/c8eb8744f1ed9d1897dc.js +1 -0
  138. package/assets/esri/core/workers/chunks/cb0e3614b78c78040662.js +1 -0
  139. package/assets/esri/core/workers/chunks/ccc89208aad7206aabd9.js +1 -0
  140. package/assets/esri/core/workers/chunks/cebd6732fe573f79849c.js +1 -0
  141. package/assets/esri/core/workers/chunks/d22e3b5d836dffdf91cc.js +1 -0
  142. package/assets/esri/core/workers/chunks/{c5ddf8b347c31fe772a3.js → d45769f8a02abe5d2917.js} +1 -1
  143. package/assets/esri/core/workers/chunks/d4b62e78bb27272a5f83.js +1 -0
  144. package/assets/esri/core/workers/chunks/d52b2a591e5e6abaa133.js +1 -0
  145. package/assets/esri/core/workers/chunks/{0978e12dd6a1cbc50b80.js → d572b125bed40a4d02b1.js} +1 -1
  146. package/assets/esri/core/workers/chunks/d65206fea850b1fc0712.js +1 -0
  147. package/assets/esri/core/workers/chunks/d6a42c936ead00ab7ad4.js +1 -0
  148. package/assets/esri/core/workers/chunks/d77887edc10d5be39ac9.js +1 -0
  149. package/assets/esri/core/workers/chunks/d7b9c16fe73f50a41099.js +1 -0
  150. package/assets/esri/core/workers/chunks/{7b6fd287e7043ad50f4e.js → d9bf0be2323e9df55834.js} +1 -1
  151. package/assets/esri/core/workers/chunks/dab98890d77a6b0b2741.js +1 -0
  152. package/assets/esri/core/workers/chunks/e2ac387e154d68fd10ca.js +1 -0
  153. package/assets/esri/core/workers/chunks/e39259ff441fb67cd3e4.js +1 -0
  154. package/assets/esri/core/workers/chunks/e3c152eeaa1c95f0f2d2.js +1 -0
  155. package/assets/esri/core/workers/chunks/e42e9dd3c933f5f864ab.js +1 -0
  156. package/assets/esri/core/workers/chunks/e4ae0fad312467f218df.js +1 -0
  157. package/assets/esri/core/workers/chunks/e50cc686db878d0a9399.js +1 -0
  158. package/assets/esri/core/workers/chunks/e7cd5eeb15d3783f803d.js +1 -0
  159. package/assets/esri/core/workers/chunks/e8042584e422044ca1d1.js +1 -0
  160. package/assets/esri/core/workers/chunks/e89640667b71c1bb4ee3.js +1 -0
  161. package/assets/esri/core/workers/chunks/e9649aa2d0fdd28d91ac.js +1 -0
  162. package/assets/esri/core/workers/chunks/ee31801144602ce816d3.js +1 -0
  163. package/assets/esri/core/workers/chunks/eff8a1a880e0eb1a6814.js +1 -0
  164. package/assets/esri/core/workers/chunks/f2b7c61462f530d812c4.js +1 -0
  165. package/assets/esri/core/workers/chunks/f56404d401dfbce29473.js +1 -0
  166. package/assets/esri/core/workers/chunks/f87416f2aa791cd1bebe.js +1 -0
  167. package/assets/esri/core/workers/chunks/{f3744b12a5d0d8ca8621.js → fa65aafac2b99478c32a.js} +1 -1
  168. package/assets/esri/core/workers/chunks/fb14a0c8d2edf868838c.js +1 -0
  169. package/assets/esri/core/workers/chunks/fb8a24aa04bd2fa43241.js +1 -0
  170. package/assets/esri/core/workers/chunks/fbb27d2cef962f725180.js +1 -0
  171. package/assets/esri/core/workers/chunks/{3c6e7dcb79d13e8aecc5.js → fc965ace82bef4c6111b.js} +1 -1
  172. package/assets/esri/core/workers/chunks/{5954f02c3901b28d8e73.js → fd9382e5207b6da74b91.js} +1 -1
  173. package/assets/esri/core/workers/chunks/fdb370546be4ad552959.js +1 -0
  174. package/assets/esri/core/workers/chunks/fefac70ebe29dff54b4c.js +1 -0
  175. package/chunks/BlurEmission.glsl.js +4 -17
  176. package/chunks/Bufferer-CclWhXVb.js +1 -1
  177. package/chunks/ColorMaterial.glsl.js +1 -1
  178. package/chunks/Component.glsl.js +2 -1
  179. package/chunks/EmissionComposite.glsl.js +2 -2
  180. package/chunks/Envelope.js +1 -1
  181. package/chunks/Envelope2D.js +1 -1
  182. package/chunks/Fog.glsl.js +3 -3
  183. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  184. package/chunks/GlobalIllumination.glsl.js +12 -11
  185. package/chunks/GlobalIlluminationBlur.glsl.js +6 -4
  186. package/chunks/ImageMaterial.glsl.js +1 -1
  187. package/chunks/LineMarker.glsl.js +2 -2
  188. package/chunks/MultiPathImpl.js +1 -1
  189. package/chunks/OperatorGeodesicBuffer.js +1 -1
  190. package/chunks/OperatorGeodeticArea.js +1 -1
  191. package/chunks/OperatorShapePreservingProject.js +1 -1
  192. package/chunks/Point2D.js +1 -1
  193. package/chunks/RealisticAtmosphere.glsl.js +7 -9
  194. package/chunks/RealisticAtmosphereCompositing.glsl.js +6 -10
  195. package/chunks/RibbonLine.glsl.js +2 -2
  196. package/chunks/Terrain.glsl.js +28 -27
  197. package/chunks/UPCPointRenderer.glsl.js +100 -0
  198. package/chunks/UnitFactory.js +1 -1
  199. package/chunks/Water.glsl.js +25 -24
  200. package/chunks/arcade.js +1 -1
  201. package/chunks/arcgis-knowledge-client-core-simd.js +4 -4
  202. package/chunks/arcgis-knowledge-client-core.js +4 -4
  203. package/chunks/array.js +1 -1
  204. package/chunks/basis_encoder.js +3 -3
  205. package/chunks/basis_transcoder.js +2 -2
  206. package/chunks/draco_mesh_decoder.js +2 -2
  207. package/chunks/dxt_encoder.js +3 -3
  208. package/chunks/i3s.js +2 -2
  209. package/chunks/languageUtils.js +1 -1
  210. package/chunks/lclayout.js +3 -3
  211. package/chunks/lerc-wasm.js +1 -1
  212. package/chunks/lyr3DWorker.js +2 -2
  213. package/chunks/pe.js +1 -1
  214. package/chunks/projector.js +1 -1
  215. package/chunks/qb3-wasm.js +1 -1
  216. package/chunks/vxlLayer.js +2 -2
  217. package/colorUtils.js +1 -1
  218. package/config.js +1 -1
  219. package/core/AsyncUpdate.js +1 -1
  220. package/core/Clonable.js +1 -1
  221. package/core/Identifiable.js +1 -1
  222. package/core/Loadable.js +1 -1
  223. package/core/MultiOriginJSONSupport.js +1 -1
  224. package/core/NumericIdentifiable.js +1 -1
  225. package/core/Promise.js +1 -1
  226. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  227. package/core/accessorSupport/metadata.js +1 -1
  228. package/core/accessorSupport/trackingUtils.js +1 -1
  229. package/core/asyncUtils.js +1 -1
  230. package/core/handleUtils.js +1 -1
  231. package/core/mapCollectionUtils.js +1 -1
  232. package/core/memoryEstimations.js +1 -1
  233. package/core/reactiveUtils.js +1 -1
  234. package/core/sql/SqlTimestampOffset.js +1 -1
  235. package/core/sql/WhereClause.js +1 -1
  236. package/core/sql/WhereGrammar.js +1 -1
  237. package/core/sql/writeUtils.js +1 -1
  238. package/core/sql.js +1 -1
  239. package/core/urlUtils.js +1 -1
  240. package/core/workers/workers.js +1 -1
  241. package/geohash/GeohashCell.js +1 -1
  242. package/geohash/GeohashTree.js +1 -1
  243. package/geometry/coordinateConversion/CoordinateConversionModel.d.ts +11 -56
  244. package/geometry/coordinateConversion/support/Conversion.d.ts +5 -17
  245. package/geometry/coordinateConversion/support/Format.d.ts +6 -30
  246. package/geometry/coordinateConversion/types.d.ts +15 -15
  247. package/geometry/operators/reshapeOperator.js +1 -1
  248. package/geometry/support/MeshMaterial.js +1 -1
  249. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  250. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  251. package/graphic/AggregateGraphicOrigin.js +1 -1
  252. package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
  253. package/graphic/BuildingGraphicOrigin.js +1 -1
  254. package/graphic/CSVGraphicOrigin.js +1 -1
  255. package/graphic/CatalogGraphicOrigin.js +1 -1
  256. package/graphic/DimensionFeatureGraphicOrigin.js +1 -1
  257. package/graphic/FeatureGraphicOrigin.js +1 -1
  258. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  259. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  260. package/graphic/ImageryGraphicOrigin.js +1 -1
  261. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  262. package/graphic/KMLGraphicOrigin.js +1 -1
  263. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  264. package/graphic/LinkChartGraphicOrigin.js +1 -1
  265. package/graphic/MapImageGraphicOrigin.js +1 -1
  266. package/graphic/MapNotesGraphicOrigin.js +1 -1
  267. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  268. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  269. package/graphic/ParquetGraphicOrigin.js +1 -1
  270. package/graphic/PointCloudGraphicOrigin.js +1 -1
  271. package/graphic/SceneGraphicOrigin.js +1 -1
  272. package/graphic/SketchGraphicOrigin.js +1 -1
  273. package/graphic/StreamGraphicOrigin.js +1 -1
  274. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  275. package/graphic/TileGraphicOrigin.js +1 -1
  276. package/graphic/TrackGraphicOrigin.js +1 -1
  277. package/graphic/VectorTileGraphicOrigin.js +1 -1
  278. package/graphic/VoxelGraphicOrigin.js +1 -1
  279. package/graphic/WCSGraphicOrigin.js +1 -1
  280. package/graphic/WFSGraphicOrigin.js +1 -1
  281. package/graphic/getLayerViewLayer.js +2 -0
  282. package/identity/IdentityManagerBase.js +1 -1
  283. package/interfaces.d.ts +0 -1
  284. package/kernel.js +1 -1
  285. package/layers/ElevationLayer.js +1 -1
  286. package/layers/LinkChartLayer.d.ts +1 -1
  287. package/layers/LinkChartLayer.js +1 -1
  288. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  289. package/layers/PointCloudLayer.js +3 -3
  290. package/layers/VectorTileLayer.d.ts +17 -10
  291. package/layers/VoxelWasmPerSceneView.js +1 -1
  292. package/layers/WMTSLayer.js +1 -1
  293. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  294. package/layers/graphics/dehydratedFeatures.js +1 -1
  295. package/layers/graphics/transferFeatures.js +1 -1
  296. package/layers/knowledgeGraph/KnowledgeGraphSublayerBase.js +1 -1
  297. package/layers/mixins/APIKeyMixin.js +1 -1
  298. package/layers/mixins/ArcGISCachedService.js +1 -1
  299. package/layers/mixins/ArcGISImageService.js +1 -1
  300. package/layers/mixins/ArcGISMapService.js +1 -1
  301. package/layers/mixins/ArcGISService.js +1 -1
  302. package/layers/mixins/BlendLayer.js +1 -1
  303. package/layers/mixins/CustomParametersMixin.js +1 -1
  304. package/layers/mixins/DataElementMixin.js +1 -1
  305. package/layers/mixins/DataSeriesLayer.js +1 -1
  306. package/layers/mixins/DisplayFilteredLayer.js +1 -1
  307. package/layers/mixins/EditBusLayer.js +1 -1
  308. package/layers/mixins/FeatureEffectLayer.js +1 -1
  309. package/layers/mixins/FeatureLayerBase.js +1 -1
  310. package/layers/mixins/FeatureReductionLayer.js +1 -1
  311. package/layers/mixins/HeightModelInfoMixin.js +1 -1
  312. package/layers/mixins/OperationalLayer.js +1 -1
  313. package/layers/mixins/OrderedLayer.js +1 -1
  314. package/layers/mixins/PortalLayer.js +1 -1
  315. package/layers/mixins/PublishableLayer.js +1 -1
  316. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  317. package/layers/mixins/RasterPresetRendererMixin.js +1 -1
  318. package/layers/mixins/RefreshableLayer.js +1 -1
  319. package/layers/mixins/ReloadableLayer.js +1 -1
  320. package/layers/mixins/ScaleRangeLayer.js +1 -1
  321. package/layers/mixins/SceneService.js +1 -1
  322. package/layers/mixins/SublayersOwner.js +1 -1
  323. package/layers/mixins/TemporalLayer.js +1 -1
  324. package/layers/mixins/TrackableLayer.js +1 -1
  325. package/layers/orientedImagery/transformations/utils.js +1 -1
  326. package/layers/raster/datasets/TIFFRaster.js +1 -1
  327. package/layers/raster/datasets/pixelReader.js +1 -1
  328. package/layers/raster/datasets/xmlUtilities.js +1 -1
  329. package/layers/raster/formats/Lerc.js +1 -1
  330. package/layers/raster/formats/Qb3.js +1 -1
  331. package/layers/raster/formats/TiffDecoder.js +1 -1
  332. package/layers/raster/formats/blosc.js +1 -1
  333. package/layers/raster/formats/tiffParser.js +1 -1
  334. package/layers/raster/formats/tiffSpatialReferenceUtils.js +2 -0
  335. package/layers/raster/formats/tiffTag.js +1 -1
  336. package/layers/raster/functions/colormaps.js +1 -1
  337. package/layers/support/TitleCreator.js +1 -1
  338. package/layers/support/WMTSSublayer.js +1 -1
  339. package/layers/support/fieldUtils.d.ts +129 -57
  340. package/layers/support/fieldUtils.js +1 -1
  341. package/layers/support/geospatialPDFUtils.js +1 -1
  342. package/layers/support/imageUtils.js +1 -1
  343. package/layers/support/labelUtils.js +1 -1
  344. package/layers/support/tiles3DUtils.js +1 -1
  345. package/layers/video/VideoController.js +14 -14
  346. package/legend/ActiveLayerInfo.js +1 -1
  347. package/legend/support/sizeRampUtils.js +1 -1
  348. package/libs/basisu/BasisUEncoder.js +1 -1
  349. package/libs/basisu/BasisUTranscoder.js +1 -1
  350. package/libs/dracoMeshDecoder/dracoMeshDecoder.js +1 -1
  351. package/libs/dxtEncoder/DXTEncoder.js +1 -1
  352. package/libs/i3s/I3SModule.js +1 -1
  353. package/libs/librust-parquet/loadParquetModule.js +1 -1
  354. package/libs/librust-text/loadTextModule.js +1 -1
  355. package/libs/linkchartlayout/LinkChartLayout.js +1 -1
  356. package/libs/maquette-advanced-projector/projector.js +1 -1
  357. package/networks/Network.js +1 -1
  358. package/networks/support/TopologyValidationJobInfo.js +1 -1
  359. package/package.json +2 -2
  360. package/popup/FeaturesModel.d.ts +6 -0
  361. package/popup/FeaturesModel.js +1 -1
  362. package/portal/PortalUser.js +1 -1
  363. package/renderers/mixins/VisualVariablesMixin.js +1 -1
  364. package/renderers/visualVariables/VisualVariableFactory.js +1 -1
  365. package/rest/identify.js +1 -1
  366. package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
  367. package/rest/layerSources/utils.js +1 -1
  368. package/rest/networks/validateNetworkTopology.js +1 -1
  369. package/rest/support/CameraInfoMixin.js +1 -1
  370. package/rest/support/NormalizationBinParametersMixin.js +1 -1
  371. package/rest/support/generateRendererUtils.js +1 -1
  372. package/smartMapping/raster/renderers/vectorField.js +1 -1
  373. package/smartMapping/renderers/type.js +1 -1
  374. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  375. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  376. package/smartMapping/symbology/color.js +1 -1
  377. package/smartMapping/symbology/support/Theme.js +1 -1
  378. package/support/BasemapStyle.js +1 -1
  379. package/support/LayersMixin.js +1 -1
  380. package/support/TablesMixin.js +1 -1
  381. package/support/actions/ActionBase.d.ts +14 -2
  382. package/support/actions/ActionBase.js +1 -1
  383. package/support/actions/ActionButton.js +1 -1
  384. package/support/actions/ActionToggle.js +1 -1
  385. package/support/loadArcade.js +1 -1
  386. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  387. package/views/2d/engine/flow/utils.js +1 -1
  388. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  389. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  390. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  391. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  392. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  393. package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
  394. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  395. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/bitmapUtils.js +1 -1
  396. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  397. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  398. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  399. package/views/2d/layerViewModuleImportUtils.js +1 -1
  400. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  401. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  402. package/views/2d/layers/LayerView2D.js +1 -1
  403. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  404. package/views/2d/layers/TileLayerView2D.js +1 -1
  405. package/views/2d/layers/features/FeatureContainer.js +1 -1
  406. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  407. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  408. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  409. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  410. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  411. package/views/3d/GroundView3D.js +1 -1
  412. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  413. package/views/3d/layerViewModuleImportUtils.js +1 -1
  414. package/views/3d/layers/BuildingSublayerView3D.js +1 -1
  415. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  416. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  417. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  418. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  419. package/views/3d/layers/I3SMeshView3D.js +1 -1
  420. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  421. package/views/3d/layers/LayerView3D.js +1 -1
  422. package/views/3d/layers/Lyr3DWorker.js +1 -1
  423. package/views/3d/layers/PointCloudIntersector.js +2 -0
  424. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  425. package/views/3d/layers/SceneLayerWorker.js +1 -1
  426. package/views/3d/layers/TiledLayerView3D.js +1 -1
  427. package/views/3d/layers/UPCPointRenderer.js +2 -0
  428. package/views/3d/layers/UPCPointRendererNode.js +2 -0
  429. package/views/3d/layers/UpdatablePointCloudLayerView3D.js +2 -0
  430. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  431. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  432. package/views/3d/layers/i3s/PointCloudHighlights.js +1 -1
  433. package/views/3d/layers/i3s/PointCloudNodeHighlights.js +2 -0
  434. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  435. package/views/3d/layers/i3s/PointCloudRendererNode.js +1 -1
  436. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  437. package/views/3d/layers/support/GraphicsProcessorLayerView3D.js +1 -1
  438. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  439. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  440. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  441. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  442. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  443. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  444. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  445. package/views/3d/support/GroundAndIMSurface.js +1 -1
  446. package/views/3d/support/QualityProfile.js +1 -1
  447. package/views/3d/support/QualitySettings.js +1 -1
  448. package/views/3d/support/cameraUtils.js +1 -1
  449. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  450. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  451. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  452. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  453. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  454. package/views/3d/terrain/TerrainRenderer.js +1 -1
  455. package/views/3d/webgl/RenderNode.js +1 -1
  456. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  457. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  458. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  459. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  460. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +9 -9
  461. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  462. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  463. package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
  464. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  465. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +19 -19
  466. package/views/3d/webgl-engine/core/shaderLibrary/lastFrameUniforms.js +1 -1
  467. package/views/3d/webgl-engine/core/shaderLibrary/outputEmission.glsl.js +5 -0
  468. package/views/3d/webgl-engine/core/shaderLibrary/{util/CloudsParallaxShading.glsl.js → renderClouds.glsl.js} +5 -4
  469. package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +2 -2
  470. package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +1 -5
  471. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +7 -7
  472. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +15 -12
  473. package/views/3d/webgl-engine/core/shaderLibrary/terrain/blendLayers.glsl.js +9 -9
  474. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  475. package/views/3d/webgl-engine/core/shaderModules/glsl.js +1 -1
  476. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  477. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  478. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  479. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.glsl.js +1 -1
  480. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.js +1 -1
  481. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositing.glsl.js +1 -1
  482. package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereConfiguration.js +1 -1
  483. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  484. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  485. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  486. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
  487. package/views/3d/webgl-engine/effects/globalIllumination/globalIlluminationUniforms.js +1 -1
  488. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +30 -53
  489. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  490. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  491. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  492. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  493. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  494. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  495. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  496. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  497. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  498. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  499. package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
  500. package/views/3d/webgl-engine/materials/LineCalloutMaterialBaseInstance.js +1 -1
  501. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  502. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  503. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  504. package/views/3d/webgl-engine/materials/getWaterColor.glsl.js +89 -0
  505. package/views/3d/webgl-engine/materials/renderers/BufferCache.js +1 -1
  506. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +12 -14
  507. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  508. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  509. package/views/3d/webgl-engine/shaders/UPCPointRenderer.glsl.js +2 -0
  510. package/views/3d/webgl-engine/shaders/UPCPointRendererTechnique.js +2 -0
  511. package/views/3d/webgl-engine/shaders/UPCPointRendererTechniqueConfiguration.js +2 -0
  512. package/views/BreakpointsOwner.js +1 -1
  513. package/views/DOMContainer.js +1 -1
  514. package/views/PopupView.js +1 -1
  515. package/views/View.d.ts +27 -1
  516. package/views/View.js +1 -1
  517. package/views/Viewport2DBaseMixin.js +1 -1
  518. package/views/Viewport2DMixin.js +1 -1
  519. package/views/animation/pointToPoint/Animation.js +1 -1
  520. package/views/interactive/Tooltip.d.ts +1 -1
  521. package/views/interactive/Tooltip.js +1 -1
  522. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  523. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  524. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  525. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  526. package/views/layers/MapImageLayerView.js +1 -1
  527. package/views/layers/PointCloudLayerView.js +1 -1
  528. package/views/layers/RefreshableLayerView.js +1 -1
  529. package/views/layers/WMSLayerView.js +1 -1
  530. package/views/overlay/ViewOverlay.js +1 -1
  531. package/views/support/flow/utils.js +1 -1
  532. package/views/support/screenshotUtils.js +1 -1
  533. package/views/types.d.ts +15 -0
  534. package/views/webgl/AllocationTracer.js +1 -1
  535. package/views/webgl/InstanceCounter.js +1 -1
  536. package/views/webgl/RenderingContext.js +1 -1
  537. package/views/webgl/ShaderBuilder.js +23 -23
  538. package/views/webgl/ShaderTranspiler.js +1 -1
  539. package/views/webgl/capabilities/DisjointTimerQuery.js +1 -1
  540. package/views/webgl/capabilities.js +1 -1
  541. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +1 -1
  542. package/widgets/CoordinateConversion/support/Conversion.d.ts +1 -0
  543. package/widgets/CoordinateConversion/support/Format.d.ts +1 -0
  544. package/widgets/Editor/EditorViewModel.js +1 -1
  545. package/widgets/Editor/workflowUtils.js +1 -1
  546. package/widgets/Feature/support/FeatureContentMixin.js +1 -1
  547. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
  548. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  549. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  550. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  551. package/widgets/OrientedImageryViewer/mixins/DrawHandlerMixin.js +1 -1
  552. package/widgets/OrientedImageryViewer/mixins/ImageMeasurementMixin.js +1 -1
  553. package/widgets/OrientedImageryViewer/mixins/SketchHandlerMixin.js +1 -1
  554. package/widgets/OrientedImageryViewer/mixins/TriangulatedImageMeasurementMixin.js +1 -1
  555. package/widgets/OrientedImageryViewer/mixins/TriangulatedSketchHandlerMixin.js +1 -1
  556. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  557. package/widgets/Sketch/support/ResponsiveToolbar/ToolbarGroupBase.js +1 -1
  558. package/widgets/smartMapping/support/utils.js +1 -1
  559. package/widgets/support/AnalysisViewModelMixin.js +1 -1
  560. package/widgets/support/AnchorElementViewModel.js +1 -1
  561. package/widgets/support/GoTo.js +1 -1
  562. package/widgets/support/InteractiveToolViewModelMixin.js +1 -1
  563. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +0 -1
  564. package/assets/esri/core/workers/chunks/04f09e1afda92cbe09f5.js +0 -1
  565. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +0 -1
  566. package/assets/esri/core/workers/chunks/0b74d353f80974ff6fea.js +0 -1
  567. package/assets/esri/core/workers/chunks/0e100855bb3832a68e4b.js +0 -1
  568. package/assets/esri/core/workers/chunks/0ede8ba757fd0976d485.js +0 -1
  569. package/assets/esri/core/workers/chunks/0f39576806866cff777d.js +0 -1
  570. package/assets/esri/core/workers/chunks/0fea695721a818955abf.js +0 -1
  571. package/assets/esri/core/workers/chunks/110f78d5e78732750097.js +0 -1
  572. package/assets/esri/core/workers/chunks/1507297550c3cd1268e2.js +0 -1
  573. package/assets/esri/core/workers/chunks/193a73a2c7f4f8482c21.js +0 -1
  574. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +0 -1
  575. package/assets/esri/core/workers/chunks/21aa29039a95debd7f44.js +0 -1
  576. package/assets/esri/core/workers/chunks/29b74a3ff03d3c8b65dc.js +0 -1
  577. package/assets/esri/core/workers/chunks/2ad6db80a508285a3e5d.js +0 -1
  578. package/assets/esri/core/workers/chunks/2b87d5b8931305b11ff6.js +0 -1
  579. package/assets/esri/core/workers/chunks/2d4788be418a4e5f6606.js +0 -1
  580. package/assets/esri/core/workers/chunks/2f07dc632e51fddb2d48.js +0 -1
  581. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +0 -1
  582. package/assets/esri/core/workers/chunks/3169d639ab54bf508e2c.js +0 -1
  583. package/assets/esri/core/workers/chunks/333140b18aeb5a50b654.js +0 -1
  584. package/assets/esri/core/workers/chunks/3354f1fa90f8ce4c8fde.js +0 -1
  585. package/assets/esri/core/workers/chunks/3809a8b3f31bb811d964.js +0 -1
  586. package/assets/esri/core/workers/chunks/3982409149571a827390.js +0 -1
  587. package/assets/esri/core/workers/chunks/3b11e4d2e69b7aea1d65.js +0 -1
  588. package/assets/esri/core/workers/chunks/3c1651e9e8d2e83d22df.js +0 -1
  589. package/assets/esri/core/workers/chunks/3df6631895d0a7109e00.js +0 -1
  590. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +0 -1
  591. package/assets/esri/core/workers/chunks/3f8d66d8447036f122ae.js +0 -1
  592. package/assets/esri/core/workers/chunks/420c6a14107a77ddad36.js +0 -1
  593. package/assets/esri/core/workers/chunks/421b8244d01736d82e7a.js +0 -1
  594. package/assets/esri/core/workers/chunks/4761cd436abceee858bf.js +0 -1
  595. package/assets/esri/core/workers/chunks/48b60ff59afbae865de1.js +0 -1
  596. package/assets/esri/core/workers/chunks/4953314fd9afd52b6eec.js +0 -1
  597. package/assets/esri/core/workers/chunks/4cf8bddc3e0619e34424.js +0 -1
  598. package/assets/esri/core/workers/chunks/4d0bb5e4a1d789cc0d75.js +0 -1
  599. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +0 -1
  600. package/assets/esri/core/workers/chunks/4de08ead94660025075b.js +0 -1
  601. package/assets/esri/core/workers/chunks/5060be52a380fc4920f8.js +0 -1
  602. package/assets/esri/core/workers/chunks/5082cdc3e91e1c6d1070.js +0 -1
  603. package/assets/esri/core/workers/chunks/52ded087d19a93e29d93.js +0 -1
  604. package/assets/esri/core/workers/chunks/53bbb9aa6e4e4a0a8121.js +0 -1
  605. package/assets/esri/core/workers/chunks/54d3cb7d95d948998591.js +0 -1
  606. package/assets/esri/core/workers/chunks/560ebf5524ade7d1f85b.js +0 -1
  607. package/assets/esri/core/workers/chunks/56f227e1a9e51d1fd742.js +0 -1
  608. package/assets/esri/core/workers/chunks/5bd451c7db17ee8f0315.js +0 -1
  609. package/assets/esri/core/workers/chunks/5c34d49a6c9cc34b7626.js +0 -1
  610. package/assets/esri/core/workers/chunks/5d75fcaded78f76efd3e.js +0 -1
  611. package/assets/esri/core/workers/chunks/5f7505ada0991cfbdd84.js +0 -1
  612. package/assets/esri/core/workers/chunks/62ddd3a82864e26f009a.js +0 -1
  613. package/assets/esri/core/workers/chunks/6737b2a4a70bbdafaf67.js +0 -1
  614. package/assets/esri/core/workers/chunks/6a339a47e765b9937dd7.js +0 -1
  615. package/assets/esri/core/workers/chunks/6c21964eb7c25c8b1e9a.js +0 -1
  616. package/assets/esri/core/workers/chunks/6fd10891506925560443.js +0 -29
  617. package/assets/esri/core/workers/chunks/703373f529c1c334cfad.js +0 -1
  618. package/assets/esri/core/workers/chunks/71a05edd6f7f3197e621.js +0 -1
  619. package/assets/esri/core/workers/chunks/72b7e7b518c88b7569dd.js +0 -1
  620. package/assets/esri/core/workers/chunks/733c32d8091427d84de7.js +0 -1
  621. package/assets/esri/core/workers/chunks/73918ca7fdf41272d941.js +0 -1
  622. package/assets/esri/core/workers/chunks/7673217a688d739141e2.js +0 -1
  623. package/assets/esri/core/workers/chunks/76869c14dd7ffaae7eff.js +0 -1
  624. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +0 -1
  625. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +0 -1
  626. package/assets/esri/core/workers/chunks/7bd5a074d9f4ba137649.js +0 -1
  627. package/assets/esri/core/workers/chunks/7c13d7754fc914a87817.js +0 -1
  628. package/assets/esri/core/workers/chunks/7dc2e714234b2cee8701.js +0 -1
  629. package/assets/esri/core/workers/chunks/835e0315661003caa71f.js +0 -1
  630. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +0 -1
  631. package/assets/esri/core/workers/chunks/860552f49f17de2f3353.js +0 -1
  632. package/assets/esri/core/workers/chunks/86578c191d76062157ec.js +0 -1
  633. package/assets/esri/core/workers/chunks/87d6e99d83db9a8cda7c.js +0 -1
  634. package/assets/esri/core/workers/chunks/88df1b8b295d3aed649f.js +0 -1
  635. package/assets/esri/core/workers/chunks/8c9934d30655dd2c48da.js +0 -1
  636. package/assets/esri/core/workers/chunks/9117c9b720c9ba6e7a6e.js +0 -1
  637. package/assets/esri/core/workers/chunks/939fb9a8c301ace07186.js +0 -1
  638. package/assets/esri/core/workers/chunks/94a38c9b3d086b37242f.js +0 -1
  639. package/assets/esri/core/workers/chunks/98e1751f888975532afc.js +0 -1
  640. package/assets/esri/core/workers/chunks/9b727f45dfea84357b57.js +0 -1
  641. package/assets/esri/core/workers/chunks/9d61f10f2bef15b5811d.js +0 -1
  642. package/assets/esri/core/workers/chunks/9dcf5be203f8b1e47d9d.js +0 -1
  643. package/assets/esri/core/workers/chunks/9eb00bb8dab995c2dcb3.js +0 -1
  644. package/assets/esri/core/workers/chunks/9ed81757937fe08363ed.js +0 -1
  645. package/assets/esri/core/workers/chunks/9fe07947cf4ec44014e8.js +0 -1
  646. package/assets/esri/core/workers/chunks/a05a2c2aaf0c288f9681.js +0 -1
  647. package/assets/esri/core/workers/chunks/a1d265614d038eb603f7.js +0 -1
  648. package/assets/esri/core/workers/chunks/a3d02885d6962b49eee4.js +0 -1
  649. package/assets/esri/core/workers/chunks/a66d6298236d59a615db.js +0 -1
  650. package/assets/esri/core/workers/chunks/a710c7a0584d9e45a469.js +0 -1
  651. package/assets/esri/core/workers/chunks/ab76170c374fd67ce8cd.js +0 -1
  652. package/assets/esri/core/workers/chunks/ab784764ddf9d7f693a1.js +0 -1
  653. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +0 -1
  654. package/assets/esri/core/workers/chunks/aebd12488b4004e207a3.js +0 -1
  655. package/assets/esri/core/workers/chunks/b7426e5f290573cb9689.js +0 -1
  656. package/assets/esri/core/workers/chunks/b88e1084097a93a89f61.js +0 -1
  657. package/assets/esri/core/workers/chunks/baa5aa0670b23db86b50.js +0 -1
  658. package/assets/esri/core/workers/chunks/c0867890a84b4c98e0ba.js +0 -1
  659. package/assets/esri/core/workers/chunks/c1a551c4aa77f123d091.js +0 -1
  660. package/assets/esri/core/workers/chunks/c58f859dec9d6675dbd6.js +0 -1
  661. package/assets/esri/core/workers/chunks/c7425fb5e804f0f9d4dd.js +0 -1
  662. package/assets/esri/core/workers/chunks/c7b1c6d57603fa385c54.js +0 -1
  663. package/assets/esri/core/workers/chunks/c85184baccb4004bf42b.js +0 -1
  664. package/assets/esri/core/workers/chunks/ccf4b5fdcdace533bcb7.js +0 -1
  665. package/assets/esri/core/workers/chunks/cd8181600623e18f511c.js +0 -1
  666. package/assets/esri/core/workers/chunks/cef537fa9705dd1cf685.js +0 -1
  667. package/assets/esri/core/workers/chunks/d33403d578fbeecaf844.js +0 -1
  668. package/assets/esri/core/workers/chunks/d5bb6f479c0cdfc21d8a.js +0 -1
  669. package/assets/esri/core/workers/chunks/d689e7c685dd9a444d19.js +0 -1
  670. package/assets/esri/core/workers/chunks/d8b84d21144a58b6b911.js +0 -1
  671. package/assets/esri/core/workers/chunks/d8ffb1502def5c85740b.js +0 -1
  672. package/assets/esri/core/workers/chunks/db96d1d9f6d1a4d7fd2a.js +0 -1
  673. package/assets/esri/core/workers/chunks/ddbfa664e69612295785.js +0 -1
  674. package/assets/esri/core/workers/chunks/de35baceeb815e6befd5.js +0 -1
  675. package/assets/esri/core/workers/chunks/ded81c504bf44806ca7d.js +0 -1
  676. package/assets/esri/core/workers/chunks/e0466387b2ab54d706ca.js +0 -1
  677. package/assets/esri/core/workers/chunks/e164198dbb87ee202ba1.js +0 -1
  678. package/assets/esri/core/workers/chunks/e4eb6fdf5115bed48856.js +0 -1
  679. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +0 -1
  680. package/assets/esri/core/workers/chunks/e59271f8b142a7602b7a.js +0 -1
  681. package/assets/esri/core/workers/chunks/ee70be138831cc2a0f56.js +0 -1
  682. package/assets/esri/core/workers/chunks/eef3fa804e456beac4c1.js +0 -1
  683. package/assets/esri/core/workers/chunks/efd6ea0966f60ab19520.js +0 -1
  684. package/assets/esri/core/workers/chunks/f23c4fd014126ea7abc6.js +0 -1
  685. package/assets/esri/core/workers/chunks/f319b59228b64e7f9008.js +0 -1
  686. package/assets/esri/core/workers/chunks/f42adcea81390fb21c66.js +0 -1
  687. package/assets/esri/core/workers/chunks/f52d081bbde5c95265cf.js +0 -1
  688. package/assets/esri/core/workers/chunks/f6e40f3faf0c80cf1b3a.js +0 -1
  689. package/assets/esri/core/workers/chunks/f7ab4bf14ec8e986ef7c.js +0 -1
  690. package/assets/esri/core/workers/chunks/f92c92c0fd1b5b33ca21.js +0 -1
  691. package/assets/esri/core/workers/chunks/fbd5f3b81cd9f061824d.js +0 -1
  692. package/assets/esri/core/workers/chunks/fdcc5fe4630a4ccf58de.js +0 -1
  693. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +0 -1
  694. package/assets/esri/core/workers/chunks/ff225735eba7f9130e19.js +0 -1
  695. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +0 -70
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as n,normalize as r,dot as i,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o,clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as c}from"../../../../core/mathUtils.js";import l from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as u,createRenderScreenPointArray3 as d,createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as p}from"../../../../core/units.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{g as C}from"../../../../chunks/cameraUtilsSpherical.js";import{fromRenderAtEye as w,fromScreen as T}from"../../support/geometryUtils/ray.js";import{computeMapPointFromVec3d as E}from"../../support/hitTest.js";import{defaultTolerance as D,Intersector as O,defaultScreenPolygonPrimitiveProcessor as k}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as A,DrapedScreenPolygonIntersectionQuery as j}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as M}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as N,createSliceExtrusionHalfspacePlanes as P,clipPolygonAgainstSlicedAwayHalfspaces as F,sliceFilterPredicate as I}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as L}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";class R{constructor(e,t,n){this.isGlobal=e,this._forEachLayer=t,this._view=n,this._externalIntersectionHandlers=new l,this._tolerance=D,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new O(this.isGlobal),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(S.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.isGlobal),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,H(this.isGlobal),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,r),t.results.min?t.results.min.getIntersectionPoint(n):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter(Z,n,r),Z[0]+=.0466,Z[1]-=.0123,w(e,Z,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await L(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.point=null,t.screenPolygonPrimitiveProcessor=k,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new N(o):null;t.screenPolygonPrimitiveProcessor=s??k,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=k,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??k,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||M(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=D){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return T(n,e,t)}_intersectRayFreePointLocal(e,t){return this.isGlobal||e==null||n(t,e.origin,r(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,n=0,a=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=p(o.spatialReference),l=t==null?`absolute-height`:t.mode,d=x(t)/c,f=(l===`on-the-ground`?0:d+n)*c/s.unitInMeters,{camera:m}=o.state;if(l===`absolute-height`){let t=s.getAltitude(m.eye),n=i(r(K,e.direction),s.worldUpAtPosition(m.eye,q));if(t<f&&n<0||t>=f&&n>0)return null;if(s.intersectInfiniteManifold(e,f,K)){let e=E(o,K);return e.z??=0,e.z-=d,e}return null}let h=m.projectToRenderScreen(e.origin,u(b.get())),g=new U(null,this._forEachLayer),_=o.slice.plane,v=_?I(_):null,y=new O(this.isGlobal);y.options.store=0,y.options.verticalOffset=f,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,y.reset(S.beginPoint,S.endPoint,m),y.point=h;let C=null;if(a&&`type`in a&&a.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===a)?.uid;C=e?t=>t.layerViewUid===e:null}else a&&(C=e=>e.graphicUid!==a.uid);switch(l){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!C||C(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(K)){let e=E(o,K);return e.z=n,e}return null}computeIntersection(e,t,n,r){if(e==null)return;let i=this._view.state.camera,a=i.projectToRenderScreen(e.origin,u(b.get())),o=new U(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r);let s=this._createRayIntersectionQuery(e,a,n);t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.reset(s.beginPoint,s.endPoint,i),t.intersect(o.layers,s.screenPoint,this._tolerance,null,o.objectFilter);let c=this._view.slice.plane,l=c?I(c):null;t.intersect(o.sliceableLayers,s.screenPoint,this._tolerance,l,o.objectFilter);let d=r&&(r.requiresGroundFeedback||r.enableDraped);this._intersectRayHandlers(t,o,s,l,!!d,e=>o.allowedIntersectorTypes==null||o.allowedIntersectorTypes.has(e.type));let f=b.get(),p=this._view,m=p.groundView.spatialReference;if(r&&r.enableDraped&&m!=null&&t.results.ground.getIntersectionPoint(f)){let e=p.overlayManager.renderer,n=p.renderCoordsHelper.spatialReference,r=b.get();p.renderCoordsHelper.fromRenderCoords(f,r,m),r[2]=p.elevationProvider?.getElevation(f[0],f[1],f[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>o.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new z(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,r){return new A(e.origin,n(o(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0){let{options:s}=e,c=s.isFiltered,l=s.filteredLayerViewUids;for(let{handler:c,filterPredicate:l,isFiltered:u,filteredLayerViewUids:d}of this._getFilteredIntersectionHandlers(t,r,null,a,o))(!u||c.isGround&&i)&&(s.isFiltered=u,s.filteredLayerViewUids=d,c.intersectRay(e,l,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay));s.isFiltered=c,s.filteredLayerViewUids=l}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??k,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(n,r){let{state:{camera:{eye:i}},pointsOfInterest:o}=this._view,l=this._view.groundView.spatialReference,u=[],d=r?[]:null,f=C(this._view,o.focus.renderLocation),p=v(l),m=1/0,h=null,g=K,_=q,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let n=h!=null&&p?h+p.shortestSignedDiff(h,g[0]):g[0];return h=n,u.push(t(n,g[1])),d&&d.push(s(_)),m=Math.min(m,a(i,_)),!0},{points:b}=n,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<f;t++){let i=t/f;if(!y(t===0?n:e(Y,c(n[0],r[0],i),c(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(r==null||!d)return[G(u,m)];let S=this._clipDrapedScreenPolygonIntersectionQueries(d,r,p,i);return S.length>0?S:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=P(t);for(let t of F(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,n,r){let{renderCoordsHelper:i}=this._view,o=this._view.groundView.spatialReference,s=[],c=1/0,l=null;for(let u of e){if(!i.fromRenderCoords(u,X,o))return null;let e=l!=null&&n?l+n.shortestSignedDiff(l,X[0]):X[0];l=e,s.push(t(e,X[1])),c=Math.min(c,a(r,u))}return s.length>=3&&Number.isFinite(c)?G(s,c):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new U(null,this._forEachLayer),a=new O(this.isGlobal);J[0]=n[0],J[1]=n[1],J[2]=0;let o=this._createRayIntersectionQuery(t,J,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new B(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class z{constructor(e){this.result=e,this.screenPoint=d()}}class B{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let V;function H(e){return V&&V.isGlobal===e||(V=new O(e)),V}class U{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function W(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function G(e,t){return new j(e,_(m(g),e),t)}const K=o(),q=o(),J=d(),Y=f(),X=o(),Z=d();export{R as SceneIntersectionHelper,W as isIntersectionHandler};
2
+ import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as n,normalize as r,dot as i,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o,clone as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as c}from"../../../../core/mathUtils.js";import l from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as u,createRenderScreenPointArray3 as d,createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as p}from"../../../../core/units.js";import{create as m,copy as h,negativeInfinity as g,expandWithNestedArray as _}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as v}from"../../../../geometry/support/normalizeUtils.js";import{create as y}from"../../../../geometry/support/ray.js";import{sv3d as b}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as x}from"../../../../support/elevationInfoUtils.js";import{TaskPriority as S,noBudget as C}from"../../../support/Scheduler.js";import{Yield as w}from"../../../support/Yield.js";import{g as T}from"../../../../chunks/cameraUtilsSpherical.js";import{fromRenderAtEye as E,fromScreen as D}from"../../support/geometryUtils/ray.js";import{computeMapPointFromVec3d as O}from"../../support/hitTest.js";import{defaultTolerance as k,Intersector as A,defaultScreenPolygonPrimitiveProcessor as j}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as M,DrapedScreenPolygonIntersectionQuery as N}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as P}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as F,createSliceExtrusionHalfspacePlanes as I,clipPolygonAgainstSlicedAwayHalfspaces as L,sliceFilterPredicate as R}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as z}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";class B{constructor(e,t,n){this.isGlobal=e,this._forEachLayer=t,this._view=n,this._externalIntersectionHandlers=new l,this._tolerance=k,this._tmpRay=y(),this._tmpRegion=m(),this._validateHUDIntersector=new A(this.isGlobal),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(S.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,n){return this.intersectRay(this._getPickRay(e,this._tmpRay),W(this.isGlobal),t,n)}intersectScreenFreePointFallback(e,t,n){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,n)}intersectRayFreePointFallback(e,t,n){return this.intersectRay(e,W(this.isGlobal),t,n)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,n,r){return this.intersectRayBudgeted(e,t,n,C,r)===!0}intersectRayBudgeted(e,t,n,r,i){return e?(t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,i,r)?t.results.min?t.results.min.getIntersectionPoint(n):!1:w):!1}getCenterRayWithSubpixelOffset(e,t,n=.5,r=.5){return e.getRenderCenter($,n,r),$[0]+=.0466,$[1]-=.0123,E(e,$,t)}intersectIntersectorScreen(e,t,n){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,n)}async intersectIntersectorScreenPolygon(e,t,n){t.polygonResults.init();let r=this._view.state.camera,i=await z(r,e);i!=null&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(r,t,i,n,e))}*_intersectIntersectorScreenPolygon(e,t,n,r,i){let a=new G(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r),t.camera=e,t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.point=null,t.screenPolygonPrimitiveProcessor=j,yield*t.intersectScreenPolygon(a.layers,n);let o=this._view.slice.plane,s=o?new F(o):null;t.screenPolygonPrimitiveProcessor=s??j,yield*t.intersectScreenPolygon(a.sliceableLayers,n),t.screenPolygonPrimitiveProcessor=j,yield*this._intersectPolygonHandlersGenerator(t,a,n,null,s,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,a,n,r),yield*t.intersectHUDScreenPolygon(a.layers,n),t.screenPolygonPrimitiveProcessor=s??j,yield*t.intersectHUDScreenPolygon(a.sliceableLayers,n),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,n){let r=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(r,t,n)}intersectToolIntersectorRay(e,t,n){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,n);let r=t.results.min;this._view.groundView.opaque||P(r)&&r.intersector!==7||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,n))}setTolerance(e=k){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((e,t)=>e.type===7?1:t.type===7?-1:0)}_getPickRay(e,t){let n=this._view.state.camera;return D(n,e,t)}_intersectRayFreePointLocal(e,t){return this.isGlobal||e==null||n(t,e.origin,r(b.get(),e.direction)),!1}intersectElevationFromScreen(e,t,n=0,r=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,n,r)}_intersectElevation(e,t,n=0,a=null){if(e==null)return null;let o=this._view,{renderCoordsHelper:s}=o,c=p(o.spatialReference),l=t==null?`absolute-height`:t.mode,d=x(t)/c,f=(l===`on-the-ground`?0:d+n)*c/s.unitInMeters,{camera:m}=o.state;if(l===`absolute-height`){let t=s.getAltitude(m.eye),n=i(r(J,e.direction),s.worldUpAtPosition(m.eye,Y));if(t<f&&n<0||t>=f&&n>0)return null;if(s.intersectInfiniteManifold(e,f,J)){let e=O(o,J);return e.z??=0,e.z-=d,e}return null}let h=m.projectToRenderScreen(e.origin,u(b.get())),g=new G(null,this._forEachLayer),_=o.slice.plane,v=_?R(_):null,y=new A(this.isGlobal);y.options.store=0,y.options.verticalOffset=f,y.options.normalRequired=!1;let S=this._createRayIntersectionQuery(e,h,!1);y.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,y.reset(S.beginPoint,S.endPoint,m),y.point=h;let C=null;if(a&&`type`in a&&a.type===`graphics`){let e=o.allLayerViews.find(e=>e.layer===a)?.uid;C=e?t=>t.layerViewUid===e:null}else a&&(C=e=>e.graphicUid!==a.uid);switch(l){case`relative-to-scene`:y.intersect(g.layers,S.screenPoint,this._tolerance,null,e=>(!C||C(e))&&!!e.lastValidElevationBB),this._intersectRayHandlers(y,g,S,v,!1,e=>e.type===2||e.type===7||e.type===8,!1);break;case`on-the-ground`:case`relative-to-ground`:this._intersectRayHandlers(y,g,S,v,!1,e=>e.isGround,!1)}if(y.results.min.getIntersectionPoint(J)){let e=O(o,J);return e.z=n,e}return null}computeIntersection(e,t,n,r,i){if(e==null)return!0;let a=this._view.state.camera,o=a.projectToRenderScreen(e.origin,u(b.get())),s=new G(r,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!r||!(`include`in r||`exclude`in r);let c=this._createRayIntersectionQuery(e,o,n);t.metersPerRenderUnit=this._view.renderCoordsHelper.unitInMeters,t.reset(c.beginPoint,c.endPoint,a),t.intersect(s.layers,c.screenPoint,this._tolerance,null,s.objectFilter);let l=this._view.slice.plane,d=l?R(l):null;t.intersect(s.sliceableLayers,c.screenPoint,this._tolerance,d,s.objectFilter);let f=r&&(r.requiresGroundFeedback||r.enableDraped);if(!this._intersectRayHandlers(t,s,c,d,!!f,e=>s.allowedIntersectorTypes==null||s.allowedIntersectorTypes.has(e.type),!0,i))return!1;let p=b.get(),m=this._view,h=m.groundView.spatialReference;if(r&&r.enableDraped&&h!=null&&t.results.ground.getIntersectionPoint(p)){let e=m.overlayManager.renderer,n=m.renderCoordsHelper.spatialReference,r=b.get();m.renderCoordsHelper.fromRenderCoords(p,r,h),r[2]=m.elevationProvider?.getElevation(p[0],p[1],p[2],n,`ground`)??0,e.intersectRay(t,r,t.results.ground,e=>s.filterRenderGeometry(e))}return t.sortResults(),this._processHUDResults(t),!0}_processHUDResults(e){let t=e.results.hud;h(this._tmpRegion,g);let n=[],r=this._tmpRegion,i=e=>{n.push(new V(e))};e.sortResults(t.all),t.min.distance!=null&&i(t.min);for(let e of t.all)t.min.target.object!==e.target.object&&t.max.target.object!==e.target.object&&i(e);if(t.max.distance!=null&&t.max.target.object!==t.min.target.object&&i(t.max),!n.length)return;r[0]===r[2]&&(r[2]+=1),r[1]===r[3]&&(r[3]+=1);let a=!0,o=e.results.max.distance==null,s=0;for(let t of n)a&&=(e.results.min.copy(t.result),!1),o&&e.results.max.copy(t.result),e.options.store===2&&e.results.all.splice(s++,0,t.result)}_createRayIntersectionQuery(e,t,r){return new M(e.origin,n(o(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=!0;for(let{handler:l,filterPredicate:u,isFiltered:f,filteredLayerViewUids:p}of this._getFilteredIntersectionHandlers(t,r,null,a,o))if((!f||l.isGround&&i)&&(c.isFiltered=f,c.filteredLayerViewUids=p,l.intersectRay(e,u,e.rayBegin,e.rayEnd,n.screenPoint,n.isVerticalRay,s)===!1)){d=!1;break}return c.isFiltered=l,c.filteredLayerViewUids=u,d}*_intersectPolygonHandlersGenerator(e,t,n,r,i,a=()=>!0,o=!0,s){let{options:c}=e,l=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(let{handler:l,screenPolygonPrimitiveProcessor:u,isFiltered:d,filteredLayerViewUids:f}of this._getFilteredIntersectionHandlers(t,r,i,a,o))d||l.intersectScreenPolygon==null||(c.isFiltered=d,c.filteredLayerViewUids=f,e.screenPolygonPrimitiveProcessor=u??j,yield*l.intersectScreenPolygon(e,n,s));c.isFiltered=l,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,n,r){let{basemapTerrain:i,overlayManager:a}=this._view,o=this._view.groundView.spatialReference!=null&&!a.renderer.isEmpty;if(!e.options.selectionMode||!r?.enableDraped||!o)return;let s=yield*this._createDrapedPolygonIntersectionQueries(n,i.slicePlaneEnabled?this._view.slice.plane:null);s!=null&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,s,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(n,r){let{state:{camera:{eye:i}},pointsOfInterest:o}=this._view,l=this._view.groundView.spatialReference,u=[],d=r?[]:null,f=T(this._view,o.focus.renderLocation),p=v(l),m=1/0,h=null,g=J,_=Y,y=e=>{if(!this._intersectDrapedScreenPolygonPoint(g,_,e))return!1;let n=h!=null&&p?h+p.shortestSignedDiff(h,g[0]):g[0];return h=n,u.push(t(n,g[1])),d&&d.push(s(_)),m=Math.min(m,a(i,_)),!0},{points:b}=n,{length:x}=b;for(let t=0;t<x;t++){let n=b[t],r=b[(t+1)%x];for(let t=0;t<f;t++){let i=t/f;if(!y(t===0?n:e(Z,c(n[0],r[0],i),c(n[1],r[1],i))))return null;yield}}if(!Number.isFinite(m))return null;if(r==null||!d)return[q(u,m)];let S=this._clipDrapedScreenPolygonIntersectionQueries(d,r,p,i);return S.length>0?S:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,n,r){let i=[],a=I(t);for(let t of L(a,e)){let e=this._createDrapedQueryFromRenderPolygon(t,n,r);e!=null&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,n,r){let{renderCoordsHelper:i}=this._view,o=this._view.groundView.spatialReference,s=[],c=1/0,l=null;for(let u of e){if(!i.fromRenderCoords(u,Q,o))return null;let e=l!=null&&n?l+n.shortestSignedDiff(l,Q[0]):Q[0];l=e,s.push(t(e,Q[1])),c=Math.min(c,a(r,u))}return s.length>=3&&Number.isFinite(c)?q(s,c):null}_intersectDrapedScreenPolygonPoint(e,t,n){let r=this._getPickRay(n,this._tmpRay);if(r==null)return!1;let{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,r,n)||i.intersectManifoldClosestSilhouette(r,0,t);let a=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,a)}_intersectGroundPoint(e,t,n){let r=this._view.state.camera,i=new G(null,this._forEachLayer),a=new A(this.isGlobal);X[0]=n[0],X[1]=n[1],X[2]=0;let o=this._createRayIntersectionQuery(t,X,!1);return a.options.selectionMode=!0,a.options.store=0,a.options.normalRequired=!1,a.options.selectOpaqueTerrainOnly=!1,a.reset(o.beginPoint,o.endPoint,r),this._intersectRayHandlers(a,i,o,null,!0,e=>e.isGround,!1),a.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,n,r=()=>!0,i=!0){for(let a of this._externalIntersectionHandlers){if(!r(a))continue;let o=!1,s=[];if(i){let t=a.layerViewUid,n=a.sublayerId,r=Array.isArray(t),i=r?t:[t],c=!1;for(let t of i)e.filterLayerViewUid(t,n)?c=!0:r&&s.push(t);o=!c}yield new H(a,a.slicePlaneEnabled?t:null,a.slicePlaneEnabled?n:null,o,s)}}}class V{constructor(e){this.result=e,this.screenPoint=d()}}class H{constructor(e,t,n,r,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=n,this.isFiltered=r,this.filteredLayerViewUids=i}}let U;function W(e){return U&&U.isGlobal===e||(U=new A(e)),U}class G{constructor(e,t){this.layers=[],this.sliceableLayers=[],this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){let{include:n,exclude:r}=this;if(e==null)return n==null&&r==null;let i=n instanceof Map?n.get(e)??!1:n?.has(e),a=r instanceof Map?r.get(e)??!1:r?.has(e);return(i==null||(typeof i==`boolean`?i:t!=null&&i.has(t)))&&(a==null||!(typeof a==`boolean`?a:t!=null&&a.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function K(e){return typeof e==`object`&&!!e&&`intersectRay`in e}function q(e,t){return new N(e,_(m(g),e),t)}const J=o(),Y=o(),X=d(),Z=f(),Q=o(),$=d();export{B as SceneIntersectionHelper,K as isIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{crossAndNormalize as e,copy as t,scale as n,subtract as r,add as i,distance as a,normalize as o,cross as s,dot as c,scaleAndAdd as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as m}from"../../../../geometry/support/lineSegment.js";import{create as h,fromPositionAndNormal as g,distance as _,projectPoint as v,projectVector as y,intersectLineSegment as b}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as ee}from"../../layers/VoxelWasm.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import{fromRenderCamera as C}from"../../webgl.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import T from"../../webgl/RenderCamera.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ne}from"./OffsetCorrectionController.js";const A=1.5,j={xSpeedMultiplier:A,ySpeedMultiplier:A,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12,i3sNodeDownwardCheckDistanceInMeters:5},M=d(),N=d(),P=f(),F=d(),I=h(),L=d(),R=d(),z=d(),B=d(),V=d(),re=d(),H=d(),U=d(),W=d(),G=d(),K=f(),q=x(),J=new S,Y=d(),ie=h(),X=d(),ae=d();function oe(e,t){return y(t,e.viewForward,M),i(N,e.eye,M),e.projectToScreen(N,P),P[1]}function se(t,u,d){let f=t.eye;if(a(u.center,f)<u.radius)return o(V,f),s(re,V,t.viewRight),i(N,f,re),t.projectToScreen(N,K),K[1];let p=t.up;te(t,d,q);let m=u.radius;if(e(F,p,q.direction),g(f,F,I),_(I,u.center)>m)return null;v(I,u.center,L);let h=a(u.center,L),y=Math.sqrt(m**2-h**2);r(R,f,L),o(z,R),e(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),ee=Math.sqrt(S**2-y**2),C=y**2/S**2,w=y/S**2*ee,T=C*b,E=w*-x,D=C*x,O=w*b,k=T+E,ne=T-E,A=D+O,j=D-O;return i(H,L,l(H,n(H,z,k),B,A)),i(U,L,l(U,n(U,z,ne),B,j)),r(W,H,f),o(W,W),r(G,U,f),o(G,G),c(t.viewForward,W)>=c(t.viewForward,G)?t.projectToScreen(H,K):t.projectToScreen(U,K),K[1]}function ce(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function le(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(j.minimumHorizonPadding,j.relativeHorizonPadding*r)}function ue(e,t){return[de(e,t),fe(e,t)]}function de(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function fe(e,t){return Math.max(0,t-Q(e,t))}function pe(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function me(e){let{view:t}=e;return t.state.isGlobal?he(e):ge(e)}function he(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:l,outGrabNormal:u,intersectionOptions:d,depthSearchSize:f}=e,m=n.state.camera,h=pe(c,l,u);J.radius=p(n.spatialReference).radius;let g=E(n,m,r,J.radius,1,d);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;t(Y,g.scenePickPoint),t(h.location,Y);let v=g.sphere;h.normal&&g.normal&&t(h.normal,g.normal);let y=ve(r,i,s,_),b=_?a(Y,m.eye):1/0;return y.wasAdjusted&&ye({view:n,screenAdjustment:y,intersector:$(n),fallbackCheck:(e,t,n)=>{let r=D(v,m,e,t);return r&&n&&o(n,t),r},output:h,intersectionOptions:d}),xe({view:n,screenPoint:y.adjustedScreenPoint,camera:m,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function ge(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:u,outGrabNormal:d,intersectionOptions:f,depthSearchSize:p}=e,m=n.sceneIntersectionHelper,h=n.state.camera,_=$(n),v=pe(c,u,d);m.intersectIntersectorScreen(r,_,f);let y=_.results.min.getIntersectionPoint(Y),b=y?a(Y,h.eye):1/0;y&&(t(v.location,Y),v.normal&&t(v.normal,_.results.min.normal)),n.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),g(X,V,ie);let x=ve(r,i,s,y);return x.wasAdjusted&&ye({view:n,screenAdjustment:x,intersector:_,fallbackCheck:(e,t,n)=>{let r=O(ie,h,e,t);return r&&n&&o(n,V),r},output:v,intersectionOptions:f}),xe({view:n,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function _e(e,t,n,r){return!r&&ce(e,t)||r&&le(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ve(e,t,n,r){let i=_e(e[1],t,n,r);return{originalScreenPoint:e,adjustedScreenPoint:f(e[0],i??e[1]),horizonY:t,horizonPadding:n,wasAdjusted:i!==null}}function $(e){let t=new w(e.state.isGlobal);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function ye(e){let{view:n,screenAdjustment:r,fallbackCheck:i,intersector:a,output:o,intersectionOptions:s}=e,c=n.sceneIntersectionHelper;c.intersectIntersectorScreen(r.adjustedScreenPoint,a,{...s,requiresGroundFeedback:!0});let l=a.results.min.getIntersectionPoint(o.location);if(l){o.normal&&t(o.normal,a.results.min.normal);return}let u=be(r);c.intersectIntersectorScreen(u,a,{...s,requiresGroundFeedback:!0}),l=a.results.min.getIntersectionPoint(o.location),l?o.normal&&t(o.normal,a.results.min.normal):(l=i(r.adjustedScreenPoint,o.location,o.normal),l||i(u,o.location,o.normal))}function be(e){let{originalScreenPoint:t,adjustedScreenPoint:n,horizonY:r,horizonPadding:i}=e,a=Z(n[1],r)?Math.min(i[1],t[1]):Math.max(i[0],t[1]);return f(n[0],a)}function xe(e){Se(e),Ce(e)}function Se(e){let{view:n,camera:i,output:a}=e,{offset:o}=n.navigation.mode;if(!o)return;let{translation:s,location:c}=a;n.renderCoordsHelper.worldUpAtPosition(i.eye,V),l(X,i.eye,V,-o),g(X,V,I),b(I,m(i.eye,r(M,c,i.eye)),X)&&(t(c,X),r(s,c,i.eye))}function Ce(e){let{view:t,screenPoint:a,camera:s,initialDistance:c,depthSearchSize:l,output:d}=e,f=l>0?t.stage.renderView.getMinimalDepthForArea(ee(t),a[0],a[1],s,l):null;r(d.translation,d.location,s.eye);let p=Math.min(u(d.translation),c);f&&f<=p&&(p=f),o(d.translation,d.translation),n(d.translation,d.translation,p),i(d.location,d.translation,s.eye)}async function we(e,t,n,r,i){let a=new T().copyFrom(e.state.camera);if(Te({view:e,camera:a,forwardDirection:t,forwardDistance:n,detectCollisions:!0}))return r?r.smoothlyCorrectGroundElevation({camera:a,deltaTime:i}):new ne(e).immediatelyCorrectGroundElevation({camera:a,correctionLimit:100}),e.goTo(C(e,a),{duration:500,liftOffDisabled:!0})}function Te(o){let{view:s,camera:c,forwardDirection:l,forwardDistance:d,detectCollisions:f}=o,p=s.navigation.mode;if(p.type!==`ground`)return!1;s.renderCoordsHelper.worldUpAtPosition(c.eye,V);let m=s.sceneIntersectionHelper,h=$(s),g=e(M,V,e(M,l,V));t(q.origin,c.eye),n(q.direction,g,d);let _=m.intersectRay(q,h,Y,{include:p.include,exclude:p.exclude}),v=r(ae,c.center,c.eye);return!f||!_||a(Y,c.eye)>Math.abs(d)?c.eye=i(M,q.origin,q.direction):(r(M,Y,c.eye),u(M)>2&&(Ee(M,M,.25,2),c.eye=i(M,c.eye,M))),c.center=i(M,c.eye,v),!0}function Ee(e,t,r,i){let a=u(e),o=Math.min(r,Math.max(a-i,0)/a);n(t,e,o)}export{Te as advanceGroundNavigationCamera,Q as computeHorizonPadding,ue as computeHorizonPaddingLimits,me as findGroundNavigationGrabLocation,oe as findPlaneHorizonY,se as findSphereHorizonY,we as groundNavigationAdvance,j as groundNavigationConstants,ce as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,le as shouldClampScreenY};
2
+ import{crossAndNormalize as e,copy as t,scale as n,subtract as r,add as i,distance as a,normalize as o,cross as s,dot as c,scaleAndAdd as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as f}from"../../../../core/screenUtils.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{fromValues as m}from"../../../../geometry/support/lineSegment.js";import{create as h,fromPositionAndNormal as g,distance as _,projectPoint as v,projectVector as y,intersectLineSegment as b}from"../../../../geometry/support/plane.js";import{create as x}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{getVoxelWasm as ee}from"../../layers/VoxelWasm.js";import{fromScreenAtEye as te}from"../../support/geometryUtils/ray.js";import{fromRenderCamera as C}from"../../webgl.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import T from"../../webgl/RenderCamera.js";import{pickPointAndInitSphere as E,sphereOrPlanePointFromScreenPoint as D,intersectPlaneFromScreenPoint as O,searchAreaSize as k}from"./navigationUtils.js";import{OffsetCorrectionController as ne}from"./OffsetCorrectionController.js";const A=1.5,j={xSpeedMultiplier:A,ySpeedMultiplier:A,maxElevation:1e4,relativeHorizonPadding:.1,minimumHorizonPadding:12,i3sNodeDownwardCheckDistanceInMeters:5},M=d(),N=d(),P=f(),F=d(),I=h(),L=d(),R=d(),z=d(),B=d(),V=d(),re=d(),H=d(),U=d(),W=d(),G=d(),K=f(),q=x(),J=new S,Y=d(),ie=h(),X=d(),ae=d();function oe(e,t){return y(t,e.viewForward,M),i(N,e.eye,M),e.projectToScreen(N,P),P[1]}function se(t,u,d){let f=t.eye;if(a(u.center,f)<u.radius)return o(V,f),s(re,V,t.viewRight),i(N,f,re),t.projectToScreen(N,K),K[1];let p=t.up;te(t,d,q);let m=u.radius;if(e(F,p,q.direction),g(f,F,I),_(I,u.center)>m)return null;v(I,u.center,L);let h=a(u.center,L),y=Math.sqrt(m**2-h**2);r(R,f,L),o(z,R),e(B,F,z);let b=c(R,z),x=c(R,B),S=Math.sqrt(b**2+x**2),ee=Math.sqrt(S**2-y**2),C=y**2/S**2,w=y/S**2*ee,T=C*b,E=w*-x,D=C*x,O=w*b,k=T+E,ne=T-E,A=D+O,j=D-O;return i(H,L,l(H,n(H,z,k),B,A)),i(U,L,l(U,n(U,z,ne),B,j)),r(W,H,f),o(W,W),r(G,U,f),o(G,G),c(t.viewForward,W)>=c(t.viewForward,G)?t.projectToScreen(H,K):t.projectToScreen(U,K),K[1]}function ce(e,t,n=!0){return n?e<t:e<=t}function Z(e,t,n=!0){return n?e>t:e>=t}function le(e,t,n){return t?e>n:e<n}function Q(e,t){let n=e.fullHeight/e.pixelRatio,r=Math.max(t,n-t);return Math.max(j.minimumHorizonPadding,j.relativeHorizonPadding*r)}function ue(e,t){return[de(e,t),fe(e,t)]}function de(e,t){let n=e.fullHeight/e.pixelRatio;return Math.min(n,t+Q(e,t))}function fe(e,t){return Math.max(0,t-Q(e,t))}function pe(e,t,n){let r={translation:e,location:t};return n&&(r.normal=n),r}function me(e){let{view:t}=e;return t.state.isGlobal?he(e):ge(e)}function he(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:l,outGrabNormal:u,intersectionOptions:d,depthSearchSize:f}=e,m=n.state.camera,h=pe(c,l,u);J.radius=p(n.spatialReference).radius;let g=E(n,m,r,J.radius,1,d);if(g.scenePickPoint==null)return!1;let _=g.hasGeometryIntersection;t(Y,g.scenePickPoint),t(h.location,Y);let v=g.sphere;h.normal&&g.normal&&t(h.normal,g.normal);let y=ve(r,i,s,_),b=_?a(Y,m.eye):1/0;return y.wasAdjusted&&ye({view:n,screenAdjustment:y,intersector:$(n),fallbackCheck:(e,t,n)=>{let r=D(v,m,e,t);return r&&n&&o(n,t),r},output:h,intersectionOptions:d}),xe({view:n,screenPoint:y.adjustedScreenPoint,camera:m,initialDistance:b,depthSearchSize:f??k,output:h}),!0}function ge(e){let{view:n,originalScreenPoint:r,horizonY:i,horizonPadding:s,outTranslation:c,outGrabLocation:u,outGrabNormal:d,intersectionOptions:f,depthSearchSize:p}=e,m=n.sceneIntersectionHelper,h=n.state.camera,_=$(n),v=pe(c,u,d);m.intersectIntersectorScreen(r,_,f);let y=_.results.min.getIntersectionPoint(Y),b=y?a(Y,h.eye):1/0;y&&(t(v.location,Y),v.normal&&t(v.normal,_.results.min.normal)),n.renderCoordsHelper.worldUpAtPosition(h.eye,V),l(X,h.eye,V,-h.relativeElevation),g(X,V,ie);let x=ve(r,i,s,y);return x.wasAdjusted&&ye({view:n,screenAdjustment:x,intersector:_,fallbackCheck:(e,t,n)=>{let r=O(ie,h,e,t);return r&&n&&o(n,V),r},output:v,intersectionOptions:f}),xe({view:n,screenPoint:x.adjustedScreenPoint,camera:h,initialDistance:b,depthSearchSize:p??k,output:v}),!0}function _e(e,t,n,r){return!r&&ce(e,t)||r&&le(e,!1,n[0])?n[0]:!r&&Z(e,t,!1)?n[1]:null}function ve(e,t,n,r){let i=_e(e[1],t,n,r);return{originalScreenPoint:e,adjustedScreenPoint:f(e[0],i??e[1]),horizonY:t,horizonPadding:n,wasAdjusted:i!==null}}function $(e){let t=new w(e.state.isGlobal);return t.options.selectionMode=!0,t.options.store=0,t.options.hud=!1,t.options.normalRequired=!0,t}function ye(e){let{view:n,screenAdjustment:r,fallbackCheck:i,intersector:a,output:o,intersectionOptions:s}=e,c=n.sceneIntersectionHelper;c.intersectIntersectorScreen(r.adjustedScreenPoint,a,{...s,requiresGroundFeedback:!0});let l=a.results.min.getIntersectionPoint(o.location);if(l){o.normal&&t(o.normal,a.results.min.normal);return}let u=be(r);c.intersectIntersectorScreen(u,a,{...s,requiresGroundFeedback:!0}),(l=a.results.min.getIntersectionPoint(o.location))?o.normal&&t(o.normal,a.results.min.normal):(l=i(r.adjustedScreenPoint,o.location,o.normal))||i(u,o.location,o.normal)}function be(e){let{originalScreenPoint:t,adjustedScreenPoint:n,horizonY:r,horizonPadding:i}=e,a=Z(n[1],r)?Math.min(i[1],t[1]):Math.max(i[0],t[1]);return f(n[0],a)}function xe(e){Se(e),Ce(e)}function Se(e){let{view:n,camera:i,output:a}=e,{offset:o}=n.navigation.mode;if(!o)return;let{translation:s,location:c}=a;n.renderCoordsHelper.worldUpAtPosition(i.eye,V),l(X,i.eye,V,-o),g(X,V,I),b(I,m(i.eye,r(M,c,i.eye)),X)&&(t(c,X),r(s,c,i.eye))}function Ce(e){let{view:t,screenPoint:a,camera:s,initialDistance:c,depthSearchSize:l,output:d}=e,f=l>0?t.stage.renderView.getMinimalDepthForArea(ee(t),a[0],a[1],s,l):null;r(d.translation,d.location,s.eye);let p=Math.min(u(d.translation),c);f&&f<=p&&(p=f),o(d.translation,d.translation),n(d.translation,d.translation,p),i(d.location,d.translation,s.eye)}async function we(e,t,n,r,i){let a=new T().copyFrom(e.state.camera);if(Te({view:e,camera:a,forwardDirection:t,forwardDistance:n,detectCollisions:!0}))return r?r.smoothlyCorrectGroundElevation({camera:a,deltaTime:i}):new ne(e).immediatelyCorrectGroundElevation({camera:a,correctionLimit:100}),e.goTo(C(e,a),{duration:500,liftOffDisabled:!0})}function Te(o){let{view:s,camera:c,forwardDirection:l,forwardDistance:d,detectCollisions:f}=o,p=s.navigation.mode;if(p.type!==`ground`)return!1;s.renderCoordsHelper.worldUpAtPosition(c.eye,V);let m=s.sceneIntersectionHelper,h=$(s),g=e(M,V,e(M,l,V));t(q.origin,c.eye),n(q.direction,g,d);let _=m.intersectRay(q,h,Y,{include:p.include,exclude:p.exclude}),v=r(ae,c.center,c.eye);return!f||!_||a(Y,c.eye)>Math.abs(d)?c.eye=i(M,q.origin,q.direction):(r(M,Y,c.eye),u(M)>2&&(Ee(M,M,.25,2),c.eye=i(M,c.eye,M))),c.center=i(M,c.eye,v),!0}function Ee(e,t,r,i){let a=u(e),o=Math.min(r,Math.max(a-i,0)/a);n(t,e,o)}export{Te as advanceGroundNavigationCamera,Q as computeHorizonPadding,ue as computeHorizonPaddingLimits,me as findGroundNavigationGrabLocation,oe as findPlaneHorizonY,se as findSphereHorizonY,we as groundNavigationAdvance,j as groundNavigationConstants,ce as isAboveHorizon,Z as isBelowHorizon,Ee as shortenTranslation,le as shouldClampScreenY};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{on as i}from"../../../core/reactiveUtils.js";import{IntegratedMeshSemantics as a}from"../../../layers/support/IntegratedMeshSemantics.js";import{isIntegratedMeshLayerView as o}from"../../support/layerViewUtils.js";import{noBudget as s}from"../../support/Scheduler.js";let c=class extends r{constructor(e){super(e),this._integratedMeshElevationUpdateHandles=new Map}initialize(){let e=this._integratedMeshElevationUpdateHandles;this.addHandles([i(()=>this.view.groundView,`elevation-change`,e=>this._elevationChange(e)),this.view.allLayerViews.on(`change`,t=>{t.added.forEach(t=>{if(!o(t)||a.contributesToGroundElevation(t.layer,t.replacesTerrain))return;let n=t.elevationProvider.on(`elevation-change`,e=>this._elevationChange(e));e.set(t,n),this.addHandles(n,t)}),t.removed.forEach(t=>{o(t)&&(this.removeHandles(t),e.delete(t))})})])}intersect(e,t,n,r){this.intersectBudgeted(e,t,n,r,s)}intersectBudgeted(e,t,n,r,i){if(!this.view.groundView.intersectBudgeted(e,t,n,r,i))return!1;for(let i of this._integratedMeshElevationUpdateHandles.keys())i.intersect(e,t,n,r);return!0}_elevationChange(e){this.emit(`elevation-change`,e)}};e([t({constructOnly:!0})],c.prototype,`view`,void 0),c=e([n(`esri.views.3d.support.GroundAndIMSurface`)],c);export{c as GroundAndIMSurface};
2
+ import{__decorate as e}from"tslib";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{on as i}from"../../../core/reactiveUtils.js";import{IntegratedMeshSemantics as a}from"../../../layers/support/IntegratedMeshSemantics.js";import{isIntegratedMeshLayerView as o}from"../../support/layerViewUtils.js";import{noBudget as s}from"../../support/Scheduler.js";let c=class extends r{constructor(e){super(e),this._integratedMeshElevationUpdateHandles=new Map}initialize(){let e=this._integratedMeshElevationUpdateHandles;this.addHandles([i(()=>this.view.groundView,`elevation-change`,e=>this._elevationChange(e)),this.view.allLayerViews.on(`change`,t=>{t.added.forEach(t=>{if(!o(t)||a.contributesToGroundElevation(t.layer,t.replacesTerrain))return;let n=t.elevationProvider.on(`elevation-change`,e=>this._elevationChange(e));e.set(t,n),this.addHandles(n,t)}),t.removed.forEach(t=>{o(t)&&(this.removeHandles(t),e.delete(t))})})])}intersect(e,t,n,r){this.intersectBudgeted(e,t,n,r,s)}intersectBudgeted(e,t,n,r,i){if(!this.view.groundView.intersectBudgeted(e,t,n,r,i))return!1;for(let a of this._integratedMeshElevationUpdateHandles.keys())if(!a.intersect(e,t,n,r,i))return!1;return!0}_elevationChange(e){this.emit(`elevation-change`,e)}};e([t({constructOnly:!0})],c.prototype,`view`,void 0),c=e([n(`esri.views.3d.support.GroundAndIMSurface`)],c);export{c as GroundAndIMSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function t(e){return a[e]}function n(){return has(`esri-iPhone`)?`low`:`medium`}const r={reset(){a=o()}},i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};let a=o();function o(){return{low:s(`low`),medium:s(`medium`),high:s(`high`)}}function s(t){let n=!!has(`esri-mobile`),r=!has(`ios`),a=e=>e[t];return{graphics3D:{maxTotalNumberOfFeatures:a({low:5e4,medium:15e4,high:3e5}),maxNumberOfDrawCalls:a({low:8e3,medium:17e3,high:17e3}),maxTotalNumberOfVertices:a({low:255e4,medium:625e4,high:125e5}),polygonLodFactor:a({low:.5,medium:n?.8:1,high:n?1.2:2}),polylineLodFactor:a({low:1,medium:n?1.2:1.5,high:n?1.2:2}),snapshotAvailable:a({low:!1,medium:r,high:r}),skipHighSymbolLods:a({low:!0,medium:!1,high:!1})},heatmap:{pixelRatio:a({low:.125,medium:.25,high:.5})},sceneService:{objectLoDFactor:a({low:.2,medium:1,high:1}),meshLoDFactor:a({low:.6,medium:1,high:1}),pointCloudLoDFactor:a({low:.5,medium:1,high:1})},gaussianSplat:{minimumPixelRadius:a({low:2,medium:1,high:.5}),minimumOpacity:a({low:0,medium:1,high:2}),maximumNumberOfGaussians:a({low:1e6,medium:n?1e6:3e6,high:6e6})},flow:{maxTotalNumberOfStreamlines:a({low:5e3,medium:2e4,high:2e4}),maxTracingResolution:a({low:1024,medium:2048,high:2048}),transitionEnabled:a({low:!1,medium:!0,high:!0})},tiledSurface:{lodBias:a({low:-1,medium:0,high:0}),angledSplitBias:a({low:.5,medium:1,high:1}),elevationLevelDelta:a({low:3,medium:3,high:2})},fadeDuration:e(a({low:0,medium:400,high:400})),physicallyBasedRenderingEnabled:a({low:!1,medium:!0,high:!0}),maxTexturePixels:a({low:n?1024**2:2048**2,medium:n?2048**2:4096**2,high:n?4096**2:1/0}),memoryLimit:a({low:200+i.IPhone12Pro,medium:n?600+i.GalaxyS20:750+i.FullHD,high:n?900+i.SurfacePro7:1500+i.FullHDRetina})*1048576,additionalCacheMemory:a({low:0,medium:n?-100:150,high:n?-150:0})*1048576,maximumPixelRatio:a({low:1,medium:1,high:n?1:1/0})}}export{r as QualityProfileTest,n as getDefaultQualityProfileName,t as getQualityProfileSettings};
2
+ import has from"../../../core/has.js";import{Milliseconds as e}from"../../../core/time.js";function t(e){return a[e]}function n(){return has(`esri-iPhone`)?`low`:`medium`}const r={reset(){a=o()}},i={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};let a=o();function o(){return{low:s(`low`),medium:s(`medium`),high:s(`high`)}}function s(t){let n=!!has(`esri-mobile`),r=!has(`ios`),a=e=>e[t];return{graphics3D:{maxTotalNumberOfFeatures:a({low:5e4,medium:15e4,high:3e5}),maxNumberOfDrawCalls:a({low:8e3,medium:17e3,high:17e3}),maxTotalNumberOfVertices:a({low:255e4,medium:625e4,high:125e5}),polygonLodFactor:a({low:.5,medium:n?.8:1,high:n?1.2:2}),polylineLodFactor:a({low:1,medium:n?1.2:1.5,high:n?1.2:2}),snapshotAvailable:a({low:!1,medium:r,high:r}),skipHighSymbolLods:a({low:!0,medium:!1,high:!1})},heatmap:{pixelRatio:a({low:.125,medium:.25,high:.5})},sceneService:{objectLoDFactor:a({low:.2,medium:1,high:1}),meshLoDFactor:a({low:.6,medium:1,high:1}),pointCloudLoDFactor:a({low:.5,medium:1,high:1})},gaussianSplat:{minimumPixelRadius:a({low:2,medium:1,high:.5}),minimumOpacity:a({low:0,medium:1,high:2}),maximumNumberOfGaussians:a({low:1e6,medium:n?1e6:3e6,high:6e6})},flow:{maxTotalNumberOfStreamlines:a({low:5e3,medium:2e4,high:2e4}),maxTracingResolution:a({low:1024,medium:2048,high:2048}),transitionEnabled:a({low:!1,medium:!0,high:!0})},tiledSurface:{lodBias:a({low:-1,medium:0,high:0}),angledSplitBias:a({low:.5,medium:1,high:1}),elevationLevelDelta:a({low:3,medium:3,high:2})},voxelWasmQuality:a({low:0,medium:1,high:2}),lyr3dWasmQuality:a({low:1,medium:2,high:3}),fadeDuration:e(a({low:0,medium:400,high:400})),physicallyBasedRenderingEnabled:a({low:!1,medium:!0,high:!0}),maxTexturePixels:a({low:n?1024**2:2048**2,medium:n?2048**2:4096**2,high:n?4096**2:1/0}),memoryLimit:a({low:200+i.IPhone12Pro,medium:n?600+i.GalaxyS20:750+i.FullHD,high:n?900+i.SurfacePro7:1500+i.FullHDRetina})*1048576,additionalCacheMemory:a({low:0,medium:n?-100:150,high:n?-150:0})*1048576,maximumPixelRatio:a({low:1,medium:1,high:n?1:1/0})}}export{r as QualityProfileTest,n as getDefaultQualityProfileName,t as getQualityProfileSettings};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{Milliseconds as i}from"../../../core/time.js";let a=class extends t{constructor(e={}){super(e),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};e([n()],a.prototype,`maxTotalNumberOfFeatures`,void 0),e([n()],a.prototype,`maxNumberOfDrawCalls`,void 0),e([n()],a.prototype,`maxTotalNumberOfVertices`,void 0),e([n()],a.prototype,`snapshotAvailable`,void 0),e([n()],a.prototype,`polygonLodFactor`,void 0),e([n()],a.prototype,`polylineLodFactor`,void 0),e([n()],a.prototype,`skipHighSymbolLods`,void 0),a=e([r(`esri.views.3d.support.QualitySettings.Graphics3DSettings`)],a);let o=class extends t{constructor(e={}){super(e),this.objectLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};e([n()],o.prototype,`objectLoDFactor`,void 0),e([n()],o.prototype,`meshLoDFactor`,void 0),e([n()],o.prototype,`pointCloudLoDFactor`,void 0),o=e([r(`esri.views.3d.support.QualitySettings.SceneServiceSettings`)],o);let s=class extends t{constructor(e={}){super(e),this.lodBias=0,this.angledSplitBias=1,this.elevationLevelDelta=3}};e([n()],s.prototype,`lodBias`,void 0),e([n()],s.prototype,`angledSplitBias`,void 0),e([n()],s.prototype,`elevationLevelDelta`,void 0),s=e([r(`esri.views.3d.support.QualitySettings.TiledSurfaceSettings`)],s);let c=class extends t{constructor(e={}){super(e),this.minimumPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=2e6}};e([n()],c.prototype,`minimumPixelRadius`,void 0),e([n()],c.prototype,`minimumOpacity`,void 0),e([n()],c.prototype,`maximumNumberOfGaussians`,void 0),c=e([r(`esri.views.3d.support.QualitySettings.GaussianSplatSettings`)],c);let l=class extends t{constructor(e={}){super(e),this.pixelRatio=1}};e([n()],l.prototype,`pixelRatio`,void 0),l=e([r(`esri.views.3d.support.QualitySettings.HeatmapSettings`)],l);let u=class extends t{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048,this.transitionEnabled=!0}};e([n()],u.prototype,`maxTotalNumberOfStreamlines`,void 0),e([n()],u.prototype,`maxTracingResolution`,void 0),e([n()],u.prototype,`transitionEnabled`,void 0),u=e([r(`esri.views.3d.support.QualitySettings.FlowSettings`)],u);let d=class extends t{constructor(e){super(e),this.graphics3D=new a,this.sceneService=new o,this.tiledSurface=new s,this.gaussianSplat=new c,this.heatmap=new l,this.flow=new u,this.fadeDuration=i(400),this.physicallyBasedRenderingEnabled=!1,this.maxTexturePixels=1/0,this.memoryLimit=786432e3,this.additionalCacheMemory=0,this.maximumPixelRatio=1/0}};e([n({type:a})],d.prototype,`graphics3D`,void 0),e([n({type:o})],d.prototype,`sceneService`,void 0),e([n({type:s})],d.prototype,`tiledSurface`,void 0),e([n({type:c})],d.prototype,`gaussianSplat`,void 0),e([n({type:l})],d.prototype,`heatmap`,void 0),e([n({type:u})],d.prototype,`flow`,void 0),e([n()],d.prototype,`fadeDuration`,void 0),e([n()],d.prototype,`physicallyBasedRenderingEnabled`,void 0),e([n()],d.prototype,`maxTexturePixels`,void 0),e([n()],d.prototype,`memoryLimit`,void 0),e([n()],d.prototype,`additionalCacheMemory`,void 0),e([n()],d.prototype,`maximumPixelRatio`,void 0),d=e([r(`esri.views.3d.support.QualitySettings`)],d);const f=d;export{f as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{Milliseconds as i}from"../../../core/time.js";let a=class extends t{constructor(e={}){super(e),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};e([n()],a.prototype,`maxTotalNumberOfFeatures`,void 0),e([n()],a.prototype,`maxNumberOfDrawCalls`,void 0),e([n()],a.prototype,`maxTotalNumberOfVertices`,void 0),e([n()],a.prototype,`snapshotAvailable`,void 0),e([n()],a.prototype,`polygonLodFactor`,void 0),e([n()],a.prototype,`polylineLodFactor`,void 0),e([n()],a.prototype,`skipHighSymbolLods`,void 0),a=e([r(`esri.views.3d.support.QualitySettings.Graphics3DSettings`)],a);let o=class extends t{constructor(e={}){super(e),this.objectLoDFactor=1,this.meshLoDFactor=1,this.pointCloudLoDFactor=1}};e([n()],o.prototype,`objectLoDFactor`,void 0),e([n()],o.prototype,`meshLoDFactor`,void 0),e([n()],o.prototype,`pointCloudLoDFactor`,void 0),o=e([r(`esri.views.3d.support.QualitySettings.SceneServiceSettings`)],o);let s=class extends t{constructor(e={}){super(e),this.lodBias=0,this.angledSplitBias=1,this.elevationLevelDelta=3}};e([n()],s.prototype,`lodBias`,void 0),e([n()],s.prototype,`angledSplitBias`,void 0),e([n()],s.prototype,`elevationLevelDelta`,void 0),s=e([r(`esri.views.3d.support.QualitySettings.TiledSurfaceSettings`)],s);let c=class extends t{constructor(e={}){super(e),this.minimumPixelRadius=1,this.minimumOpacity=1,this.maximumNumberOfGaussians=2e6}};e([n()],c.prototype,`minimumPixelRadius`,void 0),e([n()],c.prototype,`minimumOpacity`,void 0),e([n()],c.prototype,`maximumNumberOfGaussians`,void 0),c=e([r(`esri.views.3d.support.QualitySettings.GaussianSplatSettings`)],c);let l=class extends t{constructor(e={}){super(e),this.pixelRatio=1}};e([n()],l.prototype,`pixelRatio`,void 0),l=e([r(`esri.views.3d.support.QualitySettings.HeatmapSettings`)],l);let u=class extends t{constructor(){super(...arguments),this.maxTotalNumberOfStreamlines=1e5,this.maxTracingResolution=2048,this.transitionEnabled=!0}};e([n()],u.prototype,`maxTotalNumberOfStreamlines`,void 0),e([n()],u.prototype,`maxTracingResolution`,void 0),e([n()],u.prototype,`transitionEnabled`,void 0),u=e([r(`esri.views.3d.support.QualitySettings.FlowSettings`)],u);let d=class extends t{constructor(e){super(e),this.graphics3D=new a,this.sceneService=new o,this.tiledSurface=new s,this.gaussianSplat=new c,this.heatmap=new l,this.flow=new u,this.voxelWasmQuality=1,this.lyr3dWasmQuality=2,this.fadeDuration=i(400),this.physicallyBasedRenderingEnabled=!1,this.maxTexturePixels=1/0,this.memoryLimit=786432e3,this.additionalCacheMemory=0,this.maximumPixelRatio=1/0}};e([n({type:a})],d.prototype,`graphics3D`,void 0),e([n({type:o})],d.prototype,`sceneService`,void 0),e([n({type:s})],d.prototype,`tiledSurface`,void 0),e([n({type:c})],d.prototype,`gaussianSplat`,void 0),e([n({type:l})],d.prototype,`heatmap`,void 0),e([n({type:u})],d.prototype,`flow`,void 0),e([n()],d.prototype,`voxelWasmQuality`,void 0),e([n()],d.prototype,`lyr3dWasmQuality`,void 0),e([n()],d.prototype,`fadeDuration`,void 0),e([n()],d.prototype,`physicallyBasedRenderingEnabled`,void 0),e([n()],d.prototype,`maxTexturePixels`,void 0),e([n()],d.prototype,`memoryLimit`,void 0),e([n()],d.prototype,`additionalCacheMemory`,void 0),e([n()],d.prototype,`maximumPixelRatio`,void 0),d=e([r(`esri.views.3d.support.QualitySettings`)],d);const f=d;export{f as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../Camera.js";import{copy as t,distance as n,dist as r,length as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,clone as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../core/Logger.js";import{deg2rad as c,rad2deg as l,asinClamped as u}from"../../../core/mathUtils.js";import{throwIfAborted as d}from"../../../core/promiseUtils.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectPointToVectorAsync as m,projectPointToVector as h}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as g,projectVectorToPoint as _}from"../../../geometry/projection/projectVectorToPoint.js";import{projectAsync as v,project as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";import{toRenderCamera as w}from"../webgl.js";import{scaleToDistance as T,distanceToScale as E}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as D}from"./earthUtils.js";import{getElevationAtPoint as O}from"./ElevationProvider.js";import{viewModeDependentUtil as k,directionToHeadingTilt as A}from"./viewingModeUtils.js";const j=()=>s.getLogger(`esri.views.3d.support.cameraUtils`),M=a();function N(e){return e.spatialReference??b.WGS84}function ee(e,t,n,r,i){return k(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=I(A(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let a=f(e.spatialReference).radius,o=e.state.isLocal?t.eye[2]:i(t.eye)-a,s=Math.abs(o-n);return P(e,E(e,s),t,r)}function ne(e,t,n=0){let r=w(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,r,a){if(t===0)return 0;let o=e.state.contentCamera,s=n(o.eye,r),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),s;let p=s,m=A(e,o.eye,o.viewForward,o.up),h=m.tilt>90;if(e.state.isLocal){let n=F(t,m.tilt,d),r=(T(e,n)-Math.abs(o.eye[2]-a[2]))/Math.cos(c(m.tilt));return p=h?p-r:p+r,p}let g=1/0,_=0,v=z(e,m.heading,m.tilt,r,s,1);if(!v)return p;let y=i(a);for(;g>1&&_<100;){let a=i(v.eye),s=h?180-v.tilt:v.tilt,b=c(s),x=Math.sin(b)*a,S=Math.cos(b)*a,C=F(t,v.tilt,d),w=T(e,C),E=h?y-w:y+w,D=u(x/E),O=Math.cos(D)*E-S,k=n(v.eye,r);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,r,p,1);let A=Q(e,v,l(o.fov));if(!v||!A)return p;let j=ne(e,A,y-f(e.spatialReference).radius);g=Math.abs(t-j),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,T(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,a){let o=await B(e,r.heading,r.tilt,t,n,i,a);return d(a),$(e,o,r.fov,a)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(O(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:a}=e;if(r==null||!a.fromRenderCoords(t,M,i))return!1;let[o,s,c]=M,l=await r.queryElevation(o,s,c,i,`ground`,n)??0;return d(n),l>c-1}async function ce(e,n,r){let i=a();if(n==null)return t(i,e.state.camera.center);if(n instanceof p){let{renderSpatialReference:t,basemapTerrain:a,elevationProvider:o}=e,s=n.spatialReference;if(await m(n,i,t,{signal:r}),d(r),n.z==null&&a!=null&&o!=null){let t=await o.queryElevation(n.x,n.y,n.z??0,s,`ground`,r);d(r),t!=null&&e.renderCoordsHelper.setAltitude(i,t)}return i}return t(i,n)}function le(e,n){let r=a();if(n==null)return t(r,e.state.camera.center);if(n instanceof p){if(!h(n,r,e.renderSpatialReference))return null;let{basemapTerrain:t,elevationProvider:i}=e;if(n.z==null&&t!=null&&i!=null){let t=O(i,n);t!=null&&e.renderCoordsHelper.setAltitude(r,t)}return r}return t(r,n)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,a,o){let s=r instanceof p?r:null,c=await ce(e,r,o);return d(o),H(e,t,n,s,c,i,a,o)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!_(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,a,o,s){r||(r=new p({spatialReference:N(e)}),await g(i,e.renderSpatialReference,r,{signal:s})||(r=null)),d(s);let c=U(e,t,n,i,a,o);if(W(e,n,o)&&await se(e,c.eye,s)){d(s);let{tilt:o,mode:c}=G(e,n,i,a);return H(e,t,o,r,i,a,c,s)}return K(c,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a);return(0,k(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:o(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&C(i,n.isGlobal)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p({x:t.xmin,y:t.ymin,spatialReference:t.spatialReference}),a=new p({x:t.xmax,y:t.ymax,spatialReference:t.spatialReference}),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=D(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=y(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=+Math.max(.5*r*s,.5*i*c,.5*a*l);return{center:n,distance:u}}async function ue(e,t,n,r,i,a){let o=q(e,t)?t:await v(t,e.spatialReference,{signal:a});d(a);let{center:s,distance:c}=J(e,o),l=await B(e,n,r,s,c,i,a);return d(a),$(e,l,e.camera.fov,a)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:y(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let i=e.renderSpatialReference,a=new p({spatialReference:N(e)});if(!_(n,i,a))return null;let o=Math.tan(t.fovX/2),s=Math.tan(t.fovY/2),c=r(t.eye,n),l=2*c*o,u=2*c*s;return k(e).toExtent(e,a,l,u)}function pe(e,t){return k(e).toArea(e,t)}function me(e,t,r){let i=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(r/i)/Math.LN2>8)return!0;let a=t,o=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return n(a,o)/(Math.tan(e.state.camera.fov*.5)*i)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return k(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return k(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return _(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return await g(n.eye,a,o,{signal:i}),d(i),new e({position:o,heading:n.heading,tilt:n.tilt,fov:r})}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
2
+ import e from"../../../Camera.js";import{copy as t,distance as n,dist as r,length as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a,clone as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../core/Logger.js";import{deg2rad as c,rad2deg as l,asinClamped as u}from"../../../core/mathUtils.js";import{throwIfAborted as d}from"../../../core/promiseUtils.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import p from"../../../geometry/Point.js";import{projectPointToVectorAsync as m,projectPointToVector as h}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPointAsync as g,projectVectorToPoint as _}from"../../../geometry/projection/projectVectorToPoint.js";import{projectAsync as v,project as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{gcsCyclical as x,webMercatorCyclical as S}from"../../../geometry/support/normalizeUtils.js";import{isSpatialReferenceSupported as C}from"../../support/spatialReferenceSupport.js";import{toRenderCamera as w}from"../webgl.js";import{scaleToDistance as T,distanceToScale as E}from"./cameraScaleUtils.js";import{getGreatCircleSpanAt as D}from"./earthUtils.js";import{getElevationAtPoint as O}from"./ElevationProvider.js";import{viewModeDependentUtil as k,directionToHeadingTilt as A}from"./viewingModeUtils.js";const j=()=>s.getLogger(`esri.views.3d.support.cameraUtils`),M=a();function N(e){return e.spatialReference??b.WGS84}function ee(e,t,n,r,i){return k(e).headingTiltToDirectionUp(t,n,r,i)}function P(e,t,n,r){let i=r.levelAtScale(t),a=I(A(e,n.eye,n.viewForward,n.up).tilt),o=Math.max(i-a,0);return r.scaleAtLevel(o)}function F(e,t,n){let r=n.levelAtScale(e),i=I(t);return n.scaleAtLevel(r+i)}function I(e){return 2*((e>90?180-e:e)/90)**2}function te(e,t,n=0){let r=e.basemapTerrain?.tilingScheme;if(!r)return 0;let a=f(e.spatialReference).radius,o=e.state.isLocal?t.eye[2]:i(t.eye)-a,s=Math.abs(o-n);return P(e,E(e,s),t,r)}function ne(e,t,n=0){let r=w(e,t);return r?te(e,r,n):0}const re=1;function ie(e,t,r,a){if(t===0)return 0;let o=e.state.contentCamera,s=n(o.eye,r),d=e.basemapTerrain?.tilingScheme;if(!d)return j().error(`#scaleToTargetDistance()`,`Cannot compute distance from scale without a tiling scheme`),s;let p=s,m=A(e,o.eye,o.viewForward,o.up),h=m.tilt>90;if(e.state.isLocal){let n=F(t,m.tilt,d),r=(T(e,n)-Math.abs(o.eye[2]-a[2]))/Math.cos(c(m.tilt));return p=h?p-r:p+r}let g=1/0,_=0,v=z(e,m.heading,m.tilt,r,s,1);if(!v)return p;let y=i(a);for(;g>1&&_<100;){let a=i(v.eye),s=h?180-v.tilt:v.tilt,b=c(s),x=Math.sin(b)*a,S=Math.cos(b)*a,C=F(t,v.tilt,d),w=T(e,C),E=h?y-w:y+w,D=u(x/E),O=Math.cos(D)*E-S,k=n(v.eye,r);p=h?k-O:k+O,v=z(e,m.heading,m.tilt,r,p,1);let A=Q(e,v,l(o.fov));if(!v||!A)return p;let j=ne(e,A,y-f(e.spatialReference).radius);g=Math.abs(t-j),++_}return p}async function ae(e,t,n,r,i,a){return L(e,t,T(e,n),r,i,a)}function oe(e,t,n,r,i,a){return Q(e,z(e,r.heading,r.tilt,t,n,i),r.fov,a)}async function L(e,t,n,r,i,a){let o=await B(e,r.heading,r.tilt,t,n,i,a);return d(a),$(e,o,r.fov,a)}function R(e,t){return!!(e.basemapTerrain&&e.renderCoordsHelper.fromRenderCoords(t,M,e.spatialReference)&&e.elevationProvider&&(O(e.elevationProvider,M)??0)>M[2]-1)}async function se(e,t,n){if(R(e,t))return!0;let{elevationProvider:r,spatialReference:i,renderCoordsHelper:a}=e;if(r==null||!a.fromRenderCoords(t,M,i))return!1;let[o,s,c]=M,l=await r.queryElevation(o,s,c,i,`ground`,n)??0;return d(n),l>c-1}async function ce(e,n,r){let i=a();if(n==null)return t(i,e.state.camera.center);if(n instanceof p){let{renderSpatialReference:t,basemapTerrain:a,elevationProvider:o}=e,s=n.spatialReference;if(await m(n,i,t,{signal:r}),d(r),n.z==null&&a!=null&&o!=null){let t=await o.queryElevation(n.x,n.y,n.z??0,s,`ground`,r);d(r),t!=null&&e.renderCoordsHelper.setAltitude(i,t)}return i}return t(i,n)}function le(e,n){let r=a();if(n==null)return t(r,e.state.camera.center);if(n instanceof p){if(!h(n,r,e.renderSpatialReference))return null;let{basemapTerrain:t,elevationProvider:i}=e;if(n.z==null&&t!=null&&i!=null){let t=O(i,n);t!=null&&e.renderCoordsHelper.setAltitude(r,t)}return r}return t(r,n)}function z(e,t,n,r,i,a){return V(e,t,n,r instanceof p?r:null,le(e,r),i,a)}async function B(e,t,n,r,i,a,o){let s=r instanceof p?r:null,c=await ce(e,r,o);return d(o),H(e,t,n,s,c,i,a,o)}function V(e,t,n,r,i,a,o){if(i==null||!r&&(r=new p({spatialReference:N(e)}),!_(i,e.renderSpatialReference,r)))return null;let s=U(e,t,n,i,a,o);if(W(e,n,o)&&R(e,s.eye)){let{tilt:o,mode:s}=G(e,n,i,a);return V(e,t,o,r,i,a,s)}return K(s,i)}async function H(e,t,n,r,i,a,o,s){r||(r=new p({spatialReference:N(e)}),await g(i,e.renderSpatialReference,r,{signal:s})||(r=null)),d(s);let c=U(e,t,n,i,a,o);if(W(e,n,o)&&await se(e,c.eye,s)){d(s);let{tilt:o,mode:c}=G(e,n,i,a);return H(e,t,o,r,i,a,c,s)}return K(c,i)}function U(e,t,n,r,i,a){i=Math.max(i,e.state.constraints.minimumPoiDistance);let o=he(e,t,n,r,i,a);return(0,k(e).eyeForCenterWithHeadingTilt)(r,i,o.heading,o.tilt)}function W(e,t,n){let r=e.map.ground.navigationConstraint;return n===1&&e.state.isGlobal&&t>0&&(r==null||r.type===`stay-above`)}function G(e,t,n,r){let i=X(e,n,r,_e(e,r,t,n));return{tilt:i,mode:t-i<1?0:1}}function K(e,t){return{...e,center:o(t)}}function q(e,t){let{state:n,spatialReference:r}=e,i=t.spatialReference;return n.isGlobal&&C(i,n.isGlobal)||n.isLocal&&r.equals(i)}function J(e,t){let n,r,i;if(e.state.isGlobal){let e=new p({x:t.xmin,y:t.ymin,spatialReference:t.spatialReference}),a=new p({x:t.xmax,y:t.ymax,spatialReference:t.spatialReference}),o=t.spatialReference.isGeographic?x:S;n=new p({x:o.center(e.x,a.x),y:(a.y+e.y)/2,z:t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0,spatialReference:t.spatialReference});let s=f(t.spatialReference),c=D(n,e,a);r=c.lon,i=c.lat,o.diff(e.x,a.x)>o.range/2&&(r+=s.halfCircumference),r=Math.min(r,s.halfCircumference),i=Math.min(i,s.halfCircumference)}else{let a=e.renderSpatialReference??t.spatialReference;a.equals(t.spatialReference)||(t=y(t,a)),r=t.xmax-t.xmin,i=t.ymax-t.ymin;let o=t.zmax!=null&&t.zmin!=null?(t.zmax+t.zmin)/2:void 0;n=new p({x:t.xmin+.5*r,y:t.ymin+.5*i,z:o,spatialReference:a})}let a=t.zmax!=null&&t.zmin!=null?t.zmax-t.zmin:0,o=e.state.camera,s=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),l=1/Math.tan(o.fov/2),u=+Math.max(.5*r*s,.5*i*c,.5*a*l);return{center:n,distance:u}}async function ue(e,t,n,r,i,a){let o=q(e,t)?t:await v(t,e.spatialReference,{signal:a});d(a);let{center:s,distance:c}=J(e,o),l=await B(e,n,r,s,c,i,a);return d(a),$(e,l,e.camera.fov,a)}function de(e,t,n,r,i,a){let o;try{o=q(e,t)?t:y(t,e.spatialReference)}catch{return null}let{center:s,distance:c}=J(e,o),l=z(e,n,r,s,c,i);return l==null?null:Q(e,l,e.camera.fov,a)}function fe(e,t,n){let i=e.renderSpatialReference,a=new p({spatialReference:N(e)});if(!_(n,i,a))return null;let o=Math.tan(t.fovX/2),s=Math.tan(t.fovY/2),c=r(t.eye,n),l=2*c*o,u=2*c*s;return k(e).toExtent(e,a,l,u)}function pe(e,t){return k(e).toArea(e,t)}function me(e,t,r){let i=e.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(r/i)/Math.LN2>8)return!0;let a=t,o=e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation;return n(a,o)/(Math.tan(e.state.camera.fov*.5)*i)>5}function he(e,t,n,r,i,a){let o=0;return a===1&&me(e,r,i)?(t=0,o=ge(e,i,n,r)):o=Z(e,r,i,n),o=e.state.constraints.clampTilt(i,o),n=X(e,r,i,o),{heading:t,tilt:n}}const Y=.7;function ge(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);a.max=Math.min(a.max,Math.PI*.5);let o=a.min*.30000000000000004+a.max*Y;return Math.min(i,o)}function _e(e,t,n,r){let i=Z(e,r,t,n);if(!e.state.constraints.tilt)return i;let a=e.state.constraints.tilt(t);return i=Math.min(i,Math.PI*.5),a.min*.30000000000000004+i*Y}function X(e,t,n,r){return k(e).lookAtTiltToEyeTilt(r,t,n)}function Z(e,t,n,r){return k(e).eyeTiltToLookAtTilt(r,t,n)}function Q(t,n,r,i){if(n==null)return null;let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return _(n.eye,a,o)?(i??=new e,i.position=o,i.heading=n.heading,i.tilt=n.tilt,i.fov=r,i):null}async function $(t,n,r,i){let a=t.renderSpatialReference,o=new p({spatialReference:N(t)});return await g(n.eye,a,o,{signal:i}),d(i),new e({position:o,heading:n.heading,tilt:n.tilt,fov:r})}function ve(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#scaleToZoom()`,`Cannot compute zoom from scale without a tiling scheme`);else return n.levelAtScale(t)}function ye(e,t){let n=e.basemapTerrain?.tilingScheme;if(!n)j().error(`#zoomToScale()`,`Cannot compute scale from zoom without a tiling scheme`);else return n.scaleAtLevel(t)}export{P as applyTiltAdjustToScale,L as fromCenterDistanceAsync,oe as fromCenterDistanceSync,ae as fromCenterScale,ue as fromExtentAsync,de as fromExtentSync,B as getObserverForPointAtDistanceAsync,z as getObserverForPointAtDistanceSync,N as getViewSR,ee as headingTiltToDirectionUp,F as removeTiltAdjustFromScale,re as scaleErrorThreshold,ve as scaleToZoom,pe as toArea,fe as toExtent,ie as viewScaleToCameraDistance,ye as zoomToScale};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{freeze as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SizedPixelFormat as t,PixelType as n}from"../../../webgl/enums.js";import{ManagedTexture as r}from"../../webgl-engine/lib/ManagedTexture.js";const i=128,a=.5,o=e(a/2,a/2,1-a/2,1-a/2);function s(e){return e===`cross`||e===`x`}function c(e,t=128,n=t*a,i=0){let{data:o,parameters:s}=l(e,t,n,i);return new r(o,s)}function l(e,r=128,i=r*a,o=0){return{data:u(e,r,i,o),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:r,height:r,noUnpackFlip:!0,dataType:n.FLOAT,pixelFormat:6403,internalFormat:t.R16F,reloadable:!0}}}function u(e,t=128,n=t*a,r=0){switch(e){case`circle`:return d(t,n);case`square`:return f(t,n);case`cross`:return m(t,n,r);case`x`:return h(t,n,r);case`kite`:return p(t,n);case`triangle`:return g(t,n);case`arrow`:return _(t,n);default:return d(t,n)}}function d(e,t){let n=e/2-.5;return S(e,b(n,n,t/2))}function f(e,t){return v(e,t,!1)}function p(e,t){return v(e,t,!0)}function m(e,t,n=0){return y(e,t,!1,n)}function h(e,t,n=0){return y(e,t,!0,n)}function g(e,t){return S(e,x(e/2,t,t/2))}function _(e,t){let n=t,r=t/2,i=e/2,a=.8*n,o=b(i,(e-t)/2-a,Math.sqrt(a*a+r*r)),s=x(i,n,r);return S(e,(e,t)=>Math.max(s(e,t),-o(e,t)))}function v(e,t,n){return n&&(t/=Math.SQRT2),S(e,(r,i)=>{let a=r-.5*e+.25,o=-i+.5*e-.75;if(n){let e=(a+o)/Math.SQRT2;o=(o-a)/Math.SQRT2,a=e}return Math.max(Math.abs(a),Math.abs(o))-.5*t})}function y(e,t,n,r=0){t-=r,n&&(t*=Math.SQRT2);let i=.5*t;return S(e,(t,a)=>{let o=t-.5*e,s=-a+.5*e-1;if(n){let e=(o+s)/Math.SQRT2;s=(s-o)/Math.SQRT2,o=e}let c;return o=Math.abs(o),s=Math.abs(s),c=o>s?o>i?Math.sqrt((o-i)*(o-i)+s*s):s:s>i?Math.sqrt(o*o+(s-i)*(s-i)):o,c-=r/2,c})}function b(e,t,n){return(r,i)=>{let a=r-e,o=i-t;return Math.sqrt(a*a+o*o)-n}}function x(e,t,n){let r=Math.sqrt(t*t+n*n);return(i,a)=>{let o=Math.abs(i-e)-n,s=a-e+t/2+.75,c=(t*o+n*s)/r,l=-s;return Math.max(c,l)}}function S(e,t){let n=new Float32Array(e*e);for(let r=0;r<e;r++)for(let i=0;i<e;i++){let a=i+e*r;n[a]=t(i,r)/e}return n}export{_ as createArrow,d as createCircle,m as createCross,p as createKite,u as createPrimitive,f as createSquare,c as createTexture,l as createTextureInfo,g as createTriangle,h as createX,o as defaultBoundingBox,a as defaultSymbolSizeRatio,i as defaultTexSize,s as requiresHalfTexelOffset};
2
+ import{freeze as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SizedPixelFormat as t,PixelType as n}from"../../../webgl/enums.js";import{ManagedTexture as r}from"../../webgl-engine/lib/ManagedTexture.js";const i=128,a=.5,o=e(a/2,a/2,1-a/2,1-a/2);function s(e){return e===`cross`||e===`x`}function c(e,t=128,n=t*a,i=0){let{data:o,parameters:s}=l(e,t,n,i);return new r(o,s)}function l(e,r=128,i=r*a,o=0){return{data:u(e,r,i,o),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:r,height:r,noUnpackFlip:!0,dataType:n.FLOAT,pixelFormat:6403,internalFormat:t.R16F,reloadable:!0}}}function u(e,t=128,n=t*a,r=0){switch(e){case`circle`:return d(t,n);case`square`:return f(t,n);case`cross`:return m(t,n,r);case`x`:return h(t,n,r);case`kite`:return p(t,n);case`triangle`:return g(t,n);case`arrow`:return _(t,n);default:return d(t,n)}}function d(e,t){let n=e/2-.5;return S(e,b(n,n,t/2))}function f(e,t){return v(e,t,!1)}function p(e,t){return v(e,t,!0)}function m(e,t,n=0){return y(e,t,!1,n)}function h(e,t,n=0){return y(e,t,!0,n)}function g(e,t){return S(e,x(e/2,t,t/2))}function _(e,t){let n=t,r=t/2,i=e/2,a=.8*n,o=b(i,(e-t)/2-a,Math.sqrt(a*a+r*r)),s=x(i,n,r);return S(e,(e,t)=>Math.max(s(e,t),-o(e,t)))}function v(e,t,n){return n&&(t/=Math.SQRT2),S(e,(r,i)=>{let a=r-.5*e+.25,o=-i+.5*e-.75;if(n){let e=(a+o)/Math.SQRT2;o=(o-a)/Math.SQRT2,a=e}return Math.max(Math.abs(a),Math.abs(o))-.5*t})}function y(e,t,n,r=0){t-=r,n&&(t*=Math.SQRT2);let i=.5*t;return S(e,(t,a)=>{let o=t-.5*e,s=-a+.5*e-1;if(n){let e=(o+s)/Math.SQRT2;s=(s-o)/Math.SQRT2,o=e}let c;return o=Math.abs(o),s=Math.abs(s),c=o>s?o>i?Math.sqrt((o-i)*(o-i)+s*s):s:s>i?Math.sqrt(o*o+(s-i)*(s-i)):o,c-=r/2})}function b(e,t,n){return(r,i)=>{let a=r-e,o=i-t;return Math.sqrt(a*a+o*o)-n}}function x(e,t,n){let r=Math.sqrt(t*t+n*n);return(i,a)=>{let o=Math.abs(i-e)-n,s=a-e+t/2+.75,c=(t*o+n*s)/r,l=-s;return Math.max(c,l)}}function S(e,t){let n=new Float32Array(e*e);for(let r=0;r<e;r++)for(let i=0;i<e;i++){let a=i+e*r;n[a]=t(i,r)/e}return n}export{_ as createArrow,d as createCircle,m as createCross,p as createKite,u as createPrimitive,f as createSquare,c as createTexture,l as createTextureInfo,g as createTriangle,h as createX,o as defaultBoundingBox,a as defaultSymbolSizeRatio,i as defaultTexSize,s as requiresHalfTexelOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{watch as r,syncAndInitial as i,when as a,sync as o}from"../../../../core/reactiveUtils.js";import{throttle as s}from"../../../../core/throttle.js";import{clone as c,create as l}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as u}from"../../../support/flow/dataUtils.js";import d from"../../layers/FlowSubView3D.js";import{getFeatureTileId as f}from"../../layers/support/FeatureTileDescriptor.js";import{isRasterTile as p}from"../../terrain/TerrainData.js";import{descendantsAtLevel as m}from"../../terrain/tileUtils.js";import{tilesWaitingTime as h}from"./constants.js";import{FlowDataTile as g}from"./loadUtils.js";const _={type:`delete`};let v=class extends d{constructor(e){super(e),this._flowDataTiles=b(),this._throttling=!1,this._resetTileData=!0}initialize(){this.addHandles([this.surface.on(`tile-data-changed`,({tile:e,layerIndex:t,layerClass:n})=>{if(t!==this._layerIndex||n!==1)return;let r=this.frameTask.schedule(()=>{this._applyTileDataUpdate(e)&&this.triggerLoad()});this.updatingHandles.consumePromise(r)}),r(()=>this.renderedTiles,e=>{let t=this.frameTask.scheduleGenerator(this.loadAllTiles?t=>this._applyTileDataUpdates(e,t):t=>this._syncToTiles(e,t));this.updatingHandles.consumePromise(t)},i),a(()=>this.renderedTiles!=null&&this.extent!=null&&this.loadAllTiles,()=>{let e=this.frameTask.scheduleGenerator(e=>this._enterAllTilesMode(e));this.updatingHandles.consumePromise(e)},i),r(()=>this._pixelSize,()=>{this.invalidateTileData(),this._resetTileData=!0},o),this.layerView.on(`data-changed`,()=>{this.invalidateTileData(),this._resetTileData=!0})]),this._throttledTriggerLoad=s(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,h,this),this.addHandles(this._throttledTriggerLoad)}clear(){super.clear(),this._resetTileData=!1}*_enterAllTilesMode(e){let{targetTiles:t,_flowDataTiles:n}=this,r=b();for(let[e,i]of n)t.has(e)&&r.set(e,i);this._setFlowDataTiles(r),e.madeProgress(),e.done&&(e=yield),yield*this._applyTileDataUpdates(new Set(this.surface.allTiles),e),this.triggerLoad()}*_syncToTiles(e,t){let n=b();for(let r of e??[]){let e=this._flowDataTiles.get(r.key),i=e==null||e.type===`delete`||e.type===`invalid`?this._getLoadedState(r):e;i!=null&&n.set(r.key,i),t.madeProgress(),t.done&&(t=yield)}this._setFlowDataTiles(n),this.triggerLoad()}*_applyTileDataUpdates(e,t){let n=!1;for(let r of e??[]){let e=this._applyTileDataUpdate(r);n||=e,t.madeProgress(),t.done&&(t=yield)}n&&this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get _pixelSize(){return this.surface.tilingScheme.pixelSize}doRefresh(){this.invalidateTileData(),super.doRefresh()}triggerLoad(){let{_throttledTriggerLoad:e}=this;e==null?super.triggerLoad():this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){let{_flowDataTiles:n,needsMagnitude:r}=this,i=this.getSimulationSettings(e);if(i==null)return;let a=this._resetTileData;if(!a&&n.size===0)return;let o=b();n.forEach((e,t)=>{e.type===`delete`?(o.set(t,_),n.delete(t)):(a||e.type!==`on-worker`&&e.type!==`invalid`)&&(o.set(t,e),n.set(t,e.type===`invalid`?{type:`invalid`,memory:e.memory}:{type:`on-worker`,sourceLevel:e.sourceLevel,memory:e.memory}))});let s={simulationSettings:i,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,reset:a,needsMagnitude:r,startPositions:this.startPositions(e)};this._resetTileData=!1;let{streamlines:c}=await this.workerHandle.generateTiledStreamlines(s,t);return c}hasWork(){let e=!this.suspended&&super.loadRequirementsMet&&this.tilesIntersectDataBounds;return super.hasWork()||this._throttling||this._resetTileData&&e}get loadRequirementsMet(){return super.loadRequirementsMet&&(this._flowDataTiles.size>0||this._resetTileData)}_getLoadedState(e){let{_layerIndex:t}=this;if(t==null||e.isDisposed)return null;let n=e.getLayerInfo(t,1);if(n==null)return null;let r=this._getRasterTile(n,e,t);if(r==null)return this._upsampleFlowData(t,n.upsampleInfo,e.lij,e.extent);let i=this._createFlowDataTile(r,e.lij,e.extent,this._pixelSize);return{type:`loaded`,memory:S(i),data:i,sourceLevel:e.level}}_upsampleFlowData(e,t,n,r){if(t==null)return null;let i=t.tile;if(i==null)return null;let a=i.getLayerInfo(e,1);if(a==null)return null;let o=this._getRasterTile(a,i,e);if(o==null)return null;let{scale:s,offset:c}=t,l=Math.max(Math.floor(this._pixelSize*s),1),u=o.source,d=Math.floor(c[0]*u.width),f=Math.floor((1-c[1]-s)*u.height),p=this._createFlowDataTile(o,n,r,l,d,f);return{type:`loaded`,memory:S(p),data:p,sourceLevel:i.level}}_getRasterTile(e,t,n){let{data:r}=e;return e.dataMissing||!t.hasLayerData(n,1)||!p(r)?null:r}_createFlowDataTile(e,t,n,r,i,a){let o=u(this.layer.serviceRasterInfo.dataType,e.source,r,r,i,a),s=o.mask.slice();return new g(o.data,s,o.width,o.height,t,c(n))}_applyTileDataUpdate(e){let{renderedTiles:t,_layerIndex:n,loadAllTiles:r,loadAllTilesLevel:i}=this;if(t==null||n==null||r&&e.level>i)return!1;if(t.has(e))return this._updateRenderedTile(e);let a=e.key,o=this._setTileData(a,_),s=this._updateUpsampledTiles(t,e,n);o||=s;let c=r&&this._updateDescendants(e,n);return o||=c,o}_updateRenderedTile(e){let t=e.key,{_flowDataTiles:n}=this;if(x(n.get(t),e))return!1;let r=this._getLoadedState(e);return this._setTileData(t,r)}_updateUpsampledTiles(e,t,n){let{_flowDataTiles:r}=this,i=!1;for(let a of e.values()){let e=a.key;if(x(r.get(e),t))continue;let o=a.getLayerInfo(n,1);if(o==null||this._getRasterTile(o,a,n)!=null||o.upsampleInfo?.tile!==t)continue;let s=this._getLoadedState(a),c=this._setTileData(e,s);i||=c}return i}_updateDescendants(e,t){let n=!1,{tilingScheme:r,upsampleInfoPool:i}=this.surface,{targetTiles:a,_flowDataTiles:o,loadAllTilesLevel:s}=this,c=e.lij,u=m(c,s).values().map(e=>[f(e[0],e[1],e[2]),e]).filter(([e])=>a.has(e)).toArray();if(u.length===0)return n;let d=1<<s-c[0],p=1/d,h=c[1]*d,g=c[2]*d,_=i.acquire();for(let[i,a]of u){if(x(o.get(i),e))continue;let s=l();r.getExtent(a[0],a[1],a[2],s);let c=1-(a[1]-h)*p-p,u=(a[2]-g)*p;_.init(e,u,c,p);let d=this._upsampleFlowData(t,_,a,s),f=this._setTileData(i,d);n||=f}return i.release(_),n}_setTileData(e,t){if(t==null)return!1;let{_flowDataTiles:n}=this;return n.get(e)==null&&t.type===`delete`?!1:(n.set(e,t),!0)}_setFlowDataTiles(e){let t=this._flowDataTiles.size!==e.size||e.entries().some(([e,t])=>this._flowDataTiles.get(e)!==t);this._flowDataTiles=e,t&&(this._resetTileData=!0)}get _allTilesLoaded(){let e=0;for(let t of this._flowDataTiles.values()??[])t.type!==`delete`&&t.type!==`invalid`&&e++;return this.loadAllTiles?e===this.targetTiles.size:e===this.renderedTiles?.size}invalidateTileData(){let{_flowDataTiles:e}=this;for(let[t,n]of e.entries())n.type!==`delete`&&e.set(t,{type:`invalid`,memory:n.memory})}get usedMemory(){let e=0;return this._flowDataTiles.forEach(t=>{t.type!==`delete`&&(e+=t.memory)}),super.usedMemory+e}get test(){return{...super.test,loadedTiles:this._flowDataTiles}}};e([t()],v.prototype,`_throttling`,void 0),e([t()],v.prototype,`_resetTileData`,void 0),v=e([n(`esri.views.3d.support.flow.FlowSubViewTiles3D`)],v);const y=v;function b(){return new Map}function x(e,t){return e!=null&&(e.type===`loaded`||e.type===`on-worker`)&&e.sourceLevel>=t.level}function S(e){return e.width*e.height*9}export{y as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{watch as r,syncAndInitial as i,when as a,sync as o}from"../../../../core/reactiveUtils.js";import{throttle as s}from"../../../../core/throttle.js";import{clone as c,create as l}from"../../../../geometry/support/aaBoundingRect.js";import{toFlowData as u}from"../../../support/flow/dataUtils.js";import d from"../../layers/FlowSubView3D.js";import{getFeatureTileId as f}from"../../layers/support/FeatureTileDescriptor.js";import{isRasterTile as p}from"../../terrain/TerrainData.js";import{descendantsAtLevel as m}from"../../terrain/tileUtils.js";import{tilesWaitingTime as h}from"./constants.js";import{FlowDataTile as g}from"./loadUtils.js";const _={type:`delete`};let v=class extends d{constructor(e){super(e),this._flowDataTiles=b(),this._throttling=!1,this._resetTileData=!0}initialize(){this.addHandles([this.surface.on(`tile-data-changed`,({tile:e,layerIndex:t,layerClass:n})=>{if(t!==this._layerIndex||n!==1)return;let r=this.frameTask.schedule(()=>{this._applyTileDataUpdate(e)&&this.triggerLoad()});this.updatingHandles.consumePromise(r)}),r(()=>this.renderedTiles,e=>{let t=this.frameTask.scheduleGenerator(this.loadAllTiles?t=>this._applyTileDataUpdates(e,t):t=>this._syncToTiles(e,t));this.updatingHandles.consumePromise(t)},i),a(()=>this.renderedTiles!=null&&this.extent!=null&&this.loadAllTiles,()=>{let e=this.frameTask.scheduleGenerator(e=>this._enterAllTilesMode(e));this.updatingHandles.consumePromise(e)},i),r(()=>this._pixelSize,()=>{this.invalidateTileData(),this._resetTileData=!0},o),this.layerView.on(`data-changed`,()=>{this.invalidateTileData(),this._resetTileData=!0})]),this._throttledTriggerLoad=s(()=>{super.triggerLoad(),this._throttling=!1},()=>this._throttling=!0,h,this),this.addHandles(this._throttledTriggerLoad)}clear(){super.clear(),this._resetTileData=!1}*_enterAllTilesMode(e){let{targetTiles:t,_flowDataTiles:n}=this,r=b();for(let[e,i]of n)t.has(e)&&r.set(e,i);this._setFlowDataTiles(r),e.madeProgress(),e.done&&(e=yield),yield*this._applyTileDataUpdates(new Set(this.surface.allTiles),e),this.triggerLoad()}*_syncToTiles(e,t){let n=b();for(let r of e??[]){let e=this._flowDataTiles.get(r.key),i=e==null||e.type===`delete`||e.type===`invalid`?this._getLoadedState(r):e;i!=null&&n.set(r.key,i),t.madeProgress(),t.done&&(t=yield)}this._setFlowDataTiles(n),this.triggerLoad()}*_applyTileDataUpdates(e,t){let n=!1;for(let r of e??[]){let e=this._applyTileDataUpdate(r);n||=e,t.madeProgress(),t.done&&(t=yield)}n&&this.triggerLoad()}abort(){super.abort(),this._throttling=!1}get _layerIndex(){return this.surface.getLayerIndexByUID(1,this.layerView.uid)}get _pixelSize(){return this.surface.tilingScheme.pixelSize}doRefresh(){this.invalidateTileData(),super.doRefresh()}triggerLoad(){let{_throttledTriggerLoad:e}=this;e==null?super.triggerLoad():this._allTilesLoaded?(e.hasPendingUpdates()||e(),e.forceUpdate()):e()}async fetchDataAndGenerateStreamlines(e,t){let{_flowDataTiles:n,needsMagnitude:r}=this,i=this.getSimulationSettings(e);if(i==null)return;let a=this._resetTileData;if(!a&&n.size===0)return;let o=b();n.forEach((e,t)=>{e.type===`delete`?(o.set(t,_),n.delete(t)):(a||e.type!==`on-worker`&&e.type!==`invalid`)&&(o.set(t,e),n.set(t,e.type===`invalid`?{type:`invalid`,memory:e.memory}:{type:`on-worker`,sourceLevel:e.sourceLevel,memory:e.memory}))});let s={simulationSettings:i,flowExtentInfo:e.flowExtentInfo,flowDataTiles:o,reset:a,needsMagnitude:r,startPositions:this.startPositions(e)};this._resetTileData=!1;let{streamlines:c}=await this.workerHandle.generateTiledStreamlines(s,t);return c}hasWork(){let e=!this.suspended&&super.loadRequirementsMet&&this.tilesIntersectDataBounds;return super.hasWork()||this._throttling||this._resetTileData&&e}get loadRequirementsMet(){return super.loadRequirementsMet&&(this._flowDataTiles.size>0||this._resetTileData)}_getLoadedState(e){let{_layerIndex:t}=this;if(t==null||e.isDisposed)return null;let n=e.getLayerInfo(t,1);if(n==null)return null;let r=this._getRasterTile(n,e,t);if(r==null)return this._upsampleFlowData(t,n.upsampleInfo,e.lij,e.extent);let i=this._createFlowDataTile(r,e.lij,e.extent,this._pixelSize);return{type:`loaded`,memory:S(i),data:i,sourceLevel:e.level}}_upsampleFlowData(e,t,n,r){if(t==null)return null;let i=t.tile;if(i==null)return null;let a=i.getLayerInfo(e,1);if(a==null)return null;let o=this._getRasterTile(a,i,e);if(o==null)return null;let{scale:s,offset:c}=t,l=Math.max(Math.floor(this._pixelSize*s),1),u=o.source,d=Math.floor(c[0]*u.width),f=Math.floor((1-c[1]-s)*u.height),p=this._createFlowDataTile(o,n,r,l,d,f);return{type:`loaded`,memory:S(p),data:p,sourceLevel:i.level}}_getRasterTile(e,t,n){let{data:r}=e;return e.dataMissing||!t.hasLayerData(n,1)||!p(r)?null:r}_createFlowDataTile(e,t,n,r,i,a){let o=u(this.layer.serviceRasterInfo.dataType,e.source,r,r,i,a),s=o.mask.slice();return new g(o.data,s,o.width,o.height,t,c(n))}_applyTileDataUpdate(e){let{renderedTiles:t,_layerIndex:n,loadAllTiles:r,loadAllTilesLevel:i}=this;if(t==null||n==null||r&&e.level>i)return!1;if(t.has(e))return this._updateRenderedTile(e);let a=e.key,o=this._setTileData(a,_),s=this._updateUpsampledTiles(t,e,n);o||=s;let c=r&&this._updateDescendants(e,n);return o||=c}_updateRenderedTile(e){let t=e.key,{_flowDataTiles:n}=this;if(x(n.get(t),e))return!1;let r=this._getLoadedState(e);return this._setTileData(t,r)}_updateUpsampledTiles(e,t,n){let{_flowDataTiles:r}=this,i=!1;for(let a of e.values()){let e=a.key;if(x(r.get(e),t))continue;let o=a.getLayerInfo(n,1);if(o==null||this._getRasterTile(o,a,n)!=null||o.upsampleInfo?.tile!==t)continue;let s=this._getLoadedState(a),c=this._setTileData(e,s);i||=c}return i}_updateDescendants(e,t){let n=!1,{tilingScheme:r,upsampleInfoPool:i}=this.surface,{targetTiles:a,_flowDataTiles:o,loadAllTilesLevel:s}=this,c=e.lij,u=m(c,s).values().map(e=>[f(e[0],e[1],e[2]),e]).filter(([e])=>a.has(e)).toArray();if(u.length===0)return n;let d=1<<s-c[0],p=1/d,h=c[1]*d,g=c[2]*d,_=i.acquire();for(let[i,a]of u){if(x(o.get(i),e))continue;let s=l();r.getExtent(a[0],a[1],a[2],s);let c=1-(a[1]-h)*p-p,u=(a[2]-g)*p;_.init(e,u,c,p);let d=this._upsampleFlowData(t,_,a,s),f=this._setTileData(i,d);n||=f}return i.release(_),n}_setTileData(e,t){if(t==null)return!1;let{_flowDataTiles:n}=this;return n.get(e)==null&&t.type===`delete`?!1:(n.set(e,t),!0)}_setFlowDataTiles(e){let t=this._flowDataTiles.size!==e.size||e.entries().some(([e,t])=>this._flowDataTiles.get(e)!==t);this._flowDataTiles=e,t&&(this._resetTileData=!0)}get _allTilesLoaded(){let e=0;for(let t of this._flowDataTiles.values()??[])t.type!==`delete`&&t.type!==`invalid`&&e++;return this.loadAllTiles?e===this.targetTiles.size:e===this.renderedTiles?.size}invalidateTileData(){let{_flowDataTiles:e}=this;for(let[t,n]of e.entries())n.type!==`delete`&&e.set(t,{type:`invalid`,memory:n.memory})}get usedMemory(){let e=0;return this._flowDataTiles.forEach(t=>{t.type!==`delete`&&(e+=t.memory)}),super.usedMemory+e}get test(){return{...super.test,loadedTiles:this._flowDataTiles}}};e([t()],v.prototype,`_throttling`,void 0),e([t()],v.prototype,`_resetTileData`,void 0),v=e([n(`esri.views.3d.support.flow.FlowSubViewTiles3D`)],v);const y=v;function b(){return new Map}function x(e,t){return e!=null&&(e.type===`loaded`||e.type===`on-worker`)&&e.sourceLevel>=t.level}function S(e){return e.width*e.height*9}export{y as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{exactEquals as e,copy as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r,exactEquals as i,intersects as a,copy as o}from"../../../../geometry/support/aaBoundingBox.js";import{DepthRange as s}from"../../webgl-engine/lib/DepthRange.js";import{GaussianSplatFadeTexture as c}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as l}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as u}from"./GaussianSplatOrderTexture.js";import{GaussianSplatSortCoordinator as d}from"./GaussianSplatSortCoordinator.js";import{GaussianSplatTextureAtlas as f}from"./GaussianSplatTextureAtlas.js";class p{constructor(e,t,i){this._visibleTileDepthRange=new s,this._previousVisibleTileDepthRangeEye=n(),this._previousVisibleTileDepthRangeViewForward=n(),this._previousVisibleTileDepthRangeClippingBox=r(),this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._orderTexture=new u(e.renderingContext),this._fadingTexture=new c(e.renderingContext),this._headerTexture=new l(e.renderingContext),this._textureAtlas=new f(e.renderingContext,e.view.resourceController.memoryController,e.fboCache,i),this._sortCoordinator=new d(e,{ensureCapacity:()=>{this._textureAtlas.ensureTextureAtlas(),this._headerTexture.ensureCapacity(this._textureAtlas.pageAllocator.pageCount)},clear:()=>{this._orderTexture.clear(),this._textureAtlas.clear(),this._headerTexture.clear(),this._previousVisibleTileDepthRangeTilesVersion=-1},setOrder:(e,t)=>this._orderTexture.setData(e,t)},t)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get headerTexture(){return this._headerTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get headerTextureMemory(){return this._headerTexture.usedMemory}get sortBufferMemory(){return this._sortCoordinator.sortBufferMemory}get sortWorkerMemory(){return this._sortCoordinator.sortWorkerMemory}get usedMemory(){return this.textureAtlasMemory+this.headerTextureMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory+this.sortWorkerMemory}get visibleGaussians(){return this._sortCoordinator.visibleGaussians}get updating(){return this._sortCoordinator.updating}set useDeterministicSort(e){this._sortCoordinator.useDeterministicSort=e}queryVisibleTileDepthRange(n,r){if(this.visibleGaussians===0)return null;let{eye:s,viewForward:c}=n,l=s[0],u=s[1],d=s[2],f=c[0],p=c[1],m=c[2],h=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._sortCoordinator.visibleTilesVersion&&e(this._previousVisibleTileDepthRangeEye,s)&&e(this._previousVisibleTileDepthRangeViewForward,c)&&(r==null?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&i(this._previousVisibleTileDepthRangeClippingBox,r)))return h.near<=h.far?h:null;let g=1/0,_=-1/0,v=this._sortCoordinator.visibleTiles;for(let e=0;e<v.length;e++){let t=v[e];if(r!=null){let e=t.boundingBox;if(!a(e,r))continue}let n=f*(t.obbCenterX-l)+p*(t.obbCenterY-u)+m*(t.obbCenterZ-d),i=t.paddedMbsRadius,o=n-i;o<g&&(g=o);let s=n+i;s>_&&(_=s)}let y=g<=_;return y?h.set(g,_):h.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._sortCoordinator.visibleTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=r!=null,t(this._previousVisibleTileDepthRangeEye,s),t(this._previousVisibleTileDepthRangeViewForward,c),r!=null&&o(this._previousVisibleTileDepthRangeClippingBox,r),y?h:null}updateGaussianVisibility(e,t){this._sortCoordinator.updateGaussianVisibility(e,t)}requestSort(e=`view`){this._sortCoordinator.requestSort(e)}destroy(){this._sortCoordinator.destroy(),this._textureAtlas.destroy(),this._headerTexture.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}}export{p as GaussianSplatDataStore};
2
+ import{exactEquals as e,copy as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r,exactEquals as i,intersects as a,copy as o}from"../../../../geometry/support/aaBoundingBox.js";import{DepthRange as s}from"../../webgl-engine/lib/DepthRange.js";import{GaussianSplatFadeTexture as c}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as l}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as u}from"./GaussianSplatOrderTexture.js";import{GaussianSplatSortCoordinator as d}from"./GaussianSplatSortCoordinator.js";import{GaussianSplatTextureAtlas as f}from"./GaussianSplatTextureAtlas.js";class p{constructor(e,t,i){this._depthRange=new s,this._previousVisibleTileDepthRangeEye=n(),this._previousVisibleTileDepthRangeViewForward=n(),this._previousVisibleTileDepthRangeClippingBox=r(),this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._orderTexture=new u(e.renderingContext),this._fadingTexture=new c(e.renderingContext),this._headerTexture=new l(e.renderingContext),this._textureAtlas=new f(e.renderingContext,e.view.resourceController.memoryController,e.fboCache,i),this._sortCoordinator=new d(e,{ensureCapacity:()=>{this._textureAtlas.ensureTextureAtlas(),this._headerTexture.ensureCapacity(this._textureAtlas.pageAllocator.pageCount)},clear:()=>{this._orderTexture.clear(),this._textureAtlas.clear(),this._headerTexture.clear(),this._previousVisibleTileDepthRangeTilesVersion=-1},setOrder:(e,t)=>this._orderTexture.setData(e,t)},t)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get headerTexture(){return this._headerTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get headerTextureMemory(){return this._headerTexture.usedMemory}get sortBufferMemory(){return this._sortCoordinator.sortBufferMemory}get sortWorkerMemory(){return this._sortCoordinator.sortWorkerMemory}get usedMemory(){return this.textureAtlasMemory+this.headerTextureMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory+this.sortWorkerMemory}get visibleGaussians(){return this._sortCoordinator.visibleGaussians}get updating(){return this._sortCoordinator.updating}set useDeterministicSort(e){this._sortCoordinator.useDeterministicSort=e}unionVisibleTileDepthRange(n,r,s){if(this.visibleGaussians===0)return;let{eye:c,viewForward:l}=n,u=c[0],d=c[1],f=c[2],p=l[0],m=l[1],h=l[2];if(this._previousVisibleTileDepthRangeTilesVersion===this._sortCoordinator.visibleTilesVersion&&e(this._previousVisibleTileDepthRangeEye,c)&&e(this._previousVisibleTileDepthRangeViewForward,l)&&(r==null?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&i(this._previousVisibleTileDepthRangeClippingBox,r))&&this._depthRange.near<=this._depthRange.far){s.union(this._depthRange);return}let g=1/0,_=-1/0,v=this._sortCoordinator.visibleTiles;for(let e=0;e<v.length;e++){let t=v[e];if(r!=null){let e=t.boundingBox;if(!a(e,r))continue}let n=p*(t.obbCenterX-u)+m*(t.obbCenterY-d)+h*(t.obbCenterZ-f),i=t.paddedMbsRadius,o=n-i;o<g&&(g=o);let s=n+i;s>_&&(_=s)}g<=_?(this._depthRange.set(g,_),s.union(this._depthRange)):this._depthRange.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._sortCoordinator.visibleTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=r!=null,t(this._previousVisibleTileDepthRangeEye,c),t(this._previousVisibleTileDepthRangeViewForward,l),r!=null&&o(this._previousVisibleTileDepthRangeClippingBox,r)}updateGaussianVisibility(e,t){this._sortCoordinator.updateGaussianVisibility(e,t)}requestSort(e=`view`){this._sortCoordinator.requestSort(e)}destroy(){this._sortCoordinator.destroy(),this._textureAtlas.destroy(),this._headerTexture.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}}export{p as GaussianSplatDataStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as r,distance as i,scale as a,add as o,exactEquals as s,squaredLength as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as u}from"../../../../core/mathUtils.js";import{removeMaybe as d,destroyMaybe as f}from"../../../../core/maybe.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import m from"../../../../geometry/Point.js";import{projectBoundingRect as h}from"../../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../../geometry/support/aaBoundingRect.js";import{PropertiesPool as _}from"../../../support/PropertiesPool.js";import{noBudget as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";import{debugFlags as b}from"../debugFlags.js";import{PointOfInterest as x}from"./PointOfInterest.js";let S=class extends x{constructor(e){super(e),this._propertiesPool=new _({location:()=>new m,renderLocation:()=>l()},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=l(),this._updatingType=0}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=d(this._frameWorker),this._propertiesPool=f(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){let e=this._propertiesPool?.get(`location`);return e?(e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e):new m}get updating(){return this._updatingType!==0}updateRenderLocation(){this._updatingType=1,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get readyToRun(){return this.updating}runTask(e=v){let t=this._updatingType===2?2:1,n=this.estimateSurfaceAltitudeAtCenter(e,t);return n===y?(this._updatingType=2,y):(this._latestSurfaceAltitude=n,this._updateRenderLocation(),this._updatingType=0,e.madeProgress(),y)}_updateRenderLocation(){let e=C,t=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,e),n=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!t&&n&&(t=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e),t&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));let c=w;t&&this._latestSurfaceAltitudeChangesDistance(e,c)&&(r(e,c),this._currentSurfaceAltitude=this._latestSurfaceAltitude),t?this.distance=i(this._camera.eye,e):(a(e,this._camera.viewForward,this._get(`distance`)),o(e,e,this._camera.eye)),s(this._get(`renderLocation`),e)||this._set(`renderLocation`,r(this._propertiesPool.get(`renderLocation`),e))}_calculateSurfaceIntersection(e,t){let n=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(n.ray,e,t))return!1;if(this.state.isGlobal){let r=p(this.renderCoordsHelper.spatialReference).radius,s=r+e,l=c(n.eye),u=l<s*s,d=i(n.eye,t);if(u&&d>r/4){let e=s-Math.sqrt(l);return a(t,n.viewForward,e),o(t,t,n.eye),!0}}else{let e=this.surface?.ready?this.surface.groundExtent:null;e!=null&&h(e,this.surface?.spatialReference,T,this.renderCoordsHelper.spatialReference)&&(t[0]=u(t[0],T[0],T[2]),t[1]=u(t[1],T[1],T[3]))}return!0}_latestSurfaceAltitudeChangesDistance(e,t){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||e==null)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t)){if(!b.ENABLE_OPTIMIZATIONS)return!0;let n=this._camera.eye;if(i(n,e)!==i(n,t))return!0}return!1}};e([t({constructOnly:!0})],S.prototype,`scheduler`,void 0),e([t({constructOnly:!0})],S.prototype,`surface`,void 0),e([t({constructOnly:!0})],S.prototype,`task`,void 0),e([t()],S.prototype,`distance`,void 0),e([t({constructOnly:!0})],S.prototype,`estimateSurfaceAltitudeAtCenter`,void 0),e([t({readOnly:!0})],S.prototype,`location`,null),e([t({readOnly:!0})],S.prototype,`renderLocation`,void 0),e([t()],S.prototype,`_updatingType`,void 0),e([t()],S.prototype,`updating`,null),S=e([n(`esri.views.3d.support.pointsOfInterest.CenterOnSurface`)],S);const C=l(),w=l(),T=g();export{S as CenterOnSurface};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as r,distance as i,scale as a,add as o,exactEquals as s,squaredLength as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clamp as u}from"../../../../core/mathUtils.js";import{removeMaybe as d,destroyMaybe as f}from"../../../../core/maybe.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import m from"../../../../geometry/Point.js";import{projectBoundingRect as h}from"../../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../../geometry/support/aaBoundingRect.js";import{PropertiesPool as _}from"../../../support/PropertiesPool.js";import{noBudget as v}from"../../../support/Scheduler.js";import{Yield as y}from"../../../support/Yield.js";import{debugFlags as b}from"../debugFlags.js";import{PointOfInterest as x}from"./PointOfInterest.js";let S=class extends x{constructor(e){super(e),this._propertiesPool=new _({location:()=>new m,renderLocation:()=>l()},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=l(),this._updatingType=null}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=d(this._frameWorker),this._propertiesPool=f(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){let e=this._propertiesPool?.get(`location`);return e?(e.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e),e):new m}get updating(){return this._updatingType!==null}updateRenderLocation(){this._updatingType=`all-content`,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get readyToRun(){return this.updating}runTask(e=v){let t=this.estimateSurfaceAltitudeAtCenter(e,this._updatingType??`all-content`);return typeof t==`number`?(this._latestSurfaceAltitude=t,this._updateRenderLocation(),this._updatingType=null,e.madeProgress(),y):(this._updatingType=t,y)}_updateRenderLocation(){let e=C,t=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,e),n=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!t&&n&&(t=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e),t&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));let c=w;t&&this._latestSurfaceAltitudeChangesDistance(e,c)&&(r(e,c),this._currentSurfaceAltitude=this._latestSurfaceAltitude),t?this.distance=i(this._camera.eye,e):(a(e,this._camera.viewForward,this._get(`distance`)),o(e,e,this._camera.eye)),s(this._get(`renderLocation`),e)||this._set(`renderLocation`,r(this._propertiesPool.get(`renderLocation`),e))}_calculateSurfaceIntersection(e,t){let n=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(n.ray,e,t))return!1;if(this.state.isGlobal){let r=p(this.renderCoordsHelper.spatialReference).radius,s=r+e,l=c(n.eye),u=l<s*s,d=i(n.eye,t);if(u&&d>r/4){let e=s-Math.sqrt(l);return a(t,n.viewForward,e),o(t,t,n.eye),!0}}else{let e=this.surface?.ready?this.surface.groundExtent:null;e!=null&&h(e,this.surface?.spatialReference,T,this.renderCoordsHelper.spatialReference)&&(t[0]=u(t[0],T[0],T[2]),t[1]=u(t[1],T[1],T[3]))}return!0}_latestSurfaceAltitudeChangesDistance(e,t){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||e==null)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t)){if(!b.ENABLE_OPTIMIZATIONS)return!0;let n=this._camera.eye;if(i(n,e)!==i(n,t))return!0}return!1}};e([t({constructOnly:!0})],S.prototype,`scheduler`,void 0),e([t({constructOnly:!0})],S.prototype,`surface`,void 0),e([t({constructOnly:!0})],S.prototype,`task`,void 0),e([t()],S.prototype,`distance`,void 0),e([t({constructOnly:!0})],S.prototype,`estimateSurfaceAltitudeAtCenter`,void 0),e([t({readOnly:!0})],S.prototype,`location`,null),e([t({readOnly:!0})],S.prototype,`renderLocation`,void 0),e([t()],S.prototype,`_updatingType`,void 0),e([t()],S.prototype,`updating`,null),S=e([n(`esri.views.3d.support.pointsOfInterest.CenterOnSurface`)],S);const C=l(),w=l(),T=g();export{S as CenterOnSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import"../../../../core/has.js";import{add as i,exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as c,sync as l,initial as u,when as d,on as f}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as m}from"../../../../geometry/support/ray.js";import{PropertiesPool as h}from"../../../support/PropertiesPool.js";import{TaskPriority as g,noBudget as _}from"../../../support/Scheduler.js";import{Yield as v}from"../../../support/Yield.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{debugFlags as x}from"../debugFlags.js";import{DebugPoint as S}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as w}from"./CameraOnSurface.js";import{CenterOnSurface as T}from"./CenterOnSurface.js";import{ContentGeometryUpdates as E}from"./ContentGeometryUpdates.js";import{Focus as D}from"./Focus.js";import{StableSurfaceCenter as O}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as k}from"./SurfaceGeometryUpdates.js";let A=class extends t{constructor(e){super(e),this.renderPointOfView=s(),this._pois=[],this._updatingHandles=new p,this._debugCenters=null,this._tmpRay=m(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._contentChangedSinceLastUpdate=!0,this._geometryPois=[],this._propertiesPool=new h({renderPointOfView:()=>s()},this),this._contentIntersector=new y(e.view.state.isGlobal),this._surfaceIntersector=new y(e.view.state.isGlobal),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){let{state:e,groundView:t,renderCoordsHelper:n,map:r}=this.view,i=this.view.groundAndIMSurface,a=e=>this._estimateSurfaceAltitudeAtCenter(e),o=this.view.resourceController.scheduler,s=t?.elevationQueryCache,p={state:e,scheduler:o,renderCoordsHelper:n},m={...p,surface:t};this._set(`centerOnSurfaceInfrequent`,new T({...m,task:g.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnSurfaceFrequent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnContent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:(e,t)=>this._estimateContentAltitudeAtCenter(e,t)})),this._set(`cameraOnSurface`,new w({...m,cache:s,task:g.POINT_OF_INTEREST_INFREQUENT,map:r})),this._set(`surfaceGeometryUpdates`,new k({...p,surface:i,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set(`contentGeometryUpdates`,new E(this.view.allLayerViews,()=>this.view.graphicsView)),this._set(`surfaceOrigin`,new O({cache:s,view:this.view})),this._set(`focus`,new D({...p,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t,n)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t,n)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this._geometryPois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.focus),this.addHandles([c(()=>e.contentCamera,e=>this._cameraChanged(e),l),this._updatingHandles.add(()=>t.groundExtent,()=>this._updateGeometryPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain=e===`none`},u),d(()=>!t.updating&&this._contentChangedSinceLastUpdate,()=>{this._updateGeometryPointsOfInterest(),this._contentChangedSinceLastUpdate=!1},l),f(()=>this.surfaceGeometryUpdates.events,`request-update`,()=>this._updateGeometryPointsOfInterest()),f(()=>this.contentGeometryUpdates.events,`request-update`,()=>{this._contentChangedSinceLastUpdate=!0,this._updateCenterOnContent()}),this._updatingHandles.add(()=>x.SHOW_POI,e=>this._setDebug(e),u)]),this._cameraChanged(this.view.state.contentCamera);for(let e of this._pois)e.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(let e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set(`centerOnSurfaceInfrequent`,null),this._set(`centerOnSurfaceFrequent`,null),this._set(`centerOnContent`,null),this._set(`cameraOnSurface`,null),this._set(`surfaceGeometryUpdates`,null),this._set(`contentGeometryUpdates`,null),this._set(`surfaceOrigin`,null),this._set(`focus`,null)}get updating(){return!!(this.surfaceGeometryUpdates?.updating||this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&=(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),!1),this._centerRayCached}_estimateContentAltitudeAtCenter(e,t){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;let n=this._centerRay;if(n==null)return this._contentAltitudeAtCenter;if(t===1&&this.view.sceneIntersectionHelper.intersectRay(n,this._contentIntersector,j,N))this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j);else{let t=this._estimateSurfaceAltitudeAtCenter(e);if(t===v)return v;this._contentAltitudeAtCenter=t}return this._contentAltitudeAtCenterDirty=!1,this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(e=_){let{view:t}=this,{groundAndIMSurface:n}=t;if(!n)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;let r=this._centerRay;if(r==null)return this._surfaceAltitudeAtCenter;let a=r.origin,o=i(j,r.origin,r.direction);return this._surfaceIntersector.resetWithRay(r,t.state.contentCamera),n.intersectBudgeted(this._surfaceIntersector,null,a,o,e)?(this._surfaceIntersector.results.min.getIntersectionPoint(j)&&(this._surfaceAltitudeAtCenter=t.renderCoordsHelper.getAltitude(j)),this._surfaceAltitudeAtCenterDirty=!1,this._surfaceAltitudeAtCenter):v}_estimateSurfaceIntersectionAtRenderPoint(e,t,n,r=_){let a=C(t,e,M);if(a==null)return null;let o=a.origin,s=i(j,a.origin,a.direction);return this._surfaceIntersector.resetWithRay(a,t),this.view.groundAndIMSurface.intersectBudgeted(this._surfaceIntersector,null,o,s,r)?this._surfaceIntersector.results.min.getIntersectionPoint(n)?n:null:v}_cameraChanged(e){this._updateAllPointsOfInterest();let t=e.eye;a(this.renderPointOfView,t)||this._set(`renderPointOfView`,o(this._propertiesPool.get(`renderPointOfView`),t))}_updateAllPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._pois)e.updateRenderLocation()}_updateGeometryPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._geometryPois)e.updateRenderLocation()}_invalidateCenterEstimates(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)this._debugCenters?.forEach(e=>e.hide()),this.removeHandles(`debug`);else{if(!this._debugCenters){this._debugCenters=new Map;let e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new S(e,`red`,`CenterOnContent`)),this._debugCenters.set(this.centerOnSurfaceFrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.centerOnSurfaceInfrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.cameraOnSurface,new S(e,`blue`,`CameraOnSurface`)),this._debugCenters.set(this.focus,new S(e,`green`,`Focus`))}for(let e of this._pois)this.addHandles(this._updatingHandles.add(()=>e.renderLocation,t=>this._debugCenters?.get(e)?.show(t,e.renderCoordsHelper.spatialReference),u),`debug`)}}get test(){}};e([n()],A.prototype,`centerOnContent`,void 0),e([n()],A.prototype,`centerOnSurfaceFrequent`,void 0),e([n()],A.prototype,`centerOnSurfaceInfrequent`,void 0),e([n()],A.prototype,`cameraOnSurface`,void 0),e([n()],A.prototype,`focus`,void 0),e([n()],A.prototype,`renderPointOfView`,void 0),e([n()],A.prototype,`surfaceOrigin`,void 0),e([n()],A.prototype,`contentGeometryUpdates`,void 0),e([n()],A.prototype,`surfaceGeometryUpdates`,void 0),e([n({constructOnly:!0})],A.prototype,`view`,void 0),e([n()],A.prototype,`updating`,null),A=e([r(`esri.views.3d.support.pointsOfInterest.PointsOfInterest`)],A);const j=s(),M=m(),N={exclude:new Set([b])};export{A as PointsOfInterest};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import"../../../../core/has.js";import{add as i,exactEquals as a,copy as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as c,sync as l,initial as u,when as d,on as f}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as m}from"../../../../geometry/support/ray.js";import{PropertiesPool as h}from"../../../support/PropertiesPool.js";import{TaskPriority as g,noBudget as _}from"../../../support/Scheduler.js";import{Yield as v}from"../../../support/Yield.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{debugFlags as x}from"../debugFlags.js";import{DebugPoint as S}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as w}from"./CameraOnSurface.js";import{CenterOnSurface as T}from"./CenterOnSurface.js";import{ContentGeometryUpdates as E}from"./ContentGeometryUpdates.js";import{Focus as D}from"./Focus.js";import{StableSurfaceCenter as O}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as k}from"./SurfaceGeometryUpdates.js";let A=class extends t{constructor(e){super(e),this.renderPointOfView=s(),this._pois=[],this._updatingHandles=new p,this._debugCenters=null,this._tmpRay=m(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentIntersectorOptions={exclude:new Set([b])},this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._contentChangedSinceLastUpdate=!0,this._geometryPois=[],this._propertiesPool=new h({renderPointOfView:()=>s()},this),this._contentIntersector=new y(e.view.state.isGlobal),this._surfaceIntersector=new y(e.view.state.isGlobal),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){let{state:e,groundView:t,renderCoordsHelper:n,map:r}=this.view,i=this.view.groundAndIMSurface,a=e=>this._estimateSurfaceAltitudeAtCenter(e),o=this.view.resourceController.scheduler,s=t?.elevationQueryCache,p={state:e,scheduler:o,renderCoordsHelper:n},m={...p,surface:t};this._set(`centerOnSurfaceInfrequent`,new T({...m,task:g.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnSurfaceFrequent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:a})),this._set(`centerOnContent`,new T({...m,task:g.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:(e,t)=>this._estimateContentAltitudeAtCenter(e,t)})),this._set(`cameraOnSurface`,new w({...m,cache:s,task:g.POINT_OF_INTEREST_INFREQUENT,map:r})),this._set(`surfaceGeometryUpdates`,new k({...p,surface:i,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set(`contentGeometryUpdates`,new E(this.view.allLayerViews,()=>this.view.graphicsView)),this._set(`surfaceOrigin`,new O({cache:s,view:this.view})),this._set(`focus`,new D({...p,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t,n)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t,n)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this._geometryPois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.focus),this.addHandles([c(()=>e.contentCamera,e=>this._cameraChanged(e),l),this._updatingHandles.add(()=>t.groundExtent,()=>this._updateGeometryPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain=e===`none`},u),d(()=>!t.updating&&this._contentChangedSinceLastUpdate,()=>{this._updateGeometryPointsOfInterest(),this._contentChangedSinceLastUpdate=!1},l),f(()=>this.surfaceGeometryUpdates.events,`request-update`,()=>this._updateGeometryPointsOfInterest()),f(()=>this.contentGeometryUpdates.events,`request-update`,()=>{this._contentChangedSinceLastUpdate=!0,this._updateCenterOnContent()}),this._updatingHandles.add(()=>x.SHOW_POI,e=>this._setDebug(e),u)]),this._cameraChanged(this.view.state.contentCamera);for(let e of this._pois)e.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(let e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set(`centerOnSurfaceInfrequent`,null),this._set(`centerOnSurfaceFrequent`,null),this._set(`centerOnContent`,null),this._set(`cameraOnSurface`,null),this._set(`surfaceGeometryUpdates`,null),this._set(`contentGeometryUpdates`,null),this._set(`surfaceOrigin`,null),this._set(`focus`,null)}get updating(){return!!(this.surfaceGeometryUpdates?.updating||this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&=(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),!1),this._centerRayCached}_estimateContentAltitudeAtCenter(e,t){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;let n=this._centerRay;if(n==null)return this._contentAltitudeAtCenter;let r=!1;if(t===`all-content`&&(r=this.view.sceneIntersectionHelper.intersectRayBudgeted(n,this._contentIntersector,j,e,this._contentIntersectorOptions),r===v))return`all-content`;if(r)this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j);else{let t=this._estimateSurfaceAltitudeAtCenter(e);if(t===`surface-only`)return t;this._contentAltitudeAtCenter=t}return this._contentAltitudeAtCenterDirty=!1,this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(e=_){let{view:t}=this,{groundAndIMSurface:n}=t;if(!n)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;let r=this._centerRay;if(r==null)return this._surfaceAltitudeAtCenter;let a=r.origin,o=i(j,r.origin,r.direction);return this._surfaceIntersector.resetWithRay(r,t.state.contentCamera),n.intersectBudgeted(this._surfaceIntersector,null,a,o,e)?(this._surfaceIntersector.results.min.getIntersectionPoint(j)&&(this._surfaceAltitudeAtCenter=t.renderCoordsHelper.getAltitude(j)),this._surfaceAltitudeAtCenterDirty=!1,this._surfaceAltitudeAtCenter):`surface-only`}_estimateSurfaceIntersectionAtRenderPoint(e,t,n,r=_){let a=C(t,e,M);if(a==null)return null;let o=a.origin,s=i(j,a.origin,a.direction);return this._surfaceIntersector.resetWithRay(a,t),this.view.groundAndIMSurface.intersectBudgeted(this._surfaceIntersector,null,o,s,r)?this._surfaceIntersector.results.min.getIntersectionPoint(n)?n:null:v}_cameraChanged(e){this._updateAllPointsOfInterest();let t=e.eye;a(this.renderPointOfView,t)||this._set(`renderPointOfView`,o(this._propertiesPool.get(`renderPointOfView`),t))}_updateAllPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._pois)e.updateRenderLocation()}_updateGeometryPointsOfInterest(){this._invalidateCenterEstimates();for(let e of this._geometryPois)e.updateRenderLocation()}_invalidateCenterEstimates(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)this._debugCenters?.forEach(e=>e.hide()),this.removeHandles(`debug`);else{if(!this._debugCenters){this._debugCenters=new Map;let e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new S(e,`red`,`CenterOnContent`)),this._debugCenters.set(this.centerOnSurfaceFrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.centerOnSurfaceInfrequent,new S(e,`red`,`CenterOnSurface`)),this._debugCenters.set(this.cameraOnSurface,new S(e,`blue`,`CameraOnSurface`)),this._debugCenters.set(this.focus,new S(e,`green`,`Focus`))}for(let e of this._pois)this.addHandles(this._updatingHandles.add(()=>e.renderLocation,t=>this._debugCenters?.get(e)?.show(t,e.renderCoordsHelper.spatialReference),u),`debug`)}}get test(){}};e([n()],A.prototype,`centerOnContent`,void 0),e([n()],A.prototype,`centerOnSurfaceFrequent`,void 0),e([n()],A.prototype,`centerOnSurfaceInfrequent`,void 0),e([n()],A.prototype,`cameraOnSurface`,void 0),e([n()],A.prototype,`focus`,void 0),e([n()],A.prototype,`renderPointOfView`,void 0),e([n()],A.prototype,`surfaceOrigin`,void 0),e([n()],A.prototype,`contentGeometryUpdates`,void 0),e([n()],A.prototype,`surfaceGeometryUpdates`,void 0),e([n({constructOnly:!0})],A.prototype,`view`,void 0),e([n()],A.prototype,`updating`,null),A=e([r(`esri.views.3d.support.pointsOfInterest.PointsOfInterest`)],A);const j=s(),M=m();export{A as PointsOfInterest};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import has from"../../../core/has.js";import{subtract as r,set as i,dot as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as o,fromValues as s,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as l,ZEROS as u}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{disposeMaybe as d}from"../../../core/maybe.js";import{MemCachePool as f}from"../../../core/MemCachePool.js";import p from"../../../core/ObjectPool.js";import{watch as m,sync as h}from"../../../core/reactiveUtils.js";import{create as g,set as _}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{noBudget as y}from"../../support/Scheduler.js";import{PrimitiveType as b}from"../../webgl/enums.js";import{getOverlayContentForOutputTerrain as x}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as S}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as C}from"../webgl-engine/lib/Attribute.js";import{IntersectorResultRay as w}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as T,MeshIntersectionOptions as E,intersectTriangles as D}from"../webgl-engine/lib/RayIntersections.js";import{TriangleRangeBVH as O}from"../webgl-engine/lib/TriangleRangeBVH.js";import{terrainId as k,getVerticalOffsetTerrain as A}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as j}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as M}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as N}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as P}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as F}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{overlayRenderOccludedFlag as I}from"./OverlayRenderer.js";import{PatchRenderData as L}from"./PatchRenderData.js";import{TerrainAttributesCache as R}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as z}from"./terrainUtils.js";import{TileRenderer as B}from"./TileRenderer.js";import{IteratorPreorder as V,fallsWithinLayerView as H,usesStencil as U,sortTiles as W,compareTiles as G}from"./tileUtils.js";const K=g();let q=class extends S{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._view.stage.isGlobal}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,n,r,i){super(),this._surface=e,this._overlayRenderer=t,this._allTiles=n,this._compressionTracker=r,this.type=7,this.isGround=!0,this._passParameters=new N,this._drawParameters=new j,this._renderDataPool=new p(()=>new L),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new V,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===I]]),this._tileSize=256,this._configuration=new F(i.state.isGlobal),this._tileTextureCache=new f((e,t)=>i.resourceController.memoryController.newCache(e,t),`TileTexture`),this.tileGeometryCache=new R(i.resourceController.memoryController)}initialize(){this.addHandles(m(()=>this._overlayRenderer.renderOccludedFlags,()=>this.requestRender(),h))}destroy(){this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.requestRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.requestRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return k}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.requestRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.requestRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.requestRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)),e.surface.tileElevationRangeChanged(e))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=l(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(H(e,n)!==H(t,n))return!1}return!0}updateTileTexture(e,t){if(this._tileRenderer!=null){let n=t===32?0:2;if(!this._tileRenderer.updateTileTexture(e,n))return e.updateRenderData(1,n),!1;this.requestRender(),e.resetPendingUpdate(t)}return!0}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return this._surface.updateElevationSources(e),t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.dispose(),e.renderData=null,e.surface.tileElevationRangeChanged(e,e.elevationBoundsMin,e.elevationBoundsMax),e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return o;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.requestRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}requestRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new B(this._surface,this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=d(this._tileRenderer)}intersectRay(e,t,n,r){this.intersectRayBudgeted(e,t,n,r,y)}intersectRayBudgeted(e,t,n,o,s){let c=this._rootTiles;if(!c||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return!0;let l=J,u=Y;r(l,o,n),i(u,1/l[0],1/l[1],1/l[2]);let d=e.results.min,f=e.results.max,p=e.results.ground,m=e.options.store===0,h=!!e.results.ground.target,g=A(e.verticalOffset),y=e.tolerance,b,x=m&&d.distance!=null?d.distance:1/0,S=e.options,k=S.normalRequired||!S.backfacesTerrain,j=new E(y,!1,k),M=i=>{let c=i.renderData;if(!c?.vao)return!0;let h=c.geometry;_(K,h.boundingBox);let E=c.localOrigin;if(g!=null&&(g.localOrigin=E,g.applyToAabb(K)),X[0]=n[0]-E[0],X[1]=n[1]-E[1],X[2]=n[2]-E[2],!T(K,X,u,y,x))return!0;let A=(e,t,n,r)=>{e.set(this.type,i,t,n,r),x=m&&d.renderDistance!=null?d.renderDistance:1/0},M=(r,i,s)=>{(!k||s!=null)&&i>=0&&(S.backfacesTerrain||a(s,l)<0)&&(S.invisibleTerrain||!S.selectionMode||t==null||t(n,o,i))&&((p.renderDistance==null||i<p.renderDistance)&&A(p,r,i,s),S.isFiltered||(S.store===2&&(b==null?(b=new w(e.ray),A(b,r,i,s),e.results.all.push(b)):i<b.renderDistance&&A(b,r,i,s)),(d.renderDistance==null||i<d.renderDistance)&&A(d,r,i,s),S.store!==0&&(f.renderDistance==null||i>f.renderDistance)&&A(f,r,i,s)))},N=Z;r(N,o,E);let{indices:P,indexCount:F}=h,I=h.vertexAttributes,L=I.getField(`position`,v),R=new C(L.typedBuffer,3,I.stride/4),z=F/3;if(!g&&z>200){if(c.intersectionData??=new O(P,z,R,!0,[h.poleIndicesStartIndex/3,h.edgeIndicesStartIndex/3]),c.intersectionData.advance(s),!c.intersectionData.ready||s.done)return!1;c.intersectionData.intersectRay(X,N,j,M)}else D(X,N,0,z,(e,t)=>L.getVec(P[t],e),g,j,M);return!0},N=this._tileIterator;N.reset(c);let P=e.options.invisibleTerrain;for(let e=N.next();e;e=N.next()){if(s.done)return!1;if((e.visible||P&&e.intersectsClippingArea)&&(g!=null||e.intersectsRay(n,l,y,x))&&(!h||!U(e,this._stencilEnabledLayerExtents))){if(!M(e))return!1}else N.skipSubtree()}return s.madeProgress(),!0}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _view(){return this._surface.view}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&I)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.receiveGlobalIllumination=c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=M(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=x(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=s(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>{t.updateTileTexture(e,0)||e.updateRenderData(1,0)}),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.requestRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)W(n,t);e.sort((e,t)=>G(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=!!this._stencilEnabledLayerExtents?.length;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],b.TRIANGLES,a,this._passParameters.overlayContent===null)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,o),i.setUniform4fv(`texOffsetAndScale`,u));let s=this._tileRenderer?.backgroundColor==null?o:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,s);let c=!!this._stencilEnabledLayerExtents?.length,l=this.wireframe?b.LINES:b.TRIANGLES;this._configuration.textureFadingEnabled&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.requestRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,l,c),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){z&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&!this._overlayRenderer.isEmpty&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=U(n,this._stencilEnabledLayerExtents),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(P,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([t({readOnly:!0})],q.prototype,`visibleTiles`,null),e([t({readOnly:!0})],q.prototype,`_isGlobal`,null),e([t()],q.prototype,`renderOccludedFlags`,null),e([t({value:!1})],q.prototype,`renderingDisabled`,null),e([t({value:!0})],q.prototype,`visible`,null),e([t()],q.prototype,`renderPatchBorders`,null),e([t()],q.prototype,`wireframe`,null),q=e([n(`esri.views.3d.terrain.TerrainRenderer`)],q);const J=c(),Y=c(),X=c(),Z=c();export{q as TerrainRenderer};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import has from"../../../core/has.js";import{fromTranslation as r}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as a,set as o,dot as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as c,fromValues as l,create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as d,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{disposeMaybe as p}from"../../../core/maybe.js";import{MemCachePool as m}from"../../../core/MemCachePool.js";import h from"../../../core/ObjectPool.js";import{watch as g,sync as _}from"../../../core/reactiveUtils.js";import{create as v,set as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as b}from"../../../geometry/support/buffer/BufferView.js";import{noBudget as x}from"../../support/Scheduler.js";import{PrimitiveType as S}from"../../webgl/enums.js";import{getOverlayContentForOutputTerrain as C}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as w}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as T}from"../webgl-engine/lib/Attribute.js";import{unionDepthRangeWithAABB as E}from"../webgl-engine/lib/depthRangeUtils.js";import{IntersectorResultRay as D}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as ee,MeshIntersectionOptions as O,intersectTriangles as k}from"../webgl-engine/lib/RayIntersections.js";import{TriangleRangeBVH as A}from"../webgl-engine/lib/TriangleRangeBVH.js";import{terrainId as j,getVerticalOffsetTerrain as M}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as N}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as P}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as F}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as I}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as L}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{overlayRenderOccludedFlag as R}from"./OverlayRenderer.js";import{PatchRenderData as z}from"./PatchRenderData.js";import{TerrainAttributesCache as B}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as V}from"./terrainUtils.js";import{TileRenderer as H}from"./TileRenderer.js";import{IteratorPreorder as U,fallsWithinLayerView as W,usesStencil as G,sortTiles as K,compareTiles as q}from"./tileUtils.js";const J=v(),Y=i();let X=class extends w{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._view.stage.isGlobal}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,n,r,i){super(),this._surface=e,this._overlayRenderer=t,this._allTiles=n,this._compressionTracker=r,this.type=7,this.isGround=!0,this._passParameters=new F,this._drawParameters=new N,this._renderDataPool=new h(()=>new z),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new U,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===R]]),this._tileSize=256,this._configuration=new L(i.state.isGlobal),this._tileTextureCache=new m((e,t)=>i.resourceController.memoryController.newCache(e,t),`TileTexture`),this.tileGeometryCache=new B(i.resourceController.memoryController)}initialize(){this.addHandles(g(()=>this._overlayRenderer.renderOccludedFlags,()=>this.requestRender(),_))}destroy(){this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}unionDepthRange(e,t){if(this._produces()&&has(`enable-feature:terrain-shadows`)){this._updatePatchGroups();for(let[n,i]of this._visiblePatchesByOrigin){r(Y,n);for(let n of i)E(t,e,Y,n.renderData.geometry.boundingBox)}}}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.requestRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.requestRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return j}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.requestRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.requestRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.requestRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)),e.surface.tileElevationRangeChanged(e))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=d(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(W(e,n)!==W(t,n))return!1}return!0}updateTileTexture(e,t){if(this._tileRenderer!=null){let n=t===32?0:2;if(!this._tileRenderer.updateTileTexture(e,n))return e.updateRenderData(1,n),!1;this.requestRender(),e.resetPendingUpdate(t)}return!0}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return this._surface.updateElevationSources(e),t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.dispose(),e.renderData=null,e.surface.tileElevationRangeChanged(e,e.elevationBoundsMin,e.elevationBoundsMax),e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return c;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.requestRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}requestRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new H(this._surface,this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=p(this._tileRenderer)}intersectRay(e,t,n,r){this.intersectRayBudgeted(e,t,n,r,x)}intersectRayBudgeted(e,t,n,r,i){let c=this._rootTiles;if(!c||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return!0;let l=Z,u=Q;a(l,r,n),o(u,1/l[0],1/l[1],1/l[2]);let d=e.results.min,f=e.results.max,p=e.results.ground,m=e.options.store===0,h=!!e.results.ground.target,g=M(e.verticalOffset),_=e.tolerance,v,x=m&&d.distance!=null?d.distance:1/0,S=e.options,C=S.normalRequired||!S.backfacesTerrain,w=new O(_,!1,C),E=o=>{let c=o.renderData;if(!c?.vao)return!0;let h=c.geometry;y(J,h.boundingBox);let E=c.localOrigin;if(g!=null&&(g.localOrigin=E,g.applyToAabb(J)),$[0]=n[0]-E[0],$[1]=n[1]-E[1],$[2]=n[2]-E[2],!ee(J,$,u,_,x))return!0;let O=(e,t,n,r)=>{e.set(this.type,o,t,n,r),x=m&&d.renderDistance!=null?d.renderDistance:1/0},j=(i,a,o)=>{(!C||o!=null)&&a>=0&&(S.backfacesTerrain||s(o,l)<0)&&(S.invisibleTerrain||!S.selectionMode||t==null||t(n,r,a))&&((p.renderDistance==null||a<p.renderDistance)&&O(p,i,a,o),S.isFiltered||(S.store===2&&(v==null?(v=new D(e.ray),O(v,i,a,o),e.results.all.push(v)):a<v.renderDistance&&O(v,i,a,o)),(d.renderDistance==null||a<d.renderDistance)&&O(d,i,a,o),S.store!==0&&(f.renderDistance==null||a>f.renderDistance)&&O(f,i,a,o)))},M=te;a(M,r,E);let{indices:N,indexCount:P}=h,F=h.vertexAttributes,I=F.getField(`position`,b),L=new T(I.typedBuffer,3,F.stride/4),R=P/3;if(!g&&R>200){if(c.intersectionData??=new A(N,R,L,!0,[h.poleIndicesStartIndex/3,h.edgeIndicesStartIndex/3]),c.intersectionData.advance(i),!c.intersectionData.ready||i.done)return!1;c.intersectionData.intersectRay($,M,w,j)}else k($,M,0,R,(e,t)=>I.getVec(N[t],e),g,w,j);return!0},j=this._tileIterator;j.reset(c);let N=e.options.invisibleTerrain;for(let e=j.next();e;e=j.next()){if(i.done)return!1;if((e.visible||N&&e.intersectsClippingArea)&&(g!=null||e.intersectsRay(n,l,_,x))&&(!h||!G(e,this._stencilEnabledLayerExtents))){if(!E(e))return!1}else j.skipSubtree()}return i.madeProgress(),!0}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _view(){return this._surface.view}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&R)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.receiveGlobalIllumination=c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null,c.emissionReflections=c.screenSpaceReflections&&a&&n.reprojection.lastFrameEmission!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=P(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=C(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=l(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>{t.updateTileTexture(e,0)||e.updateRenderData(1,0)}),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.requestRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)K(n,t);e.sort((e,t)=>q(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=!!this._stencilEnabledLayerExtents?.length,o=this.transparency===2||this.transparency===3,s=this._passParameters.overlayContent===null||(e.output===3||e.output===4)&&!o;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],S.TRIANGLES,a,s)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,c),i.setUniform4fv(`texOffsetAndScale`,f));let o=this._tileRenderer?.backgroundColor==null?c:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,o);let s=!!this._stencilEnabledLayerExtents?.length,l=this.wireframe?S.LINES:S.TRIANGLES;this._configuration.textureFadingEnabled&&!a&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):this._configuration.textureFadingEnabled&&i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.requestRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,l,s),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){V&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&this._configuration.overlayEnabled&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=G(n,this._stencilEnabledLayerExtents),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(I,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([t({readOnly:!0})],X.prototype,`visibleTiles`,null),e([t({readOnly:!0})],X.prototype,`_isGlobal`,null),e([t()],X.prototype,`renderOccludedFlags`,null),e([t({value:!1})],X.prototype,`renderingDisabled`,null),e([t({value:!0})],X.prototype,`visible`,null),e([t()],X.prototype,`renderPatchBorders`,null),e([t()],X.prototype,`wireframe`,null),X=e([n(`esri.views.3d.terrain.TerrainRenderer`)],X);const Z=u(),Q=u(),$=u(),te=u();export{X as TerrainRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../core/Error.js";import{watch as a,initial as o}from"../../../core/reactiveUtils.js";import{getFramebufferDrawBuffers as s}from"../../webgl/RenderingContext.js";import{RenderNodeOutput as c}from"../webgl.js";let l=class extends t{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([a(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},o)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new i(`RenderNode:render-function-not-implemented`,`render() is not implemented.`)}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(s(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return this._dirty?(this._dirty=!1,!0):!1}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};e([n({constructOnly:!0})],l.prototype,`view`,void 0),e([n({constructOnly:!0})],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),e([n({readOnly:!0})],l.prototype,`techniques`,null),l=e([r(`esri.views.3d.webgl.RenderNode`)],l);export{l as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../core/Error.js";import{watch as a,initial as o}from"../../../core/reactiveUtils.js";import{getFramebufferDrawBuffers as s}from"../../webgl/RenderingContext.js";import{RenderNodeOutput as c}from"../webgl.js";let l=class extends t{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=c.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([a(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},o)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new i(`RenderNode:render-function-not-implemented`,`render() is not implemented.`)}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(s(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return this._dirty?(this._dirty=!1,!0):!1}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}unionDepthRange(e,t){}get input(){return this._frameBuffer}};e([n({constructOnly:!0})],l.prototype,`view`,void 0),e([n({constructOnly:!0})],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),e([n({readOnly:!0})],l.prototype,`techniques`,null),l=e([r(`esri.views.3d.webgl.RenderNode`)],l);export{l as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import"../../../../../core/has.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../../../core/Logger.js";import a from"../../../../../core/PooledArray.js";import{watch as o,sync as s}from"../../../../../core/reactiveUtils.js";import{isTypedArray as c}from"../../../../../core/typedArrayUtil.js";import{create as l}from"../../../../../geometry/support/aaBoundingBox.js";import{d as u}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec32.js";import{compactIndices as f}from"../../../../../geometry/support/Indices.js";import{BufferObject as p}from"../../../../webgl/BufferObject.js";import{PrimitiveType as m}from"../../../../webgl/enums.js";import{VertexBuffer as h}from"../../../../webgl/VertexBuffer.js";import{SamplerRepository as g}from"../../lib/SamplerRepository.js";import{BufferManager as _}from"../../lib/TextureBackedBuffer/BufferManager.js";import{VertexArrayObject as v}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as y}from"../../lib/verticalOffsetUtils.js";import{getComponentDataLayout as b,IndexGlLayout as x}from"../../materials/DefaultLayouts.js";import{ComponentData as S}from"./ComponentData.js";import{defaultComponentParameters as C,ComponentDrawParametersImplementation as w}from"./ComponentDrawParameters.js";import{ComponentObject as T}from"./ComponentObject.js";import{IntersectionGeometry as E}from"./IntersectionGeometry.js";import{ComponentMaterialParameters as D}from"./Material/ComponentMaterialInitParameters.js";import{ComponentMaterialRepository as O}from"./Material/ComponentMaterialRepository.js";import{RenderableMeta as k,Renderable as A}from"./Renderable.js";import{RenderGeometry as j}from"./RenderGeometry.js";import{RenderSubmitSystem as M}from"./RenderSubmitSystem.js";const N=()=>i.getLogger(`esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection`);let P=class extends t{constructor(e,t,n){super(),this._renderPassManager=e,this._isGlobal=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._highlightsInOrder=[],this._highlights=null,this._activeHighlightOptions=new Map,this._visible=new a,this._hidden=new a,this._renderSubmit=new M(this),this._renderPassManager.register(this._renderSubmit);let{rctx:r,bind:i}=e;this._componentBufferManager=new _(r,b());let c=this._isGlobal?n?1:2:0;this.materials=new O(i,c),this.samplers=new g(r.gl),this.addHandles(o(()=>i.useFloatBlend.value,()=>{this._visible.forAll(e=>e.updateMaterial(this.materials.globals)),this._hidden.forAll(e=>e.updateMaterial(this.materials.globals)),this._requestRender()},s))}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy(),this.samplers.dispose(),this.materials.destroy()}createObject(e,t){let{geometry:n}=e,r=new S(this._componentBufferManager,f(n.componentOffsets)),i=this._createRenderable(e,t,r),a=new E(this._isGlobal,n.positions,r,e.elevationAlignable),o=new T(this,e.transform,e.obb.clone(),r,i,a,e.aabbInWorldCoordinates);return(o.visible?this._visible:this._hidden).push(o),o}destroyObject(e){let t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._requestRender()}setObjectVisibility(e,t){let n=e;t!==n.visible&&(t?(this._hidden.removeUnordered(n),this._visible.push(n)):(this._visible.removeUnordered(n),this._hidden.push(n)),n.visible=t,this._requestRender())}preSubmit(e){let{camera:t,highlights:n}=e;this._updateHighlightsInOrder(n),this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getObjectOpacity(e){return e.renderable.drawParameters.opacity}updateObjectOpacity(e,t,n){let r=e;(r.opacity!==t||n!==void 0&&n!==r.renderable.material.parameters.groundTransparencyMode)&&(r.updateOpacity(t,n),this._requestRender())}isSliceplaneEnabled(e){return e.renderable.material.slicePlaneEnabled}setAllComponentVisibilities(e,t){let n=e;n.componentData.visibility.reset(t),n.componentData.markVisibilityDirty(),this._requestRender()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){let{componentData:t}=e,n=t.visibility.componentCount;return{visible:n,invisible:t.count-n}}setComponentData(e,t){e.setComponentData(t,this._isGlobal),this._elevationRangeCacheVerticalOffset=NaN,this._requestRender()}getComponentAabb(e,t,n,r=!1){e.intersectionGeometry.getComponentAabb(t,n);let i=e,a=i.componentData.verticalOffsets;if(r||a==null)return n;let o=a[t];if(!this._isGlobal||o===0)return n[2]+=o,n[5]+=o,n;let s=y(o);return s.localOrigin=i.transform.position,s.applyToAabb(n)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,n){return e.intersectionGeometry.getComponentPositions(t,n)}_updateHighlightsInOrder(e){if(this._highlights===e)return;let{_highlightsInOrder:t}=this,n=Math.min(e.length,8),r=t.length!==n;for(let i=0;i<n;++i)if(t[i]!==e[i].name){r=!0;break}if(this._highlights=e,r){t.length=n;for(let r=0;r<n;++r)t[r]=e[r].name;this._syncHighlightedObjectHighlightOrder()}}_syncHighlightedObjectHighlightOrder(){let e=this._highlightsInOrder,t=t=>{t.componentData.componentHighlights.size>0&&t.componentData.setHighlightsInOrder(e)};this._visible.forAll(t),this._hidden.forAll(t)}expandRangeWithComponentObjectElevationRange(e,t,n,r){!Number.isNaN(this._elevationRangeCacheVerticalOffset)&&this._elevationRangeCacheVerticalOffset===t&&r.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);let i=e,{componentData:a}=i,o=a.count,{verticalOffsets:s}=a,{intersectionGeometry:c}=i,l=c.getComponentAabbs(),u=F,d=1/0,f=-1/0;for(let e=0;e<o;e++){let a=e*6,o=s?.[e]??0,c=1/0,p=-1/0;if(this._isGlobal){if(u[0]=l[a],u[1]=l[a+1],u[2]=l[a+2],u[3]=l[a+3],u[4]=l[a+4],u[5]=l[a+5],o!==0){let e=y(o);e.localOrigin=i.transform.position,e.applyToAabb(u)}let e=Math.max(Math.abs(u[3]),Math.abs(u[0])),s=Math.max(Math.abs(u[4]),Math.abs(u[1])),c=t+u[5]+n;r.expandElevationRangeValues(t+u[2],Math.sqrt(e*e+s*s+c*c)-n)}else c=l[a+2]+o+t,p=l[a+5]+o+t;r.expandElevationRangeValues(c,p),d=Math.min(d,c),f=Math.max(f,p)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=d,this._elevationRangeCacheMax=f}intersectRay(e,t,n,r,i,a){let{transform:o,componentData:s,intersectionGeometry:c}=e;r!=null&&(r.localOrigin=o.position),c.intersectRay(t,n,r,s.verticalOffsets,o,i,a)}*intersectScreenPolygon(e,t,n,r,i){let{transform:a,componentData:o,intersectionGeometry:s}=e;r!=null&&(r.localOrigin=a.position),yield*s.intersectScreenPolygon(t,n,r,o.verticalOffsets,a,i)}addEdges(e,t,n,r,i){let a=e,{indices:o,positions:s}=a.intersectionGeometry,c=a.componentData.offsets;return t.addComponentObject(a,s,o,c,n,r,i)}async extractEdgeInformation(e,t,n){let i=e,a=i.componentData.visibility;if(a.allInvisible()){let{extractComponentsEdgeLocationsLayout:e}=await import(`../../lib/edgeRendering/edgeProcessing.js`);return{buffer:e.createBuffer(0),origin:[0,0,0]}}let{indices:o,positions:s}=i.intersectionGeometry,c=i.componentData.offsets,{EdgeInputBufferLayout:l}=await import(`../../lib/edgeRendering/bufferLayouts.js`),f=l.createBuffer(s.length/3);d(f.position.typedBuffer,s,f.position.typedBufferStride,3),u(f.position,f.position,i.transform.rotationScale),this._setComponentIndices(f.componentIndex,o,c);let p=f.count,m=this._computeVisibilityIndices(o,a,c,p);return{origin:r(i.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:m,indicesLength:m.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},n)}}_setComponentIndices(e,t,n){let r=0;for(let i=0;i<n.length-1;i++){let a=n[i],o=n[i+1];for(let n=a;n<o;n++){let i=t?t[n]:n;e.set(i,r)}r++}}_computeVisibilityIndices(e,t,n,r){if(e&&t.allVisible())return e;let i=0;t.forEachComponentRange((e,t)=>(i+=n[t]-n[e],!0));let a=c(e)?e?.BYTES_PER_ELEMENT===2||r<=65536?new Uint16Array(i):new Uint32Array(i):Array(i),o=0;return t.forEachComponentRange((t,r)=>{let i=n[t],s=n[r];for(let t=i;t<s;t++)a[o++]=e?e[t]:t;return!0}),a}addHighlight(e,t,n){let r=e,i=this._activeHighlightOptions.get(n)??0;this._activeHighlightOptions.set(n,i+1),r.componentData.setHighlightsInOrder(this._highlightsInOrder),r.addHighlight(t,n)&&this._requestRender()}removeHighlight(e,t,n){let r=e.removeHighlight(t,n);r!==`notfound`&&(this._removeActiveHighlight(n),r&&this._requestRender())}_removeActiveHighlight(e,t=1){let n=this._activeHighlightOptions.get(e);if(n===void 0)N().warn(`Removing non-existing highlight "${e}".`);else{let r=n-t;r<0&&N().warn(`Removing non-existing highlight "${e}".`),r<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,r)}}clearHighlights(e){let t=e,{componentData:n}=t,{componentHighlights:r}=t.componentData;if(r.size>0){for(let e of r)this._removeActiveHighlight(e[0],e[1][n.count]);t.clearHighlights(),this._requestRender()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t,n){let r=this._renderPassManager.rctx,i=e.geometry,a=i.parameters.layout,{interleavedVertexData:o,indexData:s,vertexCount:c}=i.renderGeometryData,l=new h(r,a,o),u=s?p.createIndex(r,35044,s):null,d=0,f=[[`geometry`,l]];if(!t.isIntegratedMesh){let e=new Uint16Array(c);for(let t=0;t<n.count;t++){let r=n.offsets[t],i=n.offsets[t+1],a=n.materialDataIndices[t];if(s!=null)for(let t=r;t<i;t++){let n=s[t];e[n]=a}else for(let t=r;t<i;t++)e[t]=a}let t=new h(r,x,e.buffer);d+=t.usedMemory,f.push([`componentIndices`,t])}let g=new v(r,new Map(f),u),_=s?.length??c,y=new j(g,m.TRIANGLES,i.parameters,u!=null,_),b=new D(t),S=this.materials.acquire(b,y.parameters,C),T=new k(l.usedMemory+d+(u?.usedMemory??0)),E=this.samplers.addFromTexture(t.baseColorTexture?.texture),O=new w(e,t,E);return new A(S,O,y,T)}_requestRender(){this._renderPassManager.requestRender()}};P=e([n(`esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection`)],P);const F=l();export{P as ComponentObjectCollection};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import"../../../../../core/has.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../../../core/Logger.js";import a from"../../../../../core/PooledArray.js";import{watch as o,sync as s}from"../../../../../core/reactiveUtils.js";import{isTypedArray as c}from"../../../../../core/typedArrayUtil.js";import{create as l}from"../../../../../geometry/support/aaBoundingBox.js";import{d as u}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec32.js";import{compactIndices as f}from"../../../../../geometry/support/Indices.js";import{BufferObject as p}from"../../../../webgl/BufferObject.js";import{PrimitiveType as m}from"../../../../webgl/enums.js";import{VertexBuffer as h}from"../../../../webgl/VertexBuffer.js";import{SamplerRepository as g}from"../../lib/SamplerRepository.js";import{BufferManager as _}from"../../lib/TextureBackedBuffer/BufferManager.js";import{VertexArrayObject as v}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as y}from"../../lib/verticalOffsetUtils.js";import{getComponentDataLayout as b,IndexGlLayout as x}from"../../materials/DefaultLayouts.js";import{ComponentData as S}from"./ComponentData.js";import{defaultComponentParameters as C,ComponentDrawParametersImplementation as w}from"./ComponentDrawParameters.js";import{ComponentObject as T}from"./ComponentObject.js";import{IntersectionGeometry as E}from"./IntersectionGeometry.js";import{ComponentMaterialParameters as D}from"./Material/ComponentMaterialInitParameters.js";import{ComponentMaterialRepository as O}from"./Material/ComponentMaterialRepository.js";import{RenderableMeta as k,Renderable as A}from"./Renderable.js";import{RenderGeometry as j}from"./RenderGeometry.js";import{RenderSubmitSystem as M}from"./RenderSubmitSystem.js";const N=()=>i.getLogger(`esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection`);let P=class extends t{constructor(e,t,n){super(),this._renderPassManager=e,this._isGlobal=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._highlightsInOrder=[],this._highlights=null,this._activeHighlightOptions=new Map,this._visible=new a,this._hidden=new a,this._renderSubmit=new M(this),this._renderPassManager.register(this._renderSubmit);let{rctx:r,bind:i}=e;this._componentBufferManager=new _(r,b());let c=this._isGlobal?n?1:2:0;this.materials=new O(i,c),this.samplers=new g(r.gl),this.addHandles(o(()=>i.useFloatBlend.value,()=>{this._visible.forAll(e=>e.updateMaterial(this.materials.globals)),this._hidden.forAll(e=>e.updateMaterial(this.materials.globals)),this._requestRender()},s))}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy(),this.samplers.dispose(),this.materials.destroy()}createObject(e,t){let{geometry:n}=e,r=new S(this._componentBufferManager,f(n.componentOffsets)),i=this._createRenderable(e,t,r),a=new E(this._isGlobal,n.positions,r,e.elevationAlignable),o=new T(this,e.transform,e.obb.clone(),r,i,a,e.aabbInWorldCoordinates);return(o.visible?this._visible:this._hidden).push(o),o}destroyObject(e){let t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._requestRender()}setObjectVisibility(e,t){let n=e;t!==n.visible&&(t?(this._hidden.removeUnordered(n),this._visible.push(n)):(this._visible.removeUnordered(n),this._hidden.push(n)),n.visible=t,this._requestRender())}preSubmit(e){let{camera:t,highlights:n}=e;this._updateHighlightsInOrder(n),this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getObjectOpacity(e){return e.renderable.drawParameters.opacity}updateObjectOpacity(e,t,n){let r=e;(r.opacity!==t||n!==void 0&&n!==r.renderable.material.parameters.groundTransparencyMode)&&(r.updateOpacity(t,n),this._requestRender())}isSliceplaneEnabled(e){return e.renderable.material.slicePlaneEnabled}setAllComponentVisibilities(e,t){let n=e;n.componentData.visibility.reset(t),n.componentData.markVisibilityDirty(),this._requestRender()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){let{componentData:t}=e,n=t.visibility.componentCount;return{visible:n,invisible:t.count-n}}setComponentData(e,t){e.setComponentData(t,this._isGlobal),this._elevationRangeCacheVerticalOffset=NaN,this._requestRender()}getComponentAabb(e,t,n,r=!1){e.intersectionGeometry.getComponentAabb(t,n);let i=e,a=i.componentData.verticalOffsets;if(r||a==null)return n;let o=a[t];if(!this._isGlobal||o===0)return n[2]+=o,n[5]+=o,n;let s=y(o);return s.localOrigin=i.transform.position,s.applyToAabb(n)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,n){return e.intersectionGeometry.getComponentPositions(t,n)}_updateHighlightsInOrder(e){if(this._highlights===e)return;let{_highlightsInOrder:t}=this,n=Math.min(e.length,8),r=t.length!==n;for(let i=0;i<n;++i)if(t[i]!==e[i].name){r=!0;break}if(this._highlights=e,r){t.length=n;for(let r=0;r<n;++r)t[r]=e[r].name;this._syncHighlightedObjectHighlightOrder()}}_syncHighlightedObjectHighlightOrder(){let e=this._highlightsInOrder,t=t=>{t.componentData.componentHighlights.size>0&&t.componentData.setHighlightsInOrder(e)};this._visible.forAll(t),this._hidden.forAll(t)}expandRangeWithComponentObjectElevationRange(e,t,n,r){!Number.isNaN(this._elevationRangeCacheVerticalOffset)&&this._elevationRangeCacheVerticalOffset===t&&r.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);let i=e,{componentData:a}=i,o=a.count,{verticalOffsets:s}=a,{intersectionGeometry:c}=i,l=c.getComponentAabbs(),u=F,d=1/0,f=-1/0;for(let e=0;e<o;e++){let a=e*6,o=s?.[e]??0,c=1/0,p=-1/0;if(this._isGlobal){if(u[0]=l[a],u[1]=l[a+1],u[2]=l[a+2],u[3]=l[a+3],u[4]=l[a+4],u[5]=l[a+5],o!==0){let e=y(o);e.localOrigin=i.transform.position,e.applyToAabb(u)}let e=Math.max(Math.abs(u[3]),Math.abs(u[0])),s=Math.max(Math.abs(u[4]),Math.abs(u[1])),c=t+u[5]+n;r.expandElevationRangeValues(t+u[2],Math.sqrt(e*e+s*s+c*c)-n)}else c=l[a+2]+o+t,p=l[a+5]+o+t;r.expandElevationRangeValues(c,p),d=Math.min(d,c),f=Math.max(f,p)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=d,this._elevationRangeCacheMax=f}intersectRay(e,t,n,r,i,a){let{transform:o,componentData:s,intersectionGeometry:c}=e;return r!=null&&(r.localOrigin=o.position),c.intersectRay(t,n,r,s.verticalOffsets,o,i,a)}*intersectScreenPolygon(e,t,n,r,i){let{transform:a,componentData:o,intersectionGeometry:s}=e;r!=null&&(r.localOrigin=a.position),yield*s.intersectScreenPolygon(t,n,r,o.verticalOffsets,a,i)}addEdges(e,t,n,r,i){let a=e,{indices:o,positions:s}=a.intersectionGeometry,c=a.componentData.offsets;return t.addComponentObject(a,s,o,c,n,r,i)}async extractEdgeInformation(e,t,n){let i=e,a=i.componentData.visibility;if(a.allInvisible()){let{extractComponentsEdgeLocationsLayout:e}=await import(`../../lib/edgeRendering/edgeProcessing.js`);return{buffer:e.createBuffer(0),origin:[0,0,0]}}let{indices:o,positions:s}=i.intersectionGeometry,c=i.componentData.offsets,{EdgeInputBufferLayout:l}=await import(`../../lib/edgeRendering/bufferLayouts.js`),f=l.createBuffer(s.length/3);d(f.position.typedBuffer,s,f.position.typedBufferStride,3),u(f.position,f.position,i.transform.rotationScale),this._setComponentIndices(f.componentIndex,o,c);let p=f.count,m=this._computeVisibilityIndices(o,a,c,p);return{origin:r(i.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:m,indicesLength:m.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},n)}}_setComponentIndices(e,t,n){let r=0;for(let i=0;i<n.length-1;i++){let a=n[i],o=n[i+1];for(let n=a;n<o;n++){let i=t?t[n]:n;e.set(i,r)}r++}}_computeVisibilityIndices(e,t,n,r){if(e&&t.allVisible())return e;let i=0;t.forEachComponentRange((e,t)=>(i+=n[t]-n[e],!0));let a=c(e)?e?.BYTES_PER_ELEMENT===2||r<=65536?new Uint16Array(i):new Uint32Array(i):Array(i),o=0;return t.forEachComponentRange((t,r)=>{let i=n[t],s=n[r];for(let t=i;t<s;t++)a[o++]=e?e[t]:t;return!0}),a}addHighlight(e,t,n){let r=e,i=this._activeHighlightOptions.get(n)??0;this._activeHighlightOptions.set(n,i+1),r.componentData.setHighlightsInOrder(this._highlightsInOrder),r.addHighlight(t,n)&&this._requestRender()}removeHighlight(e,t,n){let r=e.removeHighlight(t,n);r!==`notfound`&&(this._removeActiveHighlight(n),r&&this._requestRender())}_removeActiveHighlight(e,t=1){let n=this._activeHighlightOptions.get(e);if(n===void 0)N().warn(`Removing non-existing highlight "${e}".`);else{let r=n-t;r<0&&N().warn(`Removing non-existing highlight "${e}".`),r<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,r)}}clearHighlights(e){let t=e,{componentData:n}=t,{componentHighlights:r}=t.componentData;if(r.size>0){for(let e of r)this._removeActiveHighlight(e[0],e[1][n.count]);t.clearHighlights(),this._requestRender()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t,n){let r=this._renderPassManager.rctx,i=e.geometry,a=i.parameters.layout,{interleavedVertexData:o,indexData:s,vertexCount:c}=i.renderGeometryData,l=new h(r,a,o),u=s?p.createIndex(r,35044,s):null,d=0,f=[[`geometry`,l]];if(!t.isIntegratedMesh){let e=new Uint16Array(c);for(let t=0;t<n.count;t++){let r=n.offsets[t],i=n.offsets[t+1],a=n.materialDataIndices[t];if(s!=null)for(let t=r;t<i;t++){let n=s[t];e[n]=a}else for(let t=r;t<i;t++)e[t]=a}let t=new h(r,x,e.buffer);d+=t.usedMemory,f.push([`componentIndices`,t])}let g=new v(r,new Map(f),u),_=s?.length??c,y=new j(g,m.TRIANGLES,i.parameters,u!=null,_),b=new D(t),S=this.materials.acquire(b,y.parameters,C),T=new k(l.usedMemory+d+(u?.usedMemory??0)),E=this.samplers.addFromTexture(t.baseColorTexture?.texture),O=new w(e,t,E);return new A(S,O,y,T)}_requestRender(){this._renderPassManager.requestRender()}};P=e([n(`esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection`)],P);const F=l();export{P as ComponentObjectCollection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{Vertices as e}from"../../lib/Attribute.js";import{TriangleIntersectionData as t}from"../../lib/TriangleIntersectionData.js";class n{constructor(n,r,i,a,o){this._componentOffsets=o,this._intersectionData=new t(i,a,new e(n,3,r))}intersectRay(e,t,n,i){this._intersectionData.intersectRay(e,t,n,(e,t,n,a)=>{i(e,t,n,a,r(this._componentOffsets,a))})}*intersectScreenPolygon(e,t,n,i){this._intersectionData.forEachScreenPolygonHit(e,n,t,null,(e,t,n)=>{let a=r(this._componentOffsets,t);a<0||a>=this._componentOffsets.length-1||i(e,t,a,n)}),yield}}function r(e,t){let{length:n}=e;if(n===0||t<e[0])return-1;if(t>e[n-1])return n;let r=0,i=n-1;for(;i-r>1;){let n=Math.round(.5*(r+i));t<=e[n]?i=n:r=n}return r}export{n as ComponentObjectFixedBVH};
2
+ import{Vertices as e}from"../../lib/Attribute.js";import{TriangleIntersectionData as t}from"../../lib/TriangleIntersectionData.js";class n{constructor(n,r,i,a,o){this._componentOffsets=o,this._intersectionData=new t(i,a,new e(n,3,r),!0)}intersectRay(e,t,n,i){return n.budget&&(this._intersectionData.advance(n.budget),!this._intersectionData.ready)?!1:(this._intersectionData.intersectRay(e,t,n,(e,t,n,a)=>{i(e,t,n,a,r(this._componentOffsets,a))}),!0)}*intersectScreenPolygon(e,t,n,i){this._intersectionData.forEachScreenPolygonHit(e,n,t,null,(e,t,n)=>{let a=r(this._componentOffsets,t);a<0||a>=this._componentOffsets.length-1||i(e,t,a,n)}),yield}}function r(e,t){let{length:n}=e;if(n===0||t<e[0])return-1;if(t>e[n-1])return n;let r=0,i=n-1;for(;i-r>1;){let n=Math.round(.5*(r+i));t<=e[n]?i=n:r=n}return r}export{n as ComponentObjectFixedBVH};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromQuat as e,scale as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as i,transformQuat as a,dot as o,sub as s,transformMat3 as c,add as l,lerp as u,copy as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../../core/PooledArray.js";import{signedDistance as m}from"../../../../../geometry/support/plane.js";import{DepthRange as h}from"../../lib/DepthRange.js";function g(e,t){let n=new h,{eye:r,frustum:a,viewForward:c}=e;t.forAll(e=>{let t=e.offsetObb==null?e.obb:e.offsetObb,i=(t.centerX-r[0])*c[0]+(t.centerY-r[1])*c[1]+(t.centerZ-r[2])*c[2],o=t.projectedRadius(c);if(n.within(i-o)&&n.within(i+o))return;let s=k(t,a);if(s===-1)return;if(s===0){v.far=i+o,v.near=i-o,n.union(v);return}let l=_.pushNew();l.near=i-o,l.far=i+o,l.mask=s,l.object=e});for(let e=0;e<_.length;e++){let t=_.data[e];n.within(t.near)&&n.within(t.far)||(v.far=t.far,v.near=1/0,E(t.object.offsetObb==null?t.object.obb:t.object.offsetObb,r,x,e=>{let n=S;for(let r=0;r<O&&e.length>0;r++){if(!(t.mask&1<<r))continue;C(a[r],e,n);let i=e;e=n,n=i}for(let t=0;t<e.length;t+=3){i(y,e.data[t],e.data[t+1],e.data[t+2]);let n=o(s(y,y,r),c);v.near=Math.min(v.near,n)}})===0&&(v.near=0),n.union(v))}return _.length=0,n}const _=new p({allocator:e=>e||{near:1/0,far:-1/0,mask:0,object:null},deallocator:e=>(e.object=null,e)}),v=new h,y=f(),b=f(),x=new p({deallocator:null}),S=new p({deallocator:null});function C(e,t,n){n.length=0;let r=t.length-3;w(y,t,r);let i=m(e,y);i<=0&&(n.push(y[0]),n.push(y[1]),n.push(y[2]));let a=0,o=i;for(;a<r;a+=3){w(b,t,a);let r=m(e,b);if(o*r<0){let e=r/(r-o);u(y,b,y,e),T(n,y)}r<=0&&T(n,b),o=r,d(y,b)}if(o*i<0){w(b,t,r);let e=i/(i-o);u(y,b,y,e),T(n,y)}}function w(e,t,n){return i(e,t.data[n],t.data[n+1],t.data[n+2])}function T(e,t){e.push(t[0]),e.push(t[1]),e.push(t[2])}function E(n,r,o,s){n.getQuaternionConjugate(j),i(M,r[0]-n.centerX,r[1]-n.centerY,r[2]-n.centerZ),a(M,M,j);let{halfSizeX:u,halfSizeY:d,halfSizeZ:f}=n,p=M[0]<-u?-1:+(M[0]>u),m=M[1]<-d?-1:+(M[1]>d),h=M[2]<-f?-1:+(M[2]>f),g=(p+m*3+h*9+13)*8,_=D[g];if(_===0)return _;e(A,n.getQuaternion(z)),t(A,A,n.getHalfSize(R));let v=(e,t)=>{let r=D[g+t+1];return i(e,((r&1)<<1)-1,(r&2)-1,((r&4)>>1)-1),c(e,e,A),l(e,n.getCenter(L),e)};return o.length=0,T(o,v(N,0)),T(o,v(P,1)),T(o,v(M,2)),T(o,v(F,3)),s(o),_===1||(o.length=0,T(o,N),T(o,F),T(o,v(M,4)),T(o,v(I,5)),s(o),_===2)||(o.length=0,T(o,N),T(o,I),T(o,v(M,6)),T(o,P),s(o)),_}const D=(()=>{let e=Array(216),t=0,n=n=>{for(let r=0;r<n.length;r++)e[t+r]=n[r];t+=8};return n([3,0,6,2,3,1,5,4]),n([2,0,2,3,1,5,4,0]),n([3,1,0,2,3,7,5,4]),n([2,0,1,3,2,6,4,0]),n([1,0,1,3,2,0,0,0]),n([2,1,5,7,3,2,0,0]),n([3,2,0,1,3,7,6,4]),n([2,2,0,1,3,7,6,0]),n([3,3,0,1,5,7,6,2]),n([2,0,1,5,4,6,2,0]),n([1,0,1,5,4,0,0,0]),n([2,1,3,7,5,4,0,0]),n([1,0,2,6,4,0,0,0]),n([0,0,0,0,0,0,0,0]),n([1,1,3,7,5,0,0,0]),n([2,2,3,7,6,4,0,0]),n([1,2,3,7,6,0,0,0]),n([2,3,1,5,7,6,2,0]),n([3,4,0,1,5,7,6,2]),n([2,5,7,6,4,0,1,0]),n([3,5,0,1,3,7,6,4]),n([2,4,5,7,6,2,0,0]),n([1,4,5,7,6,0,0,0]),n([2,5,1,3,7,6,4,0]),n([3,6,0,2,3,7,5,4]),n([2,6,2,3,7,5,4,0]),n([3,7,6,2,3,1,5,4]),e})(),O=4;function k(e,t){let n=0;for(let r=0;r<4;r++){let i=e.intersectPlane(t[r]);if(i>0)return-1;i===0&&(n|=1<<r)}return n}const A=n(),j=r(),M=f(),N=f(),P=f(),F=f(),I=f(),L=f(),R=f(),z=r();export{g as computeDepthRange};
2
+ import{fromQuat as e,scale as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as i,transformQuat as a,dot as o,sub as s,transformMat3 as c,add as l,lerp as u,copy as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../../core/PooledArray.js";import{signedDistance as m}from"../../../../../geometry/support/plane.js";import{DepthRange as h}from"../../lib/DepthRange.js";function g(e,t,n){let{eye:r,frustum:a,viewForward:c}=e;t.forAll(e=>{let t=e.offsetObb==null?e.obb:e.offsetObb,i=(t.centerX-r[0])*c[0]+(t.centerY-r[1])*c[1]+(t.centerZ-r[2])*c[2],o=t.projectedRadius(c);if(n.within(i-o)&&n.within(i+o))return;let s=k(t,a);if(s===-1)return;if(s===0){v.far=i+o,v.near=i-o,n.union(v);return}let l=_.pushNew();l.near=i-o,l.far=i+o,l.mask=s,l.object=e});for(let e=0;e<_.length;e++){let t=_.data[e];n.within(t.near)&&n.within(t.far)||(v.far=t.far,v.near=1/0,E(t.object.offsetObb==null?t.object.obb:t.object.offsetObb,r,x,e=>{let n=S;for(let r=0;r<O&&e.length>0;r++){if(!(t.mask&1<<r))continue;C(a[r],e,n);let i=e;e=n,n=i}for(let t=0;t<e.length;t+=3){i(y,e.data[t],e.data[t+1],e.data[t+2]);let n=o(s(y,y,r),c);v.near=Math.min(v.near,n)}})===0&&(v.near=0),n.union(v))}return _.length=0,n}const _=new p({allocator:e=>e||{near:1/0,far:-1/0,mask:0,object:null},deallocator:e=>(e.object=null,e)}),v=new h,y=f(),b=f(),x=new p({deallocator:null}),S=new p({deallocator:null});function C(e,t,n){n.length=0;let r=t.length-3;w(y,t,r);let i=m(e,y);i<=0&&(n.push(y[0]),n.push(y[1]),n.push(y[2]));let a=0,o=i;for(;a<r;a+=3){w(b,t,a);let r=m(e,b);if(o*r<0){let e=r/(r-o);u(y,b,y,e),T(n,y)}r<=0&&T(n,b),o=r,d(y,b)}if(o*i<0){w(b,t,r);let e=i/(i-o);u(y,b,y,e),T(n,y)}}function w(e,t,n){return i(e,t.data[n],t.data[n+1],t.data[n+2])}function T(e,t){e.push(t[0]),e.push(t[1]),e.push(t[2])}function E(n,r,o,s){n.getQuaternionConjugate(j),i(M,r[0]-n.centerX,r[1]-n.centerY,r[2]-n.centerZ),a(M,M,j);let{halfSizeX:u,halfSizeY:d,halfSizeZ:f}=n,p=M[0]<-u?-1:+(M[0]>u),m=M[1]<-d?-1:+(M[1]>d),h=M[2]<-f?-1:+(M[2]>f),g=(p+m*3+h*9+13)*8,_=D[g];if(_===0)return _;e(A,n.getQuaternion(z)),t(A,A,n.getHalfSize(R));let v=(e,t)=>{let r=D[g+t+1];return i(e,((r&1)<<1)-1,(r&2)-1,((r&4)>>1)-1),c(e,e,A),l(e,n.getCenter(L),e)};return o.length=0,T(o,v(N,0)),T(o,v(P,1)),T(o,v(M,2)),T(o,v(F,3)),s(o),_===1||(o.length=0,T(o,N),T(o,F),T(o,v(M,4)),T(o,v(I,5)),s(o),_===2)||(o.length=0,T(o,N),T(o,I),T(o,v(M,6)),T(o,P),s(o)),_}const D=(()=>{let e=Array(216),t=0,n=n=>{for(let r=0;r<n.length;r++)e[t+r]=n[r];t+=8};return n([3,0,6,2,3,1,5,4]),n([2,0,2,3,1,5,4,0]),n([3,1,0,2,3,7,5,4]),n([2,0,1,3,2,6,4,0]),n([1,0,1,3,2,0,0,0]),n([2,1,5,7,3,2,0,0]),n([3,2,0,1,3,7,6,4]),n([2,2,0,1,3,7,6,0]),n([3,3,0,1,5,7,6,2]),n([2,0,1,5,4,6,2,0]),n([1,0,1,5,4,0,0,0]),n([2,1,3,7,5,4,0,0]),n([1,0,2,6,4,0,0,0]),n([0,0,0,0,0,0,0,0]),n([1,1,3,7,5,0,0,0]),n([2,2,3,7,6,4,0,0]),n([1,2,3,7,6,0,0,0]),n([2,3,1,5,7,6,2,0]),n([3,4,0,1,5,7,6,2]),n([2,5,7,6,4,0,1,0]),n([3,5,0,1,3,7,6,4]),n([2,4,5,7,6,2,0,0]),n([1,4,5,7,6,0,0,0]),n([2,5,1,3,7,6,4,0]),n([3,6,0,2,3,7,5,4]),n([2,6,2,3,7,5,4,0]),n([3,7,6,2,3,1,5,4]),e})(),O=4;function k(e,t){let n=0;for(let r=0;r<4;r++){let i=e.intersectPlane(t[r]);if(i>0)return-1;i===0&&(n|=1<<r)}return n}const A=n(),j=r(),M=f(),N=f(),P=f(),F=f(),I=f(),L=f(),R=f(),z=r();export{g as unionDepthRange};