@arcgis/core 4.23.0-next.20220123 → 4.23.0-next.20220128

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 (624) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
  5. package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
  6. package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
  7. package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
  8. package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 0d02c6ad1f4688bfa374.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
  10. package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
  11. package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
  16. package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
  17. package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
  18. package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
  19. package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
  20. package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
  22. package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
  23. package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
  24. package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 2c8fe9bc988c3c5760a5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
  26. package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
  27. package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
  28. package/assets/esri/core/workers/chunks/37c03cfc19086ce631c6.js +1 -0
  29. package/assets/esri/core/workers/chunks/391e96192d1ec4e55ce2.js +1 -0
  30. package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
  31. package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
  32. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  33. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  34. package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  37. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
  38. package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
  39. package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
  40. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
  42. package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
  43. package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
  44. package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
  45. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
  46. package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
  47. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
  48. package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
  51. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
  52. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  53. package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
  55. package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
  56. package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
  57. package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
  58. package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
  59. package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
  60. package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
  61. package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
  62. package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +1 -0
  63. package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
  64. package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
  65. package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
  66. package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
  67. package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
  68. package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
  69. package/assets/esri/core/workers/chunks/aeaa1667c2d9f1b3366b.js +1 -0
  70. package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
  71. package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +1 -0
  72. package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
  73. package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
  74. package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
  75. package/assets/esri/core/workers/chunks/bac9fc90e6756e211160.js +1 -0
  76. package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +1 -0
  77. package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
  78. package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
  79. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
  80. package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
  81. package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +1 -0
  82. package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
  83. package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
  84. package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
  85. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
  86. package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
  87. package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
  88. package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
  89. package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → e0c8d61c7a85ce15499a.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
  91. package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
  92. package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
  93. package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
  94. package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
  95. package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
  96. package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
  97. package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
  98. package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
  99. package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
  100. package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
  101. package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
  102. package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
  103. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
  104. package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
  105. package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
  106. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  107. package/assets/esri/themes/base/_mixins.scss +4 -1
  108. package/assets/esri/themes/base/icons/style.scss +11 -2
  109. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
  110. package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
  111. package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
  112. package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
  113. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
  114. package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
  115. package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
  116. package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
  117. package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
  118. package/assets/esri/themes/base/widgets/_Print.scss +24 -11
  119. package/assets/esri/themes/base/widgets/_Search.scss +4 -2
  120. package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
  121. package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
  122. package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
  123. package/assets/esri/themes/dark/main.css +1 -1
  124. package/assets/esri/themes/dark-blue/main.css +1 -1
  125. package/assets/esri/themes/dark-green/main.css +1 -1
  126. package/assets/esri/themes/dark-purple/main.css +1 -1
  127. package/assets/esri/themes/dark-red/main.css +1 -1
  128. package/assets/esri/themes/light/main.css +1 -1
  129. package/assets/esri/themes/light/view.css +1 -1
  130. package/assets/esri/themes/light-blue/main.css +1 -1
  131. package/assets/esri/themes/light-green/main.css +1 -1
  132. package/assets/esri/themes/light-purple/main.css +1 -1
  133. package/assets/esri/themes/light-red/main.css +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  137. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  138. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  139. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  140. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  141. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  142. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  143. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  144. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  145. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  146. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  147. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  148. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  149. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  150. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  151. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  152. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  153. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  154. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  155. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  156. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  157. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  158. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  159. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  160. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  161. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  162. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  163. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  164. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  165. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  166. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  167. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  168. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  169. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  170. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  171. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  172. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  173. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  174. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  175. package/chunks/BlendLayers.glsl.js +2 -2
  176. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  177. package/chunks/CheckerBoard.glsl.js +3 -3
  178. package/chunks/Clouds.glsl.js +2 -2
  179. package/chunks/CloudsComposition.glsl.js +1 -1
  180. package/chunks/ColorMaterial.glsl.js +12 -12
  181. package/chunks/ComponentShader.glsl.js +21 -21
  182. package/chunks/Compositing.glsl.js +1 -1
  183. package/chunks/DefaultMaterial.glsl.js +33 -33
  184. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  185. package/chunks/Fog.glsl.js +10 -12
  186. package/chunks/HUDMaterial.glsl.js +2 -2
  187. package/chunks/HighlightComposition.glsl.js +5 -5
  188. package/chunks/ImageMaterial.glsl.js +6 -6
  189. package/chunks/LaserlinePath.glsl.js +8 -8
  190. package/chunks/LineCallout.glsl.js +6 -6
  191. package/chunks/MeasurementArrow.glsl.js +1 -1
  192. package/chunks/NativeLine.glsl.js +1 -1
  193. package/chunks/Path.glsl.js +5 -5
  194. package/chunks/Pattern.glsl.js +9 -9
  195. package/chunks/PointRenderer.glsl.js +14 -14
  196. package/chunks/Precipitation.glsl.js +91 -0
  197. package/chunks/RealisticTree.glsl.js +21 -21
  198. package/chunks/RibbonLine.glsl.js +11 -11
  199. package/chunks/SMAA.glsl.js +40 -40
  200. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  201. package/chunks/ShadowCast.glsl.js +6 -6
  202. package/chunks/ShadowHighlight.glsl.js +4 -4
  203. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  204. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  205. package/chunks/Stars.glsl.js +3 -3
  206. package/chunks/Terrain.glsl.js +3 -3
  207. package/chunks/TextureOnly.glsl.js +2 -2
  208. package/chunks/WaterSurface.glsl.js +22 -22
  209. package/chunks/boundedPlane.js +1 -1
  210. package/chunks/pe.js +1 -1
  211. package/chunks/vec3.js +1 -1
  212. package/chunks/vxlLayer.js +1 -1
  213. package/core/accessorSupport/ensureType.js +1 -1
  214. package/core/accessorSupport/get.js +1 -1
  215. package/core/accessorSupport/read.js +1 -1
  216. package/core/accessorSupport/set.js +1 -1
  217. package/core/accessorSupport/watch.js +1 -1
  218. package/core/accessorSupport/write.js +1 -1
  219. package/core/clock.js +1 -1
  220. package/core/jsonMap.js +1 -1
  221. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  222. package/core/loadAll.js +1 -1
  223. package/core/promiseUtils.js +1 -1
  224. package/core/reactiveUtils.js +1 -1
  225. package/form/ExpressionInfo.js +1 -1
  226. package/geometry/pe.js +1 -1
  227. package/geometry/support/axisAngleDegrees.js +1 -1
  228. package/geometry/support/frustum.js +1 -1
  229. package/geometry/support/plane.js +1 -1
  230. package/interfaces.d.ts +263 -35
  231. package/layers/VectorTileLayer.js +1 -1
  232. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  233. package/layers/graphics/featureConversionUtils.js +1 -1
  234. package/layers/support/LayerContingentValuesCache.js +1 -1
  235. package/layers/support/TileInfo.js +1 -1
  236. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  237. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  238. package/package.json +2 -2
  239. package/popup/content/AttachmentsContent.js +1 -1
  240. package/popup/content/support/mediaInfoTypes.js +1 -1
  241. package/rest/print.js +1 -1
  242. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  243. package/support/arcadeOnDemand.js +1 -1
  244. package/support/featureFlags.js +1 -1
  245. package/support/revision.js +1 -1
  246. package/symbols/FillSymbol3DLayer.js +1 -1
  247. package/symbols/IconSymbol3DLayer.js +1 -1
  248. package/symbols/LabelSymbol3D.js +1 -1
  249. package/symbols/ObjectSymbol3DLayer.js +1 -1
  250. package/symbols/PointSymbol3D.js +1 -1
  251. package/symbols/Symbol3D.js +1 -1
  252. package/symbols/WebStyleSymbol.js +1 -1
  253. package/symbols/cim/CIMSymbolHelper.js +1 -1
  254. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  255. package/symbols/cim/cimAnalyzer.js +1 -1
  256. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  257. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  258. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  259. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  260. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  261. package/symbols/support/Symbol3DIconOutline.js +1 -1
  262. package/symbols/support/Symbol3DOutline.js +1 -1
  263. package/symbols/support/Symbol3DVerticalOffset.js +1 -1
  264. package/symbols/support/Thumbnail.js +1 -1
  265. package/symbols/support/previewCIMSymbol.js +1 -1
  266. package/symbols/support/previewSymbol2D.js +1 -1
  267. package/symbols/support/previewSymbol3D.js +1 -1
  268. package/symbols/support/previewWebStyleSymbol.js +1 -1
  269. package/symbols/support/svgUtils.js +1 -1
  270. package/symbols/support/webStyleSymbolUtils.js +1 -1
  271. package/symbols.js +1 -1
  272. package/views/2d/MapViewConstraints.js +1 -1
  273. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  274. package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
  275. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  276. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  277. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  278. package/views/2d/viewpointUtils.js +1 -1
  279. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  280. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  281. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  282. package/views/3d/environment/CloudsComposition.js +1 -1
  283. package/views/3d/environment/CloudsGenerator.js +1 -1
  284. package/views/3d/environment/CloudsPresets.js +1 -1
  285. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  286. package/views/3d/environment/Fog.glsl.js +1 -1
  287. package/views/3d/environment/Fog.js +1 -1
  288. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  289. package/views/3d/environment/Precipitation.glsl.js +5 -0
  290. package/views/3d/environment/Precipitation.js +5 -0
  291. package/views/3d/environment/PrecipitationTechnique.js +5 -0
  292. package/views/3d/environment/RainyWeather.js +1 -1
  293. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  294. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  295. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  296. package/views/3d/environment/SnowyWeather.js +5 -0
  297. package/views/3d/environment/Stars.glsl.js +1 -1
  298. package/views/3d/environment/Stars.js +1 -1
  299. package/views/3d/environment/weather.js +1 -1
  300. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  301. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  302. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  303. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  304. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  305. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  306. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  307. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  308. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  309. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  310. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  311. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  312. package/views/3d/layers/GraphicsView3D.js +1 -1
  313. package/views/3d/layers/I3SMeshView3D.js +1 -1
  314. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  315. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  316. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  317. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  320. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  321. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  322. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  323. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  324. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  325. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  326. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  327. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  328. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  329. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  330. package/views/3d/layers/graphics/lineUtils.js +1 -1
  331. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  332. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  333. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  334. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  335. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  336. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  337. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  338. package/views/3d/layers/support/patternUtils.js +1 -1
  339. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  340. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  341. package/views/3d/support/LaserLineRenderer.js +1 -1
  342. package/views/3d/support/LaserlinePathData.js +1 -1
  343. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  344. package/views/3d/support/sunUtils.js +1 -1
  345. package/views/3d/terrain/OverlayRenderer.js +1 -1
  346. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  347. package/views/3d/terrain/TerrainRenderer.js +1 -1
  348. package/views/3d/terrain/TerrainSurface.js +1 -1
  349. package/views/3d/terrain/Tile.js +1 -1
  350. package/views/3d/terrain/terrainUtils.js +1 -1
  351. package/views/3d/terrain/tileUtils.js +1 -1
  352. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  353. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  354. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  355. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  356. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  358. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  359. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  360. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  361. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  362. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  363. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  364. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  365. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  366. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  367. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  368. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  370. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  371. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  372. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  373. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  374. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  375. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  376. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  377. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  378. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  379. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  380. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  381. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  382. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  383. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  384. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  385. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  386. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  387. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  388. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  389. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  390. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  391. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  392. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
  393. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  394. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  395. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  396. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  397. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  398. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  399. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  400. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  401. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  402. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  403. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  404. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  405. package/views/3d/webgl-engine/lib/Material.js +1 -1
  406. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  407. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  408. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  409. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  410. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  411. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  412. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  413. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  414. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  415. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  416. package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
  417. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  418. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  419. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  420. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  422. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  423. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  424. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  425. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  426. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  427. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  428. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  429. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  433. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  434. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  435. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  436. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  437. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  438. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  439. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  440. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  441. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  442. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  443. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  444. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  445. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  446. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  447. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  448. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  449. package/views/3d/webgl-engine/parts/Model.js +1 -1
  450. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  451. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  452. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  453. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  454. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  455. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  456. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  457. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  458. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  459. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  460. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  461. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  462. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  463. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  464. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  465. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  466. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  467. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  468. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  469. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  470. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  471. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  472. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  473. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  474. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  475. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  476. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  477. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  478. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  479. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  480. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  481. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  482. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  483. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  484. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  485. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  486. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  487. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  488. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  489. package/views/MapView.js +1 -1
  490. package/views/SceneView.js +1 -1
  491. package/views/View.js +1 -1
  492. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  493. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  494. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  495. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  496. package/views/interactive/dragEventPipeline.js +1 -1
  497. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  498. package/views/support/DefaultsFromMap.js +1 -1
  499. package/views/support/WatchUpdatingTracking.js +1 -1
  500. package/views/support/projectionUtils.js +5 -0
  501. package/views/webgl/BufferObject.js +1 -1
  502. package/views/webgl/InstanceCounter.js +1 -1
  503. package/views/webgl/Program.js +1 -1
  504. package/views/webgl/rasterUtils.js +1 -1
  505. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  506. package/widgets/Attachments.js +1 -1
  507. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  508. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  509. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  510. package/widgets/BasemapGallery.js +1 -1
  511. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  512. package/widgets/FeatureForm/InputField.js +1 -1
  513. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  514. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  515. package/widgets/FeatureTable.js +1 -1
  516. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  517. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  518. package/widgets/Popup/PopupViewModel.js +1 -1
  519. package/widgets/Popup/actionUtils.js +1 -1
  520. package/widgets/Search/support/locatorUtils.js +1 -1
  521. package/widgets/Search.js +1 -1
  522. package/widgets/Slice/SliceViewModel.js +1 -1
  523. package/widgets/Slider/SliderViewModel.js +1 -1
  524. package/widgets/Slider.js +1 -1
  525. package/widgets/Weather/WeatherViewModel.js +1 -1
  526. package/widgets/Weather/css.js +1 -1
  527. package/widgets/Weather/enums.js +5 -0
  528. package/widgets/Weather.js +1 -1
  529. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  530. package/widgets/support/InteractiveToolViewModel.js +1 -1
  531. package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
  532. package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
  533. package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
  534. package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
  535. package/assets/components/assets/calcite-icon/squareF16.json +0 -1
  536. package/assets/components/assets/calcite-icon/squareF24.json +0 -1
  537. package/assets/components/assets/calcite-icon/squareF32.json +0 -1
  538. package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
  539. package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
  540. package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
  541. package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
  542. package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
  543. package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
  544. package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
  545. package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
  546. package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
  547. package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
  548. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
  549. package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
  550. package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
  551. package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
  552. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
  553. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
  554. package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
  555. package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
  556. package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
  557. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
  558. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
  559. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
  560. package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
  561. package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
  562. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
  563. package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
  564. package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
  565. package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
  566. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
  567. package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
  568. package/assets/esri/core/workers/chunks/5383a8f3e4ec1a8a4fcd.js +0 -1
  569. package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
  570. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
  571. package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
  572. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
  573. package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
  574. package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
  575. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  576. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
  577. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
  578. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
  579. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
  580. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
  581. package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
  582. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
  583. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
  584. package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
  585. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
  586. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  587. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
  588. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
  589. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
  590. package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
  591. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
  592. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
  593. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
  594. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
  595. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
  596. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
  597. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
  598. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
  599. package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
  600. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
  601. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
  602. package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
  603. package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
  604. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
  605. package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
  606. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
  607. package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
  608. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
  609. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
  610. package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
  611. package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
  612. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
  613. package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
  614. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
  615. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  616. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
  617. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
  618. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
  619. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
  620. package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
  621. package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
  622. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
  623. package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
  624. package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as i,unwrap as t,disposeMaybe as s}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{f as n,m as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f32.js";import{f as a,l,a as c,o as d,d as u,p as m,s as p}from"../../../../chunks/vec3.js";import{c as g}from"../../../../chunks/vec3f32.js";import{c as f}from"../../../../chunks/vec3f64.js";import{s as _}from"../../../../chunks/vec4.js";import{create as S,POSITIVE_INFINITY as x,offset as b,contains as z,containsPoint as P,equals as w,set as R}from"../../../../geometry/support/aaBoundingBox.js";import{create as A}from"../../../../geometry/support/plane.js";import{fromPoints as M}from"../../../../geometry/support/ray.js";import{PointHighlights as j}from"./PointHighlights.js";import{minimumDistancePlane as y,maximumDistancePlane as H,intersectLine as I,toAaBoundingBox as q}from"../../support/orientedBoundingBox.js";import{ShaderOutput as v}from"../../webgl-engine/core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as T}from"../../webgl-engine/core/shaderLibrary/Slice.glsl.js";import{bindOutputHighlight as L}from"../../webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{VertexAttribute as E}from"../../webgl-engine/lib/basicInterfaces.js";import{Default3D as F}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as V}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as U,StoreResults as C}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{RenderPass as O}from"../../webgl-engine/lib/RenderPass.js";import{PointRendererTechniqueConfiguration as N,PointRendererTechnique as D}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{BufferObject as B}from"../../../webgl/BufferObject.js";import{DataType as W,PrimitiveType as G,Usage as k}from"../../../webgl/enums.js";import{VertexArrayObject as Y}from"../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as J}from"../../../webgl/VertexElementDescriptor.js";const K={positions:[new J(E.POSITION,3,W.FLOAT,0,12)],colors:[new J(E.COLOR,3,W.UNSIGNED_BYTE,0,3,!0)]};class Q{constructor(e){this._params=e,this.type=U.PCL,this.isGround=!1,this._bindParameters={inverseViewport:[0,0],highlightDepthTexture:null},this._highlights=new j({forEachNode:e=>this.forEachNode(e),addHighlight:(e,i,t)=>this._addHighlight(e,i,t),removeHighlight:(e,i)=>this._removeHighlight(e,i)}),this.canRender=!0,this.layerUid="",this._useFixedSizes=!1,this._scaleFactor=1,this._minSizePx=0,this._useRealWorldSymbolSizes=!1,this._size=0,this._sizePx=0,this._slicePlaneEnabled=!1,this._clipBox=S(x),this._techniqueConfig=new N,this.tempMatrix4=h(),this.tempVec3=g(),this.nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRep,e.requestRender()}uninitializeRenderContext(){}intersect(e,i,t,s){const r=f(),n=f(),o=f(),h=f(),p=A(),g=e.camera.perScreenPixelRatio/2,x=e.camera.near,w=this._getSizeParams();a(n,s,t);const R=1/l(n);c(n,n,R),d(o,n),_(p,n[0],n[1],n[2],-u(n,t));const j=new ne,v=new ne,T=new Array,L=S(),E=S(this._clipBox);b(E,-t[0],-t[1],-t[2],E),this.nodes.forAll((l=>{const c=l.splatSize*this._scaleFactor;let d=y(l.obb,p),f=H(l.obb,p);d-=ee(c,d+x,w,g,l.isLeaf),f-=ee(c,f+x,w,g,l.isLeaf);const _=f<0,S=null!=j.dist&&null!=v.dist&&j.dist<d*R&&v.dist>f*R;if(_||S)return;const A=$(c,f+x,w,g,l.isLeaf);if(!I(l.obb,t,n,A))return;const M=A*A;q(l.obb,L),b(L,-t[0],-t[1],-t[2],L);const F=!z(E,L);a(h,l.origin,t);const V=l.coordinates.length/3;for(let a=0;a<V;a++){if(r[0]=h[0]+l.coordinates[3*a],r[1]=h[1]+l.coordinates[3*a+1],r[2]=h[2]+l.coordinates[3*a+2],F&&!P(E,r))continue;const d=u(r,n),p=m(r)-d*d;if(p>M)continue;let f=d+x;const _=ee(c,f,w,g,l.isLeaf);if(d-_<0)continue;f-=_;const S=$(c,f,w,g,l.isLeaf);if(p>S*S)continue;const b=(d-_)*R,z=e=>(e.point=ie(l,a,e.point),e.dist=b,e.normal=o,e.node=l,e.pointId=a,e.layerUid=this.layerUid,e);if((null==j.dist||b<j.dist)&&(null==i||i(t,s,b))&&z(j),e.options.store!==C.MIN&&(null==v.dist||b>v.dist)&&(null==i||i(t,s,b))&&z(v),e.options.store===C.ALL&&(null==i||i(t,s,b))){const e=new ne;T.push(z(e))}}}));const F=e=>{const{layerUid:i,node:t,pointId:s}=e;return{point:e.point,layerUid:i,graphicUid:s,createGraphic:()=>this._params.createGraphic(t,s,e.point)}},U=(e,i)=>{const t=F(i);e.set(this.type,t,i.dist,i.normal)};if(oe(j)){const i=e.results.min;(null==i.dist||j.dist<i.dist)&&U(i,j)}if(oe(v)&&e.options.store!==C.MIN){const i=e.results.max;(null==i.dist||v.dist>i.dist)&&U(i,v)}if(e.options.store===C.ALL){const i=M(t,s);for(const t of T){const s=V(i);U(s,t),e.results.all.push(s)}}}prepareTechnique(e){if(0===this.nodes.length||e.pass!==O.MATERIAL&&e.pass!==O.MATERIAL_DEPTH&&e.pass!==O.MATERIAL_HIGHLIGHT)return null;this.nodes.forAll((i=>{null==i.vao&&this._initNode(e,i)}));const i=this._getSizeParams();return this._techniqueConfig.drawScreenSize=i.drawScreenSpace,this._techniqueConfig.slicePlaneEnabled=this._slicePlaneEnabled,this._techniqueConfig.sceneHasOcludees=e.hasOccludees,this._techniqueConfig.output=e.pass===O.MATERIAL_DEPTH?v.Depth:e.pass===O.MATERIAL_HIGHLIGHT?v.Highlight:v.Color,this._techniqueRep.releaseAndAcquire(D,this._techniqueConfig,this._technique)}render(e,i){const t=e.rctx,s=this._getSizeParams(),r=i.program;t.useProgram(r),i.bindPipelineState(t);const h=this._clipBox,a=!w(h,x,((e,i)=>e===i));a||(p(this.tempVec3,-1/0,-1/0,-1/0),r.setUniform3fv("uClipMin",this.tempVec3),p(this.tempVec3,1/0,1/0,1/0),r.setUniform3fv("uClipMax",this.tempVec3)),r.setUniformMatrix4fv("uProjectionMatrix",e.camera.projectionMatrix);e.pass===O.MATERIAL_DEPTH&&r.setUniform2f("nearFar",e.camera.near,e.camera.far),e.isHighlightPass&&(this._bindParameters.inverseViewport[0]=1/e.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/e.camera.fullViewport[3],this._bindParameters.highlightDepthTexture=e.highlightDepthTexture,L(r,this._bindParameters));const l=e.camera.pixelRatio;s.drawFixedSize&&r.setUniform2f("uPointScale",s.fixedSize*l,e.camera.fullHeight);const c=this._slicePlaneEnabled?e.sliceHelper&&e.sliceHelper.plane:null;this.nodes.forAll((d=>{if(0===d.coordinates.length||e.isHighlightPass&&!d.highlights)return;if(r.setUniform2f("uScreenMinMaxSize",s.screenMinSize*l,Z(d.isLeaf)*l),!s.drawFixedSize){const i=d.splatSize*this._scaleFactor;r.setUniform2f("uPointScale",i*l,e.camera.fullHeight/l)}const u=d.origin;a&&(p(this.tempVec3,h[0]-u[0],h[1]-u[1],h[2]-u[2]),r.setUniform3fv("uClipMin",this.tempVec3),p(this.tempVec3,h[3]-u[0],h[4]-u[1],h[5]-u[2]),r.setUniform3fv("uClipMax",this.tempVec3)),n(this.tempMatrix4,u),o(this.tempMatrix4,e.camera.viewMatrix,this.tempMatrix4),r.setUniformMatrix4fv("uModelViewMatrix",this.tempMatrix4),T(r,i.configuration,c,u),t.bindVAO(d.vao),e.isHighlightPass?this._renderHighlightFragments(t,d):t.drawArrays(G.POINTS,0,d.coordinates.length/3)}))}_renderHighlightFragments(e,s){const r=s.highlights;if(i(r))return;let n=t(r[0].component),o=n+1;for(let i=1;i<r.length;i++){const s=t(r[i].component);if(s!==o){const i=o-n;i>0&&e.drawArrays(G.POINTS,n,i),n=s}o=s+1}const h=o-n;h>0&&e.drawArrays(G.POINTS,n,h)}set useFixedSizes(e){this._useFixedSizes!==e&&(this._useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._useFixedSizes}set scaleFactor(e){this._scaleFactor!==e&&(this._scaleFactor=e,this._requestRender())}get scaleFactor(){return this._scaleFactor}set minSizePx(e){this._minSizePx!==e&&(this._minSizePx=e,this._requestRender())}get minSizePx(){return this._minSizePx}set useRealWorldSymbolSizes(e){this._useRealWorldSymbolSizes!==e&&(this._useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._useRealWorldSymbolSizes}set size(e){this._size!==e&&(this._size=e,this._requestRender())}get size(){return this._size}set sizePx(e){this._sizePx!==e&&(this._sizePx=e,this._requestRender())}get sizePx(){return this._sizePx}set clippingBox(e){R(this._clipBox,e||x)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this.nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let i=null;return this.nodes.filterInPlace((t=>t.id!==e||(i=t,t.vao=s(t.vao),this._highlights.nodeRemoved(t),!1))),this._requestRender(),i}forEachNode(e){this.nodes.forAll(e)}removeAll(){this.nodes.forAll((e=>e.vao=s(e.vao))),this._highlights.removeAll(),this.nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,i,t){e.highlights=se(e.highlights,i,t),this._requestRender()}_removeHighlight(e,i){e.highlights=re(e.highlights,i),this._requestRender()}_initNode(e,i){const t=e.rctx;i.vao=new Y(t,F,K,{positions:B.createVertex(t,k.STATIC_DRAW,i.coordinates),colors:B.createVertex(t,k.STATIC_DRAW,i.rgb)})}_requestRender(){this._context&&this._context.requestRender()}_getSizeParams(){const e=this._useFixedSizes,i=e&&!this._useRealWorldSymbolSizes;return{drawScreenSpace:i,drawFixedSize:e,fixedSize:i?this._sizePx:this._size,screenMinSize:e?0:this._minSizePx}}}function X(e){return e.hasOwnProperty("splatSize")}function Z(e){return e?256:64}function $(e,i,t,s,r){if(t.drawScreenSpace)return t.fixedSize*i*s;const n=Z(r)*i*s;return t.drawFixedSize?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*i*s,e/2),n):Math.min(e/2,n)}function ee(e,i,t,s,r){return t.drawScreenSpace?0:$(e,i,t,s,r)}function ie(e,t,s){return i(s)&&(s=f()),s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}function te(i){return e(i.component)?i.component:-1}function se(e,t,s){i(e)&&(e=[]);const r={component:t,id:s};e.push(r);const n=te(r);let o=e.length-1;for(;o>0&&n<te(e[o-1]);)[e[o-1],e[o]]=[e[o],e[o-1]],--o;return e}function re(e,t){if(i(e))return e;const s=e.filter((e=>e.id!==t));return 0===s.length?null:s}class ne{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function oe(i){return e(i.dist)&&e(i.point)&&e(i.pointId)&&e(i.node)}export{Q as PointRenderer,X as isInstanceOfNode};
5
+ import{isSome as e,isNone as i,unwrap as t,disposeMaybe as s}from"../../../../core/maybe.js";import r from"../../../../core/PooledArray.js";import{f as n,m as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f32.js";import{f as a,l,a as c,o as d,d as u,p as m,s as p}from"../../../../chunks/vec3.js";import{c as g}from"../../../../chunks/vec3f32.js";import{c as f}from"../../../../chunks/vec3f64.js";import{s as _}from"../../../../chunks/vec4.js";import{create as S,POSITIVE_INFINITY as x,offset as b,contains as z,containsPoint as P,equals as w,set as R}from"../../../../geometry/support/aaBoundingBox.js";import{create as A}from"../../../../geometry/support/plane.js";import{fromPoints as M}from"../../../../geometry/support/ray.js";import{PointHighlights as j}from"./PointHighlights.js";import{minimumDistancePlane as y,maximumDistancePlane as H,intersectLine as v,toAaBoundingBox as q}from"../../support/orientedBoundingBox.js";import{ShaderOutput as I}from"../../webgl-engine/core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as T}from"../../webgl-engine/core/shaderLibrary/Slice.glsl.js";import{bindOutputHighlight as L}from"../../webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{Default3D as E}from"../../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{newIntersectorResult as F}from"../../webgl-engine/lib/Intersector.js";import{IntersectorType as V,StoreResults as U}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{RenderPass as O}from"../../webgl-engine/lib/RenderPass.js";import{VertexAttribute as N}from"../../webgl-engine/lib/VertexAttribute.js";import{PointRendererTechniqueConfiguration as C,PointRendererTechnique as D}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{BufferObject as B}from"../../../webgl/BufferObject.js";import{DataType as W,PrimitiveType as G,Usage as k}from"../../../webgl/enums.js";import{VertexArrayObject as Y}from"../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as J}from"../../../webgl/VertexElementDescriptor.js";const K={positions:[new J(N.POSITION,3,W.FLOAT,0,12)],colors:[new J(N.COLOR,3,W.UNSIGNED_BYTE,0,3,!0)]};class Q{constructor(e){this._params=e,this.type=V.PCL,this.isGround=!1,this._bindParameters={inverseViewport:[0,0],highlightDepthTexture:null},this._highlights=new j({forEachNode:e=>this.forEachNode(e),addHighlight:(e,i,t)=>this._addHighlight(e,i,t),removeHighlight:(e,i)=>this._removeHighlight(e,i)}),this.canRender=!0,this.layerUid="",this._useFixedSizes=!1,this._scaleFactor=1,this._minSizePx=0,this._useRealWorldSymbolSizes=!1,this._size=0,this._sizePx=0,this._slicePlaneEnabled=!1,this._clipBox=S(x),this._techniqueConfig=new C,this.tempMatrix4=h(),this.tempVec3=g(),this.nodes=new r}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRep,e.requestRender()}uninitializeRenderContext(){}intersect(e,i,t,s){const r=f(),n=f(),o=f(),h=f(),p=A(),g=e.camera.perScreenPixelRatio/2,x=e.camera.near,w=this._getSizeParams();a(n,s,t);const R=1/l(n);c(n,n,R),d(o,n),_(p,n[0],n[1],n[2],-u(n,t));const j=new ne,I=new ne,T=new Array,L=S(),E=S(this._clipBox);b(E,-t[0],-t[1],-t[2],E),this.nodes.forAll((l=>{const c=l.splatSize*this._scaleFactor;let d=y(l.obb,p),f=H(l.obb,p);d-=ee(c,d+x,w,g,l.isLeaf),f-=ee(c,f+x,w,g,l.isLeaf);const _=f<0,S=null!=j.dist&&null!=I.dist&&j.dist<d*R&&I.dist>f*R;if(_||S)return;const A=$(c,f+x,w,g,l.isLeaf);if(!v(l.obb,t,n,A))return;const M=A*A;q(l.obb,L),b(L,-t[0],-t[1],-t[2],L);const F=!z(E,L);a(h,l.origin,t);const V=l.coordinates.length/3;for(let a=0;a<V;a++){if(r[0]=h[0]+l.coordinates[3*a],r[1]=h[1]+l.coordinates[3*a+1],r[2]=h[2]+l.coordinates[3*a+2],F&&!P(E,r))continue;const d=u(r,n),p=m(r)-d*d;if(p>M)continue;let f=d+x;const _=ee(c,f,w,g,l.isLeaf);if(d-_<0)continue;f-=_;const S=$(c,f,w,g,l.isLeaf);if(p>S*S)continue;const b=(d-_)*R,z=e=>(e.point=ie(l,a,e.point),e.dist=b,e.normal=o,e.node=l,e.pointId=a,e.layerUid=this.layerUid,e);if((null==j.dist||b<j.dist)&&(null==i||i(t,s,b))&&z(j),e.options.store!==U.MIN&&(null==I.dist||b>I.dist)&&(null==i||i(t,s,b))&&z(I),e.options.store===U.ALL&&(null==i||i(t,s,b))){const e=new ne;T.push(z(e))}}}));const V=e=>{const{layerUid:i,node:t,pointId:s}=e;return{point:e.point,layerUid:i,graphicUid:s,createGraphic:()=>this._params.createGraphic(t,s,e.point)}},O=(e,i)=>{const t=V(i);e.set(this.type,t,i.dist,i.normal)};if(oe(j)){const i=e.results.min;(null==i.dist||j.dist<i.dist)&&O(i,j)}if(oe(I)&&e.options.store!==U.MIN){const i=e.results.max;(null==i.dist||I.dist>i.dist)&&O(i,I)}if(e.options.store===U.ALL){const i=M(t,s);for(const t of T){const s=F(i);O(s,t),e.results.all.push(s)}}}prepareTechnique(e){if(0===this.nodes.length||e.pass!==O.MATERIAL&&e.pass!==O.MATERIAL_DEPTH&&e.pass!==O.MATERIAL_HIGHLIGHT)return null;this.nodes.forAll((i=>{null==i.vao&&this._initNode(e,i)}));const i=this._getSizeParams();return this._techniqueConfig.drawScreenSize=i.drawScreenSpace,this._techniqueConfig.slicePlaneEnabled=this._slicePlaneEnabled,this._techniqueConfig.sceneHasOcludees=e.hasOccludees,this._techniqueConfig.output=e.pass===O.MATERIAL_DEPTH?I.Depth:e.pass===O.MATERIAL_HIGHLIGHT?I.Highlight:I.Color,this._techniqueRep.releaseAndAcquire(D,this._techniqueConfig,this._technique)}render(e,i){const t=e.rctx,s=this._getSizeParams(),r=i.program;t.useProgram(r),i.bindPipelineState(t);const h=this._clipBox,a=!w(h,x,((e,i)=>e===i));a||(p(this.tempVec3,-1/0,-1/0,-1/0),r.setUniform3fv("clipMin",this.tempVec3),p(this.tempVec3,1/0,1/0,1/0),r.setUniform3fv("clipMax",this.tempVec3)),r.setUniformMatrix4fv("proj",e.camera.projectionMatrix);e.pass===O.MATERIAL_DEPTH&&r.setUniform2fv("nearFar",e.camera.nearFar),e.isHighlightPass&&(this._bindParameters.inverseViewport[0]=1/e.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/e.camera.fullViewport[3],this._bindParameters.highlightDepthTexture=e.highlightDepthTexture,L(r,this._bindParameters));const l=e.camera.pixelRatio;s.drawFixedSize&&r.setUniform2f("pointScale",s.fixedSize*l,e.camera.fullHeight);const c=this._slicePlaneEnabled?e.sliceHelper&&e.sliceHelper.plane:null;this.nodes.forAll((d=>{if(0===d.coordinates.length||e.isHighlightPass&&!d.highlights)return;if(r.setUniform2f("screenMinMaxSize",s.screenMinSize*l,Z(d.isLeaf)*l),!s.drawFixedSize){const i=d.splatSize*this._scaleFactor;r.setUniform2f("pointScale",i*l,e.camera.fullHeight/l)}const u=d.origin;a&&(p(this.tempVec3,h[0]-u[0],h[1]-u[1],h[2]-u[2]),r.setUniform3fv("clipMin",this.tempVec3),p(this.tempVec3,h[3]-u[0],h[4]-u[1],h[5]-u[2]),r.setUniform3fv("clipMax",this.tempVec3)),n(this.tempMatrix4,u),o(this.tempMatrix4,e.camera.viewMatrix,this.tempMatrix4),r.setUniformMatrix4fv("modelView",this.tempMatrix4),T(r,i.configuration,c,u),t.bindVAO(d.vao),e.isHighlightPass?this._renderHighlightFragments(t,d):t.drawArrays(G.POINTS,0,d.coordinates.length/3)}))}_renderHighlightFragments(e,s){const r=s.highlights;if(i(r))return;let n=t(r[0].component),o=n+1;for(let i=1;i<r.length;i++){const s=t(r[i].component);if(s!==o){const i=o-n;i>0&&e.drawArrays(G.POINTS,n,i),n=s}o=s+1}const h=o-n;h>0&&e.drawArrays(G.POINTS,n,h)}set useFixedSizes(e){this._useFixedSizes!==e&&(this._useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._useFixedSizes}set scaleFactor(e){this._scaleFactor!==e&&(this._scaleFactor=e,this._requestRender())}get scaleFactor(){return this._scaleFactor}set minSizePx(e){this._minSizePx!==e&&(this._minSizePx=e,this._requestRender())}get minSizePx(){return this._minSizePx}set useRealWorldSymbolSizes(e){this._useRealWorldSymbolSizes!==e&&(this._useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._useRealWorldSymbolSizes}set size(e){this._size!==e&&(this._size=e,this._requestRender())}get size(){return this._size}set sizePx(e){this._sizePx!==e&&(this._sizePx=e,this._requestRender())}get sizePx(){return this._sizePx}set clippingBox(e){R(this._clipBox,e||x)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this.nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let i=null;return this.nodes.filterInPlace((t=>t.id!==e||(i=t,t.vao=s(t.vao),this._highlights.nodeRemoved(t),!1))),this._requestRender(),i}forEachNode(e){this.nodes.forAll(e)}removeAll(){this.nodes.forAll((e=>e.vao=s(e.vao))),this._highlights.removeAll(),this.nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,i,t){e.highlights=se(e.highlights,i,t),this._requestRender()}_removeHighlight(e,i){e.highlights=re(e.highlights,i),this._requestRender()}_initNode(e,i){const t=e.rctx;i.vao=new Y(t,E,K,{positions:B.createVertex(t,k.STATIC_DRAW,i.coordinates),colors:B.createVertex(t,k.STATIC_DRAW,i.rgb)})}_requestRender(){this._context&&this._context.requestRender()}_getSizeParams(){const e=this._useFixedSizes,i=e&&!this._useRealWorldSymbolSizes;return{drawScreenSpace:i,drawFixedSize:e,fixedSize:i?this._sizePx:this._size,screenMinSize:e?0:this._minSizePx}}}function X(e){return e.hasOwnProperty("splatSize")}function Z(e){return e?256:64}function $(e,i,t,s,r){if(t.drawScreenSpace)return t.fixedSize*i*s;const n=Z(r)*i*s;return t.drawFixedSize?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*i*s,e/2),n):Math.min(e/2,n)}function ee(e,i,t,s,r){return t.drawScreenSpace?0:$(e,i,t,s,r)}function ie(e,t,s){return i(s)&&(s=f()),s[0]=e.origin[0]+e.coordinates[3*t],s[1]=e.origin[1]+e.coordinates[3*t+1],s[2]=e.origin[2]+e.coordinates[3*t+2],s}function te(i){return e(i.component)?i.component:-1}function se(e,t,s){i(e)&&(e=[]);const r={component:t,id:s};e.push(r);const n=te(r);let o=e.length-1;for(;o>0&&n<te(e[o-1]);)[e[o-1],e[o]]=[e[o],e[o-1]],--o;return e}function re(e,t){if(i(e))return e;const s=e.filter((e=>e.id!==t));return 0===s.length?null:s}class ne{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function oe(i){return e(i.dist)&&e(i.point)&&e(i.pointId)&&e(i.node)}export{Q as PointRenderer,X as isInstanceOfNode};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../core/HandleOwner.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatePolicy as s}from"../../webgl-engine/lib/basicInterfaces.js";let n=class extends t{constructor(e){super(e),this.type="heatmap",this.filterVisibility={filterChanged(){},dirty:!1},this.preferredUpdatePolicy=s.ASYNC,this.dataExtent=null}initialize(){this.updatingHandles.addOnCollectionChange((()=>this.owner.loadedGraphics),(e=>{}))}destroy(){}get layer(){return this.owner.layer}get updating(){return this.updatingHandles.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get displayFeatureLimit(){return{minimumTotalNumberOfFeatures:0,maximumTotalNumberOfFeatures:1e10,maximumTotalNumberOfPrimitives:1e10,maximumNumberOfFeatures:1e10}}get scaleVisibilitySuspended(){return!1}get usedMemory(){return 0}get usedMemoryPerFeature(){return 0}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return{core:{visible:0,missing:0,pending:0},elevationUpdating:!1,visibilityFrustum:!0,visibilityScale:!0}}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return a}maskOccludee(){return a}setObjectIdVisibility(){}};e([i()],n.prototype,"type",void 0),e([i()],n.prototype,"owner",void 0),e([i()],n.prototype,"layer",null),e([i()],n.prototype,"featureStore",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"updatingRemaining",null),e([i()],n.prototype,"suspendInfo",null),e([i()],n.prototype,"legendEnabled",null),e([i()],n.prototype,"filterVisibility",void 0),e([i()],n.prototype,"displayFeatureLimit",null),e([i()],n.prototype,"preferredUpdatePolicy",void 0),e([i()],n.prototype,"dataExtent",void 0),n=e([o("esri.views.3d.layers.support.HeatmapFeatureProcessor")],n);const a=r();export{n as HeatmapFeatureProcessor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{width as t,height as e,intersects as n}from"../../../../geometry/support/aaBoundingRect.js";import{VertexAttribute as i}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";import o from"../../webgl-engine/lib/GeometryUtil.js";function a(n,i,r){const o=t(n)/e(n),a={width:r,height:r};return o>1.0001?a.height=r/o:o<.9999&&(a.width=r*o),a.width=Math.round(a.width/(t(n)/t(i))),a.height=Math.round(a.height/(e(n)/e(i))),a}function h(t){return o.createSquareGeometry([[t[0],t[1],-1],[t[2],t[1],-1],[t[2],t[3],-1],[t[0],t[3],-1]])}function s(t,e){if(!n(t,e))return h(e);const o=[t[1]-e[1],Math.min(t[3],e[3])-Math.max(t[1],e[1]),e[3]-t[3],123456],a=[t[0]-e[0],Math.min(t[2],e[2])-Math.max(t[0],e[0]),e[2]-t[2],123456],s=e[2]-e[0],l=e[3]-e[1],m=a[0]>0&&a[2]>0?3:2,u=o[0]>0&&o[2]>0?3:2,g=(u+1)*(m+1),f=new Float64Array(3*g),w=new Float32Array(2*g),d=new Uint32Array(6*(u*m-1));let y=0,M=0,b=0,p=0,x=0;for(let n=0;n<4;n++){const t=o[n];if(t<=0)continue;let i=0;for(let r=0;r<4;r++){const t=a[r];t<=0||(f[M++]=e[0]+i,f[M++]=e[1]+y,f[M++]=-1,w[b++]=i/s,w[b++]=y/l,r<3&&n<3&&(1!==r||1!==n)&&(d[x++]=p,d[x++]=p+1,d[x++]=p+m+1,d[x++]=p+1,d[x++]=p+m+2,d[x++]=p+m+1),p++,i+=t)}y+=t}const A=new Uint32Array(d.length);return new r([[i.POSITION,{size:3,data:f,exclusive:!0}],[i.NORMAL,{size:3,data:c,exclusive:!0}],[i.UV0,{size:2,data:w,exclusive:!0}]],[[i.POSITION,d],[i.NORMAL,A],[i.UV0,d]])}const c=[0,0,1];export{a as computeImageExportSize,h as createGeometryForExtent,s as createOuterImageGeometry};
5
+ import{width as t,height as e,intersects as n}from"../../../../geometry/support/aaBoundingRect.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";import i from"../../webgl-engine/lib/GeometryUtil.js";import{VertexAttribute as o}from"../../webgl-engine/lib/VertexAttribute.js";function a(n,r,i){const o=t(n)/e(n),a={width:i,height:i};return o>1.0001?a.height=i/o:o<.9999&&(a.width=i*o),a.width=Math.round(a.width/(t(n)/t(r))),a.height=Math.round(a.height/(e(n)/e(r))),a}function h(t){return i.createSquareGeometry([[t[0],t[1],-1],[t[2],t[1],-1],[t[2],t[3],-1],[t[0],t[3],-1]])}function l(t,e){if(!n(t,e))return h(e);const i=[t[1]-e[1],Math.min(t[3],e[3])-Math.max(t[1],e[1]),e[3]-t[3],123456],a=[t[0]-e[0],Math.min(t[2],e[2])-Math.max(t[0],e[0]),e[2]-t[2],123456],l=e[2]-e[0],u=e[3]-e[1],m=a[0]>0&&a[2]>0?3:2,c=i[0]>0&&i[2]>0?3:2,g=(c+1)*(m+1),w=new Float64Array(3*g),f=new Float32Array(2*g),d=new Uint32Array(6*(c*m-1));let y=0,M=0,b=0,p=0,x=0;for(let n=0;n<4;n++){const t=i[n];if(t<=0)continue;let r=0;for(let i=0;i<4;i++){const t=a[i];t<=0||(w[M++]=e[0]+r,w[M++]=e[1]+y,w[M++]=-1,f[b++]=r/l,f[b++]=y/u,i<3&&n<3&&(1!==i||1!==n)&&(d[x++]=p,d[x++]=p+1,d[x++]=p+m+1,d[x++]=p+1,d[x++]=p+m+2,d[x++]=p+m+1),p++,r+=t)}y+=t}const A=new Uint32Array(d.length);return new r([[o.POSITION,{size:3,data:w,exclusive:!0}],[o.NORMAL,{size:3,data:s,exclusive:!0}],[o.UV0,{size:2,data:f,exclusive:!0}]],[[o.POSITION,d],[o.NORMAL,A],[o.UV0,d]])}const s=[0,0,1];export{a as computeImageExportSize,h as createGeometryForExtent,l as createOuterImageGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isSome as r}from"../../../../core/maybe.js";import{f as e}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f64 as t,BufferViewVec3f64 as a,BufferViewVec4f as o}from"../../../../geometry/support/buffer/BufferView.js";import{perVertexElevationAligner as n}from"../graphics/ElevationAligners.js";import{createMapSpaceUVCoords as s}from"./uvUtils.js";import{VertexAttribute as i}from"../../webgl-engine/lib/basicInterfaces.js";import{ColorMaterial as l}from"../../webgl-engine/materials/ColorMaterial.js";import{PatternMaterial as c}from"../../webgl-engine/materials/PatternMaterial.js";import{Style as m}from"../../webgl-engine/materials/PatternStyle.js";function f(r,e,t){return g(u(r),e,t)}function u(r){return r&&r.pattern||null}function g(t,a,o){return r(t)?"none"===t.style||"solid"===t.style?("none"===t.style&&(a.color=e(0,0,0,0),a.transparent=!0),new l(a)):(a.style=p(t.style),a.draped=o.isDraped,new c(a)):new l(a)}function p(r){switch(r){case"horizontal":return m.Horizontal;case"vertical":return m.Vertical;case"cross":return m.Cross;case"forward-diagonal":return m.ForwardDiagonal;case"backward-diagonal":return m.BackwardDiagonal;case"diagonal-cross":return m.DiagonalCross;default:return}}function d(r){return r.material instanceof c&&!r.material.parameters.draped}function y(r,e){if(d(r)){const n=r.geometry.vertexAttributes,l=n.get(i.POSITION).data,c=n.get(i.UVMAPSPACE).data,m=n.get(i.BOUNDINGRECT).data;s(o.fromTypedArray(c),a.fromTypedArray(l),e,t.fromTypedArray(m))}}function w(r,e,t,a){const o=n(r,e,t,a),s=r.stageObject.geometryRecords;for(let n=0;n<s.length;n++)y(s[n],a);return o}export{f as createMaterial,g as createMaterialFromPattern,p as parsePatternStyle,d as requiresUVUpdates,y as updateMapSpaceUVCoords,w as uvElevationAligner};
5
+ import"../../../../core/has.js";import{isSome as r}from"../../../../core/maybe.js";import{f as e}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f64 as t,BufferViewVec3f64 as a,BufferViewVec4f as o}from"../../../../geometry/support/buffer/BufferView.js";import{perVertexElevationAligner as n}from"../graphics/ElevationAligners.js";import{createMapSpaceUVCoords as i}from"./uvUtils.js";import{VertexAttribute as s}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as l}from"../../webgl-engine/materials/ColorMaterial.js";import{PatternMaterial as m}from"../../webgl-engine/materials/PatternMaterial.js";import{Style as c}from"../../webgl-engine/materials/PatternStyle.js";function f(r,e,t){return g(u(r),e,t)}function u(r){return r&&r.pattern||null}function g(t,a,o){return r(t)?"none"===t.style||"solid"===t.style?("none"===t.style&&(a.color=e(0,0,0,0),a.transparent=!0),new l(a)):(a.style=p(t.style),a.draped=o.isDraped,new m(a)):new l(a)}function p(r){switch(r){case"horizontal":return c.Horizontal;case"vertical":return c.Vertical;case"cross":return c.Cross;case"forward-diagonal":return c.ForwardDiagonal;case"backward-diagonal":return c.BackwardDiagonal;case"diagonal-cross":return c.DiagonalCross;default:return}}function d(r){return r.material instanceof m&&!r.material.parameters.draped}function y(r,e){if(d(r)){const n=r.geometry.vertexAttributes,l=n.get(s.POSITION).data,m=n.get(s.UVMAPSPACE).data,c=n.get(s.BOUNDINGRECT).data;i(o.fromTypedArray(m),a.fromTypedArray(l),e,t.fromTypedArray(c))}}function w(r,e,t,a){const o=n(r,e,t,a),i=r.stageObject.geometryRecords;for(let n=0;n<i.length;n++)y(i[n],a);return o}export{f as createMaterial,g as createMaterialFromPattern,p as parsePatternStyle,d as requiresUVUpdates,y as updateMapSpaceUVCoords,w as uvElevationAligner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import{asinClamped as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{o as r,g as a,d as m,a as h,f as c,n as l,b as p}from"../../../../../chunks/vec3.js";import{c as u,f as d}from"../../../../../chunks/vec3f64.js";import{wrapAxisAngle as C}from"../../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as v,setOffsetFromPoint as M,negate as f,normal as w}from"../../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as b,applyAll as S}from"../../../camera/constraintUtils.js";import{ConstraintTypes as V,InteractionType as E,TiltMode as P}from"../../../camera/constraintUtils/common.js";import{ExponentialFalloff as j}from"../../../input/util.js";import{InteractiveController as z}from"../InteractiveController.js";import{PanPlanarMomentumController as H}from"../momentum/PanPlanarMomentumController.js";import{RotationMomentumController as O}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"../momentum/ZoomPlanarMomentumController.js";import{NavigationMode as T,centroid as A,applyZoomToPoint as F,applyPanPlanar as L,normalizeRotationDelta as x,applyRotation as R,intersectPlaneFromScreenPointAtEye as U}from"../../utils/navigationUtils.js";import D from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as N}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as _}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as k}from"../../../../navigation/ZoomMomentumEstimator.js";const I=d(0,0,1),G={ELEVATION_THRESHOLD:3e4,ANGLE_THRESHOLD:16/180*Math.PI},Z=80;let B=class extends z{constructor(t){super(t),this.view=null,this.rotationValueSmooth=new j(.05),this.scalingValueSmooth=new j(.05),this.planeHorizontal=g(),this.planeVertical=g(),this.rotationMomentumEstimator=new _,this.panMomentumEstimator=new N(300,12,.9),this.zoomMomentumEstimator=new k,this.beginCenter=u(),this.tmpPoints=[],this.beginCenterScreen=e(),this.tmpCentroid3d=u(),this.tmpCentroid2d=e(),this.tmp2d=e(),this.constraintOptions={selection:V.ALL,interactionType:E.NONE,interactionFactor:0,interactionStartCamera:new D,interactionDirection:null,tiltMode:P.TUMBLE}}get intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;const e=this.view.navigation.momentumEnabled;this.zoomMomentumEstimator.enabled=e,this.rotationMomentumEstimator.enabled=e,this.panMomentumEstimator.enabled=e,this.beginRadius=t.radius,this.pointerCount=t.pointers.size,this.beginAngle=t.angle,this.rotationValueSmooth.reset(),this.scalingValueSmooth.reset(),n(t.center,this.beginCenterScreen),v(I,0,this.planeHorizontal);const o=u();this.intersectionHelper.intersectScreenFreePointFallback(this.beginCenterScreen,o);const s=u();r(s,this.startCamera.viewForward);const d=u();a(d,I);const C=m(s,d),g=i(C<0?-C:C);if(this.panMode=g>=G.ANGLE_THRESHOLD?T.Horizontal:T.Vertical,M(this.planeHorizontal,o,this.planeHorizontal),this.startCamera.aboveGround||f(this.planeHorizontal,this.planeHorizontal),this.panMode===T.Vertical){h(d,d,C),c(this.planeVertical,s,d),l(this.planeVertical,this.planeVertical),M(this.planeVertical,o,this.planeVertical);const i=u(),e=u(),n=u();c(i,o,this.currentCamera.eye),l(i,i);const r=5*Math.max(Math.abs(this.view.camera.position.z),50),g=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),this.beginCenterScreen[0],this.beginCenterScreen[1],this.view.state.camera,Z),v=g?Math.min(g,r):r;a(n,p(e,this.currentCamera.eye,h(e,i,v))),this.planeVertical[3]=-m(this.planeVertical,n),this.computePlanePoints(t.pointers,this.planeVertical,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter)}else this.computePlanePoints(t.pointers,this.planeHorizontal,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter);this.constraintOptions.interactionStartCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,e=this.panMode===T.Horizontal?this.planeHorizontal:this.planeVertical,o=this.beginCenter;if(i){const i=this.beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this.scalingValueSmooth.gain=e,this.scalingValueSmooth.update(i),F(this.currentCamera,o,this.scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this.zoomMomentumEstimator.add(this.scalingValueSmooth.value,.001*t.timestamp),this.constraintOptions.interactionType=E.ZOOM,this.constraintOptions.interactionFactor=b(Math.abs(t.radius-this.beginRadius)),S(this.view,this.currentCamera,this.constraintOptions)}if(this.computePlanePoints(t.pointers,e,this.currentCamera,this.tmpPoints),A(this.tmpPoints,this.tmpCentroid3d),n(t.center,this.tmpCentroid2d),L(this.currentCamera,o,this.tmpCentroid3d),this.panMomentumEstimator.add(this.tmpCentroid2d,this.tmpCentroid3d,.001*t.timestamp),this.constraintOptions.interactionType=E.PAN,this.constraintOptions.interactionFactor=b(this.beginCenterScreen,this.tmpCentroid2d),S(this.view,this.currentCamera,this.constraintOptions),i){const i=this.planeHorizontal,e=o,n=this.rotationValueSmooth.value,s=n+x(t.angle-n),r=.00125*Math.min(Math.max(t.radius,40),120);this.rotationValueSmooth.gain=r,this.rotationValueSmooth.update(s);const a=this.rotationValueSmooth.value-this.beginAngle;this.rotationMomentumEstimator.add(a,.001*t.timestamp),R(this.currentCamera,e,C(i,a)),this.constraintOptions.interactionType=E.TUMBLE,this.constraintOptions.interactionFactor=b(Math.abs(t.radius*a)),S(this.view,this.currentCamera,this.constraintOptions)}}end(t){t.pointers.size===this.pointerCount&&this.update(t),this.finishController();const i=this.zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this.beginCenter});const e=this.rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this.beginCenter,axis:w(this.planeHorizontal)});const n=this.panMomentumEstimator.evaluateMomentum();return n?new H({view:this.view,momentum:n}):null}computePlanePoints(t,i,e,n){n.length=t.size;const o=this.tmp2d;let s=0;return t.forEach((t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),U(i,e,o,n[s]),s+=1})),n}};t([o({constructOnly:!0})],B.prototype,"view",void 0),B=t([s("esri.views.3d.state.controllers.local.PinchAndPanController")],B);export{B as PinchAndPanController};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{asinClamped as i}from"../../../../../core/mathUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as n}from"../../../../../core/screenUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{o as r,g as a,d as m,a as h,f as c,n as l,b as p}from"../../../../../chunks/vec3.js";import{c as u,f as d}from"../../../../../chunks/vec3f64.js";import{wrapAxisAngle as C}from"../../../../../geometry/support/axisAngle.js";import{create as g,fromNormalAndOffset as v,setOffsetFromPoint as M,negate as f,normal as w}from"../../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as b,applyAll as S}from"../../../camera/constraintUtils.js";import{ConstraintTypes as V,InteractionType as E,TiltMode as P}from"../../../camera/constraintUtils/common.js";import{ExponentialFalloff as j}from"../../../input/util.js";import{InteractiveController as z}from"../InteractiveController.js";import{PanPlanarMomentumController as H}from"../momentum/PanPlanarMomentumController.js";import{RotationMomentumController as O}from"../momentum/RotationMomentumController.js";import{ZoomPlanarMomentumController as y}from"../momentum/ZoomPlanarMomentumController.js";import{NavigationMode as T,centroid as A,applyZoomToPoint as F,applyPanPlanar as L,normalizeRotationDelta as x,applyRotation as R,intersectPlaneFromScreenPointAtEye as U}from"../../utils/navigationUtils.js";import D from"../../../webgl-engine/lib/Camera.js";import{PanPlanarMomentumEstimator as N}from"../../../../navigation/PanPlanarMomentumEstimator.js";import{RotationMomentumEstimator as _}from"../../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as k}from"../../../../navigation/ZoomMomentumEstimator.js";const I=d(0,0,1),G={ELEVATION_THRESHOLD:3e4,ANGLE_THRESHOLD:16/180*Math.PI},Z=80;let B=class extends z{constructor(t){super(t),this.view=null,this.rotationValueSmooth=new j(.05),this.scalingValueSmooth=new j(.05),this.planeHorizontal=g(),this.planeVertical=g(),this.rotationMomentumEstimator=new _,this.panMomentumEstimator=new N(300,12,.9),this.zoomMomentumEstimator=new k,this.beginCenter=u(),this.tmpPoints=[],this.beginCenterScreen=e(),this.tmpCentroid3d=u(),this.tmpCentroid2d=e(),this.tmp2d=e(),this.constraintOptions={selection:V.ALL,interactionType:E.NONE,interactionFactor:0,interactionStartCamera:new D,interactionDirection:null,tiltMode:P.TUMBLE}}get intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.active)return;const e=this.view.navigation.momentumEnabled;this.zoomMomentumEstimator.enabled=e,this.rotationMomentumEstimator.enabled=e,this.panMomentumEstimator.enabled=e,this.beginRadius=t.radius,this.pointerCount=t.pointers.size,this.beginAngle=t.angle,this.rotationValueSmooth.reset(),this.scalingValueSmooth.reset(),n(t.center,this.beginCenterScreen),v(I,0,this.planeHorizontal);const o=u();this.intersectionHelper.intersectScreenFreePointFallback(this.beginCenterScreen,o);const s=u();r(s,this.startCamera.viewForward);const d=u();a(d,I);const C=m(s,d),g=i(C<0?-C:C);if(this.panMode=g>=G.ANGLE_THRESHOLD?T.Horizontal:T.Vertical,M(this.planeHorizontal,this.planeHorizontal,o),this.startCamera.aboveGround||f(this.planeHorizontal,this.planeHorizontal),this.panMode===T.Vertical){h(d,d,C),c(this.planeVertical,s,d),l(this.planeVertical,this.planeVertical),M(this.planeVertical,this.planeVertical,o);const i=u(),e=u(),n=u();c(i,o,this.currentCamera.eye),l(i,i);const r=5*Math.max(Math.abs(this.view.camera.position.z),50),g=this.view._stage.renderView.getMinimalDepthForArea(this.view.getVoxelWasmPerSceneView(),this.beginCenterScreen[0],this.beginCenterScreen[1],this.view.state.camera,Z),v=g?Math.min(g,r):r;a(n,p(e,this.currentCamera.eye,h(e,i,v))),this.planeVertical[3]=-m(this.planeVertical,n),this.computePlanePoints(t.pointers,this.planeVertical,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter)}else this.computePlanePoints(t.pointers,this.planeHorizontal,this.startCamera,this.tmpPoints),A(this.tmpPoints,this.beginCenter);this.constraintOptions.interactionStartCamera.copyFrom(this.startCamera)}update(t){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=t.pointers.size>1,e=this.panMode===T.Horizontal?this.planeHorizontal:this.planeVertical,o=this.beginCenter;if(i){const i=this.beginRadius/t.radius,e=.001875*Math.min(Math.max(t.radius,40),120);this.scalingValueSmooth.gain=e,this.scalingValueSmooth.update(i),F(this.currentCamera,o,this.scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this.zoomMomentumEstimator.add(this.scalingValueSmooth.value,.001*t.timestamp),this.constraintOptions.interactionType=E.ZOOM,this.constraintOptions.interactionFactor=b(Math.abs(t.radius-this.beginRadius)),S(this.view,this.currentCamera,this.constraintOptions)}if(this.computePlanePoints(t.pointers,e,this.currentCamera,this.tmpPoints),A(this.tmpPoints,this.tmpCentroid3d),n(t.center,this.tmpCentroid2d),L(this.currentCamera,o,this.tmpCentroid3d),this.panMomentumEstimator.add(this.tmpCentroid2d,this.tmpCentroid3d,.001*t.timestamp),this.constraintOptions.interactionType=E.PAN,this.constraintOptions.interactionFactor=b(this.beginCenterScreen,this.tmpCentroid2d),S(this.view,this.currentCamera,this.constraintOptions),i){const i=this.planeHorizontal,e=o,n=this.rotationValueSmooth.value,s=n+x(t.angle-n),r=.00125*Math.min(Math.max(t.radius,40),120);this.rotationValueSmooth.gain=r,this.rotationValueSmooth.update(s);const a=this.rotationValueSmooth.value-this.beginAngle;this.rotationMomentumEstimator.add(a,.001*t.timestamp),R(this.currentCamera,e,C(i,a)),this.constraintOptions.interactionType=E.TUMBLE,this.constraintOptions.interactionFactor=b(Math.abs(t.radius*a)),S(this.view,this.currentCamera,this.constraintOptions)}}end(t){t.pointers.size===this.pointerCount&&this.update(t),this.finishController();const i=this.zoomMomentumEstimator.evaluateMomentum();if(i)return new y({view:this.view,momentum:i,zoomCenter:this.beginCenter});const e=this.rotationMomentumEstimator.evaluateMomentum();if(e)return new O({view:this.view,momentum:e,center:this.beginCenter,axis:w(this.planeHorizontal)});const n=this.panMomentumEstimator.evaluateMomentum();return n?new H({view:this.view,momentum:n}):null}computePlanePoints(t,i,e,n){n.length=t.size;const o=this.tmp2d;let s=0;return t.forEach((t=>{o[0]=t.x,o[1]=t.y,void 0===n[s]&&(n[s]=u()),U(i,e,o,n[s]),s+=1})),n}};t([o({constructOnly:!0})],B.prototype,"view",void 0),B=t([s("esri.views.3d.state.controllers.local.PinchAndPanController")],B);export{B as PinchAndPanController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{a as i}from"../../../chunks/mat4.js";import{c as r}from"../../../chunks/mat4f64.js";import{b as n,a as o,r as s,m as a,s as c,d as l}from"../../../chunks/vec3.js";import{c as p}from"../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as h,projectVectorToVector as d,projectBoundingRect as m}from"../../../geometry/projection.js";import{getReferenceEllipsoid as g}from"../../../geometry/projectionEllipsoid.js";import{create as u,empty as f,expandWithVec3 as x}from"../../../geometry/support/aaBoundingBox.js";import{create as R,center as y}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as j}from"../../../geometry/support/frustum.js";import{create as b,fromPoints as A}from"../../../geometry/support/lineSegment.js";import{create as E,fromVectorsAndPoint as S,copy as C,negate as H}from"../../../geometry/support/plane.js";import{wrap as w}from"../../../geometry/support/ray.js";import{ViewingMode as B}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class _{constructor(t){this.renderCoordsHelper=t.renderCoordsHelper,this.extent=new Array(4),this.planes=new Array(6),this.maxSpan=0,this.center={origin:p(),direction:p()};for(let e=0;e<4;e++)this.extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this.planes[e]=E();this.planes[j.NEAR]=E(),this.planes[j.FAR]=E(),this.planesWithoutFar=this.planes.slice(0,5)}update(t,e,i,r=!0){const a=this.extent;this._toRenderBoundingExtent(t,e,i),n(this.center.origin,a[0].origin,a[2].origin),o(this.center.origin,this.center.origin,.5),this.renderCoordsHelper.worldUpAtPosition(this.center.origin,this.center.direction),r||o(this.center.direction,this.center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this.renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),S(t.direction,t.cap.direction,t.origin,this.planes[n]),r||o(t.direction,t.direction,-1)}S(a[0].cap.direction,a[1].cap.direction,a[0].origin,this.planes[j.NEAR]),r?H(this.planes[j.NEAR],this.planes[j.FAR]):(C(this.planes[j.NEAR],this.planes[j.FAR]),H(this.planes[j.NEAR],this.planes[j.NEAR])),this.maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this.maxSpanSpatialReference=e,this.minGlobalAltitude=.9*g(this.maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this.renderCoordsHelper.viewingMode===B.Global){const i=this.maxSpanSpatialReference.isGeographic?F:M*e;if(this.maxSpan>i)return!0;if(t.altitude>=this.minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this.maxSpan){const e=this.extent[0];return!(i||!t.intersectsRay(w(e.origin,e.direction)))}for(let n=0;n<this.extent.length;n++){const e=this.extent[n];if(!i&&t.intersectsRay(w(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(A(e.origin,e.cap.next,P),e.cap.direction))return!0}const r=i?this.planes:this.planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;y(t,N),N[2]=n,h(r,N,v,this.renderCoordsHelper.spatialReference),i(I,v),f(U);for(const{x0:i,x1:s,y0:c,y1:l}of k)for(let p=0;p<o;p++){const h=p/(o-1);N[0]=e(t[i],t[s],h),N[1]=e(t[c],t[l],h),N[2]=n,d(N,r,N,this.renderCoordsHelper.spatialReference),a(N,N,I),x(U,N)}c(this.extent[0].origin,U[0],U[1],U[2]),c(this.extent[1].origin,U[3],U[1],U[2]),c(this.extent[2].origin,U[3],U[4],U[2]),c(this.extent[3].origin,U[0],U[4],U[2]);for(let e=0;e<4;++e)a(this.extent[e].origin,this.extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,L,this.renderCoordsHelper.spatialReference),c(this.extent[0].origin,L[0],L[1],i),c(this.extent[1].origin,L[2],L[1],i),c(this.extent[2].origin,L[2],L[3],i),c(this.extent[3].origin,L[0],L[3],i)}_toRenderBoundingExtent(e,i,r){switch(this.renderCoordsHelper.viewingMode){case B.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case B.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this.renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(l(this.center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this.extent[e];if(l(i.direction,t.direction)<0)return!0}return!1}}const k=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],N=p(),v=r(),I=r(),U=u(),L=R(),P=b();export{_ as FrustumExtentIntersection,_ as default};
5
+ import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{a as i}from"../../../chunks/mat4.js";import{c as r}from"../../../chunks/mat4f64.js";import{b as n,a as o,r as s,m as a,s as c,d as l}from"../../../chunks/vec3.js";import{c as p}from"../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as h,projectVectorToVector as d,projectBoundingRect as m}from"../../../geometry/projection.js";import{getReferenceEllipsoid as g}from"../../../geometry/projectionEllipsoid.js";import{create as u,empty as f,expandWithVec3 as x}from"../../../geometry/support/aaBoundingBox.js";import{create as R,center as y}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as j}from"../../../geometry/support/frustum.js";import{create as b,fromPoints as A}from"../../../geometry/support/lineSegment.js";import{create as E,fromVectorsAndPoint as S,copy as C,negate as H}from"../../../geometry/support/plane.js";import{wrap as w}from"../../../geometry/support/ray.js";import{ViewingMode as B}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class _{constructor(t){this.renderCoordsHelper=t.renderCoordsHelper,this.extent=new Array(4),this.planes=new Array(6),this.maxSpan=0,this.center={origin:p(),direction:p()};for(let e=0;e<4;e++)this.extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this.planes[e]=E();this.planes[j.NEAR]=E(),this.planes[j.FAR]=E(),this.planesWithoutFar=this.planes.slice(0,5)}update(t,e,i,r=!0){const a=this.extent;this._toRenderBoundingExtent(t,e,i),n(this.center.origin,a[0].origin,a[2].origin),o(this.center.origin,this.center.origin,.5),this.renderCoordsHelper.worldUpAtPosition(this.center.origin,this.center.direction),r||o(this.center.direction,this.center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this.renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),S(t.direction,t.cap.direction,t.origin,this.planes[n]),r||o(t.direction,t.direction,-1)}S(a[0].cap.direction,a[1].cap.direction,a[0].origin,this.planes[j.NEAR]),r?H(this.planes[j.NEAR],this.planes[j.FAR]):(C(this.planes[j.FAR],this.planes[j.NEAR]),H(this.planes[j.NEAR],this.planes[j.NEAR])),this.maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this.maxSpanSpatialReference=e,this.minGlobalAltitude=.9*g(this.maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this.renderCoordsHelper.viewingMode===B.Global){const i=this.maxSpanSpatialReference.isGeographic?F:M*e;if(this.maxSpan>i)return!0;if(t.altitude>=this.minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this.maxSpan){const e=this.extent[0];return!(i||!t.intersectsRay(w(e.origin,e.direction)))}for(let n=0;n<this.extent.length;n++){const e=this.extent[n];if(!i&&t.intersectsRay(w(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(A(e.origin,e.cap.next,P),e.cap.direction))return!0}const r=i?this.planes:this.planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;y(t,N),N[2]=n,h(r,N,v,this.renderCoordsHelper.spatialReference),i(I,v),f(U);for(const{x0:i,x1:s,y0:c,y1:l}of k)for(let p=0;p<o;p++){const h=p/(o-1);N[0]=e(t[i],t[s],h),N[1]=e(t[c],t[l],h),N[2]=n,d(N,r,N,this.renderCoordsHelper.spatialReference),a(N,N,I),x(U,N)}c(this.extent[0].origin,U[0],U[1],U[2]),c(this.extent[1].origin,U[3],U[1],U[2]),c(this.extent[2].origin,U[3],U[4],U[2]),c(this.extent[3].origin,U[0],U[4],U[2]);for(let e=0;e<4;++e)a(this.extent[e].origin,this.extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,L,this.renderCoordsHelper.spatialReference),c(this.extent[0].origin,L[0],L[1],i),c(this.extent[1].origin,L[2],L[1],i),c(this.extent[2].origin,L[2],L[3],i),c(this.extent[3].origin,L[0],L[3],i)}_toRenderBoundingExtent(e,i,r){switch(this.renderCoordsHelper.viewingMode){case B.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case B.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this.renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(l(this.center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this.extent[e];if(l(i.direction,t.direction)<0)return!0}return!1}}const k=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],N=p(),v=r(),I=r(),U=u(),L=R(),P=b();export{_ as FrustumExtentIntersection,_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as e}from"../../../core/mathUtils.js";import{isSome as t,isNone as i,disposeMaybe as n,releaseMaybe as s}from"../../../core/maybe.js";import{a as r}from"../../../chunks/vec2f64.js";import{g as a,m as h,i as l,n as o,c,b as _}from"../../../chunks/vec3.js";import{c as d}from"../../../chunks/vec3f64.js";import{t as m}from"../../../chunks/vec4.js";import{c as p}from"../../../chunks/vec4f64.js";import{create as f,fromRay as g,getStart as u,getEnd as b}from"../../../geometry/support/clipRay.js";import{intersectClipRay as P}from"../../../geometry/support/frustum.js";import{create as V,copy as E,pointAt as L}from"../../../geometry/support/lineSegment.js";import{create as D,fromPositionAndNormal as S}from"../../../geometry/support/plane.js";import{wrap as q}from"../../../geometry/support/ray.js";import{c as R}from"../../../chunks/sphere.js";import{LaserlinePathData as U}from"./LaserlinePathData.js";import{createQuadVAO as T}from"../webgl-engine/lib/glUtil3D.js";import{RenderSlot as M}from"../webgl-engine/lib/RenderSlot.js";import{inverseProjectionInfo as x}from"../webgl-engine/lib/Util.js";import{copyParameters as C,updateParameters as A}from"../webgl-engine/materials/internal/MaterialUtil.js";import{LaserlinePathTechniqueConfiguration as v,LaserlinePathTechnique as j}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{LaserlineTechniqueConfiguration as w,LaserlineTechnique as I}from"../webgl-engine/shaders/LaserlineTechnique.js";import{PrimitiveType as O}from"../../webgl/enums.js";const y=d(),H=p(),z={glowColor:[1,.5,0],glowWidth:8,glowFalloff:8,innerColor:[1,1,1],innerWidth:1,globalAlpha:.75,angleCutoff:e(6),globalAlphaContrastBoost:2};function N(e,t,i,n){const s=y,r=H;h(s,t,n),a(r,i),r[3]=0,m(r,r,n),S(s,r,e)}class k{constructor(e,t={},i={contrastControlEnabled:!1}){this._renderCoordsHelper=e,this._config=i,this._technique=null,this._projInfo=p(),this._zScale=r(),this._heightManifoldEnabled=!1,this._heightManifoldTarget=d(),this._pointDistanceEnabled=!1,this._pointDistanceOrigin=d(),this._pointDistanceTarget=d(),this._lineVerticalPlaneEnabled=!1,this._lineVerticalPlaneSegment=V(),this._intersectsLineEnabled=!1,this._intersectsLineSegment=V(),this._intersectsLineRadius=3,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this.canRender=!0,this._tempNormal=d(),this._tempDir=d(),this._tempUp=d(),this._tempVec3A=d(),this._tempVec3B=d(),this._tempVec4=p(),this._tempPlane=D(),this._tempSphere=R(),this._params=C(t,z)}get renderSlots(){return[this._config.contrastControlEnabled?M.LASERLINES_CONTRAST_CONTROL:M.LASERLINES]}get needsLinearDepth(){return!0}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._heightManifoldTarget}set heightManifoldTarget(e){a(this._heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._pointDistanceTarget}set pointDistanceTarget(e){a(this._pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._pointDistanceOrigin}set pointDistanceOrigin(e){a(this._pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){E(e,this._lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._intersectsLineSegment}set intersectsLineSegment(e){E(e,this._intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._intersectsLineRadius}set intersectsLineRadius(e){e!==this._intersectsLineRadius&&(this._intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,t(this._pathVerticalPlaneData)&&this._requestRender())}set pathVerticalPlaneVertices(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){A(this._params,e)&&this._requestRender()}initializeRenderContext(e){this._context=e;const t=e.renderContext.rctx;this._quadVAO=T(t),this._techniqueRepository=e.shaderTechniqueRep,this._techniqueConfig=new w;const i=new v;i.contrastControlEnabled=this._config.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(j,i)}uninitializeRenderContext(){this._quadVAO=n(this._quadVAO),this._technique=s(this._technique),this._pathVerticalPlaneData=n(this._pathVerticalPlaneData),this._pathTechnique=s(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this._config.contrastControlEnabled,this._technique=this._techniqueRepository.releaseAndAcquire(I,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,t){const i=e.camera;x(i.projectionMatrix,i.fullWidth,i.fullHeight,this._projInfo,this._zScale),(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const i=e.rctx,n=t.program;i.useProgram(n),t.bindPipelineState(i),this._bindGlobalUniforms(e,n),this._bindHeightManifoldUniforms(e,n),this._bindPointDistanceUniforms(e,n),this._bindLineVerticalPlaneUniforms(e,n),this._bindIntersectsLineUniforms(e,n),t.bind(this._params,e.camera),i.bindVAO(this._quadVAO),i.drawArrays(O.TRIANGLE_STRIP,0,4)}_renderPath(e){if(i(this._pathVerticalPlaneData)||i(this._pathTechnique))return;const t=e.rctx,n=this._pathTechnique,s=n.program;t.useProgram(s),n.bindPipelineState(t),this._bindGlobalUniforms(e,s),n.bind(this._params,this._pathVerticalPlaneData.origin,e.camera),this._pathVerticalPlaneData.draw(e.rctx)}_bindHeightManifoldUniforms(e,t){if(!this.heightManifoldEnabled)return;const i=this._tempVec3A,n=this._tempPlane;this._renderCoordsHelper.worldUpAtPosition(this._heightManifoldTarget,i),N(n,this._heightManifoldTarget,i,e.camera.viewMatrix),t.setUniform4fv("heightPlane",n)}_bindPointDistanceUniforms(e,t){if(!this._pointDistanceEnabled)return;const i=e.camera,n=this._tempSphere;a(n,this._pointDistanceOrigin),h(n,n,i.viewMatrix),n[3]=l(this._pointDistanceOrigin,this._pointDistanceTarget),t.setUniform4f("pointDistanceSphere",n[0],n[1],n[2],n[3])}_bindLineVerticalPlaneUniforms(e,t){if(!this._lineVerticalPlaneEnabled)return;const i=this._renderCoordsHelper,n=e.camera,s=this._tempPlane,r=this._tempVec3A,l=this._tempUp,d=this._tempDir,m=this._tempNormal;L(this._lineVerticalPlaneSegment,.5,r),i.worldUpAtPosition(r,l),o(d,this._lineVerticalPlaneSegment.vector),c(m,l,d),o(m,m),N(s,this._lineVerticalPlaneSegment.origin,m,n.viewMatrix),t.setUniform4fv("lineVerticalPlane",s);const p=this._tempVec3A;a(p,this._lineVerticalPlaneSegment.origin),i.setAltitude(p,0),h(p,p,n.viewMatrix),t.setUniform3fv("lineVerticalStart",p);const f=this._tempVec3B;_(f,this._lineVerticalPlaneSegment.origin,this._lineVerticalPlaneSegment.vector),i.setAltitude(f,0),h(f,f,n.viewMatrix),t.setUniform3fv("lineVerticalEnd",f)}_bindIntersectsLineUniforms(e,t){if(!this._intersectsLineEnabled)return;const i=G,n=W;if(this._intersectsLineInfinite){const t=e.camera;if(g(q(this._intersectsLineSegment.origin,this._intersectsLineSegment.vector),B),B.c0=-Number.MAX_VALUE,!P(t.frustum,B))return;u(B,i),b(B,n)}else a(i,this._intersectsLineSegment.origin),_(n,this._intersectsLineSegment.origin,this._intersectsLineSegment.vector);const s=this._tempVec3A;h(s,i,e.camera.viewMatrix),t.setUniform3fv("intersectsLineStart",s);const r=this._tempVec4;a(r,this._intersectsLineSegment.vector),this._tempVec4[3]=0,m(this._tempVec4,this._tempVec4,e.camera.viewMatrix),h(n,n,e.camera.viewMatrix),t.setUniform3fv("intersectsLineEnd",n),o(r,r),t.setUniform3f("intersectsLineDirection",r[0],r[1],r[2]),t.setUniform1f("intersectsLineRadius",this._intersectsLineRadius)}_bindGlobalUniforms(e,t){const i=e.camera;t.setUniform4fv("projInfo",this._projInfo),t.setUniform2fv("zScale",this._zScale),t.setUniform2f("nearFar",i.near,i.far),this._heightManifoldEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._heightManifoldTarget)):this._pointDistanceEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._pointDistanceTarget)):this._lineVerticalPlaneEnabled&&t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._lineVerticalPlaneSegment.origin)),t.bindTexture(e.offscreenRenderingHelper.linearDepthTexture,"depthMap"),t.bindTexture(e.offscreenRenderingHelper.mainColorTexture,"frameColor")}_requestRender(){this._context&&this._context.requestRender()}}const B=f(),G=d(),W=d();export{k as LaserLineRenderer};
5
+ import{deg2rad as e}from"../../../core/mathUtils.js";import{isSome as t,isNone as i,disposeMaybe as n,releaseMaybe as s}from"../../../core/maybe.js";import{a as r}from"../../../chunks/vec2f64.js";import{g as a,m as h,i as l,n as o,c,b as _}from"../../../chunks/vec3.js";import{c as d}from"../../../chunks/vec3f64.js";import{t as m}from"../../../chunks/vec4.js";import{c as p}from"../../../chunks/vec4f64.js";import{create as g,fromRay as f,getStart as u,getEnd as b}from"../../../geometry/support/clipRay.js";import{intersectClipRay as P}from"../../../geometry/support/frustum.js";import{create as V,copy as E,pointAt as L}from"../../../geometry/support/lineSegment.js";import{create as D,fromPositionAndNormal as S}from"../../../geometry/support/plane.js";import{wrap as q}from"../../../geometry/support/ray.js";import{c as R}from"../../../chunks/sphere.js";import{LaserlinePathData as U}from"./LaserlinePathData.js";import{createQuadVAO as T}from"../webgl-engine/lib/glUtil3D.js";import{RenderSlot as M}from"../webgl-engine/lib/RenderSlot.js";import{inverseProjectionInfo as x}from"../webgl-engine/lib/Util.js";import{copyParameters as C,updateParameters as v}from"../webgl-engine/materials/internal/MaterialUtil.js";import{LaserlinePathTechniqueConfiguration as A,LaserlinePathTechnique as j}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{LaserlineTechniqueConfiguration as w,LaserlineTechnique as I}from"../webgl-engine/shaders/LaserlineTechnique.js";import{PrimitiveType as O}from"../../webgl/enums.js";const y=d(),H=p(),z={glowColor:[1,.5,0],glowWidth:8,glowFalloff:8,innerColor:[1,1,1],innerWidth:1,globalAlpha:.75,angleCutoff:e(6),globalAlphaContrastBoost:2};function N(e,t,i,n){const s=y,r=H;h(s,t,n),a(r,i),r[3]=0,m(r,r,n),S(s,r,e)}class k{constructor(e,t={},i={contrastControlEnabled:!1}){this._renderCoordsHelper=e,this._config=i,this._technique=null,this._projInfo=p(),this._zScale=r(),this._heightManifoldEnabled=!1,this._heightManifoldTarget=d(),this._pointDistanceEnabled=!1,this._pointDistanceOrigin=d(),this._pointDistanceTarget=d(),this._lineVerticalPlaneEnabled=!1,this._lineVerticalPlaneSegment=V(),this._intersectsLineEnabled=!1,this._intersectsLineSegment=V(),this._intersectsLineRadius=3,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this.canRender=!0,this._tempNormal=d(),this._tempDir=d(),this._tempUp=d(),this._tempVec3A=d(),this._tempVec3B=d(),this._tempVec4=p(),this._tempPlane=D(),this._tempSphere=R(),this._params=C(t,z)}get renderSlots(){return[this._config.contrastControlEnabled?M.LASERLINES_CONTRAST_CONTROL:M.LASERLINES]}get needsLinearDepth(){return!0}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._heightManifoldTarget}set heightManifoldTarget(e){a(this._heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._pointDistanceTarget}set pointDistanceTarget(e){a(this._pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._pointDistanceOrigin}set pointDistanceOrigin(e){a(this._pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){E(e,this._lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._intersectsLineSegment}set intersectsLineSegment(e){E(e,this._intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._intersectsLineRadius}set intersectsLineRadius(e){e!==this._intersectsLineRadius&&(this._intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,t(this._pathVerticalPlaneData)&&this._requestRender())}set pathVerticalPlaneVertices(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){i(this._pathVerticalPlaneData)&&(this._pathVerticalPlaneData=new U(this._renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){v(this._params,e)&&this._requestRender()}initializeRenderContext(e){this._context=e;const t=e.renderContext.rctx;this._quadVAO=T(t),this._techniqueRepository=e.shaderTechniqueRep,this._techniqueConfig=new w;const i=new A;i.contrastControlEnabled=this._config.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(j,i)}uninitializeRenderContext(){this._quadVAO=n(this._quadVAO),this._technique=s(this._technique),this._pathVerticalPlaneData=n(this._pathVerticalPlaneData),this._pathTechnique=s(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this._config.contrastControlEnabled,this._technique=this._techniqueRepository.releaseAndAcquire(I,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}render(e,t){const i=e.camera;x(i.projectionMatrix,i.fullWidth,i.fullHeight,this._projInfo,this._zScale),(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const i=e.rctx,n=t.program;i.useProgram(n),t.bindPipelineState(i),this._bindGlobalUniforms(e,n),this._bindHeightManifoldUniforms(e,n),this._bindPointDistanceUniforms(e,n),this._bindLineVerticalPlaneUniforms(e,n),this._bindIntersectsLineUniforms(e,n),t.bind(this._params,e.camera),i.bindVAO(this._quadVAO),i.drawArrays(O.TRIANGLE_STRIP,0,4)}_renderPath(e){if(i(this._pathVerticalPlaneData)||i(this._pathTechnique))return;const t=e.rctx,n=this._pathTechnique,s=n.program;t.useProgram(s),n.bindPipelineState(t),this._bindGlobalUniforms(e,s),n.bind(this._params,this._pathVerticalPlaneData.origin,e.camera),this._pathVerticalPlaneData.draw(e.rctx)}_bindHeightManifoldUniforms(e,t){if(!this.heightManifoldEnabled)return;const i=this._tempVec3A,n=this._tempPlane;this._renderCoordsHelper.worldUpAtPosition(this._heightManifoldTarget,i),N(n,this._heightManifoldTarget,i,e.camera.viewMatrix),t.setUniform4fv("heightPlane",n)}_bindPointDistanceUniforms(e,t){if(!this._pointDistanceEnabled)return;const i=e.camera,n=this._tempSphere;a(n,this._pointDistanceOrigin),h(n,n,i.viewMatrix),n[3]=l(this._pointDistanceOrigin,this._pointDistanceTarget),t.setUniform4f("pointDistanceSphere",n[0],n[1],n[2],n[3])}_bindLineVerticalPlaneUniforms(e,t){if(!this._lineVerticalPlaneEnabled)return;const i=this._renderCoordsHelper,n=e.camera,s=this._tempPlane,r=this._tempVec3A,l=this._tempUp,d=this._tempDir,m=this._tempNormal;L(this._lineVerticalPlaneSegment,.5,r),i.worldUpAtPosition(r,l),o(d,this._lineVerticalPlaneSegment.vector),c(m,l,d),o(m,m),N(s,this._lineVerticalPlaneSegment.origin,m,n.viewMatrix),t.setUniform4fv("lineVerticalPlane",s);const p=this._tempVec3A;a(p,this._lineVerticalPlaneSegment.origin),i.setAltitude(p,0),h(p,p,n.viewMatrix),t.setUniform3fv("lineVerticalStart",p);const g=this._tempVec3B;_(g,this._lineVerticalPlaneSegment.origin,this._lineVerticalPlaneSegment.vector),i.setAltitude(g,0),h(g,g,n.viewMatrix),t.setUniform3fv("lineVerticalEnd",g)}_bindIntersectsLineUniforms(e,t){if(!this._intersectsLineEnabled)return;const i=G,n=F;if(this._intersectsLineInfinite){const t=e.camera;if(f(q(this._intersectsLineSegment.origin,this._intersectsLineSegment.vector),B),B.c0=-Number.MAX_VALUE,!P(t.frustum,B))return;u(B,i),b(B,n)}else a(i,this._intersectsLineSegment.origin),_(n,this._intersectsLineSegment.origin,this._intersectsLineSegment.vector);const s=this._tempVec3A;h(s,i,e.camera.viewMatrix),t.setUniform3fv("intersectsLineStart",s);const r=this._tempVec4;a(r,this._intersectsLineSegment.vector),this._tempVec4[3]=0,m(this._tempVec4,this._tempVec4,e.camera.viewMatrix),h(n,n,e.camera.viewMatrix),t.setUniform3fv("intersectsLineEnd",n),o(r,r),t.setUniform3f("intersectsLineDirection",r[0],r[1],r[2]),t.setUniform1f("intersectsLineRadius",this._intersectsLineRadius)}_bindGlobalUniforms(e,t){const i=e.camera;t.setUniform4fv("projInfo",this._projInfo),t.setUniform2fv("zScale",this._zScale),t.setUniform2fv("nearFar",i.nearFar),this._heightManifoldEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._heightManifoldTarget)):this._pointDistanceEnabled?t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._pointDistanceTarget)):this._lineVerticalPlaneEnabled&&t.setUniform1f("maxPixelDistance",2*i.computeScreenPixelSizeAt(this._lineVerticalPlaneSegment.origin)),t.bindTexture(e.offscreenRenderingHelper.linearDepthTexture,"depthMap"),t.bindTexture(e.offscreenRenderingHelper.mainColorTexture,"frameColor")}_requestRender(){this._context&&this._context.requestRender()}}const B=g(),G=d(),F=d();export{k as LaserLineRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as t}from"../../../core/maybe.js";import{s as r,f as s}from"../../../chunks/vec3.js";import{c as i}from"../../../chunks/vec3f64.js";import{glLayout as o}from"./buffer/glUtil.js";import{newLayout as f}from"./buffer/InterleavedLayout.js";import{VertexAttribute as n}from"../webgl-engine/lib/basicInterfaces.js";import{LaserlinePathTechnique as u}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{BufferObject as a}from"../../webgl/BufferObject.js";import{PrimitiveType as c,Usage as h}from"../../webgl/enums.js";import{VertexArrayObject as l}from"../../webgl/VertexArrayObject.js";class _{constructor(e){this._renderCoordsHelper=e,this._buffers=null,this._origin=i(),this._dirty=!1,this._count=0,this._vao=null}set vertices(e){const t=new Float64Array(3*e.length);let r=0;for(const s of e)t[r++]=s[0],t[r++]=s[1],t[r++]=s[2];this.buffers=[t]}set buffers(e){if(this._buffers=e,this._buffers.length>0){const e=this._buffers[0],t=3*Math.floor(e.length/3/2);r(this._origin,e[t+0],e[t+1],e[t+2])}else r(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(t){const r=this._ensureVAO(t);e(r)&&(t.bindVAO(r),t.drawArrays(c.TRIANGLES,0,this._count))}dispose(){e(this._vao)&&this._vao.dispose()}_ensureVAO(e){return t(this._buffers)?null:(t(this._vao)&&(this._vao=this._createVAO(e,this._buffers)),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(e,t){const r=this._createDataBuffer(t);return this._dirty=!1,new l(e,u.attributeLocations,{data:o(V)},{data:a.createVertex(e,h.STATIC_DRAW,r)})}_ensureVertexData(e,t){if(!this._dirty)return;const r=this._createDataBuffer(t);e.vertexBuffers.data.setData(r),this._dirty=!1}_numberOfRenderVertices(e){return 3*(2*(e.length/3-1))}_createDataBuffer(e){const t=e.reduce(((e,t)=>e+this._numberOfRenderVertices(t)),0);this._count=t;const i=V.createBuffer(t),o=this._origin;let f=0,n=0;for(const u of e){for(let e=0;e<u.length;e+=3){const t=r(b,u[e+0],u[e+1],u[e+2]);0===e?n=this._renderCoordsHelper.getAltitude(t):this._renderCoordsHelper.setAltitude(t,n);const a=this._renderCoordsHelper.worldUpAtPosition(t,d),c=f+2*e,h=s(b,t,o);if(e<u.length-3){i.up.setVec(c,a),i.up.setVec(c+3,a),i.up.setVec(c+5,a);for(let e=0;e<6;e++)i.start.setVec(c+e,h);i.extrude.setValues(c+0,0,-1),i.extrude.setValues(c+1,1,-1),i.extrude.setValues(c+2,1,1),i.extrude.setValues(c+3,0,-1),i.extrude.setValues(c+4,1,1),i.extrude.setValues(c+5,0,1)}if(e>0){i.up.setVec(c-2,a),i.up.setVec(c-4,a),i.up.setVec(c-5,a);for(let e=-6;e<0;e++)i.end.setVec(c+e,h)}}f+=this._numberOfRenderVertices(u)}return i.buffer}}const d=i(),b=i(),V=f().vec3f(n.START).vec3f(n.END).vec3f(n.UP).vec2f(n.EXTRUDE);export{_ as LaserlinePathData};
5
+ import{isSome as e,isNone as t}from"../../../core/maybe.js";import{s as r,f as s}from"../../../chunks/vec3.js";import{c as i}from"../../../chunks/vec3f64.js";import{glLayout as o}from"./buffer/glUtil.js";import{newLayout as f}from"./buffer/InterleavedLayout.js";import{VertexAttribute as n}from"../webgl-engine/lib/VertexAttribute.js";import{LaserlinePathTechnique as u}from"../webgl-engine/shaders/LaserlinePathTechnique.js";import{BufferObject as a}from"../../webgl/BufferObject.js";import{PrimitiveType as c,Usage as h}from"../../webgl/enums.js";import{VertexArrayObject as l}from"../../webgl/VertexArrayObject.js";class _{constructor(e){this._renderCoordsHelper=e,this._buffers=null,this._origin=i(),this._dirty=!1,this._count=0,this._vao=null}set vertices(e){const t=new Float64Array(3*e.length);let r=0;for(const s of e)t[r++]=s[0],t[r++]=s[1],t[r++]=s[2];this.buffers=[t]}set buffers(e){if(this._buffers=e,this._buffers.length>0){const e=this._buffers[0],t=3*Math.floor(e.length/3/2);r(this._origin,e[t+0],e[t+1],e[t+2])}else r(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(t){const r=this._ensureVAO(t);e(r)&&(t.bindVAO(r),t.drawArrays(c.TRIANGLES,0,this._count))}dispose(){e(this._vao)&&this._vao.dispose()}_ensureVAO(e){return t(this._buffers)?null:(t(this._vao)&&(this._vao=this._createVAO(e,this._buffers)),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(e,t){const r=this._createDataBuffer(t);return this._dirty=!1,new l(e,u.attributeLocations,{data:o(V)},{data:a.createVertex(e,h.STATIC_DRAW,r)})}_ensureVertexData(e,t){if(!this._dirty)return;const r=this._createDataBuffer(t);e.vertexBuffers.data.setData(r),this._dirty=!1}_numberOfRenderVertices(e){return 3*(2*(e.length/3-1))}_createDataBuffer(e){const t=e.reduce(((e,t)=>e+this._numberOfRenderVertices(t)),0);this._count=t;const i=V.createBuffer(t),o=this._origin;let f=0,n=0;for(const u of e){for(let e=0;e<u.length;e+=3){const t=r(b,u[e+0],u[e+1],u[e+2]);0===e?n=this._renderCoordsHelper.getAltitude(t):this._renderCoordsHelper.setAltitude(t,n);const a=this._renderCoordsHelper.worldUpAtPosition(t,d),c=f+2*e,h=s(b,t,o);if(e<u.length-3){i.up.setVec(c,a),i.up.setVec(c+3,a),i.up.setVec(c+5,a);for(let e=0;e<6;e++)i.start.setVec(c+e,h);i.extrude.setValues(c+0,0,-1),i.extrude.setValues(c+1,1,-1),i.extrude.setValues(c+2,1,1),i.extrude.setValues(c+3,0,-1),i.extrude.setValues(c+4,1,1),i.extrude.setValues(c+5,0,1)}if(e>0){i.up.setVec(c-2,a),i.up.setVec(c-4,a),i.up.setVec(c-5,a);for(let e=-6;e<0;e++)i.end.setVec(c+e,h)}}f+=this._numberOfRenderVertices(u)}return i.buffer}}const d=i(),b=i(),V=f().vec3f(n.START).vec3f(n.END).vec3f(n.UP).vec2f(n.EXTRUDE);export{_ as LaserlinePathData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,z as i,g as a,e as c,f as d,n as p}from"../../../../chunks/vec3.js";import{c as l}from"../../../../chunks/vec3f64.js";import h from"../../../../geometry/Point.js";import{wrap as u}from"../../../../geometry/support/ray.js";import{PropertiesPool as m}from"../PropertiesPool.js";import{PointOfInterest as f}from"./PointOfInterest.js";import{PaddingSide as y}from"../../webgl-engine/lib/Camera.js";import{TaskPriority as g}from"../../../support/Scheduler.js";const _=Array;let O=class extends f{constructor(e){super(e),this._propertiesPool=new m({location:h,renderLocation:_},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.handles.add([this.centerOnSurface.watch("renderLocation",(()=>this.updateRenderLocation())),this.state.watch("contentCamera",(()=>this.updateRenderLocation()))]),this.scheduler&&this.handles.add(this.scheduler.registerTask(g.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool.destroy(),this._propertiesPool=null}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}get running(){return this._dirty}runTask(){const e=this._get("renderLocation"),r=this.centerOnSurface.renderLocation,o=this.renderCoordsHelper,s=this.state.contentCamera;this._dirty=!1,o.worldUpAtPosition(r,P);const d=Math.max(0,(Math.acos(n(P,s.viewForward))-.5*Math.PI)*(s.aboveGround?1:-1));if(Number.isNaN(d)){if(!e||!i(e,r)){const e=this._propertiesPool.get("renderLocation");a(e,r),this._set("renderLocation",e)}return}const p=1-t(d/(.5*Math.PI),0,1),l=p*p*p;this._calculateScreenHorizontalEdgeOnSurface(j);const h=this._propertiesPool.get("renderLocation");c(h,r,j,l),e&&i(e,h)||this._set("renderLocation",h)}_calculateScreenHorizontalEdgeOnSurface(e){const t=this.state.contentCamera,o=t.getRenderCenter(r());if(o[1]=t.aboveGround?t.padding[y.BOTTOM]:t.fullHeight-t.padding[y.TOP],this.estimateSurfaceIntersectionAtRenderPoint(o,e))return e;const s=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(t.unprojectFromRenderScreen(o,S)){d(S,S,t.eye);const r=p(S,S);if(this.renderCoordsHelper.intersectManifold(u(t.eye,r),s,e))return e}return this.renderCoordsHelper.setAltitude(e,s,t.eye)}updateRenderLocation(){this._dirty=!0}};e([o()],O.prototype,"_dirty",void 0),e([o({constructOnly:!0})],O.prototype,"scheduler",void 0),e([o({constructOnly:!0})],O.prototype,"centerOnSurface",void 0),e([o({constructOnly:!0})],O.prototype,"estimateSurfaceIntersectionAtRenderPoint",void 0),e([o({readOnly:!0})],O.prototype,"updating",null),e([o({readOnly:!0})],O.prototype,"location",null),e([o({readOnly:!0})],O.prototype,"renderLocation",void 0),O=e([s("esri.views.3d.support.CenterOnSurface")],O);const P=l(),S=l(),j=l(),L=O;export{O as Focus,L as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{d as n,y as i,g as a,e as c,f as d,n as p}from"../../../../chunks/vec3.js";import{c as l}from"../../../../chunks/vec3f64.js";import h from"../../../../geometry/Point.js";import{wrap as u}from"../../../../geometry/support/ray.js";import{PropertiesPool as m}from"../PropertiesPool.js";import{PointOfInterest as f}from"./PointOfInterest.js";import{PaddingSide as y}from"../../webgl-engine/lib/Camera.js";import{TaskPriority as g}from"../../../support/Scheduler.js";const _=Array;let O=class extends f{constructor(e){super(e),this._propertiesPool=new m({location:h,renderLocation:_},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.handles.add([this.centerOnSurface.watch("renderLocation",(()=>this.updateRenderLocation())),this.state.watch("contentCamera",(()=>this.updateRenderLocation()))]),this.scheduler&&this.handles.add(this.scheduler.registerTask(g.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool.destroy(),this._propertiesPool=null}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}get running(){return this._dirty}runTask(){const e=this._get("renderLocation"),r=this.centerOnSurface.renderLocation,o=this.renderCoordsHelper,s=this.state.contentCamera;this._dirty=!1,o.worldUpAtPosition(r,P);const d=Math.max(0,(Math.acos(n(P,s.viewForward))-.5*Math.PI)*(s.aboveGround?1:-1));if(Number.isNaN(d)){if(!e||!i(e,r)){const e=this._propertiesPool.get("renderLocation");a(e,r),this._set("renderLocation",e)}return}const p=1-t(d/(.5*Math.PI),0,1),l=p*p*p;this._calculateScreenHorizontalEdgeOnSurface(j);const h=this._propertiesPool.get("renderLocation");c(h,r,j,l),e&&i(e,h)||this._set("renderLocation",h)}_calculateScreenHorizontalEdgeOnSurface(e){const t=this.state.contentCamera,o=t.getRenderCenter(r());if(o[1]=t.aboveGround?t.padding[y.BOTTOM]:t.fullHeight-t.padding[y.TOP],this.estimateSurfaceIntersectionAtRenderPoint(o,e))return e;const s=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(t.unprojectFromRenderScreen(o,S)){d(S,S,t.eye);const r=p(S,S);if(this.renderCoordsHelper.intersectManifold(u(t.eye,r),s,e))return e}return this.renderCoordsHelper.setAltitude(e,s,t.eye)}updateRenderLocation(){this._dirty=!0}};e([o()],O.prototype,"_dirty",void 0),e([o({constructOnly:!0})],O.prototype,"scheduler",void 0),e([o({constructOnly:!0})],O.prototype,"centerOnSurface",void 0),e([o({constructOnly:!0})],O.prototype,"estimateSurfaceIntersectionAtRenderPoint",void 0),e([o({readOnly:!0})],O.prototype,"updating",null),e([o({readOnly:!0})],O.prototype,"location",null),e([o({readOnly:!0})],O.prototype,"renderLocation",void 0),O=e([s("esri.views.3d.support.CenterOnSurface")],O);const P=l(),S=l(),j=l(),L=O;export{O as Focus,L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/has.js";import{lerp as e,clamp as i,smoothstep as n}from"../../../core/mathUtils.js";import{i as o,r as a,o as r,g as l}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s,e as u,m}from"../../../chunks/vec3.js";import{c as d,f as b,a as g}from"../../../chunks/vec3f64.js";import{ViewingMode as h}from"../../ViewingMode.js";import{S as f}from"../../../chunks/SunCalc.js";const p={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8e5,ambient:.015,direct:.75},planarDirection:{localAltitude:1e4,globalAltitude:1e6,globalAngles:{azimuth:1.3*Math.PI,altitude:.6*Math.PI}}};function A(t,n,o,a,r){const l=n[2];s(a.ambient.color,1,1,1),a.ambient.intensity=p.global.ambient,s(a.direct.color,1,1,1),a.direct.intensity=p.global.direct;const c=i((Math.abs(l)-p.local.altitude)/(p.global.altitude-p.local.altitude),0,1);a.globalFactor=c;const m=f.getTimes(t,n[1],n[0]);if(c<1){const i=v(t,m,r);u(a.ambient.color,i.ambient.color,a.ambient.color,c),a.ambient.intensity=e(i.ambient.intensity,a.ambient.intensity,c),u(a.direct.color,i.direct.color,a.direct.color,c),a.direct.intensity=e(i.direct.intensity,a.direct.intensity,c)}a.noonFactor=O(t,m),y(t,n,o,a.direct.directionToLightSource)}function y(e,c,d,b){const g=z,A=o(x);if(d===h.Global){if(f.getPosition(e,0,0,g),s(b,0,0,-1),a(A,A,-g.azimuth),r(A,A,-g.altitude),m(b,b,A),t("enable-feature:pole-lights")){const t=Math.sign(c[1]),e=n(t*G,t*H,c[1])*n(S,k,c[2]);u(b,b,1===t?I:D,e)}}else{const t=p.planarDirection,n=t.globalAngles,o=c[2];let r=(Math.abs(o)-t.localAltitude)/(t.globalAltitude-t.localAltitude);r=i(r,0,1),r<1?(f.getPosition(e,c[1],c[0],g),g.azimuth=(1-r)*g.azimuth+r*n.azimuth,g.altitude=(1-r)*g.altitude+r*n.altitude):(g.azimuth=n.azimuth,g.altitude=n.altitude),s(b,0,-1,0),l(A,A,-g.azimuth),a(A,A,-g.altitude),m(b,b,A)}}function N(t,e){if(e===h.Global)return!0;const i=p.planarDirection;return Math.abs(t)<i.localAltitude}function T(t,e,i,n,o){const a=t.getTime(),r=e.getTime()-a,l=Math.floor(r/i)+1,c=new Array(l);for(let s=0;s<l;++s)E.setTime(a+i*s),c[s]=d(),y(E,n,o,c[s]);return c}const M=b(.5773502691896258,-.5773502691896258,.5773502691896258);class P{constructor(){this.ambient={color:b(1,1,1),intensity:.55},this.direct={color:b(1,1,1),intensity:.55,directionToLightSource:g(M)},this.noonFactor=.5,this.globalFactor=0}}const x=c(),z={azimuth:0,altitude:0};function O(t,e){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=o+(a-o)/2;return 1-i(Math.abs(n-r)/432e5,0,1)}function j(t){switch(t){case"disabled":case"sunny":return{direct:1,ambient:1};case"cloudy":return{direct:.8,ambient:1.1};case"rainy":return{direct:.4,ambient:1};case"foggy":return{direct:.3,ambient:1.6}}}function v(t,e,i){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=a-o,l=o+r/2,c=r/4,s=l-c,u=l+c,m=.06*r,d=o-m/2,g=o+m/2,h=a-m/2,A=a+m/2,y=p.local,N=[.01,y.ambientAtNight],T=[.8,.8,1],M=[.01,.01,.01],P=[y.directAtTwilight,y.ambientAtTwilight],x=[1,.6,.5],z=[.8,.8,1],O=[.9*y.directAtNoon,y.ambientAtNoon],v=[1,.98,.98],E=[.98,.98,1],I=[y.directAtNoon,y.ambientAtNoon],D=[1,1,1],G=[1,1,1],H=O,S=v,k=E,F=P,L=x,_=z;let U,R,C=[0,0],V=[0,0,0],q=[0,0,0];n<d||n>A?(C=N,V=M,q=T,R="night"):n<g?(U=g-d,C=w(n-d,U,N,P),V=w(n-d,U,M,x),q=w(n-d,U,T,z),R="sun rising"):n<s?(U=s-g,C=w(n-g,U,P,O),V=w(n-g,U,x,v),q=w(n-g,U,z,E),R="early morning"):n<l?(U=l-s,C=w(n-s,U,O,I),V=w(n-s,U,v,D),q=w(n-s,U,E,G),R="late morning"):n<u?(U=u-l,C=w(n-l,U,I,H),V=w(n-l,U,D,S),q=w(n-l,U,G,k),R="early afternoon"):n<h?(U=h-u,C=w(n-u,U,H,F),V=w(n-u,U,S,L),q=w(n-u,U,k,_),R="late afternoon"):n<A&&(U=A-h,C=w(n-h,U,F,N),V=w(n-h,U,L,M),q=w(n-h,U,_,T),R="sun setting");const B=b(V[0],V[1],V[2]),J=b(q[0],q[1],q[2]),K=j(i);return{direct:{intensity:C[0]*K.direct,color:B},ambient:{intensity:C[1]*K.ambient,color:J},timeOfDay:R}}function w(t,e,i,n){const o=[];for(let a=0;a<i.length;a++)o[a]=(n[a]-i[a])*t/e+i[a];return o}const E=new Date(0),I=b(0,0,1),D=b(0,0,-1),G=55,H=70,S=15e6,k=1e7;export{P as ColorAndIntensity,A as computeColorAndIntensity,T as computeDirectionsOverTime,N as computeShadowsEnabled};
5
+ import t from"../../../core/has.js";import{lerp as e,clamp as i,smoothstep as n}from"../../../core/mathUtils.js";import{i as o,r as a,o as r,g as l}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s,e as u,m}from"../../../chunks/vec3.js";import{c as d,f as b,a as g}from"../../../chunks/vec3f64.js";import{ViewingMode as h}from"../../ViewingMode.js";import{S as f}from"../../../chunks/SunCalc.js";const p={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8e5,ambient:.015,direct:.75},planarDirection:{localAltitude:1e4,globalAltitude:1e6,globalAngles:{azimuth:1.3*Math.PI,altitude:.6*Math.PI}}};function A(t,n,o,a,r){const l=n[2];s(a.ambient.color,1,1,1),a.ambient.intensity=p.global.ambient,s(a.direct.color,1,1,1),a.direct.intensity=p.global.direct;const c=i((Math.abs(l)-p.local.altitude)/(p.global.altitude-p.local.altitude),0,1);a.globalFactor=c;const m=f.getTimes(t,n[1],n[0]);if(c<1){const i=j(t,m,r);u(a.ambient.color,i.ambient.color,a.ambient.color,c),a.ambient.intensity=e(i.ambient.intensity,a.ambient.intensity,c),u(a.direct.color,i.direct.color,a.direct.color,c),a.direct.intensity=e(i.direct.intensity,a.direct.intensity,c)}a.noonFactor=z(t,m),y(t,n,o,a.direct.directionToLightSource)}function y(e,c,d,b){const g=x,A=o(w);if(d===h.Global){if(f.getPosition(e,0,0,g),s(b,0,0,-1),a(A,A,-g.azimuth),r(A,A,-g.altitude),m(b,b,A),t("enable-feature:pole-lights")){const t=Math.sign(c[1]),e=n(t*G,t*H,c[1])*n(S,k,c[2]);u(b,b,1===t?I:D,e)}}else{const t=p.planarDirection,n=t.globalAngles,o=c[2];let r=(Math.abs(o)-t.localAltitude)/(t.globalAltitude-t.localAltitude);r=i(r,0,1),r<1?(f.getPosition(e,c[1],c[0],g),g.azimuth=(1-r)*g.azimuth+r*n.azimuth,g.altitude=(1-r)*g.altitude+r*n.altitude):(g.azimuth=n.azimuth,g.altitude=n.altitude),s(b,0,-1,0),l(A,A,-g.azimuth),a(A,A,-g.altitude),m(b,b,A)}}function N(t,e){if(e===h.Global)return!0;const i=p.planarDirection;return Math.abs(t)<i.localAltitude}function T(t,e,i,n,o){const a=t.getTime(),r=e.getTime()-a,l=Math.floor(r/i)+1,c=new Array(l);for(let s=0;s<l;++s)E.setTime(a+i*s),c[s]=d(),y(E,n,o,c[s]);return c}const M=b(.5773502691896258,-.5773502691896258,.5773502691896258);class P{constructor(){this.ambient={color:b(1,1,1),intensity:.55},this.direct={color:b(1,1,1),intensity:.55,directionToLightSource:g(M)},this.noonFactor=.5,this.globalFactor=0}}const w=c(),x={azimuth:0,altitude:0};function z(t,e){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=o+(a-o)/2;return 1-i(Math.abs(n-r)/432e5,0,1)}function O(t){switch(t){case"disabled":case"sunny":return{direct:1,ambient:1};case"cloudy":return{direct:.8,ambient:1.1};case"rainy":return{direct:.4,ambient:1};case"snowy":return{direct:.6,ambient:1};case"foggy":return{direct:.3,ambient:1.6}}}function j(t,e,i){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=a-o,l=o+r/2,c=r/4,s=l-c,u=l+c,m=.06*r,d=o-m/2,g=o+m/2,h=a-m/2,A=a+m/2,y=p.local,N=[.01,y.ambientAtNight],T=[.8,.8,1],M=[.01,.01,.01],P=[y.directAtTwilight,y.ambientAtTwilight],w=[1,.6,.5],x=[.8,.8,1],z=[.9*y.directAtNoon,y.ambientAtNoon],j=[1,.98,.98],E=[.98,.98,1],I=[y.directAtNoon,y.ambientAtNoon],D=[1,1,1],G=[1,1,1],H=z,S=j,k=E,F=P,L=w,_=x;let U,R,C=[0,0],V=[0,0,0],q=[0,0,0];n<d||n>A?(C=N,V=M,q=T,R="night"):n<g?(U=g-d,C=v(n-d,U,N,P),V=v(n-d,U,M,w),q=v(n-d,U,T,x),R="sun rising"):n<s?(U=s-g,C=v(n-g,U,P,z),V=v(n-g,U,w,j),q=v(n-g,U,x,E),R="early morning"):n<l?(U=l-s,C=v(n-s,U,z,I),V=v(n-s,U,j,D),q=v(n-s,U,E,G),R="late morning"):n<u?(U=u-l,C=v(n-l,U,I,H),V=v(n-l,U,D,S),q=v(n-l,U,G,k),R="early afternoon"):n<h?(U=h-u,C=v(n-u,U,H,F),V=v(n-u,U,S,L),q=v(n-u,U,k,_),R="late afternoon"):n<A&&(U=A-h,C=v(n-h,U,F,N),V=v(n-h,U,L,M),q=v(n-h,U,_,T),R="sun setting");const B=b(V[0],V[1],V[2]),J=b(q[0],q[1],q[2]),K=O(i);return{direct:{intensity:C[0]*K.direct,color:B},ambient:{intensity:C[1]*K.ambient,color:J},timeOfDay:R}}function v(t,e,i,n){const o=[];for(let a=0;a<i.length;a++)o[a]=(n[a]-i[a])*t/e+i[a];return o}const E=new Date(0),I=b(0,0,1),D=b(0,0,-1),G=55,H=70,S=15e6,k=1e7;export{P as ColorAndIntensity,A as computeColorAndIntensity,T as computeDirectionsOverTime,N as computeShadowsEnabled};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import t from"../../../core/Evented.js";import s from"../../../core/Handles.js";import i from"../../../core/Logger.js";import{someMap as a}from"../../../core/MapUtils.js";import{releaseMaybe as o,disposeMaybe as n,isSome as l,unwrapOr as h,isNone as d,unwrap as c}from"../../../core/maybe.js";import u from"../../../core/PooledArray.js";import{someSet as p}from"../../../core/SetUtils.js";import{init as g}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _,f}from"../../../chunks/mat4.js";import{a as R}from"../../../chunks/vec2f64.js";import{f as T,c as b}from"../../../chunks/vec3f64.js";import{I as w}from"../../../chunks/mat4f64.js";import{ViewingMode as v}from"../../ViewingMode.js";import{DrapeTargetType as x,DrapeSourceType as O}from"../layers/interfaces.js";import E from"../support/debugFlags.js";import{OverlayIndex as L,RenderTargetType as j}from"./interfaces.js";import{Overlay as A}from"./Overlay.js";import{OverlayFramebufferObject as S}from"./OverlayFramebufferObject.js";import{OverlayRenderTarget as P}from"./OverlayRenderTarget.js";import{ShaderTechniqueRepository as C}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as D,AutoDisposableMixin as G}from"../webgl-engine/lib/AutoDisposable.js";import{TransparencyPassType as I,UpdatePolicy as V}from"../webgl-engine/lib/basicInterfaces.js";import M from"../webgl-engine/lib/Camera.js";import{GLMaterialRepository as U}from"../webgl-engine/lib/GLMaterialRepository.js";import{createEmptyDepthTexture as F,createQuadVAO as q}from"../webgl-engine/lib/glUtil3D.js";import{GridLocalOriginFactory as H}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{newIntersectorResult as W}from"../webgl-engine/lib/Intersector.js";import{StoreResults as N,IntersectorType as B}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as k}from"../webgl-engine/lib/Material.js";import{ModelDirty as z}from"../webgl-engine/lib/ModelDirtyTypes.js";import{OverlayRenderContext as Y}from"../webgl-engine/lib/RenderContext.js";import{RenderPass as X}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as Q}from"../webgl-engine/lib/RenderSlot.js";import{SortedRenderGeometryRenderer as J}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{TextureTechniqueConfiguration as K,TextureTechnique as Z}from"../webgl-engine/lib/TextureTechnique.js";import{AmbientLight as $}from"../webgl-engine/lighting/Lightsources.js";import{SceneLighting as ee}from"../webgl-engine/lighting/SceneLighting.js";import{StippleTextureRepository as re}from"../webgl-engine/materials/StippleTextureRepository.js";import{C as te}from"../../../chunks/Compositing.glsl.js";import{AlphaMode as se}from"../webgl-engine/shaders/CompositingTechnique.js";import{ImmediateTask as ie,TaskPriority as ae,noBudget as oe}from"../../support/Scheduler.js";import{ClearBufferBit as ne,PrimitiveType as le,TextureType as he,PixelFormat as de,PixelType as ce,TextureSamplingMode as ue}from"../../webgl/enums.js";import{Texture as pe}from"../../webgl/Texture.js";import{vertexCount as ge}from"../../webgl/Util.js";const me=i.getLogger("esri.views.3d.webgl-engine.lib.OverlayRenderer");let ye=class extends(G(r)){constructor(e){super(e),this._overlays=null,this._overlayRenderTarget=null,this._hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._lighting=new ee,this._handles=new s,this._frameTask=ie,this._layerRenderers=new Map,this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers=new u,this._geometries=new Map,this.worldToPCSRatio=1,this.events=new t,this.longitudeCyclical=null}initialize(){const e=this.view._stage.renderView;this._rctx=e.renderingContext,this._renderContext=new Y(this._rctx);const r=e.waterTextureRepository;this._stippleTextureRepository=new re(e.renderingContext),this._shaderTechniqueRepository=new C({rctx:this._rctx,viewingMode:v.Local,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:r}),this._handles.add([g(r,"loadingState",(()=>this.events.emit("content-changed"))),g(this,"spatialReference",(e=>this._localOrigins=new H(e)))]),this._materialRepository=new U(e.textureRepository,this._shaderTechniqueRepository,(e=>{(e.renderOccluded&Oe)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating")}),(()=>this.events.emit("content-changed"))),this._lighting.groundLightingFactor=1,this._lighting.globalFactor=0,this._lighting.set([new $(T(1,1,1))]),this._bindParameters={slot:Q.DRAPED_MATERIAL,highlightDepthTexture:F(this._rctx),camera:be,inverseViewport:R(),origin:null,screenToWorldRatio:null,screenToPCSRatio:null,shadowMappingEnabled:!1,slicePlane:null,ssaoEnabled:!1,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:w,ssrEnabled:!1,lighting:this._lighting,transparencyPassType:I.NONE,terrainLinearDepthTexture:null,geometryLinearDepthTexture:null,multipassTerrainEnabled:!1,cullAboveGround:!1,multipassGeometryEnabled:!1,highlightColorTexture:null},this._frameTask=this.view.resourceController.scheduler.registerTask(ae.STAGE,this),this._handles.add(this._frameTask)}dispose(){this._handles.destroy(),this._layerRenderers.forEach((e=>e.dispose())),this._layerRenderers.clear(),this._debugTextureTechnique=o(this._debugTextureTechnique),this._debugPatternTexture=n(this._debugPatternTexture),this._bindParameters.highlightDepthTexture=n(this._bindParameters.highlightDepthTexture),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),this._temporaryFBO=n(this._temporaryFBO),this._quadVAO=n(this._quadVAO),this.disposeOverlays()}get updating(){return this._sortedLayerRenderersDirty||this._frameTask.updating||a(this._layerRenderers,(e=>e.updating))}get hasOverlays(){return l(this._overlays)&&l(this._overlayRenderTarget)}get gpuMemoryUsage(){return l(this._overlayRenderTarget)?this._overlayRenderTarget.gpuMemoryUsage:0}collectUnusedRenderTargetMemory(e){let r=!1;if(l(this._overlayRenderTarget))for(const t of this._overlayRenderTarget.renderTargets){const s=this.overlays[0].validTargets[t.type]||!this.overlays[1].validTargets[t.type];r=this._overlayRenderTarget.validateUsageForTarget(s,t,e)||r}return r}get overlays(){return h(this._overlays,[])}ensureDrapeTargets(e){l(this._overlays)&&this._overlays.forEach((r=>{r.hasTargetWithoutRasterImage=p(e,(e=>e.drapeTargetType===x.WithoutRasterImage))}))}ensureDrapeSources(e){l(this._overlays)&&this._overlays.forEach((r=>{r.hasDrapedFeatureSource=a(e,((e,r)=>r.drapeSourceType===O.Features)),r.hasDrapedRasterSource=a(e,((e,r)=>r.drapeSourceType===O.RasterImage))}))}ensureOverlays(e,r){d(this._overlays)&&(this._overlayRenderTarget=new P(this._rctx),this._overlays=[new A(L.INNER,this._overlayRenderTarget),new A(L.OUTER,this._overlayRenderTarget)]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r)}disposeOverlays(){this._overlays=null,this._overlayRenderTarget=n(this._overlayRenderTarget),this.events.emit("textures-disposed")}get running(){return this.updating}runTask(e,r=(()=>!0)){this._frameTask.processQueue(e),e.done||this._processLayers(e,r)}_processLayers(e,r){let t=!1;for(const[s,i]of this._layerRenderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()),i.isEmpty&&(t=!0,this._sortedLayerRenderersDirty=!0,this._layerRenderers.delete(s),this._handles.remove(s)))}this._updateSortedLayerRenderers(),t&&(l(this._overlays)&&0===this._layerRenderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.events.emit("content-changed"),this._updateHasHighlights(),this._updateRendersOccluded(),this._updateHasWater())}processSyncLayers(){this._processLayers(oe,(e=>e.updatePolicy===V.SYNC))}addGeometries(e,r,t){for(const s of e)d(s.origin)&&(s.origin=this._localOrigins.getOrigin(s.boundingSphere)),this._geometries.set(s.id,s);this._ensureLayerRenderer(r).add(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r)}removeGeometries(e,r,t){for(const i of e)this._geometries.delete(c(i.id));const s=this._layerRenderers.get(r);s&&(s.remove(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r))}updateGeometries(e,r,t){const s=this._layerRenderers.get(r);if(s)switch(s.modify(e,t),t){case z.State.TRANSFORMATION:case z.State.VERTEXATTRS:return this._notifyGraphicGeometryChanged(e,r);case z.State.VISIBILITIES:return this._notifyGraphicVisibilityChanged(e,r)}else me.warn("Attempted to update geometry for nonexistent layer")}_notifyGraphicGeometryChanged(e,r){if(d(r.notifyGraphicGeometryChanged))return;let t;for(const s of e){const e=s.graphicUid;l(e)&&e!==t&&(r.notifyGraphicGeometryChanged(e),t=e)}}_notifyGraphicVisibilityChanged(e,r){if(d(r.notifyGraphicVisibilityChanged))return;let t;for(const s of e){const e=s.graphicUid;l(e)&&e!==t&&(r.notifyGraphicVisibilityChanged(e),t=e)}}updateHighlights(e,r){const t=this._layerRenderers.get(r);t?t.modify(e,z.State.HIGHLIGHTS):me.warn("Attempted to update highlights for nonexistent layer")}isEmpty(){return 0===this._geometries.size&&!E.OVERLAY_DRAW_DEBUG_TEXTURE}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}updateAnimation(e){let r=!1;return this._layerRenderers.forEach((t=>r=t.updateAnimation(e)||r)),r}updateLayerOrder(){this._sortedLayerRenderersDirty=!0}drawTarget(e,r,t){const s=e.canvasGeometries;if(0===s.numViews)return!1;this._screenToWorldRatio=t*e.mapUnitsPerPixel;const i=r.renderPass;if(this.isEmpty()||i===X.MATERIAL_HIGHLIGHT&&!this.hasHighlights||i===X.MATERIAL_NORMAL&&!this.hasWater||!e.hasSomeSizedView())return!1;const a=r.fbo;if(!a.isValid())return!1;const o=2*e.resolution,n=e.resolution;a.resize(o,n);const h=this._rctx;be.pixelRatio=e.pixelRatio*t,this._renderContext.pass=i,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=i===X.MATERIAL_NORMAL?Q.DRAPED_WATER:Q.DRAPED_MATERIAL,e.applyViewport(this._rctx),a.bind(h),e.index===L.INNER&&(h.setClearColor(0,0,0,0),h.clearSafe(ne.COLOR_BUFFER_BIT));const d=r.type===j.ColorNoRasterImage?_e.ExcludeRasterImage:r.type===j.Occluded?_e.OccludedOnly:_e.Normal;if(d===_e.OccludedOnly&&(this._renderContext.renderOccludedMask=Oe),E.OVERLAY_DRAW_DEBUG_TEXTURE&&d!==_e.OccludedOnly)for(let l=0;l<s.numViews;l++)this._setViewParameters(s.extents[l],e,be),this._drawDebugTexture(e.resolution,Re[e.index]);return this._layerRenderers.size>0&&this._sortedLayerRenderers.forAll((({layerView:r,renderer:t})=>{if(d===_e.ExcludeRasterImage&&l(r)&&r.drapeSourceType===O.RasterImage)return;const u=l(r)&&l(r.fullOpacity)&&r.fullOpacity<1&&i===X.MATERIAL;u&&(this.bindTemporaryFramebuffer(this._rctx,o,n),h.clearSafe(ne.COLOR_BUFFER_BIT));for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],e,be),t.render(this._renderContext,this._bindParameters);u&&l(this._temporaryFBO)&&(a.bind(h),this.view._stage.renderView.compositingHelper.composite(this._temporaryFBO.getTexture(),se.PremultipliedAlpha,c(c(r).fullOpacity),te.OverlayWithTransparency,e.index))})),h.bindFramebuffer(null),a.generateMipMap(),this._renderContext.resetRenderOccludedMask(),!0}bindTemporaryFramebuffer(e,r,t){d(this._temporaryFBO)&&(this._temporaryFBO=new S(e,!1)),this._temporaryFBO.resize(r,t),this._temporaryFBO.bind(e)}async reloadShaders(){await this._shaderTechniqueRepository.reloadAll()}intersect(e,r,t,s){let i=0;this._geometries.forEach((a=>{if(s&&!s(a))return;this._intersectRenderGeometry(a,t,r,0,e,i);const o=this.longitudeCyclical;o&&(a.boundingSphere[0]-a.boundingSphere[3]<o.min&&this._intersectRenderGeometry(a,t,r,o.range,e,i),a.boundingSphere[0]+a.boundingSphere[3]>o.max&&this._intersectRenderGeometry(a,t,r,-o.range,e,i)),i++}))}_intersectRenderGeometry(e,r,t,s,i,a){if(!e.instanceParameters.visible)return;let o=0;l(e.transformation)&&(s+=e.transformation[12],o=e.transformation[13]),we[0]=t[0]-s,we[1]=t[1]-o,we[2]=1,ve[0]=t[0]-s,ve[1]=t[1]-o,ve[2]=0,e.screenToWorldRatio=this._screenToWorldRatio,e.material.intersect(e,null,e.getShaderTransformation(),i,we,ve,((t,s,o)=>{Te(r,o,e.material.renderPriority,a,i,e.layerUid,e.graphicUid)}),e.calculateShaderTransformation,r)}_ensureLayerRenderer(e){let r=this._layerRenderers.get(e);return r||(r=new J({rctx:this._rctx,materialRepository:this._materialRepository}),this._layerRenderers.set(e,r),this._sortedLayerRenderersDirty=!0,"fullOpacity"in e&&this._handles.add(e.watch("fullOpacity",(()=>this.events.emit("content-changed"))),e),this._handles.add(g(r,"updating",(()=>this.notifyChange("updating"))),e)),r}_updateSortedLayerRenderers(){if(!this._sortedLayerRenderersDirty)return;if(this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers.clear(),0===this._layerRenderers.size)return;const e=new Set(this._layerRenderers.values());this.view.allLayerViews.forEach((r=>{const t=r,s=this._layerRenderers.get(t);s&&(this._sortedLayerRenderers.push(new fe(t,s)),e.delete(s))})),e.forEach((e=>this._sortedLayerRenderers.push(new fe(null,e))))}_setViewParameters(e,r,t){t.viewport[0]=t.viewport[1]=0,t.viewport[2]=t.viewport[3]=r.resolution,_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),f(t.viewMatrix,[-e[0],-e[1],0]),this._renderContext.camera=t,this._bindParameters.camera=t,this._bindParameters.inverseViewport[0]=1/t.fullViewport[2],this._bindParameters.inverseViewport[1]=1/t.fullViewport[3]}_updateHasWater(){const e=a(this._layerRenderers,(e=>e.hasWater));e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateHasHighlights(){const e=a(this._layerRenderers,(e=>e.hasHighlights));e!==this._hasHighlights&&(this._hasHighlights=e,this.events.emit("has-highlights",e))}_updateRendersOccluded(){const e=a(this._layerRenderers,(e=>e.rendersOccluded));e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_drawDebugTexture(e,r){const t=this._rctx;this._ensureDebugPatternResources(e,e);const s=this._debugTextureTechnique.program;t.useProgram(s),this._debugTextureTechnique.bindPipelineState(t),s.setUniform4f("color",r[0],r[1],r[2],1),s.bindTexture(this._debugPatternTexture,"tex"),t.bindVAO(this._quadVAO),t.drawArrays(le.TRIANGLE_STRIP,0,ge(this._quadVAO,"geometry"))}_ensureDebugPatternResources(e,r){if(this._debugPatternTexture)return;const t=new Uint8Array(e*r*4);let s=0;for(let a=0;a<r;a++)for(let i=0;i<e;i++){const o=Math.floor(i/10),n=Math.floor(a/10);o<2||n<2||10*o>e-20||10*n>r-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&o&&1&n?1&i^1&a?0:255:1&o^1&n?0:128)}this._debugPatternTexture=new pe(this._rctx,{target:he.TEXTURE_2D,pixelFormat:de.RGBA,dataType:ce.UNSIGNED_BYTE,samplingMode:ue.NEAREST,width:e,height:r},t);const i=new K;i.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(Z,i),this._quadVAO=q(this._rctx)}get test(){return{layerRenderers:this._layerRenderers}}};var _e;e([m()],ye.prototype,"_frameTask",void 0),e([m()],ye.prototype,"_sortedLayerRenderersDirty",void 0),e([D()],ye.prototype,"_shaderTechniqueRepository",void 0),e([D()],ye.prototype,"_stippleTextureRepository",void 0),e([m({constructOnly:!0})],ye.prototype,"view",void 0),e([m()],ye.prototype,"worldToPCSRatio",void 0),e([m()],ye.prototype,"spatialReference",void 0),e([m({type:Boolean,readOnly:!0})],ye.prototype,"updating",null),ye=e([y("esri.views.3d.terrain.OverlayRenderer")],ye),function(e){e[e.Normal=0]="Normal",e[e.OccludedOnly=1]="OccludedOnly",e[e.ExcludeRasterImage=2]="ExcludeRasterImage"}(_e||(_e={}));class fe{constructor(e,r){this.layerView=e,this.renderer=r}}const Re=[[1,.5,.5],[.5,.5,1]];function Te(e,r,t,s,i,a,o){const n={layerUid:a,graphicUid:o,triangleNr:r},l=r=>{r.set(B.OVERLAY,n,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&l(i.results.min),i.options.store!==N.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&l(i.results.max),i.options.store===N.ALL){const e=W(i.ray);l(e),i.results.all.push(e)}}const be=new M;be.near=1,be.far=1e4,be.relativeElevation=null;const we=b(),ve=b(),xe=-2,Oe=k.OccludeAndTransparent;export{xe as DRAPED_Z,_e as DrawPassOption,ye as OverlayRenderer,Oe as overlayRenderOccludedFlag};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import t from"../../../core/Evented.js";import s from"../../../core/Handles.js";import i from"../../../core/Logger.js";import{someMap as a}from"../../../core/MapUtils.js";import{releaseMaybe as o,disposeMaybe as n,isSome as h,unwrapOr as l,isNone as d,unwrap as c}from"../../../core/maybe.js";import u from"../../../core/PooledArray.js";import{someSet as p}from"../../../core/SetUtils.js";import{init as g}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _,f}from"../../../chunks/mat4.js";import{a as R}from"../../../chunks/vec2f64.js";import{f as T,c as b}from"../../../chunks/vec3f64.js";import{I as w}from"../../../chunks/mat4f64.js";import{ViewingMode as v}from"../../ViewingMode.js";import{DrapeTargetType as x,DrapeSourceType as O}from"../layers/interfaces.js";import E from"../support/debugFlags.js";import{OverlayIndex as L,RenderTargetType as j}from"./interfaces.js";import{Overlay as A}from"./Overlay.js";import{OverlayFramebufferObject as S}from"./OverlayFramebufferObject.js";import{OverlayRenderTarget as P}from"./OverlayRenderTarget.js";import{ShaderTechniqueRepository as C}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js";import{autoDispose as D,AutoDisposableMixin as G}from"../webgl-engine/lib/AutoDisposable.js";import{TransparencyPassType as I,UpdatePolicy as M}from"../webgl-engine/lib/basicInterfaces.js";import V from"../webgl-engine/lib/Camera.js";import{GLMaterialRepository as U}from"../webgl-engine/lib/GLMaterialRepository.js";import{createEmptyDepthTexture as F,createQuadVAO as q}from"../webgl-engine/lib/glUtil3D.js";import{GridLocalOriginFactory as H}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{newIntersectorResult as W}from"../webgl-engine/lib/Intersector.js";import{StoreResults as N,IntersectorType as B}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as k}from"../webgl-engine/lib/Material.js";import{ModelDirty as z}from"../webgl-engine/lib/ModelDirtyTypes.js";import{OverlayRenderContext as Y}from"../webgl-engine/lib/RenderContext.js";import{RenderPass as X}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as Q}from"../webgl-engine/lib/RenderSlot.js";import{SortedRenderGeometryRenderer as J}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{TextureTechniqueConfiguration as K,TextureTechnique as Z}from"../webgl-engine/lib/TextureTechnique.js";import{AmbientLight as $}from"../webgl-engine/lighting/Lightsources.js";import{SceneLighting as ee}from"../webgl-engine/lighting/SceneLighting.js";import{StippleTextureRepository as re}from"../webgl-engine/materials/StippleTextureRepository.js";import{C as te}from"../../../chunks/Compositing.glsl.js";import{AlphaMode as se}from"../webgl-engine/shaders/CompositingTechnique.js";import{ImmediateTask as ie,TaskPriority as ae,noBudget as oe}from"../../support/Scheduler.js";import{ClearBufferBit as ne,PrimitiveType as he,TextureType as le,PixelFormat as de,PixelType as ce,TextureSamplingMode as ue}from"../../webgl/enums.js";import{Texture as pe}from"../../webgl/Texture.js";import{vertexCount as ge}from"../../webgl/Util.js";const me=i.getLogger("esri.views.3d.webgl-engine.lib.OverlayRenderer");let ye=class extends(G(r)){constructor(e){super(e),this._overlays=null,this._overlayRenderTarget=null,this._hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._lighting=new ee,this._handles=new s,this._frameTask=ie,this._layerRenderers=new Map,this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers=new u,this._geometries=new Map,this.worldToPCSRatio=1,this.events=new t,this.longitudeCyclical=null}initialize(){const e=this.view._stage.renderView;this._rctx=e.renderingContext,this._renderContext=new Y(this._rctx);const r=e.waterTextureRepository;this._stippleTextureRepository=new re(e.renderingContext),this._shaderTechniqueRepository=new C({rctx:this._rctx,viewingMode:v.Local,stippleTextureRepository:this._stippleTextureRepository,waterTextureRepository:r}),this._handles.add([g(r,"loadingState",(()=>this.events.emit("content-changed"))),g(this,"spatialReference",(e=>this._localOrigins=new H(e)))]),this._materialRepository=new U(e.textureRepository,this._shaderTechniqueRepository,(e=>{(e.renderOccluded&Oe)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating")}),(()=>this.events.emit("content-changed"))),this._lighting.groundLightingFactor=1,this._lighting.globalFactor=0,this._lighting.set([new $(T(1,1,1))]),this._bindParameters={slot:Q.DRAPED_MATERIAL,highlightDepthTexture:F(this._rctx),camera:be,inverseViewport:R(),origin:null,screenToWorldRatio:null,screenToPCSRatio:null,shadowMappingEnabled:!1,slicePlane:null,ssaoEnabled:!1,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:w,ssrEnabled:!1,lighting:this._lighting,transparencyPassType:I.NONE,terrainLinearDepthTexture:null,geometryLinearDepthTexture:null,multipassTerrainEnabled:!1,cullAboveGround:!1,multipassGeometryEnabled:!1,highlightColorTexture:null,cloudsCompositionParams:null},this._frameTask=this.view.resourceController.scheduler.registerTask(ae.STAGE,this),this._handles.add(this._frameTask)}dispose(){this._handles.destroy(),this._layerRenderers.forEach((e=>e.dispose())),this._layerRenderers.clear(),this._debugTextureTechnique=o(this._debugTextureTechnique),this._debugPatternTexture=n(this._debugPatternTexture),this._bindParameters.highlightDepthTexture=n(this._bindParameters.highlightDepthTexture),this._shaderTechniqueRepository=n(this._shaderTechniqueRepository),this._temporaryFBO=n(this._temporaryFBO),this._quadVAO=n(this._quadVAO),this.disposeOverlays()}get updating(){return this._sortedLayerRenderersDirty||this._frameTask.updating||a(this._layerRenderers,(e=>e.updating))}get hasOverlays(){return h(this._overlays)&&h(this._overlayRenderTarget)}get gpuMemoryUsage(){return h(this._overlayRenderTarget)?this._overlayRenderTarget.gpuMemoryUsage:0}collectUnusedRenderTargetMemory(e){let r=!1;if(h(this._overlayRenderTarget))for(const t of this._overlayRenderTarget.renderTargets){const s=this.overlays[0].validTargets[t.type]||!this.overlays[1].validTargets[t.type];r=this._overlayRenderTarget.validateUsageForTarget(s,t,e)||r}return r}get overlays(){return l(this._overlays,[])}ensureDrapeTargets(e){h(this._overlays)&&this._overlays.forEach((r=>{r.hasTargetWithoutRasterImage=p(e,(e=>e.drapeTargetType===x.WithoutRasterImage))}))}ensureDrapeSources(e){h(this._overlays)&&this._overlays.forEach((r=>{r.hasDrapedFeatureSource=a(e,((e,r)=>r.drapeSourceType===O.Features)),r.hasDrapedRasterSource=a(e,((e,r)=>r.drapeSourceType===O.RasterImage))}))}ensureOverlays(e,r){d(this._overlays)&&(this._overlayRenderTarget=new P(this._rctx),this._overlays=[new A(L.INNER,this._overlayRenderTarget),new A(L.OUTER,this._overlayRenderTarget)]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r)}disposeOverlays(){this._overlays=null,this._overlayRenderTarget=n(this._overlayRenderTarget),this.events.emit("textures-disposed")}get running(){return this.updating}runTask(e,r=(()=>!0)){this._frameTask.processQueue(e),e.done||this._processLayers(e,r)}_processLayers(e,r){let t=!1;for(const[s,i]of this._layerRenderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()),i.isEmpty&&(t=!0,this._sortedLayerRenderersDirty=!0,this._layerRenderers.delete(s),this._handles.remove(s)))}this._updateSortedLayerRenderers(),t&&(h(this._overlays)&&0===this._layerRenderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.events.emit("content-changed"),this._updateHasHighlights(),this._updateRendersOccluded(),this._updateHasWater())}processSyncLayers(){this._processLayers(oe,(e=>e.updatePolicy===M.SYNC))}addGeometries(e,r,t){for(const s of e)d(s.origin)&&(s.origin=this._localOrigins.getOrigin(s.boundingSphere)),this._geometries.set(s.id,s);this._ensureLayerRenderer(r).add(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r)}removeGeometries(e,r,t){for(const i of e)this._geometries.delete(c(i.id));const s=this._layerRenderers.get(r);s&&(s.remove(e),t===z.Geometry.UPDATE&&this._notifyGraphicGeometryChanged(e,r))}updateGeometries(e,r,t){const s=this._layerRenderers.get(r);if(s)switch(s.modify(e,t),t){case z.State.TRANSFORMATION:case z.State.VERTEXATTRS:return this._notifyGraphicGeometryChanged(e,r);case z.State.VISIBILITIES:return this._notifyGraphicVisibilityChanged(e,r)}else me.warn("Attempted to update geometry for nonexistent layer")}_notifyGraphicGeometryChanged(e,r){if(d(r.notifyGraphicGeometryChanged))return;let t;for(const s of e){const e=s.graphicUid;h(e)&&e!==t&&(r.notifyGraphicGeometryChanged(e),t=e)}}_notifyGraphicVisibilityChanged(e,r){if(d(r.notifyGraphicVisibilityChanged))return;let t;for(const s of e){const e=s.graphicUid;h(e)&&e!==t&&(r.notifyGraphicVisibilityChanged(e),t=e)}}updateHighlights(e,r){const t=this._layerRenderers.get(r);t?t.modify(e,z.State.HIGHLIGHTS):me.warn("Attempted to update highlights for nonexistent layer")}isEmpty(){return 0===this._geometries.size&&!E.OVERLAY_DRAW_DEBUG_TEXTURE}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}updateAnimation(e){let r=!1;return this._layerRenderers.forEach((t=>r=t.updateAnimation(e)||r)),r}updateLayerOrder(){this._sortedLayerRenderersDirty=!0}drawTarget(e,r,t){const s=e.canvasGeometries;if(0===s.numViews)return!1;this._screenToWorldRatio=t*e.mapUnitsPerPixel;const i=r.renderPass;if(this.isEmpty()||i===X.MATERIAL_HIGHLIGHT&&!this.hasHighlights||i===X.MATERIAL_NORMAL&&!this.hasWater||!e.hasSomeSizedView())return!1;const a=r.fbo;if(!a.isValid())return!1;const o=2*e.resolution,n=e.resolution;a.resize(o,n);const l=this._rctx;be.pixelRatio=e.pixelRatio*t,this._renderContext.pass=i,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=i===X.MATERIAL_NORMAL?Q.DRAPED_WATER:Q.DRAPED_MATERIAL,e.applyViewport(this._rctx),a.bind(l),e.index===L.INNER&&(l.setClearColor(0,0,0,0),l.clearSafe(ne.COLOR_BUFFER_BIT));const d=r.type===j.ColorNoRasterImage?_e.ExcludeRasterImage:r.type===j.Occluded?_e.OccludedOnly:_e.Normal;if(d===_e.OccludedOnly&&(this._renderContext.renderOccludedMask=Oe),E.OVERLAY_DRAW_DEBUG_TEXTURE&&d!==_e.OccludedOnly)for(let h=0;h<s.numViews;h++)this._setViewParameters(s.extents[h],e,be),this._drawDebugTexture(e.resolution,Re[e.index]);return this._layerRenderers.size>0&&this._sortedLayerRenderers.forAll((({overlayLayer:r,renderer:t})=>{if(d===_e.ExcludeRasterImage&&r.drapeSourceType===O.RasterImage)return;const{fullOpacity:c}=r,u=h(c)&&c<1&&i===X.MATERIAL;u&&(this.bindTemporaryFramebuffer(this._rctx,o,n),l.clearSafe(ne.COLOR_BUFFER_BIT));for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],e,be),t.render(this._renderContext,this._bindParameters);u&&h(this._temporaryFBO)&&(a.bind(l),this.view._stage.renderView.compositingHelper.composite(this._temporaryFBO.getTexture(),se.PremultipliedAlpha,c,te.OverlayWithTransparency,e.index))})),l.bindFramebuffer(null),a.generateMipMap(),this._renderContext.resetRenderOccludedMask(),!0}bindTemporaryFramebuffer(e,r,t){d(this._temporaryFBO)&&(this._temporaryFBO=new S(e,!1)),this._temporaryFBO.resize(r,t),this._temporaryFBO.bind(e)}async reloadShaders(){await this._shaderTechniqueRepository.reloadAll()}intersect(e,r,t,s){let i=0;this._geometries.forEach((a=>{if(s&&!s(a))return;this._intersectRenderGeometry(a,t,r,0,e,i);const o=this.longitudeCyclical;o&&(a.boundingSphere[0]-a.boundingSphere[3]<o.min&&this._intersectRenderGeometry(a,t,r,o.range,e,i),a.boundingSphere[0]+a.boundingSphere[3]>o.max&&this._intersectRenderGeometry(a,t,r,-o.range,e,i)),i++}))}_intersectRenderGeometry(e,r,t,s,i,a){if(!e.instanceParameters.visible)return;let o=0;h(e.transformation)&&(s+=e.transformation[12],o=e.transformation[13]),we[0]=t[0]-s,we[1]=t[1]-o,we[2]=1,ve[0]=t[0]-s,ve[1]=t[1]-o,ve[2]=0,e.screenToWorldRatio=this._screenToWorldRatio,e.material.intersect(e,null,e.getShaderTransformation(),i,we,ve,((t,s,o)=>{Te(r,o,e.material.renderPriority,a,i,e.layerUid,e.graphicUid)}),e.calculateShaderTransformation,r)}_ensureLayerRenderer(e){let r=this._layerRenderers.get(e);return r||(r=new J({rctx:this._rctx,materialRepository:this._materialRepository}),this._layerRenderers.set(e,r),this._sortedLayerRenderersDirty=!0,"fullOpacity"in e&&this._handles.add(e.watch("fullOpacity",(()=>this.events.emit("content-changed"))),e),this._handles.add(g(r,"updating",(()=>this.notifyChange("updating"))),e)),r}_updateSortedLayerRenderers(){if(!this._sortedLayerRenderersDirty)return;if(this._sortedLayerRenderersDirty=!1,this._sortedLayerRenderers.clear(),0===this._layerRenderers.size)return;const e=this.view.map.allLayers;this._layerRenderers.forEach(((r,t)=>{const s=e.indexOf(t.layer);this._sortedLayerRenderers.push(new fe(t,r,s<0?1/0:s))})),this._sortedLayerRenderers.sort(((e,r)=>e.index-r.index))}_setViewParameters(e,r,t){t.viewport[0]=t.viewport[1]=0,t.viewport[2]=t.viewport[3]=r.resolution,_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),f(t.viewMatrix,[-e[0],-e[1],0]),this._renderContext.camera=t,this._bindParameters.camera=t,this._bindParameters.inverseViewport[0]=1/t.fullViewport[2],this._bindParameters.inverseViewport[1]=1/t.fullViewport[3]}_updateHasWater(){const e=a(this._layerRenderers,(e=>e.hasWater));e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateHasHighlights(){const e=a(this._layerRenderers,(e=>e.hasHighlights));e!==this._hasHighlights&&(this._hasHighlights=e,this.events.emit("has-highlights",e))}_updateRendersOccluded(){const e=a(this._layerRenderers,(e=>e.rendersOccluded));e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_drawDebugTexture(e,r){const t=this._rctx;this._ensureDebugPatternResources(e,e);const s=this._debugTextureTechnique.program;t.useProgram(s),this._debugTextureTechnique.bindPipelineState(t),s.setUniform4f("uColor",r[0],r[1],r[2],1),s.bindTexture(this._debugPatternTexture,"tex"),t.bindVAO(this._quadVAO),t.drawArrays(he.TRIANGLE_STRIP,0,ge(this._quadVAO,"geometry"))}_ensureDebugPatternResources(e,r){if(this._debugPatternTexture)return;const t=new Uint8Array(e*r*4);let s=0;for(let a=0;a<r;a++)for(let i=0;i<e;i++){const o=Math.floor(i/10),n=Math.floor(a/10);o<2||n<2||10*o>e-20||10*n>r-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&o&&1&n?1&i^1&a?0:255:1&o^1&n?0:128)}this._debugPatternTexture=new pe(this._rctx,{target:le.TEXTURE_2D,pixelFormat:de.RGBA,dataType:ce.UNSIGNED_BYTE,samplingMode:ue.NEAREST,width:e,height:r},t);const i=new K;i.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(Z,i),this._quadVAO=q(this._rctx)}get test(){return{layerRenderers:this._layerRenderers}}};var _e;e([m()],ye.prototype,"_frameTask",void 0),e([m()],ye.prototype,"_sortedLayerRenderersDirty",void 0),e([D()],ye.prototype,"_shaderTechniqueRepository",void 0),e([D()],ye.prototype,"_stippleTextureRepository",void 0),e([m({constructOnly:!0})],ye.prototype,"view",void 0),e([m()],ye.prototype,"worldToPCSRatio",void 0),e([m()],ye.prototype,"spatialReference",void 0),e([m({type:Boolean,readOnly:!0})],ye.prototype,"updating",null),ye=e([y("esri.views.3d.terrain.OverlayRenderer")],ye),function(e){e[e.Normal=0]="Normal",e[e.OccludedOnly=1]="OccludedOnly",e[e.ExcludeRasterImage=2]="ExcludeRasterImage"}(_e||(_e={}));class fe{constructor(e,r,t){this.overlayLayer=e,this.renderer=r,this.index=t}}const Re=[[1,.5,.5],[.5,.5,1]];function Te(e,r,t,s,i,a,o){const n={layerUid:a,graphicUid:o,triangleNr:r},h=r=>{r.set(B.OVERLAY,n,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&h(i.results.min),i.options.store!==N.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&h(i.results.max),i.options.store===N.ALL){const e=W(i.ray);h(e),i.results.all.push(e)}}const be=new V;be.near=1,be.far=1e4,be.relativeElevation=null;const we=b(),ve=b(),xe=-2,Oe=k.OccludeAndTransparent;export{xe as DRAPED_Z,_e as DrawPassOption,ye as OverlayRenderer,Oe as overlayRenderOccludedFlag};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as t}from"../../../core/mathUtils.js";import{isSome as e}from"../../../core/maybe.js";import{c as n}from"../../../chunks/vec3f64.js";import{s as o}from"../../../chunks/vec4.js";import{c as r}from"../../../chunks/vec4f64.js";import{empty as s}from"../../../geometry/support/aaBoundingBox.js";import{earth as i}from"../../../geometry/support/Ellipsoid.js";import{BufferPool as c}from"../../../geometry/support/buffer/BufferPool.js";import{newLayout as u}from"../support/buffer/InterleavedLayout.js";import{sampleElevation as f}from"./ElevationData.js";import{PatchType as a}from"./interfaces.js";import{MAX_PATCH_TESSELATION as m,GEOMETRY_VERTEX_STRIDE as l}from"./TerrainConst.js";import{VertexAttribute as g}from"../webgl-engine/lib/basicInterfaces.js";import{computeNormal as p}from"../webgl-engine/materials/internal/MaterialUtil.js";const h=u().vec3f(g.POSITION).vec2f(g.UV0),d=new c((t=>h.createBuffer(t)),(t=>t.count));class S{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=s(),this.numSurfaceIndices=0,this.numSkirtIndices=0,this.numWithoutSkirtIndices=0,this.numVertsPerRow=0,this.skirtLength=0,this.uvOffsetAndScale=r()}}class y{constructor(t,e,n){this.values=t,this.numSurfaceIndices=e,this.numSkirtIndices=n}}function I(){d.clear(),x.clear()}function A(t){d.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}const P=65536;function v(n,r,i,c,u,m,g,p){const h=u[0],S=u[1],y=u[2],I=u[3],A=.1*g.radius*(I-S),P=n.numVertsPerSide-1,v=n.numVertsPerSide*n.numVertsPerSide,M=4*P,x=m&&(p===a.HAS_SOUTH_POLE||p===a.HAS_BOTH_POLES),b=m&&(p===a.HAS_NORTH_POLE||p===a.HAS_BOTH_POLES),L=d.acquire(v+M),k=L.position.typedBuffer,B=L.uv0.typedBuffer,E=c.geometryInfo.boundingBox;s(E);const U=r[2]-r[0],D=r[3]-r[1],N=y-h,q=i[0],G=i[1],W=i[2];for(let t=0;t<=P;t++){const e=t/P,n=h+e*N;T[t]=Math.sin(n),H[t]=Math.cos(n),_[t]=e,R[t]=r[0]+e*U}let C=0;const F=n.samplerData,z=e(F)&&F.some((t=>e(t)))?(t,e)=>f(R[t],e,F):()=>0;for(let o=0;o<=P;o++){let n=o/P;const s=t(S,I,n),i=Math.cos(s),c=Math.sin(s);let u;m?(u=g.halfSemiMajorAxis*Math.log((1+c)/(1-c)),n=(u-r[1])/D):u=180*s/Math.PI;for(let t=0;t<=P;t++){const r=_[t],s=T[t],f=H[t],a=g.radius+z(t,u),m=f*i*a-q,p=s*i*a-G,h=c*a-W;w(m,p,h,E);const d=l*C;k[d+0]=m,k[d+1]=p,k[d+2]=h,B[d+0]=r,B[d+1]=n;const S=j(t,o,P);if(e(S)){const t=l*(v+S),e=x&&0===o?-1:b&&o===P?1:0,s=0===e?m:-q,i=0===e?p:-G,c=0===e?h:g.radius*e-W;k[t+0]=s,k[t+1]=i,k[t+2]=c,B[t+0]=0===e?O(r,n):r,B[t+1]=0===e?A:n,0!==e&&w(s,i,c,E)}++C}}c.geometryInfo.numVertsPerRow=n.numVertsPerSide,c.geometryInfo.vertexAttributes=L,c.geometryInfo.skirtLength=A,o(c.geometryInfo.uvOffsetAndScale,0,0,1,1),V(c.geometryInfo,n.numVertsPerSide,m?p:a.REGULAR,n.wireframe),c.intersectionData=null,c.skirtIntersectionData=null}function M(t,n,r,c,u,m){const g=n[0],p=n[1],h=n[2]-g,S=n[3]-p,y=t.clippingArea,I=e(y)?Math.max(0,(y[0]-n[0])/h):0,A=e(y)?Math.max(0,(y[1]-n[1])/S):0,P=e(y)?Math.min(1,(y[2]-n[0])/h):1,v=e(y)?Math.min(1,(y[3]-n[1])/S):1,M=P>I?1/(P-I):1,x=v>A?1/(v-A):1,b=-I*M,L=-A*x,k=h*c*.1,B=t.numVertsPerSide-1,E=t.numVertsPerSide*t.numVertsPerSide,T=4*B,H=d.acquire(E+T),_=H.position.typedBuffer,R=H.uv0.typedBuffer,U=m.geometryInfo.boundingBox;s(U);let D=0;const N=i.radius,q=t.samplerData,G=e(q)&&q.some((t=>e(t)))?(t,e)=>f(t,e,q):()=>0;for(let o=0;o<=B;o++){const t=o/B;let n=L+t*x,s=p+t*S;e(y)&&(s<y[1]?(s=y[1],n=0):s>y[3]&&(s=y[3],n=1));const i=s,f=(u?(Math.PI/2-2*Math.atan(Math.exp(-i/N)))*N:i*c)-r[1];for(let u=0;u<=B;u++){const t=u/B;let s=b+t*M,a=g+t*h;e(y)&&(a<y[0]?(a=y[0],s=0):a>y[2]&&(a=y[2],s=1));const m=G(a,i),p=a*c-r[0],d=m-r[2];w(p,f,d,U);const S=l*D;_[S+0]=p,_[S+1]=f,_[S+2]=d,R[S+0]=s,R[S+1]=n;const I=j(u,o,B);if(e(I)){const t=l*(E+I);_[t+0]=p,_[t+1]=f,_[t+2]=d,R[t+0]=O(s,n),R[t+1]=k}++D}}m.geometryInfo.numVertsPerRow=t.numVertsPerSide,m.geometryInfo.vertexAttributes=H,m.geometryInfo.skirtLength=k,o(m.geometryInfo.uvOffsetAndScale,I,A,P-I,v-A),V(m.geometryInfo,t.numVertsPerSide,a.REGULAR,t.wireframe),m.intersectionData=null,m.skirtIntersectionData=null}const x=new Map;function V(t,e,n,o){const r=n===a.HAS_NORTH_POLE||n===a.HAS_BOTH_POLES,s=e+(o?1024:0)+(r?2048:0);let i=x.get(s);i||(i=b(e,r,o),x.set(s,i)),t.indices=i.values,t.numSurfaceIndices=i.numSurfaceIndices,t.numSkirtIndices=i.numSkirtIndices,t.numWithoutSkirtIndices=t.numSurfaceIndices+(n===a.REGULAR?0:6*(e-1)*(o?2:1))}function b(t,n,o){const r=t-1,s=t*t,i=4*r;let c=2*s*3,u=6*i,f=6*(2*r+r-1);o&&(c*=2,u*=2,f*=2);const a=s+i>P?new Uint32Array(c+u):new Uint16Array(c+u);let m=0,l=0,g=c;for(let p=0;p<=r;p++){let t=0;n&&(t=0===p?f:p===r?-f:0),g+=t;for(let n=0;n<=r;n++){const t=j(n,p,r);if(e(t)){const e=L(n,p,r);if(0!==e){const r=m,i=s+t,c=s+(0===n&&1===p?0:t+1),u=m+e;o?(a[g++]=r,a[g++]=i,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=r,a[g++]=c,a[g++]=u,a[g++]=u,a[g++]=r,a[g++]=r,a[g++]=c):(a[g++]=r,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=u,a[g++]=r)}}if(++m,n<r&&p<r){const t=p*(r+1)+n,e=t+1,s=e+(r+1),i=s-1;o?(a[l++]=t,a[l++]=e,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=t,a[l++]=s,a[l++]=i,a[l++]=i,a[l++]=t,a[l++]=t,a[l++]=s):(a[l++]=t,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=i,a[l++]=t)}}g-=t}return new y(a,c,u)}function w(t,e,n,o){t<o[0]&&(o[0]=t),t>o[3]&&(o[3]=t),e<o[1]&&(o[1]=e),e>o[4]&&(o[4]=e),n<o[2]&&(o[2]=n),n>o[5]&&(o[5]=n)}function O(t,e){const n=e>t?1:0;return 2+4*n+(1-2*n)*(t+e)}function j(t,e,n){return 0===e?t:t===n?n+e:e===n?3*n-t:0===t&&e>0?4*n-e:null}function L(t,e,n){return 0===e&&t!==n?1:t===n&&e!==n?n+1:e===n&&0!==t?-1:0===t&&0!==e?-(n+1):0}function k(t,n,o,r,s,i,c,u,f,a){const m=i.position,l=i.uv0,g=t[0],h=t[1],d=t[2],S=n[0]-g,y=n[1]-h,I=n[2]-d;r*=3;for(let A=o*=3;A<r;A+=3){const t=s[A],n=s[A+1],o=s[A+2];let r=m.get(t,0),i=m.get(t,1),P=m.get(t,2),v=m.get(n,0),M=m.get(n,1),x=m.get(n,2),V=m.get(o,0),b=m.get(o,1),w=m.get(o,2);if(l.get(t,0)>=2){const t=r+u[0],e=i+u[1],n=P+u[2],o=c/Math.sqrt(t*t+e*e+n*n);r+=t*o,i+=e*o,P+=n*o}if(l.get(n,0)>=2){const t=v+u[0],e=M+u[1],n=x+u[2],o=c/Math.sqrt(t*t+e*e+n*n);v+=t*o,M+=e*o,x+=n*o}if(l.get(o,0)>=2){const t=V+u[0],e=b+u[1],n=w+u[2],o=c/Math.sqrt(t*t+e*e+n*n);V+=t*o,b+=e*o,w+=n*o}e(f)&&([r,i,P]=f.applyToVertex(r,i,P),[v,M,x]=f.applyToVertex(v,M,x),[V,b,w]=f.applyToVertex(V,b,w));const O=v-r,j=M-i,L=x-P,k=V-r,B=b-i,E=w-P,T=y*E-B*I,H=I*k-E*S,_=S*B-k*y,R=O*T+j*H+L*_;if(Math.abs(R)<=Number.EPSILON)continue;const D=g-r,N=h-i,q=d-P,G=D*T+N*H+q*_;if(R>0){if(G<0||G>R)continue}else if(G>0||G<R)continue;const W=N*L-j*q,C=q*O-L*D,F=D*j-O*N,z=S*W+y*C+I*F;if(R>0){if(z<0||G+z>R)continue}else if(z>0||G+z<R)continue;const J=(k*W+B*C+E*F)/R;if(J>=0){a(J,p(O,j,L,k,B,E,U))}}}function B(t,e,n,o,r,s){const i=o.position,c=o.uv0,u=new Map,f=3*e,a=3*n-f,m=new Uint32Array(a);let l=0;for(let p=0;p<a;++p){const e=t[p+f];if(u.has(e))m[p]=u.get(e);else{const t=l++;u.set(e,t),m[p]=t}}const g=new Float64Array(3*l);return u.forEach(((t,e)=>{let n=i.get(e,0),o=i.get(e,1),u=i.get(e,2);if(c.get(e,0)>=2){const t=n+s[0],e=o+s[1],i=u+s[2],c=r/Math.sqrt(t*t+e*e+i*i);n+=t*c,o+=e*c,u+=i*c}g[3*t+0]=n,g[3*t+1]=o,g[3*t+2]=u})),{vertices:g,indices:m}}function E(t,n,o,r,s,i,c,u,f){const a=i.position,m=i.uv0,l=t[0],g=t[1],h=t[2],d=n[0]-l,S=n[1]-g,y=n[2]-h;r*=3;for(let I=o*=3;I<r;I+=3){const t=s[I],n=s[I+1],o=s[I+2];let r=a.get(t,0),i=a.get(t,1),A=a.get(t,2),P=a.get(n,0),v=a.get(n,1),M=a.get(n,2),x=a.get(o,0),V=a.get(o,1),b=a.get(o,2);m.get(t,0)>=2&&(A+=c);m.get(n,0)>=2&&(M+=c);m.get(o,0)>=2&&(b+=c),e(u)&&([r,i,A]=u.applyToVertex(r,i,A),[P,v,M]=u.applyToVertex(P,v,M),[x,V,b]=u.applyToVertex(x,V,b));const w=P-r,O=v-i,j=M-A,L=x-r,k=V-i,B=b-A,E=S*B-k*y,T=y*L-B*d,H=d*k-L*S,_=w*E+O*T+j*H;if(Math.abs(_)<=Number.EPSILON)continue;const R=l-r,D=g-i,N=h-A,q=R*E+D*T+N*H;if(_>0){if(q<0||q>_)continue}else if(q>0||q<_)continue;const G=D*j-O*N,W=N*w-j*R,C=R*O-w*D,F=d*G+S*W+y*C;if(_>0){if(F<0||q+F>_)continue}else if(F>0||q+F<_)continue;const z=(L*G+k*W+B*C)/_;if(z>=0){f(z,p(w,O,j,L,k,B,U))}}}const T=new Array(m+1),H=new Array(m+1),_=new Array(m+1),R=new Array(m+1),U=n();export{S as PatchGeometry,I as clearCaches,M as createPlanarGlobePatch,v as createSphericalGlobePatch,B as getGlobalSkirtGeometry,k as intersectSkirtsGlobal,E as intersectSkirtsLocal,A as releaseGeometry};
5
+ import{lerp as t}from"../../../core/mathUtils.js";import{isSome as e}from"../../../core/maybe.js";import{c as n}from"../../../chunks/vec3f64.js";import{s as o}from"../../../chunks/vec4.js";import{c as r}from"../../../chunks/vec4f64.js";import{empty as s}from"../../../geometry/support/aaBoundingBox.js";import{earth as i}from"../../../geometry/support/Ellipsoid.js";import{BufferPool as c}from"../../../geometry/support/buffer/BufferPool.js";import{newLayout as u}from"../support/buffer/InterleavedLayout.js";import{sampleElevation as f}from"./ElevationData.js";import{PatchType as a}from"./interfaces.js";import{MAX_PATCH_TESSELATION as m,GEOMETRY_VERTEX_STRIDE as l}from"./TerrainConst.js";import{VertexAttribute as g}from"../webgl-engine/lib/VertexAttribute.js";import{computeNormal as p}from"../webgl-engine/materials/internal/MaterialUtil.js";const h=u().vec3f(g.POSITION).vec2f(g.UV0),d=new c((t=>h.createBuffer(t)),(t=>t.count));class S{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=s(),this.numSurfaceIndices=0,this.numSkirtIndices=0,this.numWithoutSkirtIndices=0,this.numVertsPerRow=0,this.skirtLength=0,this.uvOffsetAndScale=r()}}class y{constructor(t,e,n){this.values=t,this.numSurfaceIndices=e,this.numSkirtIndices=n}}function I(){d.clear(),x.clear()}function A(t){d.release(t.vertexAttributes),t.vertexAttributes=null,t.indices=null}const P=65536;function v(n,r,i,c,u,m,g,p){const h=u[0],S=u[1],y=u[2],I=u[3],A=.1*g.radius*(I-S),P=n.numVertsPerSide-1,v=n.numVertsPerSide*n.numVertsPerSide,M=4*P,x=m&&(p===a.HAS_SOUTH_POLE||p===a.HAS_BOTH_POLES),b=m&&(p===a.HAS_NORTH_POLE||p===a.HAS_BOTH_POLES),L=d.acquire(v+M),k=L.position.typedBuffer,B=L.uv0.typedBuffer,E=c.geometryInfo.boundingBox;s(E);const U=r[2]-r[0],D=r[3]-r[1],N=y-h,q=i[0],G=i[1],W=i[2];for(let t=0;t<=P;t++){const e=t/P,n=h+e*N;T[t]=Math.sin(n),H[t]=Math.cos(n),_[t]=e,R[t]=r[0]+e*U}let C=0;const F=n.samplerData,z=e(F)&&F.some((t=>e(t)))?(t,e)=>f(R[t],e,F):()=>0;for(let o=0;o<=P;o++){let n=o/P;const s=t(S,I,n),i=Math.cos(s),c=Math.sin(s);let u;m?(u=g.halfSemiMajorAxis*Math.log((1+c)/(1-c)),n=(u-r[1])/D):u=180*s/Math.PI;for(let t=0;t<=P;t++){const r=_[t],s=T[t],f=H[t],a=g.radius+z(t,u),m=f*i*a-q,p=s*i*a-G,h=c*a-W;w(m,p,h,E);const d=l*C;k[d+0]=m,k[d+1]=p,k[d+2]=h,B[d+0]=r,B[d+1]=n;const S=j(t,o,P);if(e(S)){const t=l*(v+S),e=x&&0===o?-1:b&&o===P?1:0,s=0===e?m:-q,i=0===e?p:-G,c=0===e?h:g.radius*e-W;k[t+0]=s,k[t+1]=i,k[t+2]=c,B[t+0]=0===e?O(r,n):r,B[t+1]=0===e?A:n,0!==e&&w(s,i,c,E)}++C}}c.geometryInfo.numVertsPerRow=n.numVertsPerSide,c.geometryInfo.vertexAttributes=L,c.geometryInfo.skirtLength=A,o(c.geometryInfo.uvOffsetAndScale,0,0,1,1),V(c.geometryInfo,n.numVertsPerSide,m?p:a.REGULAR,n.wireframe),c.intersectionData=null,c.skirtIntersectionData=null}function M(t,n,r,c,u,m){const g=n[0],p=n[1],h=n[2]-g,S=n[3]-p,y=t.clippingArea,I=e(y)?Math.max(0,(y[0]-n[0])/h):0,A=e(y)?Math.max(0,(y[1]-n[1])/S):0,P=e(y)?Math.min(1,(y[2]-n[0])/h):1,v=e(y)?Math.min(1,(y[3]-n[1])/S):1,M=P>I?1/(P-I):1,x=v>A?1/(v-A):1,b=-I*M,L=-A*x,k=h*c*.1,B=t.numVertsPerSide-1,E=t.numVertsPerSide*t.numVertsPerSide,T=4*B,H=d.acquire(E+T),_=H.position.typedBuffer,R=H.uv0.typedBuffer,U=m.geometryInfo.boundingBox;s(U);let D=0;const N=i.radius,q=t.samplerData,G=e(q)&&q.some((t=>e(t)))?(t,e)=>f(t,e,q):()=>0;for(let o=0;o<=B;o++){const t=o/B;let n=L+t*x,s=p+t*S;e(y)&&(s<y[1]?(s=y[1],n=0):s>y[3]&&(s=y[3],n=1));const i=s,f=(u?(Math.PI/2-2*Math.atan(Math.exp(-i/N)))*N:i*c)-r[1];for(let u=0;u<=B;u++){const t=u/B;let s=b+t*M,a=g+t*h;e(y)&&(a<y[0]?(a=y[0],s=0):a>y[2]&&(a=y[2],s=1));const m=G(a,i),p=a*c-r[0],d=m-r[2];w(p,f,d,U);const S=l*D;_[S+0]=p,_[S+1]=f,_[S+2]=d,R[S+0]=s,R[S+1]=n;const I=j(u,o,B);if(e(I)){const t=l*(E+I);_[t+0]=p,_[t+1]=f,_[t+2]=d,R[t+0]=O(s,n),R[t+1]=k}++D}}m.geometryInfo.numVertsPerRow=t.numVertsPerSide,m.geometryInfo.vertexAttributes=H,m.geometryInfo.skirtLength=k,o(m.geometryInfo.uvOffsetAndScale,I,A,P-I,v-A),V(m.geometryInfo,t.numVertsPerSide,a.REGULAR,t.wireframe),m.intersectionData=null,m.skirtIntersectionData=null}const x=new Map;function V(t,e,n,o){const r=n===a.HAS_NORTH_POLE||n===a.HAS_BOTH_POLES,s=e+(o?1024:0)+(r?2048:0);let i=x.get(s);i||(i=b(e,r,o),x.set(s,i)),t.indices=i.values,t.numSurfaceIndices=i.numSurfaceIndices,t.numSkirtIndices=i.numSkirtIndices,t.numWithoutSkirtIndices=t.numSurfaceIndices+(n===a.REGULAR?0:6*(e-1)*(o?2:1))}function b(t,n,o){const r=t-1,s=t*t,i=4*r;let c=2*s*3,u=6*i,f=6*(2*r+r-1);o&&(c*=2,u*=2,f*=2);const a=s+i>P?new Uint32Array(c+u):new Uint16Array(c+u);let m=0,l=0,g=c;for(let p=0;p<=r;p++){let t=0;n&&(t=0===p?f:p===r?-f:0),g+=t;for(let n=0;n<=r;n++){const t=j(n,p,r);if(e(t)){const e=L(n,p,r);if(0!==e){const r=m,i=s+t,c=s+(0===n&&1===p?0:t+1),u=m+e;o?(a[g++]=r,a[g++]=i,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=r,a[g++]=c,a[g++]=u,a[g++]=u,a[g++]=r,a[g++]=r,a[g++]=c):(a[g++]=r,a[g++]=i,a[g++]=c,a[g++]=c,a[g++]=u,a[g++]=r)}}if(++m,n<r&&p<r){const t=p*(r+1)+n,e=t+1,s=e+(r+1),i=s-1;o?(a[l++]=t,a[l++]=e,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=t,a[l++]=s,a[l++]=i,a[l++]=i,a[l++]=t,a[l++]=t,a[l++]=s):(a[l++]=t,a[l++]=e,a[l++]=s,a[l++]=s,a[l++]=i,a[l++]=t)}}g-=t}return new y(a,c,u)}function w(t,e,n,o){t<o[0]&&(o[0]=t),t>o[3]&&(o[3]=t),e<o[1]&&(o[1]=e),e>o[4]&&(o[4]=e),n<o[2]&&(o[2]=n),n>o[5]&&(o[5]=n)}function O(t,e){const n=e>t?1:0;return 2+4*n+(1-2*n)*(t+e)}function j(t,e,n){return 0===e?t:t===n?n+e:e===n?3*n-t:0===t&&e>0?4*n-e:null}function L(t,e,n){return 0===e&&t!==n?1:t===n&&e!==n?n+1:e===n&&0!==t?-1:0===t&&0!==e?-(n+1):0}function k(t,n,o,r,s,i,c,u,f,a){const m=i.position,l=i.uv0,g=t[0],h=t[1],d=t[2],S=n[0]-g,y=n[1]-h,I=n[2]-d;r*=3;for(let A=o*=3;A<r;A+=3){const t=s[A],n=s[A+1],o=s[A+2];let r=m.get(t,0),i=m.get(t,1),P=m.get(t,2),v=m.get(n,0),M=m.get(n,1),x=m.get(n,2),V=m.get(o,0),b=m.get(o,1),w=m.get(o,2);if(l.get(t,0)>=2){const t=r+u[0],e=i+u[1],n=P+u[2],o=c/Math.sqrt(t*t+e*e+n*n);r+=t*o,i+=e*o,P+=n*o}if(l.get(n,0)>=2){const t=v+u[0],e=M+u[1],n=x+u[2],o=c/Math.sqrt(t*t+e*e+n*n);v+=t*o,M+=e*o,x+=n*o}if(l.get(o,0)>=2){const t=V+u[0],e=b+u[1],n=w+u[2],o=c/Math.sqrt(t*t+e*e+n*n);V+=t*o,b+=e*o,w+=n*o}e(f)&&([r,i,P]=f.applyToVertex(r,i,P),[v,M,x]=f.applyToVertex(v,M,x),[V,b,w]=f.applyToVertex(V,b,w));const O=v-r,j=M-i,L=x-P,k=V-r,B=b-i,E=w-P,T=y*E-B*I,H=I*k-E*S,_=S*B-k*y,R=O*T+j*H+L*_;if(Math.abs(R)<=Number.EPSILON)continue;const D=g-r,N=h-i,q=d-P,G=D*T+N*H+q*_;if(R>0){if(G<0||G>R)continue}else if(G>0||G<R)continue;const W=N*L-j*q,C=q*O-L*D,F=D*j-O*N,z=S*W+y*C+I*F;if(R>0){if(z<0||G+z>R)continue}else if(z>0||G+z<R)continue;const J=(k*W+B*C+E*F)/R;if(J>=0){a(J,p(O,j,L,k,B,E,U))}}}function B(t,e,n,o,r,s){const i=o.position,c=o.uv0,u=new Map,f=3*e,a=3*n-f,m=new Uint32Array(a);let l=0;for(let p=0;p<a;++p){const e=t[p+f];if(u.has(e))m[p]=u.get(e);else{const t=l++;u.set(e,t),m[p]=t}}const g=new Float64Array(3*l);return u.forEach(((t,e)=>{let n=i.get(e,0),o=i.get(e,1),u=i.get(e,2);if(c.get(e,0)>=2){const t=n+s[0],e=o+s[1],i=u+s[2],c=r/Math.sqrt(t*t+e*e+i*i);n+=t*c,o+=e*c,u+=i*c}g[3*t+0]=n,g[3*t+1]=o,g[3*t+2]=u})),{vertices:g,indices:m}}function E(t,n,o,r,s,i,c,u,f){const a=i.position,m=i.uv0,l=t[0],g=t[1],h=t[2],d=n[0]-l,S=n[1]-g,y=n[2]-h;r*=3;for(let I=o*=3;I<r;I+=3){const t=s[I],n=s[I+1],o=s[I+2];let r=a.get(t,0),i=a.get(t,1),A=a.get(t,2),P=a.get(n,0),v=a.get(n,1),M=a.get(n,2),x=a.get(o,0),V=a.get(o,1),b=a.get(o,2);m.get(t,0)>=2&&(A+=c);m.get(n,0)>=2&&(M+=c);m.get(o,0)>=2&&(b+=c),e(u)&&([r,i,A]=u.applyToVertex(r,i,A),[P,v,M]=u.applyToVertex(P,v,M),[x,V,b]=u.applyToVertex(x,V,b));const w=P-r,O=v-i,j=M-A,L=x-r,k=V-i,B=b-A,E=S*B-k*y,T=y*L-B*d,H=d*k-L*S,_=w*E+O*T+j*H;if(Math.abs(_)<=Number.EPSILON)continue;const R=l-r,D=g-i,N=h-A,q=R*E+D*T+N*H;if(_>0){if(q<0||q>_)continue}else if(q>0||q<_)continue;const G=D*j-O*N,W=N*w-j*R,C=R*O-w*D,F=d*G+S*W+y*C;if(_>0){if(F<0||q+F>_)continue}else if(F>0||q+F<_)continue;const z=(L*G+k*W+B*C)/_;if(z>=0){f(z,p(w,O,j,L,k,B,U))}}}const T=new Array(m+1),H=new Array(m+1),_=new Array(m+1),R=new Array(m+1),U=n();export{S as PatchGeometry,I as clearCaches,M as createPlanarGlobePatch,v as createSphericalGlobePatch,B as getGlobalSkirtGeometry,k as intersectSkirtsGlobal,E as intersectSkirtsLocal,A as releaseGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as i,isNone as s}from"../../../core/maybe.js";import n from"../../../core/ObjectPool.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{j as l}from"../../../chunks/mat4.js";import{c as d,I as h}from"../../../chunks/mat4f64.js";import{f as c,s as u,n as p,d as g}from"../../../chunks/vec3.js";import{Z as f,c as m}from"../../../chunks/vec3f64.js";import{s as T}from"../../../chunks/vec4.js";import{Z as R,c as b}from"../../../chunks/vec4f64.js";import{create as _,set as v,expandWithOffset as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as x}from"../../../geometry/support/buffer/BufferView.js";import{requestImage as A}from"../../../support/requestImageUtils.js";import{ViewingMode as D}from"../../ViewingMode.js";import{TextureUpdate as E,OverlayIndex as O}from"./interfaces.js";import{LayerClass as P}from"./LayerClass.js";import{OverlaySource as I}from"./Overlay.js";import{overlayRenderOccludedFlag as S}from"./OverlayRenderer.js";import{clearCaches as C,getGlobalSkirtGeometry as k,intersectSkirtsGlobal as N,intersectSkirtsLocal as q}from"./PatchGeometryFactory.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as L}from"./RenderOrder.js";import{ScaleRangeQueries as M}from"./ScaleRangeQueries.js";import{DEFAULT_TILE_BACKGROUND as G}from"./TerrainConst.js";import{TileRenderer as U}from"./TileRenderer.js";import{TileUpdate as j}from"./TileUpdate.js";import{IteratorPreorder as B,sortTiles as F,compareTiles as H}from"./tileUtils.js";import{componentMinimalSizeForIntersectionData as z,ComponentIntersectionData as V}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as W}from"../webgl-engine/core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as Q}from"../webgl-engine/core/shaderLibrary/Slice.glsl.js";import{bindSSRUniforms as Y}from"../webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{OverlayMode as X}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{bindProjectionMatrix as Z}from"../webgl-engine/core/shaderLibrary/util/View.glsl.js";import{RenderRequestType as K,VertexAttribute as J}from"../webgl-engine/lib/basicInterfaces.js";import{createEmptyTexture as $}from"../webgl-engine/lib/glUtil3D.js";import{newIntersectorResult as ee}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as te,StoreResults as re}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as ie}from"../webgl-engine/lib/Material.js";import{RenderPass as se}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as ne}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as ae}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{TERRAIN_ID as oe,getVerticalOffsetTerrain as le}from"../webgl-engine/lib/verticalOffsetUtils.js";import{bindScreenSizePerspective as de,intersectAabbInvDirBefore as he,intersectTriangles as ce}from"../webgl-engine/materials/internal/MaterialUtil.js";import{TerrainTechniqueConfiguration as ue,TerrainTechnique as pe}from"../webgl-engine/shaders/TerrainTechnique.js";import{ClearBufferBit as ge,PrimitiveType as fe}from"../../webgl/enums.js";const me=7,Te=10,Re=_(),be=b();let _e=class extends r{constructor(e){super(e),this.type=te.TERRAIN,this.isGround=!0,this.tileSize=256,this.rctx=null,this._isTransparent=!1,this._scaleRangeQueries=new M,this.renderDataPool=new n(w),this._patchGroups=new Map,this.patchGroupsDirty=!0,this.tileIterator=new B,this.highestVisibleLODTile=null,this.visible=!0,this._opaque=!0,this._skirtScale=1,this._velvetOverground=!0,this.castShadows=!0,this._ssrEnabled=!1,this.emptyTex=null,this.tileRenderer=null,this.tileBackgroundInitialized=!1,this.tileBackgroundUpdating=!1,this.stencilEnabledLayerExtents=[],this.numTrianglesRendered=0,this.numTilesRendered=0,this.numTilesCulled=0,this.numOriginsRendered=0,this.overlayOpacity=1,this.needsHighlight=!1,this.renderOccludedFlags=ie.Occlude}get isGlobal(){return this.stage.viewingMode===D.Global}initialize(){const e=[ne.OPAQUE_TERRAIN,ne.TRANSPARENT_TERRAIN,ne.OCCLUDED_TERRAIN];this.stage.addRenderPlugin(e,this)}destroy(){this.stage.removeRenderPlugin(this),C()}get updating(){return!this.tileBackgroundInitialized||this.tileBackgroundUpdating}get canRender(){return this.visible&&!!this._rootTiles&&this.tileBackgroundInitialized&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setNeedsRender()}set opaque(e){this._opaque!==e&&(this._opaque=e,this.setNeedsRender())}get opaque(){return this._opaque&&!this.shaderTechniqueConfig.slicePlaneEnabled}get needsLinearDepth(){return this.overlayRenderer.hasWater}set isTransparent(e){this._isTransparent!==e&&(this._isTransparent=e,this.setNeedsRender())}get isTransparent(){return this._isTransparent}set skirtScale(e){e!==this._skirtScale&&(this._skirtScale=e,this.setNeedsRender())}get skirtScale(){return this._skirtScale}get renderPatchBorders(){return!!this.shaderTechniqueConfig.tileBorders}set renderPatchBorders(e){this.shaderTechniqueConfig.tileBorders!==e&&(this.shaderTechniqueConfig.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get cullBackFaces(){return this.shaderTechniqueConfig.backfaceCullingEnabled}set cullBackFaces(e){this.shaderTechniqueConfig.backfaceCullingEnabled!==e&&(this.shaderTechniqueConfig.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this.setNeedsRender()}set velvetOverground(e){this._velvetOverground!==e&&(this._velvetOverground=e,this.setNeedsRender())}get layerUid(){return oe}get slicePlaneEnabled(){return this.shaderTechniqueConfig.slicePlaneEnabled}set slicePlaneEnabled(e){this.shaderTechniqueConfig.slicePlaneEnabled!==e&&(this.shaderTechniqueConfig.slicePlaneEnabled=e,this.setNeedsRender())}set textureFadingEnabled(e){this.shaderTechniqueConfig.textureFadingEnabled!==e&&(this.shaderTechniqueConfig.textureFadingEnabled=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this.shaderTechniqueConfig.screenSizePerspective!==e&&(this.shaderTechniqueConfig.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setNeedsRender()}setNeedsHighlight(e){this.needsHighlight=e,this.setNeedsRender()}setRenderOccludedOverlay(e){this.renderOccludedFlags=e?S:ie.Occlude,this.setNeedsRender()}setStencilEnabledLayerExtents(e){this.stencilEnabledLayerExtents=e,this.setNeedsRender()}setTileSize(e){this.tileSize=e,this.tileRenderer&&(this.tileRenderer.tileSize=e),this.setNeedsRender()}loadTile(e){e.renderData||(e.renderData=this.renderDataPool.acquire(),e.renderData.init(e),e.renderData.localOrigin=this._getLocalOriginOfTile(e)),this.updateTileGeometry(e),this.updateTileTexture(e,j.TEXTURE_FADING)}queryVisibleLevelRange(e,t,r,i){this._scaleRangeQueries.queryVisibleLevelRange(e,t,r,i),this.setNeedsRender()}updateTileTexture(e,t){this.tileRenderer&&this.tileBackgroundInitialized&&(this.tileRenderer.updateTileTexture(e,t===j.TEXTURE_FADING?E.FADING:E.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometry(e){for(const t of e.layerInfo[P.ELEVATION])t.pendingUpdates&=~j.GEOMETRY;e.resetPendingUpdate(j.GEOMETRY),e.renderData.updateGeometry(this.rctx,this.wireframe)&&this.setNeedsRender()}unloadTile(e){e.renderData&&(e.renderData.releaseGeometry()&&this.setNeedsRender(),this.renderDataPool.release(e.renderData),e.renderData.clear(),e.renderData=null,e.setMemoryDirty(),this.setNeedsRender())}_getLocalOriginOfTile(e){const t=Te-me,r=Math.max(0,Math.floor((e.level-t)/me)*me);if(this.isGlobal&&0===r)return f;for(;e.parent&&e.level>r;)e=e.parent;return e.centerAtSeaLevel}setVisibility(e){this.visible=e,this.setNeedsRender()}getStats(){return{numTilesRendered:this.numTilesRendered,numTilesCulled:this.numTilesCulled,numTrianglesRendered:this.numTrianglesRendered,numOriginsRendered:this.numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.allTiles.forAll((t=>{var r;return null==(r=t.renderData)?void 0:r.updateGeometry(this.rctx,e)})),this.setNeedsRender())}setNeedsRender(e=K.UPDATE){this.patchGroupsDirty=!0,this.context.requestRender(e)}setTileBackground(e){this.tileBackground=e,this._updateTileBackground()}initializeRenderContext(e){this.context=e,this.rctx=e.renderContext.rctx,this.shaderTechniques=e.shaderTechniqueRep,this.shaderTechniqueConfig=new ue,this.tileRenderer=new U(this.rctx,this.tileSize,this.shaderTechniques),this.tileBackground&&this._updateTileBackground(),this.emptyTex=$(this.rctx)}uninitializeRenderContext(){null!=this.emptyTex&&(this.emptyTex.dispose(),this.emptyTex=null),this.tileRenderer&&(this.tileRenderer.dispose(),this.tileRenderer=null)}intersect(e,t,r,n){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&!this._opaque)return;const a=De,o=Ee;c(a,n,r),u(o,1/a[0],1/a[1],1/a[2]);const l=e.results.min,d=e.results.max,p=e.results.ground,f=e.options.store===re.MIN,m=!!e.results.ground.target,T=le(e.verticalOffset),R=this._skirtScale,b=e.tolerance;let _,A=f&&i(l.dist)?l.dist:1/0;const D=u=>{const m=u.renderData;if(null==m)return;const D=m.geometryInfo;v(Re,D.boundingBox);const E=m.localOrigin;i(T)&&(T.localOrigin=E,T.applyToAabb(Re));const O=-R*D.skirtLength;if(0!==O){const e=u.up;y(Re,O*e[0],O*e[1],O*e[2])}const P=Re;if(Oe[0]=r[0]-E[0],Oe[1]=r[1]-E[1],Oe[2]=r[2]-E[2],!he(P,Oe,o,b,A))return;const I=(e,t,r)=>{e.set(this.type,u,t,r,h),A=f&&i(l.dist)?l.dist:1/0},S=(o,h)=>{if(i(h)&&o>=0&&(e.options.backfacesTerrain||g(h,a)<0)&&(e.options.invisibleTerrain||!e.options.selectionMode||null==t||t(r,n,o))){if((null==p.dist||o<p.dist)&&I(p,o,h),e.options.isFiltered)return;e.options.store===re.ALL&&(s(_)?(_=ee(e.ray),I(_,o,h),e.results.all.push(_)):o<_.dist&&I(_,o,h)),(null==l.dist||o<l.dist)&&I(l,o,h),e.options.store!==re.MIN&&(null==d.dist||o>d.dist)&&I(d,o,h)}},C=Pe;c(C,n,E);const w=D.indices,L=D.vertexAttributes,M={data:L.getField(J.POSITION,x).typedBuffer,size:3,stride:L.stride/4},G=D.numWithoutSkirtIndices/3;if(!i(T)&&G>z){const e=u.renderData;i(e.intersectionData)||(e.intersectionData=new V(w,0,G,M)),e.intersectionData.intersectRay({r0:Oe,r1:C},S)}else ce(Oe,C,0,G,w,M,null,T,S);if(0!==O){const e=w.length/3;if(this.isGlobal){const t=e-G;if(!i(T)&&t>z){const r=u.renderData;if(!i(r.skirtIntersectionData)){const i=k(w,G,e,L,O,E);r.skirtIntersectionData=new V(i.indices,0,t,{data:i.vertices,stride:3})}r.skirtIntersectionData.intersectRay({r0:Oe,r1:C},S)}else N(Oe,C,G,e,w,L,O,E,T,S)}else q(Oe,C,G,e,w,L,O,T,S)}},E=this._rootTiles;if(i(E)){(()=>{const t=this.tileIterator;t.reset(E);const s=e.options.invisibleTerrain;for(;!t.done;){const e=t.next();!(e.visible||s&&e.intersectsClippingArea)||!i(T)&&!e.intersectsRay(r,a,b,A,R)||m&&this._useStencilForTile(e)?t.skipSubtree():D(e)}})()}}prepareTechnique(e){if(e.slot===ne.OCCLUDED_TERRAIN){if(0==(e.renderOccludedMask&S))return null}else{const t=this.opaque?ne.OPAQUE_TERRAIN:ne.TRANSPARENT_TERRAIN;if(e.slot!==t)return null}switch(e.pass){case se.MATERIAL:{const t=e.shadowMap&&e.shadowMap.enabled;this.shaderTechniqueConfig.receiveShadows!==t&&(this.shaderTechniqueConfig.receiveShadows=t);const r=this.overlayRenderer.isEmpty()?X.Disabled:this.overlayRenderer.hasWater?X.EnabledWithWater:X.Enabled;this.shaderTechniqueConfig.overlayMode!==r&&(this.shaderTechniqueConfig.overlayMode=r);const i=e.slot===ne.OCCLUDED_TERRAIN?I.Occluded:I.ColorAndWater;return this._updateTechnique(W.Color,i===I.Occluded)}case se.MATERIAL_DEPTH_SHADOWMAP_ALL:case se.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:return this.castShadows&&1===e.scenelightingData.globalFactor?this._updateTechnique(W.Shadow,!1):null;case se.MATERIAL_DEPTH:return this.isTransparent&&this.overlayRenderer.isEmpty()?null:this._updateTechnique(W.Depth,!1);case se.MATERIAL_NORMAL:return this._updateTechnique(W.Normal,!1);case se.MATERIAL_HIGHLIGHT:return this.needsHighlight?this._updateTechnique(W.Highlight,!1):null}return null}render(e,t){const r=e.pass,i=1===e.scenelightingData.globalFactor;switch(this._updatePatchGroups(),r){case se.MATERIAL:{const r=e.slot===ne.OCCLUDED_TERRAIN?I.Occluded:I.ColorAndWater;this._renderMaterialPass(e,t,r);break}case se.MATERIAL_DEPTH_SHADOWMAP_ALL:case se.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:this.castShadows&&i&&this._renderAuxiliaryPass(e,t,I.None);break;case se.MATERIAL_DEPTH:this.isTransparent&&this.overlayRenderer.isEmpty()||this._renderAuxiliaryPass(e,t,I.None);break;case se.MATERIAL_NORMAL:this._renderAuxiliaryPass(e,t,I.None);break;case se.MATERIAL_HIGHLIGHT:this.needsHighlight&&(this._renderAuxiliaryPass(e,t,I.Highlight),e.rctx.clearSafe(ge.DEPTH_BUFFER_BIT))}this._scaleRangeQueries.hasPendingQueries()&&this.setNeedsRender()}_renderMaterialPass(e,t,r){const{rctx:i,camera:s}=e;this._ssrEnabled=e.ssrParams.ssrEnabled;const n=t.program;i.useProgram(n),this.shaderTechniqueConfig.overlayMode!==X.Disabled&&r===I.ColorAndWater&&e.ssrParams&&Y(n,e.ssrParams),e.shadowMap.bind(n),e.ssaoHelper.bind(n,e.camera),this._bindOverlayData(n,r),n.setUniformMatrix4fv("viewNormal",s.viewInverseTransposeMatrix),Z(n,s.projectionMatrix),e.scenelightingData.setUniforms(n,!0);const a=s.viewMatrix;u(Ae,a[12],a[13],a[14]),p(Ae,Ae),n.setUniform3fv("viewDirection",Ae),this.numTilesRendered=0,this.numTilesCulled=0,this.numTrianglesRendered=0,this.numOriginsRendered=0,this._scaleRangeQueries.prepareQueries(),this.opaque?this._renderPatchGroups(e,t,r):e.offscreenRenderingHelper.renderToTargets((()=>this._renderPatchGroups(e,t,r)),e.offscreenRenderingHelper.tmpColor,e.offscreenRenderingHelper.mainDepth,[0,0,0,0]),this._scaleRangeQueries.processQueries()}_renderAuxiliaryPass(e,t,r){const i=t.program;if(e.rctx.useProgram(i),e.pass===se.MATERIAL_HIGHLIGHT){const t=e.offscreenRenderingHelper;i.bindTexture(t.depthTexture,"depthTex"),i.setUniform4f("highlightViewportPixelSz",0,0,1/t.width,1/t.height)}else i.setUniformMatrix4fv("viewNormal",e.camera.viewInverseTransposeMatrix),e.pass!==se.MATERIAL_DEPTH&&e.pass!==se.MATERIAL_DEPTH_SHADOWMAP_ALL&&e.pass!==se.MATERIAL_DEPTH_SHADOWMAP_DEFAULT||i.setUniform2fv("nearFar",e.camera.nearFar);this._renderPatchGroupsAuxiliary(e,t,r)}_updateTileBackground(){if(!this.tileRenderer)return;this.tileBackgroundUpdating=!0;const e=()=>{this.tileBackgroundInitialized=!0,this.tileBackgroundUpdating=!1,this.shaderTechniqueConfig.useGrid=this.tileRenderer.backgroundIsGrid,this.shaderTechniqueConfig.hasBackgroundColor=!this.tileRenderer.backgroundIsGrid&&!!i(this.tileRenderer.backgroundColor),this.allTiles.forAll((e=>this.tileRenderer.updateTileTexture(e,E.FADING))),this.setNeedsRender()};if("string"==typeof this.tileBackground){const t=this.tileBackground;A(t).then((r=>{t===this.tileBackground&&this.tileRenderer&&(this.tileRenderer.setBackground(r,this.tileBackground===G),e())}))}else{const r=this.tileBackground?t.toUnitRGBA(this.tileBackground):[0,0,0,0];this.tileRenderer.setBackground(r,!1),e()}}_updatePatchGroups(){if(this.patchGroupsDirty){if(this.highestVisibleLODTile=null,this._rebuildPatchGroups(),this.renderOrder!==L.NONE){const e=Array.from(this._patchGroups.values());e.forEach((e=>F(this.renderOrder,e))),e.sort(((e,t)=>H(e[0],t[0],this.renderOrder))),this._patchGroups=new Map(e.map((e=>[e[0].renderData.localOrigin,e])))}this.patchGroupsDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(!s(e)){this._patchGroups.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this.tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),r=e.renderData;if(!r||e.visible)if(e.rendered){if(r){const i=this._patchGroups.get(r.localOrigin)||new Array;this._patchGroups.set(r.localOrigin,i),i.push(e),(!this.highestVisibleLODTile||e.vlevel>this.highestVisibleLODTile.vlevel)&&(this.highestVisibleLODTile=e),t.skipSubtree()}}else this.numTilesCulled++;else this.numTilesCulled++,t.skipSubtree()}}_useStencilForTile(e){for(const t of this.stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderPatchGroupsAuxiliary(e,t,r){const i=e.rctx;t.useStencil=!1,t.bindPipelineState(i,e.slot);const s=this.stencilEnabledLayerExtents.length>0,n=t.program;n.setUniformMatrix4fv("proj",e.camera.projectionMatrix),n.setUniform1f("skirtScale",this._skirtScale),r!==I.None&&this._bindOverlayData(n,r),this._patchGroups.forEach((i=>{const a=i[0].renderData.localOrigin;this._bindPatchGroupData(n,a,e.camera.eye,e.camera.viewMatrix);for(let n=0;n<i.length;n++)this._renderPatch(e,t,i[n],fe.TRIANGLES,s,r)})),e.rctx.bindVAO(null)}_renderPatchGroups(e,t,r){const n=e.rctx,a=e.camera,o=a.viewMatrix,l=t.program;if(t.useStencil=!1,t.bindPipelineState(n,e.slot),this.shaderTechniqueConfig.screenSizePerspective&&this.pointsOfInterest){const e=ae(this.stage.viewingMode,this.ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:a.fovY}),de(e,l,"screenSizePerspective")}const d=this.stencilEnabledLayerExtents.length>0,h=r===I.Occluded;h&&(l.bindTexture(this.emptyTex,"tex"),l.setUniform1f("blend",1),l.setUniform4fv("texOffsetAndScale",R));const c=i(this.tileRenderer.backgroundColor)?this.tileRenderer.backgroundColor:f;this.shaderTechniqueConfig.hasBackgroundColor&&l.setUniform3fv("backgroundColor",c);const u=h?0:this._skirtScale;l.setUniform1f("skirtScale",u);const p=this.wireframe?fe.LINES:fe.TRIANGLES;this.shaderTechniqueConfig.textureFadingEnabled&&l.bindTexture(this.emptyTex,"texNext"),this._patchGroups.forEach((n=>{const c=n[0].renderData.localOrigin;this._bindPatchGroupData(l,c,a.eye,o);const u=e.sliceHelper&&e.sliceHelper.plane;Q(l,t.configuration,u,c),e.shadowMap&&e.shadowMap.bindView(l,c),this.numOriginsRendered++;for(let a=0;a<n.length;a++){const o=n[a],c=o.renderData.textureReference;if(s(c))continue;if(!h){this._scaleRangeQueries.scaleQueriesForTile(o),ye(o.renderData.geometryInfo.uvOffsetAndScale,c.offsetAndScale,be),l.setUniform4fv("texOffsetAndScale",be),l.bindTexture(c.texture.texture,"tex");const e=o.renderData.textureFadeFactor,t=e<1?o.renderData.nextTextureReference:null;this.shaderTechniqueConfig.textureFadingEnabled&&i(t)&&e<1?(ye(o.renderData.geometryInfo.uvOffsetAndScale,t.offsetAndScale,be),l.setUniform1f("fadeFactor",e),l.setUniform4fv("nextTexOffsetAndScale",be),l.setUniform3fv("nextTexOpacities",t.opacities),l.bindTexture(t.texture.texture,"texNext")):l.setUniform1f("fadeFactor",1),o.renderData.textureIsFading&&this.setNeedsRender(),l.setUniform3fv("textureOpacities",c.opacities)}const u=this._renderPatch(e,t,o,p,d,r);o.renderOrder=this.numTilesRendered,this.numTilesRendered++,this.numTrianglesRendered+=u/3}})),n.bindVAO(null)}_renderPatch(e,t,r,i,n,a){if(s(r.renderData.vao.indexBuffer))return 0;const o=t.program;a!==I.None&&this._bindOverlayPatchData(o,r.renderData.overlay),n&&(t.useStencil=this._useStencilForTile(r),t.bindPipelineState(e.rctx,e.slot));const l=0===this._skirtScale?r.renderData.geometryInfo.numWithoutSkirtIndices:r.renderData.vao.indexBuffer.size;return e.rctx.bindVAO(r.renderData.vao),o.assertCompatibleVertexAttributeLocations(r.renderData.vao),e.rctx.drawElements(i,l,r.renderData.vao.indexBuffer.indexType,0),l}_bindPatchGroupData(e,t,r,i){e.setUniform3fv("origin",t),l(xe,i,t),e.setUniformMatrix4fv("view",xe),e.setUniform3f("camPos",r[0]-t[0],r[1]-t[1],r[2]-t[2])}_bindOverlayData(e,t){if(this.shaderTechniqueConfig.overlayMode===X.Disabled)return;e.setUniform1f("overlayOpacity",this.overlayOpacity);const r=this.overlayRenderer.overlays;if(r.length>O.INNER){const s=r[O.INNER],n=s.getColorTexture(t);if(e.bindTexture(i(n)?n:this.emptyTex,"ovColorTex"),this.shaderTechniqueConfig.overlayMode===X.EnabledWithWater){const r=s.getNormalTexture(t);e.bindTexture(i(r)?r:this.emptyTex,"ovWaterTex")}}}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_updateTechnique(e,t){return this.shaderTechniqueConfig.output=e,e===W.Color&&(this.shaderTechniqueConfig.atmosphere=this.isGlobal&&this._velvetOverground,this.shaderTechniqueConfig.ssrEnabled=this._ssrEnabled),this.shaderTechniqueConfig.renderOccluded=t,this.shaderTechniqueConfig.stencilEnabled=!1,this._shaderTechnique=this.shaderTechniques.releaseAndAcquire(pe,this.shaderTechniqueConfig,this._shaderTechnique),this._shaderTechnique}get test(){return{tileRenderer:this.tileRenderer}}};e([a()],_e.prototype,"tileBackgroundInitialized",void 0),e([a()],_e.prototype,"tileBackgroundUpdating",void 0),e([a({constructOnly:!0})],_e.prototype,"overlayRenderer",void 0),e([a({constructOnly:!0})],_e.prototype,"stage",void 0),e([a({readOnly:!0})],_e.prototype,"isGlobal",null),e([a({constructOnly:!0})],_e.prototype,"allTiles",void 0),e([a({constructOnly:!0})],_e.prototype,"ellipsoidRadius",void 0),e([a({readOnly:!0})],_e.prototype,"updating",null),e([a({value:!1})],_e.prototype,"renderingDisabled",null),e([a()],_e.prototype,"renderPatchBorders",null),e([a()],_e.prototype,"cullBackFaces",null),e([a({value:L.FRONT_TO_BACK})],_e.prototype,"renderOrder",null),e([a()],_e.prototype,"wireframe",null),_e=e([o("esri.views.3d.terrain.TerrainRenderer")],_e);const ve=_e;function ye(e,t,r){const i=e[0]*t[2]+t[0],s=e[1]*t[3]+t[1],n=e[2]*t[2],a=e[3]*t[3];T(r,i,s,n,a)}const xe=d(),Ae=m(),De=m(),Ee=m(),Oe=m(),Pe=m();export{ve as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as i,isNone as s}from"../../../core/maybe.js";import n from"../../../core/ObjectPool.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{j as l}from"../../../chunks/mat4.js";import{c as d,I as h}from"../../../chunks/mat4f64.js";import{f as c,s as u,n as p,d as g}from"../../../chunks/vec3.js";import{Z as f,c as m}from"../../../chunks/vec3f64.js";import{Z as T,c as R}from"../../../chunks/vec4f64.js";import{create as b,set as _,expandWithOffset as y}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{requestImage as x}from"../../../support/requestImageUtils.js";import{ViewingMode as A}from"../../ViewingMode.js";import{TextureUpdate as D,OverlayIndex as E}from"./interfaces.js";import{LayerClass as O}from"./LayerClass.js";import{OverlaySource as P}from"./Overlay.js";import{overlayRenderOccludedFlag as I}from"./OverlayRenderer.js";import{clearCaches as S,getGlobalSkirtGeometry as C,intersectSkirtsGlobal as k,intersectSkirtsLocal as N}from"./PatchGeometryFactory.js";import{PatchRenderData as w}from"./PatchRenderData.js";import{RenderOrder as q}from"./RenderOrder.js";import{ScaleRangeQueries as L}from"./ScaleRangeQueries.js";import{DEFAULT_TILE_BACKGROUND as M}from"./TerrainConst.js";import{TileRenderer as G}from"./TileRenderer.js";import{TileUpdate as U}from"./TileUpdate.js";import{IteratorPreorder as j,sortTiles as B,compareTiles as F}from"./tileUtils.js";import{componentMinimalSizeForIntersectionData as H,ComponentIntersectionData as z}from"../webgl-engine/collections/Component/ComponentIntersectionData.js";import{ShaderOutput as V}from"../webgl-engine/core/shaderLibrary/ShaderOutputOptions.js";import{bindSliceUniforms as W}from"../webgl-engine/core/shaderLibrary/Slice.glsl.js";import{bindSSRUniforms as Q}from"../webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js";import{OverlayMode as Y}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{bindProjectionMatrix as X}from"../webgl-engine/core/shaderLibrary/util/View.glsl.js";import{RenderRequestType as Z}from"../webgl-engine/lib/basicInterfaces.js";import{createEmptyTexture as K}from"../webgl-engine/lib/glUtil3D.js";import{newIntersectorResult as J}from"../webgl-engine/lib/Intersector.js";import{IntersectorType as $,StoreResults as ee}from"../webgl-engine/lib/IntersectorInterfaces.js";import{RenderOccludedFlag as te}from"../webgl-engine/lib/Material.js";import{RenderPass as re}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as ie}from"../webgl-engine/lib/RenderSlot.js";import{getSettings as se}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as ne}from"../webgl-engine/lib/VertexAttribute.js";import{TERRAIN_ID as ae,getVerticalOffsetTerrain as oe}from"../webgl-engine/lib/verticalOffsetUtils.js";import{bindScreenSizePerspective as le,intersectAabbInvDirBefore as de,intersectTriangles as he}from"../webgl-engine/materials/internal/MaterialUtil.js";import{TerrainTechniqueConfiguration as ce,TerrainTechnique as ue}from"../webgl-engine/shaders/TerrainTechnique.js";import{ClearBufferBit as pe,PrimitiveType as ge}from"../../webgl/enums.js";const fe=7,me=10,Te=b(),Re=R();let be=class extends r{constructor(e){super(e),this.type=$.TERRAIN,this.isGround=!0,this.tileSize=256,this.rctx=null,this._isTransparent=!1,this._scaleRangeQueries=new L,this.renderDataPool=new n(w),this._patchGroups=new Map,this.patchGroupsDirty=!0,this.tileIterator=new j,this.highestVisibleLODTile=null,this.visible=!0,this._opaque=!0,this._skirtScale=1,this._velvetOverground=!0,this.castShadows=!0,this._ssrEnabled=!1,this.emptyTex=null,this.tileRenderer=null,this.tileBackgroundInitialized=!1,this.tileBackgroundUpdating=!1,this.stencilEnabledLayerExtents=[],this.numTilesRendered=0,this.numTilesCulled=0,this.numOriginsRendered=0,this.overlayOpacity=1,this.needsHighlight=!1,this.renderOccludedFlags=te.Occlude}get isGlobal(){return this.stage.viewingMode===A.Global}initialize(){const e=[ie.OPAQUE_TERRAIN,ie.TRANSPARENT_TERRAIN,ie.OCCLUDED_TERRAIN];this.stage.addRenderPlugin(e,this)}destroy(){this.stage.removeRenderPlugin(this),S()}get updating(){return!this.tileBackgroundInitialized||this.tileBackgroundUpdating}get canRender(){return this.visible&&!!this._rootTiles&&this.tileBackgroundInitialized&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setNeedsRender()}set opaque(e){this._opaque!==e&&(this._opaque=e,this.setNeedsRender())}get opaque(){return this._opaque&&!this.shaderTechniqueConfig.slicePlaneEnabled}get needsLinearDepth(){return this.overlayRenderer.hasWater}set isTransparent(e){this._isTransparent!==e&&(this._isTransparent=e,this.setNeedsRender())}get isTransparent(){return this._isTransparent}set skirtScale(e){e!==this._skirtScale&&(this._skirtScale=e,this.setNeedsRender())}get skirtScale(){return this._skirtScale}get renderPatchBorders(){return!!this.shaderTechniqueConfig.tileBorders}set renderPatchBorders(e){this.shaderTechniqueConfig.tileBorders!==e&&(this.shaderTechniqueConfig.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get cullBackFaces(){return this.shaderTechniqueConfig.backfaceCullingEnabled}set cullBackFaces(e){this.shaderTechniqueConfig.backfaceCullingEnabled!==e&&(this.shaderTechniqueConfig.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this.setNeedsRender()}set velvetOverground(e){this._velvetOverground!==e&&(this._velvetOverground=e,this.setNeedsRender())}get layerUid(){return ae}get slicePlaneEnabled(){return this.shaderTechniqueConfig.slicePlaneEnabled}set slicePlaneEnabled(e){this.shaderTechniqueConfig.slicePlaneEnabled!==e&&(this.shaderTechniqueConfig.slicePlaneEnabled=e,this.setNeedsRender())}set textureFadingEnabled(e){this.shaderTechniqueConfig.textureFadingEnabled!==e&&(this.shaderTechniqueConfig.textureFadingEnabled=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this.shaderTechniqueConfig.screenSizePerspective!==e&&(this.shaderTechniqueConfig.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setNeedsRender()}setNeedsHighlight(e){this.needsHighlight=e,this.setNeedsRender()}setRenderOccludedOverlay(e){this.renderOccludedFlags=e?I:te.Occlude,this.setNeedsRender()}setStencilEnabledLayerExtents(e){this.stencilEnabledLayerExtents=e,this.setNeedsRender()}setTileSize(e){this.tileSize=e,this.tileRenderer&&(this.tileRenderer.tileSize=e),this.setNeedsRender()}loadTile(e){e.renderData||(e.renderData=this.renderDataPool.acquire(),e.renderData.init(e),e.renderData.localOrigin=this._getLocalOriginOfTile(e)),this.updateTileGeometry(e),this.updateTileTexture(e,U.TEXTURE_FADING)}queryVisibleLevelRange(e,t,r,i){this._scaleRangeQueries.queryVisibleLevelRange(e,t,r,i),this.setNeedsRender()}updateTileTexture(e,t){this.tileRenderer&&this.tileBackgroundInitialized&&(this.tileRenderer.updateTileTexture(e,t===U.TEXTURE_FADING?D.FADING:D.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometry(e){for(const t of e.layerInfo[O.ELEVATION])t.pendingUpdates&=~U.GEOMETRY;e.resetPendingUpdate(U.GEOMETRY),e.renderData.updateGeometry(this.rctx,this.wireframe)&&this.setNeedsRender()}unloadTile(e){e.renderData&&(e.renderData.releaseGeometry()&&this.setNeedsRender(),this.renderDataPool.release(e.renderData),e.renderData.clear(),e.renderData=null,e.setMemoryDirty(),this.setNeedsRender())}_getLocalOriginOfTile(e){const t=me-fe,r=Math.max(0,Math.floor((e.level-t)/fe)*fe);if(this.isGlobal&&0===r)return f;for(;e.parent&&e.level>r;)e=e.parent;return e.centerAtSeaLevel}setVisibility(e){this.visible=e,this.setNeedsRender()}getStats(){return{numTilesRendered:this.numTilesRendered,numTilesCulled:this.numTilesCulled,numOriginsRendered:this.numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.allTiles.forAll((t=>{var r;return null==(r=t.renderData)?void 0:r.updateGeometry(this.rctx,e)})),this.setNeedsRender())}setNeedsRender(e=Z.UPDATE){this.patchGroupsDirty=!0,this.context.requestRender(e)}setTileBackground(e){this.tileBackground=e,this._updateTileBackground()}initializeRenderContext(e){this.context=e,this.rctx=e.renderContext.rctx,this.shaderTechniques=e.shaderTechniqueRep,this.shaderTechniqueConfig=new ce,this.tileRenderer=new G(this.rctx,this.tileSize,this.shaderTechniques),this.tileBackground&&this._updateTileBackground(),this.emptyTex=K(this.rctx)}uninitializeRenderContext(){null!=this.emptyTex&&(this.emptyTex.dispose(),this.emptyTex=null),this.tileRenderer&&(this.tileRenderer.dispose(),this.tileRenderer=null)}intersect(e,t,r,n){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&!this._opaque)return;const a=Ae,o=De;c(a,n,r),u(o,1/a[0],1/a[1],1/a[2]);const l=e.results.min,d=e.results.max,p=e.results.ground,f=e.options.store===ee.MIN,m=!!e.results.ground.target,T=oe(e.verticalOffset),R=this._skirtScale,b=e.tolerance;let x,A=f&&i(l.dist)?l.dist:1/0;const D=u=>{const m=u.renderData;if(null==m)return;const D=m.geometryInfo;_(Te,D.boundingBox);const E=m.localOrigin;i(T)&&(T.localOrigin=E,T.applyToAabb(Te));const O=-R*D.skirtLength;if(0!==O){const e=u.up;y(Te,O*e[0],O*e[1],O*e[2])}const P=Te;if(Ee[0]=r[0]-E[0],Ee[1]=r[1]-E[1],Ee[2]=r[2]-E[2],!de(P,Ee,o,b,A))return;const I=(e,t,r)=>{e.set(this.type,u,t,r,h),A=f&&i(l.dist)?l.dist:1/0},S=(o,h)=>{if(i(h)&&o>=0&&(e.options.backfacesTerrain||g(h,a)<0)&&(e.options.invisibleTerrain||!e.options.selectionMode||null==t||t(r,n,o))){if((null==p.dist||o<p.dist)&&I(p,o,h),e.options.isFiltered)return;e.options.store===ee.ALL&&(s(x)?(x=J(e.ray),I(x,o,h),e.results.all.push(x)):o<x.dist&&I(x,o,h)),(null==l.dist||o<l.dist)&&I(l,o,h),e.options.store!==ee.MIN&&(null==d.dist||o>d.dist)&&I(d,o,h)}},w=Oe;c(w,n,E);const q=D.indices,L=D.vertexAttributes,M={data:L.getField(ne.POSITION,v).typedBuffer,size:3,stride:L.stride/4},G=D.numWithoutSkirtIndices/3;if(!i(T)&&G>H){const e=u.renderData;i(e.intersectionData)||(e.intersectionData=new z(q,0,G,M)),e.intersectionData.intersectRay({r0:Ee,r1:w},S)}else he(Ee,w,0,G,q,M,null,T,S);if(0!==O){const e=q.length/3;if(this.isGlobal){const t=e-G;if(!i(T)&&t>H){const r=u.renderData;if(!i(r.skirtIntersectionData)){const i=C(q,G,e,L,O,E);r.skirtIntersectionData=new z(i.indices,0,t,{data:i.vertices,stride:3})}r.skirtIntersectionData.intersectRay({r0:Ee,r1:w},S)}else k(Ee,w,G,e,q,L,O,E,T,S)}else N(Ee,w,G,e,q,L,O,T,S)}},E=this._rootTiles;if(i(E)){(()=>{const t=this.tileIterator;t.reset(E);const s=e.options.invisibleTerrain;for(;!t.done;){const e=t.next();!(e.visible||s&&e.intersectsClippingArea)||!i(T)&&!e.intersectsRay(r,a,b,A,R)||m&&this._useStencilForTile(e)?t.skipSubtree():D(e)}})()}}prepareTechnique(e){if(e.slot===ie.OCCLUDED_TERRAIN){if(0==(e.renderOccludedMask&I))return null}else{const t=this.opaque?ie.OPAQUE_TERRAIN:ie.TRANSPARENT_TERRAIN;if(e.slot!==t)return null}switch(e.pass){case re.MATERIAL:{const t=e.shadowMap&&e.shadowMap.enabled;this.shaderTechniqueConfig.receiveShadows!==t&&(this.shaderTechniqueConfig.receiveShadows=t);const r=this.overlayRenderer.isEmpty()?Y.Disabled:this.overlayRenderer.hasWater?Y.EnabledWithWater:Y.Enabled;this.shaderTechniqueConfig.overlayMode!==r&&(this.shaderTechniqueConfig.overlayMode=r);const i=e.slot===ie.OCCLUDED_TERRAIN?P.Occluded:P.ColorAndWater;return this._updateTechnique(V.Color,i===P.Occluded)}case re.MATERIAL_DEPTH_SHADOWMAP_ALL:case re.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:return this.castShadows&&1===e.scenelightingData.globalFactor?this._updateTechnique(V.Shadow,!1):null;case re.MATERIAL_DEPTH:return this.isTransparent&&this.overlayRenderer.isEmpty()?null:this._updateTechnique(V.Depth,!1);case re.MATERIAL_NORMAL:return this._updateTechnique(V.Normal,!1);case re.MATERIAL_HIGHLIGHT:return this.needsHighlight?this._updateTechnique(V.Highlight,!1):null}return null}render(e,t){const r=e.pass,i=1===e.scenelightingData.globalFactor;switch(this._updatePatchGroups(),r){case re.MATERIAL:{const r=e.slot===ie.OCCLUDED_TERRAIN?P.Occluded:P.ColorAndWater;this._renderMaterialPass(e,t,r);break}case re.MATERIAL_DEPTH_SHADOWMAP_ALL:case re.MATERIAL_DEPTH_SHADOWMAP_DEFAULT:this.castShadows&&i&&this._renderAuxiliaryPass(e,t,P.None);break;case re.MATERIAL_DEPTH:this.isTransparent&&this.overlayRenderer.isEmpty()||this._renderAuxiliaryPass(e,t,P.None);break;case re.MATERIAL_NORMAL:this._renderAuxiliaryPass(e,t,P.None);break;case re.MATERIAL_HIGHLIGHT:this.needsHighlight&&(this._renderAuxiliaryPass(e,t,P.Highlight),e.rctx.clearSafe(pe.DEPTH_BUFFER_BIT))}this._scaleRangeQueries.hasPendingQueries()&&this.setNeedsRender()}_renderMaterialPass(e,t,r){const{rctx:i,camera:s}=e;this._ssrEnabled=e.ssrParams.ssrEnabled;const n=t.program;i.useProgram(n),this.shaderTechniqueConfig.overlayMode!==Y.Disabled&&r===P.ColorAndWater&&e.ssrParams&&Q(n,e.ssrParams),e.shadowMap.bind(n),e.ssaoHelper.bind(n,e.camera),this._bindOverlayData(n,r),n.setUniformMatrix4fv("viewNormal",s.viewInverseTransposeMatrix),X(n,s.projectionMatrix),e.scenelightingData.setUniforms(n,!0);const a=s.viewMatrix;u(xe,a[12],a[13],a[14]),p(xe,xe),n.setUniform3fv("viewDirection",xe),this.numTilesRendered=0,this.numTilesCulled=0,this.numOriginsRendered=0,this._scaleRangeQueries.prepareQueries(),this.opaque?this._renderPatchGroups(e,t,r):e.offscreenRenderingHelper.renderToTargets((()=>this._renderPatchGroups(e,t,r)),e.offscreenRenderingHelper.tmpColor,e.offscreenRenderingHelper.mainDepth,[0,0,0,0]),this._scaleRangeQueries.processQueries()}_renderAuxiliaryPass(e,t,r){const i=t.program;if(e.rctx.useProgram(i),e.pass===re.MATERIAL_HIGHLIGHT){const t=e.offscreenRenderingHelper;i.bindTexture(t.depthTexture,"depthTex"),i.setUniform4f("highlightViewportPixelSz",0,0,1/t.width,1/t.height)}else i.setUniformMatrix4fv("viewNormal",e.camera.viewInverseTransposeMatrix),e.pass!==re.MATERIAL_DEPTH&&e.pass!==re.MATERIAL_DEPTH_SHADOWMAP_ALL&&e.pass!==re.MATERIAL_DEPTH_SHADOWMAP_DEFAULT||i.setUniform2fv("nearFar",e.camera.nearFar);this._renderPatchGroupsAuxiliary(e,t,r)}_updateTileBackground(){if(!this.tileRenderer)return;this.tileBackgroundUpdating=!0;const e=()=>{this.tileBackgroundInitialized=!0,this.tileBackgroundUpdating=!1,this.shaderTechniqueConfig.useGrid=this.tileRenderer.backgroundIsGrid,this.shaderTechniqueConfig.hasBackgroundColor=!this.tileRenderer.backgroundIsGrid&&!!i(this.tileRenderer.backgroundColor),this.allTiles.forAll((e=>this.tileRenderer.updateTileTexture(e,D.FADING))),this.setNeedsRender()};if("string"==typeof this.tileBackground){const t=this.tileBackground;x(t).then((r=>{t===this.tileBackground&&this.tileRenderer&&(this.tileRenderer.setBackground(r,this.tileBackground===M),e())}))}else{const r=this.tileBackground?t.toUnitRGBA(this.tileBackground):[0,0,0,0];this.tileRenderer.setBackground(r,!1),e()}}_updatePatchGroups(){if(this.patchGroupsDirty){if(this.highestVisibleLODTile=null,this._rebuildPatchGroups(),this.renderOrder!==q.NONE){const e=Array.from(this._patchGroups.values());e.forEach((e=>B(this.renderOrder,e))),e.sort(((e,t)=>F(e[0],t[0],this.renderOrder))),this._patchGroups=new Map(e.map((e=>[e[0].renderData.localOrigin,e])))}this.patchGroupsDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(!s(e)){this._patchGroups.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this.tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),r=e.renderData;if(!r||e.visible)if(e.rendered){if(r){const i=this._patchGroups.get(r.localOrigin)||new Array;this._patchGroups.set(r.localOrigin,i),i.push(e),(!this.highestVisibleLODTile||e.vlevel>this.highestVisibleLODTile.vlevel)&&(this.highestVisibleLODTile=e),t.skipSubtree()}}else this.numTilesCulled++;else this.numTilesCulled++,t.skipSubtree()}}_useStencilForTile(e){for(const t of this.stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderPatchGroupsAuxiliary(e,t,r){const i=e.rctx;t.useStencil=!1,t.bindPipelineState(i,e.slot);const s=this.stencilEnabledLayerExtents.length>0,n=t.program;n.setUniformMatrix4fv("proj",e.camera.projectionMatrix),n.setUniform1f("skirtScale",this._skirtScale),r!==P.None&&this._bindOverlayData(n,r),this._patchGroups.forEach((i=>{const a=i[0].renderData.localOrigin;this._bindPatchGroupData(n,a,e.camera.eye,e.camera.viewMatrix);for(let n=0;n<i.length;n++)this._renderPatch(e,t,i[n],ge.TRIANGLES,s,r)})),e.rctx.bindVAO(null)}_renderPatchGroups(e,t,r){const n=e.rctx,a=e.camera,o=a.viewMatrix,l=t.program;if(t.useStencil=!1,t.bindPipelineState(n,e.slot),this.shaderTechniqueConfig.screenSizePerspective&&this.pointsOfInterest){const e=se(this.stage.viewingMode,this.ellipsoidRadius),t=this.pointsOfInterest.centerOnSurfaceFrequent.distance;e.update({distance:t,fovY:a.fovY}),le(e,l,"screenSizePerspective")}const d=this.stencilEnabledLayerExtents.length>0,h=r===P.Occluded;h&&(l.bindTexture(this.emptyTex,"tex"),l.setUniform1f("blend",1),l.setUniform4fv("texOffsetAndScale",T));const c=i(this.tileRenderer.backgroundColor)?this.tileRenderer.backgroundColor:f;this.shaderTechniqueConfig.hasBackgroundColor&&l.setUniform3fv("backgroundColor",c);const u=h?0:this._skirtScale;l.setUniform1f("skirtScale",u);const p=this.wireframe?ge.LINES:ge.TRIANGLES;this.shaderTechniqueConfig.textureFadingEnabled&&l.bindTexture(this.emptyTex,"texNext"),this._patchGroups.forEach((n=>{const c=n[0].renderData.localOrigin;this._bindPatchGroupData(l,c,a.eye,o);const u=e.sliceHelper&&e.sliceHelper.plane;W(l,t.configuration,u,c),e.shadowMap&&e.shadowMap.bindView(l,c),this.numOriginsRendered++;for(let a=0;a<n.length;a++){const o=n[a],c=o.renderData.textureReference;if(!s(c)){if(!h){this._scaleRangeQueries.scaleQueriesForTile(o),ye(o.renderData.geometryInfo.uvOffsetAndScale,c.offsetAndScale,Re),l.setUniform4fv("texOffsetAndScale",Re),l.bindTexture(c.texture.texture,"tex");const e=o.renderData.textureFadeFactor,t=e<1?o.renderData.nextTextureReference:null;this.shaderTechniqueConfig.textureFadingEnabled&&i(t)&&e<1?(ye(o.renderData.geometryInfo.uvOffsetAndScale,t.offsetAndScale,Re),l.setUniform1f("fadeFactor",e),l.setUniform4fv("nextTexOffsetAndScale",Re),l.setUniform3fv("nextTexOpacities",t.opacities),l.bindTexture(t.texture.texture,"texNext")):l.setUniform1f("fadeFactor",1),o.renderData.textureIsFading&&this.setNeedsRender(),l.setUniform3fv("textureOpacities",c.opacities)}this._renderPatch(e,t,o,p,d,r),o.renderOrder=this.numTilesRendered,this.numTilesRendered++}}})),n.bindVAO(null)}_renderPatch(e,t,r,i,n,a){if(s(r.renderData.vao.indexBuffer))return;const o=t.program;a!==P.None&&this._bindOverlayPatchData(o,r.renderData.overlay),n&&(t.useStencil=this._useStencilForTile(r),t.bindPipelineState(e.rctx,e.slot));const l=0===this._skirtScale?r.renderData.geometryInfo.numWithoutSkirtIndices:r.renderData.vao.indexBuffer.size;e.rctx.bindVAO(r.renderData.vao),o.assertCompatibleVertexAttributeLocations(r.renderData.vao),e.rctx.drawElements(i,l,r.renderData.vao.indexBuffer.indexType,0)}_bindPatchGroupData(e,t,r,i){e.setUniform3fv("origin",t),l(ve,i,t),e.setUniformMatrix4fv("view",ve),e.setUniform3f("cameraPosition",r[0]-t[0],r[1]-t[1],r[2]-t[2])}_bindOverlayData(e,t){if(this.shaderTechniqueConfig.overlayMode===Y.Disabled)return;e.setUniform1f("overlayOpacity",this.overlayOpacity);const r=this.overlayRenderer.overlays;if(r.length>E.INNER){const s=r[E.INNER],n=s.getColorTexture(t);if(e.bindTexture(i(n)?n:this.emptyTex,"ovColorTex"),this.shaderTechniqueConfig.overlayMode===Y.EnabledWithWater){const r=s.getNormalTexture(t);e.bindTexture(i(r)?r:this.emptyTex,"ovWaterTex")}}}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_updateTechnique(e,t){return this.shaderTechniqueConfig.output=e,e===V.Color&&(this.shaderTechniqueConfig.atmosphere=this.isGlobal&&this._velvetOverground,this.shaderTechniqueConfig.ssrEnabled=this._ssrEnabled),this.shaderTechniqueConfig.renderOccluded=t,this.shaderTechniqueConfig.stencilEnabled=!1,this._shaderTechnique=this.shaderTechniques.releaseAndAcquire(ue,this.shaderTechniqueConfig,this._shaderTechnique),this._shaderTechnique}get test(){return{tileRenderer:this.tileRenderer}}};e([a()],be.prototype,"tileBackgroundInitialized",void 0),e([a()],be.prototype,"tileBackgroundUpdating",void 0),e([a({constructOnly:!0})],be.prototype,"overlayRenderer",void 0),e([a({constructOnly:!0})],be.prototype,"stage",void 0),e([a({readOnly:!0})],be.prototype,"isGlobal",null),e([a({constructOnly:!0})],be.prototype,"allTiles",void 0),e([a({constructOnly:!0})],be.prototype,"ellipsoidRadius",void 0),e([a({readOnly:!0})],be.prototype,"updating",null),e([a({value:!1})],be.prototype,"renderingDisabled",null),e([a()],be.prototype,"renderPatchBorders",null),e([a()],be.prototype,"cullBackFaces",null),e([a({value:q.FRONT_TO_BACK})],be.prototype,"renderOrder",null),e([a()],be.prototype,"wireframe",null),be=e([o("esri.views.3d.terrain.TerrainRenderer")],be);const _e=be;function ye(e,t,r){r[0]=e[0]*t[2]+t[0],r[1]=e[1]*t[3]+t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3]}const ve=d(),xe=m(),Ae=m(),De=m(),Ee=m(),Oe=m();export{_e as default};