@arcgis/core 4.23.0-next.20220124 → 4.23.0-next.20220129

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 (623) 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/422537fc3df707bb62c9.js +1 -0
  31. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  32. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  33. package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
  35. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  36. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
  37. package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
  38. package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
  39. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
  41. package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
  42. package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
  43. package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
  44. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
  45. package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
  46. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
  47. package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
  50. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
  51. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  52. package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
  54. package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
  55. package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
  56. package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
  57. package/assets/esri/core/workers/chunks/8a876f91c9c7c23786b5.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/_ItemList.scss +1 -1
  115. package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
  116. package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
  117. package/assets/esri/themes/base/widgets/_Print.scss +24 -11
  118. package/assets/esri/themes/base/widgets/_Search.scss +4 -2
  119. package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
  120. package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
  121. package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
  122. package/assets/esri/themes/dark/main.css +1 -1
  123. package/assets/esri/themes/dark-blue/main.css +1 -1
  124. package/assets/esri/themes/dark-green/main.css +1 -1
  125. package/assets/esri/themes/dark-purple/main.css +1 -1
  126. package/assets/esri/themes/dark-red/main.css +1 -1
  127. package/assets/esri/themes/light/main.css +1 -1
  128. package/assets/esri/themes/light/view.css +1 -1
  129. package/assets/esri/themes/light-blue/main.css +1 -1
  130. package/assets/esri/themes/light-green/main.css +1 -1
  131. package/assets/esri/themes/light-purple/main.css +1 -1
  132. package/assets/esri/themes/light-red/main.css +1 -1
  133. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  137. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  138. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  139. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  140. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  141. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  142. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  143. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  144. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  145. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  146. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  147. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  148. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  149. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  150. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  151. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  152. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  153. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  154. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  155. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  156. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  157. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  158. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  159. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  160. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  161. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  162. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  163. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  164. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  165. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  166. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  167. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  168. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  169. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  170. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  171. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  172. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  173. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  174. package/chunks/BlendLayers.glsl.js +2 -2
  175. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  176. package/chunks/CheckerBoard.glsl.js +3 -3
  177. package/chunks/Clouds.glsl.js +2 -2
  178. package/chunks/CloudsComposition.glsl.js +1 -1
  179. package/chunks/ColorMaterial.glsl.js +12 -12
  180. package/chunks/ComponentShader.glsl.js +21 -21
  181. package/chunks/Compositing.glsl.js +1 -1
  182. package/chunks/DefaultMaterial.glsl.js +33 -33
  183. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  184. package/chunks/Fog.glsl.js +10 -12
  185. package/chunks/HUDMaterial.glsl.js +2 -2
  186. package/chunks/HighlightComposition.glsl.js +5 -5
  187. package/chunks/ImageMaterial.glsl.js +6 -6
  188. package/chunks/LaserlinePath.glsl.js +8 -8
  189. package/chunks/LineCallout.glsl.js +6 -6
  190. package/chunks/MeasurementArrow.glsl.js +1 -1
  191. package/chunks/NativeLine.glsl.js +1 -1
  192. package/chunks/Path.glsl.js +5 -5
  193. package/chunks/Pattern.glsl.js +9 -9
  194. package/chunks/PointRenderer.glsl.js +14 -14
  195. package/chunks/Precipitation.glsl.js +91 -0
  196. package/chunks/RealisticTree.glsl.js +21 -21
  197. package/chunks/RibbonLine.glsl.js +11 -11
  198. package/chunks/SMAA.glsl.js +40 -40
  199. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  200. package/chunks/ShadowCast.glsl.js +6 -6
  201. package/chunks/ShadowHighlight.glsl.js +4 -4
  202. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  203. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  204. package/chunks/Stars.glsl.js +3 -3
  205. package/chunks/Terrain.glsl.js +3 -3
  206. package/chunks/TextureOnly.glsl.js +2 -2
  207. package/chunks/WaterSurface.glsl.js +22 -22
  208. package/chunks/boundedPlane.js +1 -1
  209. package/chunks/pe.js +1 -1
  210. package/chunks/vec3.js +1 -1
  211. package/chunks/vxlLayer.js +1 -1
  212. package/core/accessorSupport/read.js +1 -1
  213. package/core/accessorSupport/watch.js +1 -1
  214. package/core/accessorSupport/write.js +1 -1
  215. package/core/clock.js +1 -1
  216. package/core/jsonMap.js +1 -1
  217. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  218. package/core/loadAll.js +1 -1
  219. package/core/promiseUtils.js +1 -1
  220. package/core/reactiveUtils.js +1 -1
  221. package/form/ExpressionInfo.js +1 -1
  222. package/geometry/pe.js +1 -1
  223. package/geometry/support/axisAngleDegrees.js +1 -1
  224. package/geometry/support/frustum.js +1 -1
  225. package/geometry/support/plane.js +1 -1
  226. package/interfaces.d.ts +263 -35
  227. package/layers/VectorTileLayer.js +1 -1
  228. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  229. package/layers/graphics/featureConversionUtils.js +1 -1
  230. package/layers/support/LayerContingentValuesCache.js +1 -1
  231. package/layers/support/TileInfo.js +1 -1
  232. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  233. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  234. package/package.json +2 -2
  235. package/popup/content/AttachmentsContent.js +1 -1
  236. package/popup/content/support/mediaInfoTypes.js +1 -1
  237. package/rest/print.js +1 -1
  238. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  239. package/support/arcadeOnDemand.js +1 -1
  240. package/support/featureFlags.js +1 -1
  241. package/support/revision.js +1 -1
  242. package/symbols/FillSymbol3DLayer.js +1 -1
  243. package/symbols/IconSymbol3DLayer.js +1 -1
  244. package/symbols/LabelSymbol3D.js +1 -1
  245. package/symbols/ObjectSymbol3DLayer.js +1 -1
  246. package/symbols/PointSymbol3D.js +1 -1
  247. package/symbols/Symbol3D.js +1 -1
  248. package/symbols/WebStyleSymbol.js +1 -1
  249. package/symbols/cim/CIMSymbolHelper.js +1 -1
  250. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  251. package/symbols/cim/cimAnalyzer.js +1 -1
  252. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  253. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  254. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  255. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  256. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  257. package/symbols/support/Symbol3DIconOutline.js +1 -1
  258. package/symbols/support/Symbol3DOutline.js +1 -1
  259. package/symbols/support/Symbol3DVerticalOffset.js +1 -1
  260. package/symbols/support/Thumbnail.js +1 -1
  261. package/symbols/support/previewCIMSymbol.js +1 -1
  262. package/symbols/support/previewSymbol2D.js +1 -1
  263. package/symbols/support/previewSymbol3D.js +1 -1
  264. package/symbols/support/previewWebStyleSymbol.js +1 -1
  265. package/symbols/support/svgUtils.js +1 -1
  266. package/symbols/support/webStyleSymbolUtils.js +1 -1
  267. package/symbols.js +1 -1
  268. package/views/2d/MapViewConstraints.js +1 -1
  269. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  270. package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
  271. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  272. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  273. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  274. package/views/2d/viewpointUtils.js +1 -1
  275. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  276. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  277. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  278. package/views/3d/environment/CloudsComposition.js +1 -1
  279. package/views/3d/environment/CloudsGenerator.js +1 -1
  280. package/views/3d/environment/CloudsPresets.js +1 -1
  281. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  282. package/views/3d/environment/Fog.glsl.js +1 -1
  283. package/views/3d/environment/Fog.js +1 -1
  284. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  285. package/views/3d/environment/Precipitation.glsl.js +5 -0
  286. package/views/3d/environment/Precipitation.js +5 -0
  287. package/views/3d/environment/PrecipitationTechnique.js +5 -0
  288. package/views/3d/environment/RainyWeather.js +1 -1
  289. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  290. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  291. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  292. package/views/3d/environment/SnowyWeather.js +5 -0
  293. package/views/3d/environment/Stars.glsl.js +1 -1
  294. package/views/3d/environment/Stars.js +1 -1
  295. package/views/3d/environment/weather.js +1 -1
  296. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  297. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  298. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  299. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  300. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  301. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  302. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  303. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  304. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  305. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  306. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  307. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  308. package/views/3d/layers/GraphicsView3D.js +1 -1
  309. package/views/3d/layers/I3SMeshView3D.js +1 -1
  310. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  311. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  312. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  313. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  314. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  315. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  316. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  317. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  320. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  321. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  322. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  323. package/views/3d/layers/graphics/lineUtils.js +1 -1
  324. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  325. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  326. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  327. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  328. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  329. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  330. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  331. package/views/3d/layers/support/patternUtils.js +1 -1
  332. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  333. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  334. package/views/3d/support/LaserLineRenderer.js +1 -1
  335. package/views/3d/support/LaserlinePathData.js +1 -1
  336. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  337. package/views/3d/support/sunUtils.js +1 -1
  338. package/views/3d/terrain/OverlayRenderer.js +1 -1
  339. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  340. package/views/3d/terrain/TerrainRenderer.js +1 -1
  341. package/views/3d/terrain/TerrainSurface.js +1 -1
  342. package/views/3d/terrain/Tile.js +1 -1
  343. package/views/3d/terrain/terrainUtils.js +1 -1
  344. package/views/3d/terrain/tileUtils.js +1 -1
  345. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  346. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  347. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  348. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  349. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  350. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  351. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  352. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  353. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  354. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  355. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  356. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  357. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  358. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  359. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  360. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  361. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  362. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  363. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  364. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  365. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  366. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  367. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  368. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  369. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  370. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  371. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  372. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  373. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  374. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  375. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  376. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  377. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  378. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  379. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  380. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  381. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  382. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  383. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  384. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  385. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
  386. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  387. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  388. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  389. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  390. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  391. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  392. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  393. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  394. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  395. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  396. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  397. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  398. package/views/3d/webgl-engine/lib/Material.js +1 -1
  399. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  400. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  401. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  402. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  403. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  404. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  405. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  406. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  407. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  408. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  409. package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
  410. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  411. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  412. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  413. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  414. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  415. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  416. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  417. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  418. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  419. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  420. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  421. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  422. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  423. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  424. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  425. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  426. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  427. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  428. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  429. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  432. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  433. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  434. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  435. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  436. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  437. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  438. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  439. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  440. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  441. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  442. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  443. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  444. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  445. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  446. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  447. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  448. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  449. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  450. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  451. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  452. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  453. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  454. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  455. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  456. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  457. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  458. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  459. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  460. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  461. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  462. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  463. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  464. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  465. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  466. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  467. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  468. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  469. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  470. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  471. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  472. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  473. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  474. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  475. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  476. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  477. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  478. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  479. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  480. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  481. package/views/MapView.js +1 -1
  482. package/views/SceneView.js +1 -1
  483. package/views/View.js +1 -1
  484. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  485. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  486. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  487. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  488. package/views/interactive/dragEventPipeline.js +1 -1
  489. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  490. package/views/support/DefaultsFromMap.js +1 -1
  491. package/views/support/WatchUpdatingTracking.js +1 -1
  492. package/views/support/projectionUtils.js +5 -0
  493. package/views/webgl/BufferObject.js +1 -1
  494. package/views/webgl/InstanceCounter.js +1 -1
  495. package/views/webgl/Program.js +1 -1
  496. package/views/webgl/rasterUtils.js +1 -1
  497. package/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
  498. package/webmap/Bookmark.js +1 -1
  499. package/webmap/Version.js +1 -1
  500. package/webscene/Slide.js +1 -1
  501. package/webscene/Version.js +1 -1
  502. package/webscene/support/SlideVisibleLayer.js +1 -1
  503. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  504. package/widgets/Attachments.js +1 -1
  505. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  506. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  507. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  508. package/widgets/BasemapGallery.js +1 -1
  509. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  510. package/widgets/Bookmarks.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/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  515. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  516. package/widgets/Popup/PopupViewModel.js +1 -1
  517. package/widgets/Popup/actionUtils.js +1 -1
  518. package/widgets/Search/support/locatorUtils.js +1 -1
  519. package/widgets/Search.js +1 -1
  520. package/widgets/Slice/SliceViewModel.js +1 -1
  521. package/widgets/Slider/SliderViewModel.js +1 -1
  522. package/widgets/Slider.js +1 -1
  523. package/widgets/TimeSlider.js +1 -1
  524. package/widgets/Weather/WeatherViewModel.js +1 -1
  525. package/widgets/Weather/css.js +1 -1
  526. package/widgets/Weather/enums.js +5 -0
  527. package/widgets/Weather.js +1 -1
  528. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  529. package/widgets/support/InteractiveToolViewModel.js +1 -1
  530. package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
  531. package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
  532. package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
  533. package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
  534. package/assets/components/assets/calcite-icon/squareF16.json +0 -1
  535. package/assets/components/assets/calcite-icon/squareF24.json +0 -1
  536. package/assets/components/assets/calcite-icon/squareF32.json +0 -1
  537. package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
  538. package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
  539. package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
  540. package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
  541. package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
  542. package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
  543. package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
  544. package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
  545. package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
  546. package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
  547. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
  548. package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
  549. package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
  550. package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
  551. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
  552. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
  553. package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
  554. package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
  555. package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
  556. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
  557. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
  558. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
  559. package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
  560. package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
  561. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
  562. package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
  563. package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
  564. package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
  565. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
  566. package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
  567. package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
  568. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
  569. package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
  570. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
  571. package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
  572. package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
  573. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  574. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
  575. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
  576. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
  577. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
  578. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
  579. package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
  580. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
  581. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
  582. package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
  583. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
  584. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  585. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
  586. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
  587. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
  588. package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
  589. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
  590. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
  591. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
  592. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
  593. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
  594. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
  595. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
  596. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
  597. package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
  598. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
  599. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
  600. package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
  601. package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
  602. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
  603. package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
  604. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
  605. package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
  606. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
  607. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
  608. package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
  609. package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
  610. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
  611. package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
  612. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
  613. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  614. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
  615. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
  616. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
  617. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
  618. package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
  619. package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
  620. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
  621. package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
  622. package/assets/esri/core/workers/chunks/fe864d01e72aa24574b6.js +0 -1
  623. 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 e from"../../../../Color.js";import{isSome as t,get as s,none as r,isNone as i,unwrapOr as a}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{c as n,i as l,h as c,j as h}from"../../../../chunks/mat4.js";import{c as d}from"../../../../chunks/mat4f64.js";import{l as m,o as p,g as u,D as y,b as f,s as _}from"../../../../chunks/vec3.js";import{d as b,O as g,Z as P,f as v,c as x}from"../../../../chunks/vec3f64.js";import{O as R,c as L}from"../../../../chunks/vec4f64.js";import{projectPointToVector as S,computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection.js";import{create as E,size as U,containsPoint as w,center as j}from"../../../../geometry/support/aaBoundingBox.js";import{defaultPrimitive as B}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{objectSymbolLayerPrimitiveBoundingBox as T,objectSymbolLayerSizeWithResourceSize as G}from"../../../../symbols/support/symbolLayerUtils3D.js";import{perLodInstanceElevationAligner as O}from"./ElevationAligners.js";import{needsElevationUpdates3D as I,evaluateElevationInfoAtPoint as z,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{ElevationContext as M}from"./ElevationContext.js";import A from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as V,mixinColorAndOpacity as k,computeObjectScale as W,computeObjectRotation as q}from"./graphicUtils.js";import{ApplyRendererDiffResult as H}from"./interfaces.js";import{LoadStatus as N}from"./Loadable.js";import{makeLodResources as $,fillEstimatedMinScreenSpaceRadius as Z}from"./lodResourceUtils.js";import{fetch as J}from"./objectResourceUtils.js";import{placePointOnGeometry as K,extendPointGraphicElevationContext as Q}from"./pointUtils.js";import{isValidPrimitive as X,primitiveLodResources as Y}from"./primitiveObjectSymbolUtils.js";import{defaultSymbolLayerMemoryComplexity as ee}from"./symbolComplexity.js";import{initFastSymbolUpdatesState as te,updateFastSymbolUpdatesState as se,evaluateModelTransform as re,evaluateModelTransformScale as ie}from"../support/FastSymbolUpdates.js";import{CullFaceOptions as ae,VertexAttribute as oe}from"../../webgl-engine/lib/basicInterfaces.js";import{LodRenderer as ne}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{materialsFromLodResources as le,texturesFromLodResources as ce,geometriesFromLodResources as he,geometriesFromLodLevelResources as de}from"../../webgl-engine/lib/lodRendering/LodResources.js";import{DefaultMaterial as me}from"../../webgl-engine/materials/DefaultMaterial.js";class pe extends F{constructor(e,t,s,r){super(e,t,s,r),this._resources=null,this._optionalFields=new Array,this._instanceIndexToGraphicUid=new Map,this.hasLoadedPBRTextures=!1,this.ensureDrapedStatus(!1),this.hasLoadedPBRTextures=s.physicalBasedRenderingEnabled}getCachedSize(){const[e,s,r]=t(this._resources)?this._resources.symbolSize:[1,1,1];return{width:e,depth:s,height:r}}async doLoad(e){if(!this._drivenProperties.size){if(V(this.symbolLayer))throw new Error}const t=this.symbolLayer;if(this.isPrimitive){const s=t.resource?t.resource.primitive:B;this._resources=await this._createResourcesForPrimitive(s,e)}else this._resources=await this._createResourcesForUrl(t.resource.href,e);this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.complexity=this.computeComplexity()}get extentPadding(){return t(this._resources)?this._resources.extentPadding:0}get isPrimitive(){return!(this.symbolLayer.resource&&this.symbolLayer.resource.href)}get lodRenderer(){return s(this._resources,"lodRenderer")}_setMaterialTransparencyParams(e,t=s(this.symbolLayer,"material","color")){const r=this._getCombinedOpacity(t),i=r<1||this.needsDrivenTransparentPass;return e.transparent=i,e.opacity=r,e.cullFace=i?ae.None:ae.Back,e}async _createResourcesForPrimitive(s,i){if(!X(s))throw new Error(`Unknown object symbol primitive: ${s}`);const a=this.symbolLayer,n=E(T(s)),l=b(U(n)),c=b(G(l,a)),h=m(c),d=!1,p=!1,u={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,instanced:["transformation"],ambient:g,diffuse:g,slicePlaneEnabled:this._context.slicePlaneEnabled,sliceHighlightDisabled:!0,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive},y=u.usePBR;this._setMaterialTransparencyParams(u);const f=this.symbol;if("point-3d"===f.type&&f.verticalOffset){const{screenLength:e,minWorldLength:t,maxWorldLength:s}=f.verticalOffset;u.verticalOffset={screenLength:o(e),minWorldLength:t||0,maxWorldLength:null!=s?s:1/0},u.castShadows=!1}if(this._context.screenSizePerspectiveEnabled&&(u.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),this._drivenProperties.color)u.externalColor=R;else{const s=t(a.material)&&a.material.color,r=t(s)?e.toUnitRGBA(s):R;u.externalColor=r}this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(n,c,l,r)),this._fastUpdates.enabled?(Object.assign(u,this._fastUpdates.materialParameters),u.instanced.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(u.instanced.push("color"),this._optionalFields.push("color"));const _=new me(u),P=Y(s,_);if(!P)throw new Error(`Unknown object symbol primitive: ${s}`);const v=le(P).map((e=>({opacity:1,transparent:e.parameters.transparent}))),x=await this._createStageResources(P,y);return{lodResources:P,lodRenderer:await this._createLodRenderer(P,i),stageResources:x,symbolSize:c,extentPadding:h,isEsriSymbolResource:d,isWosr:p,originalMaterialParameters:v,physicalBasedRenderingEnabled:y,resourceBoundingBox:n,resourceSize:l,dispose:r,pivotOffset:r}}async _createResourcesForUrl(e,t){const i=["transformation"],a={materialParamsMixin:{instanced:i,slicePlaneEnabled:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(r,r,r,r)),this._fastUpdates.enabled?(Object.assign(a.materialParamsMixin,this._fastUpdates.materialParameters),i.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(i.push("color"),this._optionalFields.push("color"));const n=this.symbol;if("point-3d"===n.type&&n.verticalOffset){const{screenLength:e,minWorldLength:t,maxWorldLength:s}=n.verticalOffset;a.materialParamsMixin.verticalOffset={screenLength:o(e),minWorldLength:t||0,maxWorldLength:null!=s?s:1/0},a.materialParamsMixin.castShadows=!1}a.signal=t,a.usePBR=this._context.physicalBasedRenderingEnabled;const l=a.usePBR,c=await J(e,a),h=c.isEsriSymbolResource,d=c.isWosr,p=c.remove,u=$(c.lods);Z(u),u.levels.sort(((e,t)=>e.minScreenSpaceRadius-t.minScreenSpaceRadius)),u.levels[0].minScreenSpaceRadius=Math.min(2,u.levels[0].minScreenSpaceRadius);const y=this._context,f=this.symbolLayer.material,_=this._getExternalColorParameters(f),g=s(this.symbolLayer,"material","color"),P=this._getCombinedOpacity(g,{hasIntrinsicColor:!0}),v=this.needsDrivenTransparentPass,x=le(u),R=le(u).map((e=>({opacity:e.parameters.opacity||1,transparent:e.parameters.transparent})));x.forEach((e=>{const t=e.parameters;e.setParameters(_);const s=t.opacity*P,r=s<1||v||t.transparent;e.setParameters({opacity:s,transparent:r}),y.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:y.sharedResources.screenSizePerspectiveSettings})}));const L=c.referenceBoundingBox,S=b(U(L)),C=b(u.levels[0].pivotOffset),E=b(G(S,this.symbolLayer)),w=m(E);se(this._fastUpdates,this._context.renderer,this._fastVisualVariableConvertOptions(L,E,S,C))&&x.forEach((e=>e.setParameters(this._fastUpdates.materialParameters)));const j=await this._createStageResources(u,l);return{lodResources:u,lodRenderer:await this._createLodRenderer(u,t),stageResources:j,symbolSize:E,extentPadding:w,isEsriSymbolResource:h,isWosr:d,originalMaterialParameters:R,physicalBasedRenderingEnabled:l,resourceBoundingBox:L,resourceSize:S,dispose:p,pivotOffset:C}}async _createStageResources(e,t){const s=this._context.stage,r=le(e);t!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged(),s.addMany(r);const i=ce(e);s.addMany(i),await s.load(i);const a=he(e);return s.addMany(a),{materials:r,textures:i,geometries:a}}async _createLodRenderer(e,t){const s=this._context.stage,r={layerUid:this._context.layer.uid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},i=this._fastUpdates.enabled?{applyTransform:(e,t,s)=>{e.getFeatureAttribute(t,_e),n(s,re(this._fastUpdates.materialParameters,_e,s))},scaleFactor:(e,t,s)=>(t.getFeatureAttribute(s,_e),ie(e,this._fastUpdates.materialParameters,_e))}:null,a=new ne(e,this._optionalFields,r,i);return a.slicePlaneEnabled=this._context.slicePlaneEnabled,await s.addRenderPlugin(a.slots,a,t),a}_getExternalColorParameters(s){const r={};return this._drivenProperties.color?r.externalColor=R:t(s)&&t(s.color)?r.externalColor=e.toUnitRGBA(s.color):(r.externalColor=R,r.colorMixMode="ignore"),r}destroy(){if(super.destroy(),t(this._resources)){const e=this._context.stage;e.removeRenderPlugin(this._resources.lodRenderer);const s=this._resources.stageResources;e.removeMany(s.materials),e.removeMany(s.textures),e.removeMany(s.geometries),t(this._resources.dispose)&&this._resources.dispose(),this._resources=null}}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const s=K(t.geometry);if(i(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const r=this.setGraphicElevationContext(t,new M),a=e.renderingInfo;return this._createAs3DShape(t,s,a,r,t.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(i(this._resources))return!0;const e=this._drivenProperties.opacity,t=!this.isPrimitive,r=this._resources.stageResources.materials,a=this._resources.originalMaterialParameters;for(let i=0;i<r.length;i++){const o=r[i],n=s(this.symbolLayer,"material","color"),l=a[i],c=this._getCombinedOpacity(n,{hasIntrinsicColor:t})*l.opacity,h=c<1||e||l.transparent;o.setParameters({opacity:c,transparent:h}),this.isPrimitive&&o.setParameters({cullFace:h?ae.None:ae.Back})}return!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,I)}slicePlaneEnabledChanged(){if(i(this._resources))return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(const e of this._resources.stageResources.materials)e.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(i(this._resources))return!0;const{stageResources:e,isWosr:t}=this._resources;for(const s of e.materials)this.isPrimitive?s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1!==this.hasLoadedPBRTextures||!0!==this._context.physicalBasedRenderingEnabled||(this.hasLoadedPBRTextures=!0,!1)}pixelRatioChanged(){return!0}applyRendererDiff(e,t){if(i(this._resources))return H.Recreate_Symbol;const{stageResources:{materials:s},lodRenderer:r,resourceBoundingBox:a,symbolSize:o,resourceSize:n,pivotOffset:l}=this._resources;for(const i in e.diff){if("visualVariables"!==i)return H.Recreate_Symbol;if(!se(this._fastUpdates,t,this._fastVisualVariableConvertOptions(a,o,n,l)))return H.Recreate_Symbol;for(const e of s)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}return H.Fast_Update}computeComplexity(){if(i(this._resources))return super.computeComplexity();return{primitivesPerFeature:de(this._resources.lodResources.levels[0]).reduce(((e,t)=>e+t.indices.get(oe.POSITION).length),0)/3,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:ee(this.symbol,this.symbolLayer)}}_hasLodRenderer(){return t(this._resources)}_createAs3DShape(e,s,r,a,o){if(!this._hasLodRenderer()||i(this._resources))return null;const n=this.getFastUpdateAttrValues(e),l=!this._fastUpdates.enabled&&this._hasPerInstanceColor()?k(r.color,r.opacity):null,c=this._context.clippingExtent;if(S(s,ue,this._context.elevationProvider.spatialReference),t(c)&&!w(c,ue))return null;const h=this._requiresTerrainElevation(a),d=this._computeGlobalTransform(s,a,fe,be),m=this._computeLocalTransform(this._resources,this.symbolLayer,r,ye),p=this._resources.lodRenderer.instanceData,u=p.addInstance();this._instanceIndexToGraphicUid.set(u,o),p.setLocalTransform(u,m,!1),p.setGlobalTransform(u,d),n&&p.setFeatureAttribute(u,n),l&&p.setColor(u,l);const y=new A(this,u,O,a);return h&&(y.alignedSampledElevation=be.sampledElevation),y.needsElevationUpdates=I(a.mode),Q(y,s,this._context.elevationProvider),y}_computeGlobalTransform(e,t,s,r){return z(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),ue[0]=e.x,ue[1]=e.y,ue[2]=r.z,C(e.spatialReference,ue,s,this._context.renderCoordsHelper.spatialReference),s}_computeLocalTransform(e,t,s,r){return l(r),this._applyObjectRotation(s,!1,r),this._applyObjectRotation(t,!0,r),this._applyObjectScale(e,s,r),this._applyAnchor(e,t,r),r}_applyObjectScale(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._drivenProperties.size&&t.size?t.size:e.symbolSize,i=W(r,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);1===i[0]&&1===i[1]&&1===i[2]||c(s,s,i)}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t)}updateGeometry(e,t){if(i(this._resources))return!0;const s=t&&K(t);if(i(s))return!1;const r=this.getGeometryElevationMode(t);return e.elevationContext.mode===r&&(this._computeGlobalTransform(s,e.elevationContext,fe,be),this._requiresTerrainElevation(e.elevationContext)&&(e.alignedSampledElevation=be.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(e.instanceIndex,fe,!0),Q(e,s,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!(t.heading||t.tilt||t.roll||t.width||t.height||t.depth||t.anchor||t.anchorPosition))return;if(i(this._resources))return;const s=(e,t,s)=>a(null!=e&&"complete"===e.type?e.newValue:t,s),r=s(t.heading,this.symbolLayer.heading,0),o=s(t.tilt,this.symbolLayer.tilt,0),n=s(t.roll,this.symbolLayer.roll,0),l=s(t.width,this.symbolLayer.width,void 0),c=s(t.height,this.symbolLayer.height,void 0),h=s(t.depth,this.symbolLayer.depth,void 0),d=s(t.anchor,this.symbolLayer.anchor,void 0),m=s(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;const p={heading:r,tilt:o,roll:n,anchor:d,anchorPosition:m},u=this._resources;this.loadStatus===N.LOADED&&e.symbolLayerStatePatches.push((()=>{u.symbolSize=b(G(u.resourceSize,{width:l,height:c,depth:h,isPrimitive:this.symbolLayer.isPrimitive}))})),e.graphics3DGraphicPatches.push(((e,t)=>{const s=this._computeLocalTransform(u,p,t,ye),r=e.instanceIndex;u.lodRenderer.instanceData.setLocalTransform(r,s,!0)}))}_preparePatchColor(s,r){if(!r.material||"partial"!==r.material.type)return;const a=r.material.diff;if(!a.color||"complete"!==a.color.type||null==a.color.newValue||null==a.color.oldValue)return;const o=a.color.newValue,n=t(o)?e.toUnitRGBA(o):R;delete a.color;const l=this._resources;i(l)||s.graphics3DGraphicPatches.push((e=>{let t;this._hasPerInstanceColor()?(l.lodRenderer.instanceData.setColor(e.instanceIndex,n),t=this._setMaterialTransparencyParams({},o)):t=this._setMaterialTransparencyParams({externalColor:n},o);for(const s of l.stageResources.materials)s.setParameters(t)}))}_requiresTerrainElevation(e){return"absolute-height"!==e.mode}_applyObjectRotation(e,t,s){if(!(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation&&t))return q(e.heading,e.tilt,e.roll,s)}_computeAnchor(e,s,r){const i=x();switch(r.anchor){case"center":u(i,j(e)),p(i,i);break;case"top":{const t=j(e);_(i,-t[0],-t[1],-e[5]);break}case"bottom":{const t=j(e);_(i,-t[0],-t[1],-e[2]);break}case"relative":{const t=j(e),s=U(e),a=r.anchorPosition,o=a?v(a.x,a.y,a.z):P;y(i,s,o),f(i,i,t),p(i,i);break}default:t(s)?p(i,s):u(i,P)}return i}_applyAnchor(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._computeAnchor(e.resourceBoundingBox,e.pivotOffset,t);r&&h(s,s,r)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(e,s,r,i){const a=t(e)?b(U(e)):g,o=t(e)?this._computeAnchor(e,i,this.symbolLayer):P,n=this._context.renderCoordsHelper.unitInMeters,l=W(t(s)?s:void 0,s,r,n),c=v(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return{modelSize:a,symbolSize:t(s)?s:g,unitInMeters:n,transformation:{anchor:o,scale:l,rotation:c}}}}const ue=x(),ye=d(),fe=d(),_e=L(),be=new D;export{pe as Graphics3DObjectSymbolLayer};
5
+ import e from"../../../../Color.js";import{isSome as t,get as s,none as r,isNone as i,unwrapOr as a}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{c as n,i as l,h as c,j as h}from"../../../../chunks/mat4.js";import{c as d}from"../../../../chunks/mat4f64.js";import{l as m,o as p,g as u,D as y,b as f,s as _}from"../../../../chunks/vec3.js";import{d as b,O as g,Z as P,f as v,c as x}from"../../../../chunks/vec3f64.js";import{O as R,c as L}from"../../../../chunks/vec4f64.js";import{projectPointToVector as S,computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection.js";import{create as E,size as w,containsPoint as U,center as j}from"../../../../geometry/support/aaBoundingBox.js";import{defaultPrimitive as B}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{objectSymbolLayerPrimitiveBoundingBox as T,objectSymbolLayerSizeWithResourceSize as G}from"../../../../symbols/support/symbolLayerUtils3D.js";import{perLodInstanceElevationAligner as O}from"./ElevationAligners.js";import{needsElevationUpdates3D as I,evaluateElevationInfoAtPoint as z,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{ElevationContext as M}from"./ElevationContext.js";import A from"./Graphics3DLodInstanceGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as V,mixinColorAndOpacity as k,computeObjectScale as W,computeObjectRotation as q}from"./graphicUtils.js";import{ApplyRendererDiffResult as H}from"./interfaces.js";import{LoadStatus as N}from"./Loadable.js";import{makeLodResources as $,fillEstimatedMinScreenSpaceRadius as Z}from"./lodResourceUtils.js";import{fetch as J}from"./objectResourceUtils.js";import{placePointOnGeometry as K,extendPointGraphicElevationContext as Q}from"./pointUtils.js";import{isValidPrimitive as X,primitiveLodResources as Y}from"./primitiveObjectSymbolUtils.js";import{defaultSymbolLayerMemoryComplexity as ee}from"./symbolComplexity.js";import{initFastSymbolUpdatesState as te,updateFastSymbolUpdatesState as se,evaluateModelTransform as re,evaluateModelTransformScale as ie}from"../support/FastSymbolUpdates.js";import{CullFaceOptions as ae}from"../../webgl-engine/lib/basicInterfaces.js";import{VertexAttribute as oe}from"../../webgl-engine/lib/VertexAttribute.js";import{LodRenderer as ne}from"../../webgl-engine/lib/lodRendering/LodRenderer.js";import{materialsFromLodResources as le,texturesFromLodResources as ce,geometriesFromLodResources as he,geometriesFromLodLevelResources as de}from"../../webgl-engine/lib/lodRendering/LodResources.js";import{DefaultMaterial as me}from"../../webgl-engine/materials/DefaultMaterial.js";class pe extends F{constructor(e,t,s,r){super(e,t,s,r),this._resources=null,this._optionalFields=new Array,this._instanceIndexToGraphicUid=new Map,this.hasLoadedPBRTextures=!1,this.ensureDrapedStatus(!1),this.hasLoadedPBRTextures=s.physicalBasedRenderingEnabled}getCachedSize(){const[e,s,r]=t(this._resources)?this._resources.symbolSize:[1,1,1];return{width:e,depth:s,height:r}}async doLoad(e){if(!this._drivenProperties.size){if(V(this.symbolLayer))throw new Error}const t=this.symbolLayer;if(this.isPrimitive){const s=t.resource?t.resource.primitive:B;this._resources=await this._createResourcesForPrimitive(s,e)}else this._resources=await this._createResourcesForUrl(t.resource.href,e);this.layerOpacityChanged(),this.slicePlaneEnabledChanged(),this.physicalBasedRenderingChanged(),this.complexity=this.computeComplexity()}get extentPadding(){return t(this._resources)?this._resources.extentPadding:0}get isPrimitive(){return!(this.symbolLayer.resource&&this.symbolLayer.resource.href)}get lodRenderer(){return s(this._resources,"lodRenderer")}_setMaterialTransparencyParams(e,t=s(this.symbolLayer,"material","color")){const r=this._getCombinedOpacity(t),i=r<1||this.needsDrivenTransparentPass;return e.transparent=i,e.opacity=r,e.cullFace=i?ae.None:ae.Back,e}async _createResourcesForPrimitive(s,i){if(!X(s))throw new Error(`Unknown object symbol primitive: ${s}`);const a=this.symbolLayer,n=E(T(s)),l=b(w(n)),c=b(G(l,a)),h=m(c),d=!1,p=!1,u={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,instanced:["transformation"],ambient:g,diffuse:g,slicePlaneEnabled:this._context.slicePlaneEnabled,sliceHighlightDisabled:!0,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive},y=u.usePBR;this._setMaterialTransparencyParams(u);const f=this.symbol;if("point-3d"===f.type&&f.verticalOffset){const{screenLength:e,minWorldLength:t,maxWorldLength:s}=f.verticalOffset;u.verticalOffset={screenLength:o(e),minWorldLength:t||0,maxWorldLength:null!=s?s:1/0},u.castShadows=!1}if(this._context.screenSizePerspectiveEnabled&&(u.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),this._drivenProperties.color)u.externalColor=R;else{const s=t(a.material)&&a.material.color,r=t(s)?e.toUnitRGBA(s):R;u.externalColor=r}this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(n,c,l,r)),this._fastUpdates.enabled?(Object.assign(u,this._fastUpdates.materialParameters),u.instanced.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(u.instanced.push("color"),this._optionalFields.push("color"));const _=new me(u),P=Y(s,_);if(!P)throw new Error(`Unknown object symbol primitive: ${s}`);const v=le(P).map((e=>({opacity:1,transparent:e.parameters.transparent}))),x=await this._createStageResources(P,y);return{lodResources:P,lodRenderer:await this._createLodRenderer(P,i),stageResources:x,symbolSize:c,extentPadding:h,isEsriSymbolResource:d,isWosr:p,originalMaterialParameters:v,physicalBasedRenderingEnabled:y,resourceBoundingBox:n,resourceSize:l,dispose:r,pivotOffset:r}}async _createResourcesForUrl(e,t){const i=["transformation"],a={materialParamsMixin:{instanced:i,slicePlaneEnabled:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};this._fastUpdates=te(this._context.renderer,this._fastVisualVariableConvertOptions(r,r,r,r)),this._fastUpdates.enabled?(Object.assign(a.materialParamsMixin,this._fastUpdates.materialParameters),i.push("featureAttribute"),this._optionalFields.push("featureAttribute")):this._hasPerInstanceColor()&&(i.push("color"),this._optionalFields.push("color"));const n=this.symbol;if("point-3d"===n.type&&n.verticalOffset){const{screenLength:e,minWorldLength:t,maxWorldLength:s}=n.verticalOffset;a.materialParamsMixin.verticalOffset={screenLength:o(e),minWorldLength:t||0,maxWorldLength:null!=s?s:1/0},a.materialParamsMixin.castShadows=!1}a.signal=t,a.usePBR=this._context.physicalBasedRenderingEnabled;const l=a.usePBR,c=await J(e,a),h=c.isEsriSymbolResource,d=c.isWosr,p=c.remove,u=$(c.lods);Z(u),u.levels.sort(((e,t)=>e.minScreenSpaceRadius-t.minScreenSpaceRadius)),u.levels[0].minScreenSpaceRadius=Math.min(2,u.levels[0].minScreenSpaceRadius);const y=this._context,f=this.symbolLayer.material,_=this._getExternalColorParameters(f),g=s(this.symbolLayer,"material","color"),P=this._getCombinedOpacity(g,{hasIntrinsicColor:!0}),v=this.needsDrivenTransparentPass,x=le(u),R=le(u).map((e=>({opacity:e.parameters.opacity||1,transparent:e.parameters.transparent})));x.forEach((e=>{const t=e.parameters;e.setParameters(_);const s=t.opacity*P,r=s<1||v||t.transparent;e.setParameters({opacity:s,transparent:r}),y.screenSizePerspectiveEnabled&&e.setParameters({screenSizePerspective:y.sharedResources.screenSizePerspectiveSettings})}));const L=c.referenceBoundingBox,S=b(w(L)),C=b(u.levels[0].pivotOffset),E=b(G(S,this.symbolLayer)),U=m(E);se(this._fastUpdates,this._context.renderer,this._fastVisualVariableConvertOptions(L,E,S,C))&&x.forEach((e=>e.setParameters(this._fastUpdates.materialParameters)));const j=await this._createStageResources(u,l);return{lodResources:u,lodRenderer:await this._createLodRenderer(u,t),stageResources:j,symbolSize:E,extentPadding:U,isEsriSymbolResource:h,isWosr:d,originalMaterialParameters:R,physicalBasedRenderingEnabled:l,resourceBoundingBox:L,resourceSize:S,dispose:p,pivotOffset:C}}async _createStageResources(e,t){const s=this._context.stage,r=le(e);t!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged(),s.addMany(r);const i=ce(e);s.addMany(i),await s.load(i);const a=he(e);return s.addMany(a),{materials:r,textures:i,geometries:a}}async _createLodRenderer(e,t){const s=this._context.stage,r={layerUid:this._context.layer.uid,graphicUid:e=>this._instanceIndexToGraphicUid.get(e),notifyGraphicGeometryChanged:e=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(e)),notifyGraphicVisibilityChanged:e=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(e))},i=this._fastUpdates.enabled?{applyTransform:(e,t,s)=>{e.getFeatureAttribute(t,_e),n(s,re(this._fastUpdates.materialParameters,_e,s))},scaleFactor:(e,t,s)=>(t.getFeatureAttribute(s,_e),ie(e,this._fastUpdates.materialParameters,_e))}:null,a=new ne(e,this._optionalFields,r,i);return a.slicePlaneEnabled=this._context.slicePlaneEnabled,await s.addRenderPlugin(a.slots,a,t),a}_getExternalColorParameters(s){const r={};return this._drivenProperties.color?r.externalColor=R:t(s)&&t(s.color)?r.externalColor=e.toUnitRGBA(s.color):(r.externalColor=R,r.colorMixMode="ignore"),r}destroy(){if(super.destroy(),t(this._resources)){const e=this._context.stage;e.removeRenderPlugin(this._resources.lodRenderer);const s=this._resources.stageResources;e.removeMany(s.materials),e.removeMany(s.textures),e.removeMany(s.geometries),t(this._resources.dispose)&&this._resources.dispose(),this._resources=null}}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;const s=K(t.geometry);if(i(s))return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const r=this.setGraphicElevationContext(t,new M),a=e.renderingInfo;return this._createAs3DShape(t,s,a,r,t.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){if(i(this._resources))return!0;const e=this._drivenProperties.opacity,t=!this.isPrimitive,r=this._resources.stageResources.materials,a=this._resources.originalMaterialParameters;for(let i=0;i<r.length;i++){const o=r[i],n=s(this.symbolLayer,"material","color"),l=a[i],c=this._getCombinedOpacity(n,{hasIntrinsicColor:t})*l.opacity,h=c<1||e||l.transparent;o.setParameters({opacity:c,transparent:h}),this.isPrimitive&&o.setParameters({cullFace:h?ae.None:ae.Back})}return!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,I)}slicePlaneEnabledChanged(){if(i(this._resources))return!0;this._resources.lodRenderer.slicePlaneEnabled=this._context.slicePlaneEnabled;for(const e of this._resources.stageResources.materials)e.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled});return!0}physicalBasedRenderingChanged(){if(i(this._resources))return!0;const{stageResources:e,isWosr:t}=this._resources;for(const s of e.materials)this.isPrimitive?s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}):t||s.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!1});return!1!==this.hasLoadedPBRTextures||!0!==this._context.physicalBasedRenderingEnabled||(this.hasLoadedPBRTextures=!0,!1)}pixelRatioChanged(){return!0}applyRendererDiff(e,t){if(i(this._resources))return H.Recreate_Symbol;const{stageResources:{materials:s},lodRenderer:r,resourceBoundingBox:a,symbolSize:o,resourceSize:n,pivotOffset:l}=this._resources;for(const i in e.diff){if("visualVariables"!==i)return H.Recreate_Symbol;if(!se(this._fastUpdates,t,this._fastVisualVariableConvertOptions(a,o,n,l)))return H.Recreate_Symbol;for(const e of s)e.setParameters(this._fastUpdates.materialParameters);r.notifyShaderTransformationChanged()}return H.Fast_Update}computeComplexity(){if(i(this._resources))return super.computeComplexity();return{primitivesPerFeature:de(this._resources.lodResources.levels[0]).reduce(((e,t)=>e+t.indices.get(oe.POSITION).length),0)/3,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:ee(this.symbol,this.symbolLayer)}}_hasLodRenderer(){return t(this._resources)}_createAs3DShape(e,s,r,a,o){if(!this._hasLodRenderer()||i(this._resources))return null;const n=this.getFastUpdateAttrValues(e),l=!this._fastUpdates.enabled&&this._hasPerInstanceColor()?k(r.color,r.opacity):null,c=this._context.clippingExtent;if(S(s,ue,this._context.elevationProvider.spatialReference),t(c)&&!U(c,ue))return null;const h=this._requiresTerrainElevation(a),d=this._computeGlobalTransform(s,a,fe,be),m=this._computeLocalTransform(this._resources,this.symbolLayer,r,ye),p=this._resources.lodRenderer.instanceData,u=p.addInstance();this._instanceIndexToGraphicUid.set(u,o),p.setLocalTransform(u,m,!1),p.setGlobalTransform(u,d),n&&p.setFeatureAttribute(u,n),l&&p.setColor(u,l);const y=new A(this,u,O,a);return h&&(y.alignedSampledElevation=be.sampledElevation),y.needsElevationUpdates=I(a.mode),Q(y,s,this._context.elevationProvider),y}_computeGlobalTransform(e,t,s,r){return z(e,this._context.elevationProvider,t,this._context.renderCoordsHelper,r),ue[0]=e.x,ue[1]=e.y,ue[2]=r.z,C(e.spatialReference,ue,s,this._context.renderCoordsHelper.spatialReference),s}_computeLocalTransform(e,t,s,r){return l(r),this._applyObjectRotation(s,!1,r),this._applyObjectRotation(t,!0,r),this._applyObjectScale(e,s,r),this._applyAnchor(e,t,r),r}_applyObjectScale(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._drivenProperties.size&&t.size?t.size:e.symbolSize,i=W(r,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);1===i[0]&&1===i[1]&&1===i[2]||c(s,s,i)}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchTransform(e,t),this._preparePatchColor(e,t)}updateGeometry(e,t){if(i(this._resources))return!0;const s=t&&K(t);if(i(s))return!1;const r=this.getGeometryElevationMode(t);return e.elevationContext.mode===r&&(this._computeGlobalTransform(s,e.elevationContext,fe,be),this._requiresTerrainElevation(e.elevationContext)&&(e.alignedSampledElevation=be.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(e.instanceIndex,fe,!0),Q(e,s,this._context.elevationProvider),!0)}_preparePatchTransform(e,t){if(!(t.heading||t.tilt||t.roll||t.width||t.height||t.depth||t.anchor||t.anchorPosition))return;if(i(this._resources))return;const s=(e,t,s)=>a(null!=e&&"complete"===e.type?e.newValue:t,s),r=s(t.heading,this.symbolLayer.heading,0),o=s(t.tilt,this.symbolLayer.tilt,0),n=s(t.roll,this.symbolLayer.roll,0),l=s(t.width,this.symbolLayer.width,void 0),c=s(t.height,this.symbolLayer.height,void 0),h=s(t.depth,this.symbolLayer.depth,void 0),d=s(t.anchor,this.symbolLayer.anchor,void 0),m=s(t.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete t.heading,delete t.tilt,delete t.roll,delete t.width,delete t.height,delete t.depth,delete t.anchor,delete t.anchorPosition;const p={heading:r,tilt:o,roll:n,anchor:d,anchorPosition:m},u=this._resources;this.loadStatus===N.LOADED&&e.symbolLayerStatePatches.push((()=>{u.symbolSize=b(G(u.resourceSize,{width:l,height:c,depth:h,isPrimitive:this.symbolLayer.isPrimitive}))})),e.graphics3DGraphicPatches.push(((e,t)=>{const s=this._computeLocalTransform(u,p,t,ye),r=e.instanceIndex;u.lodRenderer.instanceData.setLocalTransform(r,s,!0)}))}_preparePatchColor(s,r){if(!r.material||"partial"!==r.material.type)return;const a=r.material.diff;if(!a.color||"complete"!==a.color.type||null==a.color.newValue||null==a.color.oldValue)return;const o=a.color.newValue,n=t(o)?e.toUnitRGBA(o):R;delete a.color;const l=this._resources;i(l)||s.graphics3DGraphicPatches.push((e=>{let t;this._hasPerInstanceColor()?(l.lodRenderer.instanceData.setColor(e.instanceIndex,n),t=this._setMaterialTransparencyParams({},o)):t=this._setMaterialTransparencyParams({externalColor:n},o);for(const s of l.stageResources.materials)s.setParameters(t)}))}_requiresTerrainElevation(e){return"absolute-height"!==e.mode}_applyObjectRotation(e,t,s){if(!(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation&&t))return q(e.heading,e.tilt,e.roll,s)}_computeAnchor(e,s,r){const i=x();switch(r.anchor){case"center":u(i,j(e)),p(i,i);break;case"top":{const t=j(e);_(i,-t[0],-t[1],-e[5]);break}case"bottom":{const t=j(e);_(i,-t[0],-t[1],-e[2]);break}case"relative":{const t=j(e),s=w(e),a=r.anchorPosition,o=a?v(a.x,a.y,a.z):P;y(i,s,o),f(i,i,t),p(i,i);break}default:t(s)?p(i,s):u(i,P)}return i}_applyAnchor(e,t,s){if(this._fastUpdates.enabled&&this._fastUpdates.requiresShaderTransformation)return;const r=this._computeAnchor(e.resourceBoundingBox,e.pivotOffset,t);r&&h(s,s,r)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(e,s,r,i){const a=t(e)?b(w(e)):g,o=t(e)?this._computeAnchor(e,i,this.symbolLayer):P,n=this._context.renderCoordsHelper.unitInMeters,l=W(t(s)?s:void 0,s,r,n),c=v(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return{modelSize:a,symbolSize:t(s)?s:g,unitInMeters:n,transformation:{anchor:o,scale:l,rotation:c}}}}const ue=x(),ye=d(),fe=d(),_e=L(),be=new D;export{pe as Graphics3DObjectSymbolLayer};
@@ -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 e from"../../../../Color.js";import{isSome as t,get as i,isNone as r,unwrap as n}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{e as a}from"../../../../chunks/earcut.js";import{I as s}from"../../../../chunks/mat4f64.js";import{s as l}from"../../../../chunks/vec4.js";import{create as u,empty as c,expandWithBuffer as p,intersectsClippingArea as h,expandWithAABB as d}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewMat3f64 as m,BufferViewVec3f64 as _,BufferViewVec4f as y}from"../../../../geometry/support/buffer/BufferView.js";import{SymbolUpdateType as g,elevationModeChangeUpdateType as f,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{ElevationContext as v}from"./ElevationContext.js";import E from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as M}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as x}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as O}from"./graphicUtils.js";import{parseCapType as D,createGeometry as S,RemoveDuplicateStartEnd as A}from"./lineUtils.js";import{geometryAsPolygon as U,geometryToRenderInfo as P,createColorGeometry as C,geometryToRenderInfoDraped as w}from"./polygonUtils.js";import{createMaterial as G,uvElevationAligner as T}from"../support/patternUtils.js";import{createMapSpaceUVCoords as j,createMapSpaceUVCoordsDraped as R}from"../support/uvUtils.js";import{VertexAttribute as B}from"../../webgl-engine/lib/basicInterfaces.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as F}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as V}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as I}from"../../webgl-engine/materials/RibbonLineMaterial.js";const H=["polyline","polygon","extent"];class W extends x{constructor(e,t,i,r){super(e,t,i,r),this._needsUV=!1,this._hasOutline=!1}async doLoad(){}_ensureMaterials(){this._ensureFillMaterial(),this._ensureOutlineMaterial()}_ensureFillMaterial(){if(t(this._material))return;const e=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacityAndColor(e);this._material=G(this.symbolLayer,{color:r,transparent:r[3]<1||this.needsDrivenTransparentPass,polygonOffset:!1,vertexColors:!0,writeLinearDepth:!0,slicePlaneEnabled:this._context.slicePlaneEnabled},{isDraped:this.draped}),this._needsUV=this._material instanceof V,this._context.stage.add(this._material)}_ensureOutlineMaterial(){const e=this.symbolLayer.outline;if(t(this._outlineMaterial)||!this._isValidOutline(e))return;this._hasOutline=!0;const i=t=>{const i=F(e.pattern);return new I({width:t,color:this._getOutlineColor(),polygonOffset:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:i,stippleScaleWithLineWidth:!0,cap:D(e.patternCap||"butt")})};this._outlineMaterial=i(o(e.size)),this._context.stage.add(this._outlineMaterial)}_isValidOutline(e){return t(e)&&e.size&&e.size>0&&t(e.color)&&(r(e.pattern)||"style"!==e.pattern.type||"none"!==e.pattern.style)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null,this._context.stage.remove(this._outlineMaterial),this._outlineMaterial=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,H,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t,new v);return this.ensureDrapedStatus("on-the-ground"===r.mode),this._ensureMaterials(),this.draped?this._createAsOverlay(t,i):this._createAs3DShape(t,i,r)}layerOpacityChanged(){if(t(this._material)){const e=this._material.parameters.color,t=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacity(t);this._material.setParameters({color:[e[0],e[1],e[2],r],transparent:r<1||this.needsDrivenTransparentPass})}if(t(this._outlineMaterial)){const e=this._outlineMaterial.parameters.color;this._outlineMaterial.setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}return!0}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,n=f(W.elevationModeChangeTypes,i,r);if(n!==g.UPDATE)return n;const o=b(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){if(t(this._material)&&this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),t(this._outlineMaterial)){const e={slicePlaneEnabled:this._context.slicePlaneEnabled};this._outlineMaterial.setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_createAs3DShape(e,t,i){const n=U(e.geometry);if(r(n))return null;z.renderData=P(n,this._context.elevationProvider,this._context.renderCoordsHelper,i),z.color=t;const o=z.renderData.position.length/3;if(this._needsUV&&(z.uvMapSpace=new Float32Array(4*o),z.boundingRect=new Float64Array(9*o)),z.outNum=0,z.outGeometries=[],z.outTransforms=[],z.outMaterials=[],this._createAs3DShapeFill(z),this._hasOutline&&this._createAs3DShapeOutline(z),this._logGeometryCreationWarnings(z.renderData,n.rings,"rings","FillSymbol3DLayer"),0===z.outNum)return null;this._needsUV&&j(y.fromTypedArray(z.uvMapSpace),_.fromTypedArray(z.renderData.position),this._context.renderCoordsHelper,m.fromTypedArray(z.boundingRect));const a=new L({geometries:z.outGeometries,materials:z.outMaterials,transformations:z.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:e.uid}}),s=new M(this,a,z.outGeometries,null,null,T,i);return s.alignedSampledElevation=z.renderData.sampledElevation,s.needsElevationUpdates=b(i.mode),s}_createAs3DShapeFill(e){const i=e.renderData.polygons;for(const{position:r,mapPosition:o,holeIndices:l,index:u,count:d}of i){if(t(this._context.clippingExtent)&&(c(k),p(k,o),!h(k,this._context.clippingExtent)))continue;const i=a(o,l,3);if(0===i.length)continue;const m=new Uint32Array(i),_=C({indices:m,attributeData:{position:r,color:e.color,mapPosition:o,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*u*e.uvMapSpace.BYTES_PER_ELEMENT,4*d):null,boundingRect:this._needsUV?new Float64Array(e.boundingRect.buffer,9*u*e.boundingRect.BYTES_PER_ELEMENT,9*d):null}});e.outGeometries.push(_),e.outMaterials.push(n(this._material)),e.outTransforms.push(s),e.outNum++}}_createAs3DShapeOutline(e){if(!this._hasOutline)return;const i=e.renderData.outlines;for(let r=0;r<i.length;++r){const{mapPosition:o,position:a}=i[r];if(t(this._context.clippingExtent)&&(c(k),p(k,o),!h(k,this._context.clippingExtent)))continue;const l=S({overlayInfo:null,removeDuplicateStartEnd:A.REMOVE,attributeData:{position:a,mapPosition:o}}),u=l.vertexAttributes.get(B.POSITION);u.data===a&&(u.data=new Float64Array(a)),e.outGeometries.push(l),e.outMaterials.push(n(this._outlineMaterial)),e.outTransforms.push(s),e.outNum++}}_createAsOverlay(e,i){const o=U(e.geometry);if(r(o))return null;n(this._material).renderPriority=this._renderPriority+this._renderPriorityStep/2,t(this._outlineMaterial)&&(this._outlineMaterial.renderPriority=this._renderPriority),Y.renderData=w(o,this._context.overlaySR),Y.color=i;const a=Y.renderData.position.length/3;return this._needsUV&&(Y.uvMapSpace=new Float32Array(4*a)),Y.outNum=0,Y.outGeometries=[],Y.outBoundingBox=c(),Y.layerUid=this._context.layer.uid,Y.graphicsUid=e.uid,this._createAsOverlayFill(Y),this._hasOutline&&this._createAsOverlayOutline(Y),this._logGeometryCreationWarnings(Y.renderData,o.rings,"rings","FillSymbol3DLayer"),0===Y.outNum?null:(this._needsUV&&R(y.fromTypedArray(Y.uvMapSpace),_.fromTypedArray(Y.renderData.position),this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode),Y.outNum>0?new E(this,Y.outGeometries,Y.outBoundingBox):null)}_createAsOverlayFill(e){const t=e.renderData.polygons;for(const{position:i,holeIndices:r,index:o,count:s}of t){if(c(k),p(k,i),!h(k,this._context.clippingExtent))continue;const t=a(i,r,3);if(0===t.length)continue;d(e.outBoundingBox,k);const u=new Uint32Array(t),m=C({indices:u,attributeData:{position:i,color:e.color,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*o*e.uvMapSpace.BYTES_PER_ELEMENT,4*s):null}}),_=new N(m,n(this._material),{layerUid:e.layerUid,graphicUid:e.graphicsUid}),y=k;l(_.boundingSphere,.5*(y[0]+y[3]),.5*(y[1]+y[4]),0,.5*Math.sqrt((y[3]-y[0])*(y[3]-y[0])+(y[4]-y[1])*(y[4]-y[1]))),e.outGeometries.push(_),e.outNum++}}_createAsOverlayOutline(e){if(!this._hasOutline)return;const t=e.renderData.outlines;for(let i=0;i<t.length;++i){const{position:r}=t[i];if(c(k),p(k,r),!h(k,this._context.clippingExtent))continue;d(e.outBoundingBox,k);const o=S({overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:A.REMOVE,attributeData:{position:r}}),a=new N(o,n(this._outlineMaterial),{layerUid:e.layerUid,graphicUid:e.graphicsUid}),s=k;l(a.boundingSphere,.5*(s[0]+s[3]),.5*(s[1]+s[4]),0,.5*Math.sqrt((s[3]-s[0])*(s[3]-s[0])+(s[4]-s[1])*(s[4]-s[1]))),e.outGeometries.push(a),e.outNum++}}_getOutlineOpacity(){const e=i(this.symbolLayer,"outline","color");return(this.draped?1:this._getLayerOpacity())*(t(e)?e.a:0)}_getOutlineColor(){const r=i(this.symbolLayer,"outline","color"),n=this._getOutlineOpacity();return O(t(r)?e.toUnitRGB(r):null,n)}get test(){return{createAsOverlay:(e,t)=>this._createAsOverlay(e,t),createAs3DShape:(e,t,i)=>this._createAs3DShape(e,t,i)}}}W.elevationModeChangeTypes={definedChanged:g.RECREATE,staysOnTheGround:g.NONE,onTheGroundChanged:g.RECREATE};const k=u(),z={renderData:null,color:null,uvMapSpace:null,boundingRect:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null},Y={renderData:null,color:null,uvMapSpace:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};export{W as Graphics3DPolygonFillSymbolLayer,W as default};
5
+ import e from"../../../../Color.js";import{isSome as t,get as i,isNone as r,unwrap as n}from"../../../../core/maybe.js";import{pt2px as o}from"../../../../core/screenUtils.js";import{e as a}from"../../../../chunks/earcut.js";import{I as s}from"../../../../chunks/mat4f64.js";import{s as l}from"../../../../chunks/vec4.js";import{create as u,empty as p,expandWithBuffer as c,intersectsClippingArea as h,expandWithAABB as d}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewMat3f64 as m,BufferViewVec3f64 as _,BufferViewVec4f as y}from"../../../../geometry/support/buffer/BufferView.js";import{SymbolUpdateType as g,elevationModeChangeUpdateType as f,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{ElevationContext as v}from"./ElevationContext.js";import E from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as x}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as O}from"./graphicUtils.js";import{parseCapType as D,createGeometry as S,RemoveDuplicateStartEnd as A}from"./lineUtils.js";import{geometryAsPolygon as U,geometryToRenderInfo as P,createColorGeometry as C,geometryToRenderInfoDraped as w}from"./polygonUtils.js";import{createMaterial as G,uvElevationAligner as T}from"../support/patternUtils.js";import{createMapSpaceUVCoords as j,createMapSpaceUVCoordsDraped as R}from"../support/uvUtils.js";import{Object3D as B}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as L}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as N}from"../../webgl-engine/lib/VertexAttribute.js";import{getStipplePatternForLinePattern as V}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as F}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as I}from"../../webgl-engine/materials/RibbonLineMaterial.js";const H=["polyline","polygon","extent"];class W extends M{constructor(e,t,i,r){super(e,t,i,r),this._needsUV=!1,this._hasOutline=!1}async doLoad(){}_ensureMaterials(){this._ensureFillMaterial(),this._ensureOutlineMaterial()}_ensureFillMaterial(){if(t(this._material))return;const e=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacityAndColor(e);this._material=G(this.symbolLayer,{color:r,transparent:r[3]<1||this.needsDrivenTransparentPass,polygonOffset:!1,vertexColors:!0,writeLinearDepth:!0,slicePlaneEnabled:this._context.slicePlaneEnabled},{isDraped:this.draped}),this._needsUV=this._material instanceof F,this._context.stage.add(this._material)}_ensureOutlineMaterial(){const e=this.symbolLayer.outline;if(t(this._outlineMaterial)||!this._isValidOutline(e))return;this._hasOutline=!0;const i=t=>{const i=V(e.pattern);return new I({width:t,color:this._getOutlineColor(),polygonOffset:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:i,stippleScaleWithLineWidth:!0,cap:D(e.patternCap||"butt")})};this._outlineMaterial=i(o(e.size)),this._context.stage.add(this._outlineMaterial)}_isValidOutline(e){return t(e)&&e.size&&e.size>0&&t(e.color)&&(r(e.pattern)||"style"!==e.pattern.type||"none"!==e.pattern.style)}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null,this._context.stage.remove(this._outlineMaterial),this._outlineMaterial=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,H,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t,new v);return this.ensureDrapedStatus("on-the-ground"===r.mode),this._ensureMaterials(),this.draped?this._createAsOverlay(t,i):this._createAs3DShape(t,i,r)}layerOpacityChanged(){if(t(this._material)){const e=this._material.parameters.color,t=i(this.symbolLayer,"material","color"),r=this._getCombinedOpacity(t);this._material.setParameters({color:[e[0],e[1],e[2],r],transparent:r<1||this.needsDrivenTransparentPass})}if(t(this._outlineMaterial)){const e=this._outlineMaterial.parameters.color;this._outlineMaterial.setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}return!0}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,n=f(W.elevationModeChangeTypes,i,r);if(n!==g.UPDATE)return n;const o=b(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){if(t(this._material)&&this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),t(this._outlineMaterial)){const e={slicePlaneEnabled:this._context.slicePlaneEnabled};this._outlineMaterial.setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_createAs3DShape(e,t,i){const n=U(e.geometry);if(r(n))return null;z.renderData=P(n,this._context.elevationProvider,this._context.renderCoordsHelper,i),z.color=t;const o=z.renderData.position.length/3;if(this._needsUV&&(z.uvMapSpace=new Float32Array(4*o),z.boundingRect=new Float64Array(9*o)),z.outNum=0,z.outGeometries=[],z.outTransforms=[],z.outMaterials=[],this._createAs3DShapeFill(z),this._hasOutline&&this._createAs3DShapeOutline(z),this._logGeometryCreationWarnings(z.renderData,n.rings,"rings","FillSymbol3DLayer"),0===z.outNum)return null;this._needsUV&&j(y.fromTypedArray(z.uvMapSpace),_.fromTypedArray(z.renderData.position),this._context.renderCoordsHelper,m.fromTypedArray(z.boundingRect));const a=new B({geometries:z.outGeometries,materials:z.outMaterials,transformations:z.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:e.uid}}),s=new x(this,a,z.outGeometries,null,null,T,i);return s.alignedSampledElevation=z.renderData.sampledElevation,s.needsElevationUpdates=b(i.mode),s}_createAs3DShapeFill(e){const i=e.renderData.polygons;for(const{position:r,mapPosition:o,holeIndices:l,index:u,count:d}of i){if(t(this._context.clippingExtent)&&(p(k),c(k,o),!h(k,this._context.clippingExtent)))continue;const i=a(o,l,3);if(0===i.length)continue;const m=new Uint32Array(i),_=C({indices:m,attributeData:{position:r,color:e.color,mapPosition:o,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*u*e.uvMapSpace.BYTES_PER_ELEMENT,4*d):null,boundingRect:this._needsUV?new Float64Array(e.boundingRect.buffer,9*u*e.boundingRect.BYTES_PER_ELEMENT,9*d):null}});e.outGeometries.push(_),e.outMaterials.push(n(this._material)),e.outTransforms.push(s),e.outNum++}}_createAs3DShapeOutline(e){if(!this._hasOutline)return;const i=e.renderData.outlines;for(let r=0;r<i.length;++r){const{mapPosition:o,position:a}=i[r];if(t(this._context.clippingExtent)&&(p(k),c(k,o),!h(k,this._context.clippingExtent)))continue;const l=S({overlayInfo:null,removeDuplicateStartEnd:A.REMOVE,attributeData:{position:a,mapPosition:o}}),u=l.vertexAttributes.get(N.POSITION);u.data===a&&(u.data=new Float64Array(a)),e.outGeometries.push(l),e.outMaterials.push(n(this._outlineMaterial)),e.outTransforms.push(s),e.outNum++}}_createAsOverlay(e,i){const o=U(e.geometry);if(r(o))return null;n(this._material).renderPriority=this._renderPriority+this._renderPriorityStep/2,t(this._outlineMaterial)&&(this._outlineMaterial.renderPriority=this._renderPriority),Y.renderData=w(o,this._context.overlaySR),Y.color=i;const a=Y.renderData.position.length/3;return this._needsUV&&(Y.uvMapSpace=new Float32Array(4*a)),Y.outNum=0,Y.outGeometries=[],Y.outBoundingBox=p(),Y.layerUid=this._context.layer.uid,Y.graphicsUid=e.uid,this._createAsOverlayFill(Y),this._hasOutline&&this._createAsOverlayOutline(Y),this._logGeometryCreationWarnings(Y.renderData,o.rings,"rings","FillSymbol3DLayer"),0===Y.outNum?null:(this._needsUV&&R(y.fromTypedArray(Y.uvMapSpace),_.fromTypedArray(Y.renderData.position),this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode),Y.outNum>0?new E(this,Y.outGeometries,Y.outBoundingBox):null)}_createAsOverlayFill(e){const t=e.renderData.polygons;for(const{position:i,holeIndices:r,index:o,count:s}of t){if(p(k),c(k,i),!h(k,this._context.clippingExtent))continue;const t=a(i,r,3);if(0===t.length)continue;d(e.outBoundingBox,k);const u=new Uint32Array(t),m=C({indices:u,attributeData:{position:i,color:e.color,uvMapSpace:this._needsUV?new Float32Array(e.uvMapSpace.buffer,4*o*e.uvMapSpace.BYTES_PER_ELEMENT,4*s):null}}),_=new L(m,n(this._material),{layerUid:e.layerUid,graphicUid:e.graphicsUid}),y=k;l(_.boundingSphere,.5*(y[0]+y[3]),.5*(y[1]+y[4]),0,.5*Math.sqrt((y[3]-y[0])*(y[3]-y[0])+(y[4]-y[1])*(y[4]-y[1]))),e.outGeometries.push(_),e.outNum++}}_createAsOverlayOutline(e){if(!this._hasOutline)return;const t=e.renderData.outlines;for(let i=0;i<t.length;++i){const{position:r}=t[i];if(p(k),c(k,r),!h(k,this._context.clippingExtent))continue;d(e.outBoundingBox,k);const o=S({overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:A.REMOVE,attributeData:{position:r}}),a=new L(o,n(this._outlineMaterial),{layerUid:e.layerUid,graphicUid:e.graphicsUid}),s=k;l(a.boundingSphere,.5*(s[0]+s[3]),.5*(s[1]+s[4]),0,.5*Math.sqrt((s[3]-s[0])*(s[3]-s[0])+(s[4]-s[1])*(s[4]-s[1]))),e.outGeometries.push(a),e.outNum++}}_getOutlineOpacity(){const e=i(this.symbolLayer,"outline","color");return(this.draped?1:this._getLayerOpacity())*(t(e)?e.a:0)}_getOutlineColor(){const r=i(this.symbolLayer,"outline","color"),n=this._getOutlineOpacity();return O(t(r)?e.toUnitRGB(r):null,n)}get test(){return{createAsOverlay:(e,t)=>this._createAsOverlay(e,t),createAs3DShape:(e,t,i)=>this._createAs3DShape(e,t,i)}}}W.elevationModeChangeTypes={definedChanged:g.RECREATE,staysOnTheGround:g.NONE,onTheGroundChanged:g.RECREATE};const k=u(),z={renderData:null,color:null,uvMapSpace:null,boundingRect:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null},Y={renderData:null,color:null,uvMapSpace:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};export{W as Graphics3DPolygonFillSymbolLayer,W 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{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import s from"../../../../core/Collection.js";import r from"../../../../core/Handles.js";import{isSome as a,destroyMaybe as o,isNone as n}from"../../../../core/maybe.js";import{isAbortError as c}from"../../../../core/promiseUtils.js";import{init as p}from"../../../../core/watchUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as d}from"../../../../core/accessorSupport/diffUtils.js";import u from"../../../../layers/Layer.js";import{hydrateGraphic as g}from"../../../../layers/graphics/hydratedFeatures.js";import m from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as y}from"./constants.js";import{Graphics3DCore as f}from"./Graphics3DCore.js";import b from"./Graphics3DElevationAlignment.js";import{Graphics3DObjectStates as j}from"./Graphics3DObjectStates.js";import w from"./Graphics3DScaleVisibility.js";import{enlargeExtent as C}from"./graphicUtils.js";import{UpdatePolicy as S,Object3DState as v}from"../../webgl-engine/lib/basicInterfaces.js";import{WatchUpdatingTracking as x}from"../../../support/WatchUpdatingTracking.js";let E=class extends i{constructor(t){super(t),this.type="graphics-3d",this.graphicsCore=null,this.elevationAlignment=new b,this.watchUpdatingTracking=new x,this.handles=new r,this.suspendResumeExtent=null}normalizeCtorArgs(t){let e=null;t.scaleVisibilityEnabled&&(delete(t={...t}).scaleVisibilityEnabled,e=new w);const i=new f({owner:t.owner,layer:t.layer,preferredUpdatePolicy:S.SYNC,graphicSymbolSupported:!0});return{...t,graphicsCore:i,scaleVisibility:e}}initialize(){const{layer:t,scaleVisibility:e}=this;a(e)&&"graphics"===t.type&&this.watchUpdatingTracking.add((()=>t.effectiveScaleRange),(()=>e.layerMinMaxScaleChangeHandler())),"graphics"===t.type&&this.watchUpdatingTracking.add((()=>t.elevationInfo),((t,e)=>{d(t,e)&&this.watchUpdatingTracking.addPromise(this.graphicsCore.elevationInfoChange())}))}async setup(){const t=(t,e,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(t,e,i);if(this.elevationAlignment.setup(this.owner,t,this.graphicsCore,this.view.elevationProvider),a(this.scaleVisibility)&&"effectiveScaleRange"in this.layer){const e=this.owner.view.basemapTerrain;this.scaleVisibility.setup(this.owner,this.layer,t,this.graphicsCore,e)}this._set("objectStates",new j(this.graphicsCore));try{await this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,objectStates:this.objectStates})}catch(e){if(c(e))return;throw e}this.destroyed||(this.handles.add(this.view.watch("clippingArea",(()=>this._updateClippingExtent()),!0)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles=o(this.handles),this.watchUpdatingTracking.destroy(),this._set("elevationAlignment",o(this.elevationAlignment)),this._set("scaleVisibility",o(this.scaleVisibility)),this._set("objectStates",o(this.objectStates)),this._set("graphicsCore",o(this.graphicsCore))}get suspended(){return!(!a(this.scaleVisibility)||!this.scaleVisibility.suspended)}get updating(){var t,e;return!!(null!=(t=this.graphicsCore)&&t.updating||a(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(e=this.watchUpdatingTracking)&&e.updating)}getGraphicFromGraphicUid(t){if(this.owner.loadedGraphics){const e=this.owner.loadedGraphics.find((e=>e.uid===t));if(e){const t=this.layer instanceof u?this.layer:null;return g(e,t)}}}whenGraphicBounds(t,e){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(t,e):Promise.reject()}computeAttachmentOrigin(t,e){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(t,e):null}getSymbolLayerSize(t,e){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(t,e):null}maskOccludee(t){const{set:e,handle:i}=this.objectStates.acquireSet(v.MaskOccludee,null);return this.objectStates.setUid(e,t.uid),i}highlight(t){if(t instanceof m)return V;if("number"==typeof t)return this.highlight([t]);if(t instanceof e)return this.highlight([t]);if(t instanceof s&&(t=t.toArray()),Array.isArray(t)&&t.length>0){if(t[0]instanceof e){const e=t.map((t=>t.uid)),{set:i,handle:s}=this.objectStates.acquireSet(v.Highlight,null);return this.objectStates.setUids(i,e),s}if("number"==typeof t[0]){const e=t,{set:i,handle:s}=this.objectStates.acquireSet(v.Highlight,null);return this.objectStates.setObjectIds(i,e),s}}return V}_updateClippingExtent(){const t=this.view.clippingArea;this.graphicsCore.setClippingExtent(t,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}_updateSuspendResumeExtent(){n(this.scaleVisibility)||(this.suspendResumeExtent=C(this.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.graphicsCore.extentPadding),this.scaleVisibility.setExtent(this.suspendResumeExtent))}_setupSuspendResumeExtent(){n(this.scaleVisibility)||(p(this.graphicsCore,"computedExtent",(t=>this._updateSuspendResumeExtent()),!0),this.graphicsCore.watch("extentPadding",(t=>this._updateSuspendResumeExtent())))}};t([h()],E.prototype,"type",void 0),t([h({constructOnly:!0})],E.prototype,"owner",void 0),t([h({constructOnly:!0})],E.prototype,"layer",void 0),t([h({readOnly:!0,aliasOf:"owner.view"})],E.prototype,"view",void 0),t([h({constructOnly:!0})],E.prototype,"graphicsCore",void 0),t([h({constructOnly:!0})],E.prototype,"scaleVisibility",void 0),t([h({readOnly:!0})],E.prototype,"elevationAlignment",void 0),t([h({readOnly:!0})],E.prototype,"objectStates",void 0),t([h({readOnly:!0})],E.prototype,"watchUpdatingTracking",void 0),t([h({readOnly:!0})],E.prototype,"suspended",null),t([h({readOnly:!0})],E.prototype,"updating",null),E=t([l("esri.views.3d.layers.graphics.GraphicsProcessor")],E);const V={remove(){},pause(){},resume(){}},A=E;export{A as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import i from"../../../../core/Collection.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{isSome as a,destroyMaybe as n,isNone as o}from"../../../../core/maybe.js";import{isAbortError as l}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as u}from"../../../../core/accessorSupport/diffUtils.js";import g from"../../../../layers/Layer.js";import{hydrateGraphic as y}from"../../../../layers/graphics/hydratedFeatures.js";import{getRenderingInfo as m,getRenderingInfoAsync as f}from"../../../../renderers/support/renderingInfoUtils.js";import b from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as C}from"./constants.js";import{Graphics3DCore as j}from"./Graphics3DCore.js";import S from"./Graphics3DElevationAlignment.js";import{Graphics3DObjectStates as v}from"./Graphics3DObjectStates.js";import w from"./Graphics3DScaleVisibility.js";import{enlargeExtent as G}from"./graphicUtils.js";import{UpdatePolicy as x,Object3DState as E}from"../../webgl-engine/lib/basicInterfaces.js";let V=class extends s{constructor(e){super(e),this.type="graphics-3d",this.graphicsCore=null,this.elevationAlignment=new S,this.suspendResumeExtent=null}normalizeCtorArgs(e){let t=null;return e.scaleVisibilityEnabled&&(delete(e={...e}).scaleVisibilityEnabled,t=new w),{...e,scaleVisibility:t}}initialize(){const e=new j({owner:this,layer:this.owner.layer,preferredUpdatePolicy:x.SYNC,graphicSymbolSupported:!0});this._set("graphicsCore",e);const{layer:t,scaleVisibility:i}=this;a(i)&&"graphics"===t.type&&this.updatingHandles.add((()=>t.effectiveScaleRange),(()=>i.layerMinMaxScaleChangeHandler())),"graphics"===t.type&&this.updatingHandles.add((()=>t.elevationInfo),((e,t)=>{u(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}))}async setup(){const e=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.elevationAlignment.setup(this,e,this.graphicsCore,this.view.elevationProvider),a(this.scaleVisibility)&&"effectiveScaleRange"in this.layer){const t=this.owner.view.basemapTerrain;this.scaleVisibility.setup(this,this.layer,e,this.graphicsCore,t)}this._set("objectStates",new v(this.graphicsCore));try{await this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,objectStates:this.objectStates})}catch(t){if(l(t))return;throw t}this.destroyed||(this.handles.add(this.view.watch("clippingArea",(()=>this._updateClippingExtent()),!0)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("elevationAlignment",n(this.elevationAlignment)),this._set("scaleVisibility",n(this.scaleVisibility)),this._set("objectStates",n(this.objectStates)),this._set("graphicsCore",n(this.graphicsCore))}get layer(){return this.owner.layer}get view(){return this.owner.view}get scaleVisibilitySuspended(){return!(!a(this.scaleVisibility)||!this.scaleVisibility.suspended)}get suspended(){var e;return null!=(e=this.owner.suspended)&&e}get updating(){var e;return!!(null!=(e=this.graphicsCore)&&e.updating||a(this.scaleVisibility)&&this.scaleVisibility.updating||this.updatingHandles.updating)}get graphics3DGraphics(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){var e;return null!=(e=this.owner.fullOpacity)?e:1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get drapeSourceType(){return this.owner.drapeSourceType}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=m(e,{renderer:t,arcade:i});if(a(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return f(e,{renderer:t,arcade:i,...s})}getGraphicFromGraphicUid(e){if(this.owner.loadedGraphics){const t=this.owner.loadedGraphics.find((t=>t.uid===e));if(t){const e=this.layer instanceof g?this.layer:null;return y(t,e)}}}whenGraphicBounds(e,t){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(e,t):Promise.reject()}computeAttachmentOrigin(e,t){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(e,t):null}getSymbolLayerSize(e,t){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(e,t):null}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(E.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e){if(e instanceof b)return A;if("number"==typeof e)return this.highlight([e]);if(e instanceof t)return this.highlight([e]);if(e instanceof i&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(E.Highlight,null);return this.objectStates.setUids(i,t),s}if("number"==typeof e[0]){const t=e,{set:i,handle:s}=this.objectStates.acquireSet(E.Highlight,null);return this.objectStates.setObjectIds(i,t),s}}return A}_updateClippingExtent(){const e=this.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}_updateSuspendResumeExtent(){o(this.scaleVisibility)||(this.suspendResumeExtent=G(this.graphicsCore.computedExtent,this.suspendResumeExtent,C,this.graphicsCore.extentPadding),this.scaleVisibility.setExtent(this.suspendResumeExtent))}_setupSuspendResumeExtent(){o(this.scaleVisibility)||this.handles.add([p((()=>this.graphicsCore.computedExtent),(()=>this._updateSuspendResumeExtent()),c),p((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent()))])}};e([h()],V.prototype,"type",void 0),e([h({constructOnly:!0})],V.prototype,"owner",void 0),e([h()],V.prototype,"layer",null),e([h()],V.prototype,"view",null),e([h({constructOnly:!0})],V.prototype,"graphicsCore",void 0),e([h({constructOnly:!0})],V.prototype,"scaleVisibility",void 0),e([h({readOnly:!0})],V.prototype,"elevationAlignment",void 0),e([h({readOnly:!0})],V.prototype,"objectStates",void 0),e([h({readOnly:!0})],V.prototype,"scaleVisibilitySuspended",null),e([h()],V.prototype,"suspended",null),e([h({readOnly:!0})],V.prototype,"updating",null),e([h()],V.prototype,"loadedGraphics",null),e([h()],V.prototype,"fullOpacity",null),e([h()],V.prototype,"slicePlaneEnabled",null),e([h()],V.prototype,"drapeSourceType",null),e([h()],V.prototype,"updatePolicy",null),V=e([d("esri.views.3d.layers.graphics.GraphicsProcessor")],V);const A=r();export{V as GraphicsProcessor};
@@ -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 t,isNone as e}from"../../../../core/maybe.js";import{g as r,r as n,o}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{f as s}from"../../../../chunks/vec2f64.js";import{O as u,d as a}from"../../../../chunks/vec3f64.js";import{s as m}from"../../../../chunks/vec4.js";import{b as c,O as l}from"../../../../chunks/vec4f64.js";import{projectPoint as f}from"../../../../geometry/projection.js";import{isPoint as p,maximumDimension as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as g}from"../../../../geometry/support/aaBoundingRect.js";import{ringsCentroid as y}from"../../../../geometry/support/centroid.js";import{getPointOnPath as d,getPathLength as j}from"../../../../geometry/support/coordsUtils.js";import{makeDehydratedPoint as x}from"../../../../layers/graphics/dehydratedFeatures.js";import{isHydratedGeometry as b,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{VertexAttribute as w}from"../../webgl-engine/lib/basicInterfaces.js";function R(t,e){if("point"===t.type)return P(t,e,!1);if(b(t))switch(t.type){case"extent":return P(t.center,e,!1);case"polygon":return P(t.centroid,e,!1);case"polyline":return P(k(t),e,!0);case"mesh":return P(t.origin,e,!1)}else switch(t.type){case"extent":return P(A(t),e,!0);case"polygon":return P(M(t),e,!0);case"polyline":return P(k(t),e,!0)}}function k(t){const e=t.paths[0];if(!e||0===e.length)return null;const r=d(e,j(e)/2);return x(r[0],r[1],r[2],t.spatialReference)}function A(t){const e=isFinite(t.zmin);return x(.5*(t.xmax+t.xmin),.5*(t.ymax+t.ymin),e?.5*(t.zmax+t.zmin):void 0,t.spatialReference)}function M(t){const e=t.rings[0];if(!e||0===e.length)return null;const r=y(t.rings,t.hasZ);return x(r[0],r[1],r[2],t.spatialReference)}function P(t,e,r){const n=r?t:v(t);return e&&t?f(t,n,e)?n:null:n}function F(t,e,r,n=0){if(t){e||(e=g());const o=t;let i=.5*o.width*(r-1),s=.5*o.height*(r-1);return o.width<1e-7*o.height?i+=s/20:o.height<1e-7*o.width&&(s+=i/20),m(e,o.xmin-i-n,o.ymin-s-n,o.xmax+i+n,o.ymax+s+n),e}return null}function z(t,e){for(let r=0;r<t.geometries.length;++r){const n=t.geometries[r].getMutableAttribute(w.AUXPOS1);n&&n.data[3]!==e&&(n.data[3]=e,t.geometryVertexAttrsUpdated(t.geometryRecords[r]))}}function I(e,r){const n=c(l);return t(e)&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),t(r)?n[3]=r:t(e)&&e.length>3&&(n[3]=e[3]),n}function B(e,r,n,o,i,s=[0,0,0,0]){for(let u=0;u<3;++u)t(e)&&null!=e[u]?s[u]=e[u]:t(n)&&null!=n[u]?s[u]=n[u]:s[u]=i[u];return t(r)?s[3]=r:t(o)?s[3]=o:s[3]=i[3],s}function D(t=u,r,n,o=1){const i=new Array(3);if(e(r)||e(n))i[0]=1,i[1]=1,i[2]=1;else{let e,o=0;for(let s=2;s>=0;s--){const u=t[s];let a;const m=null!=u,c=0===s&&!e&&!m,l=n[s];"symbol-value"===u||c?a=0!==l?r[s]/l:1:m&&"proportional"!==u&&isFinite(u)&&(a=0!==l?u/l:1),null!=a&&(i[s]=a,e=a,o=Math.max(o,Math.abs(a)))}for(let t=2;t>=0;t--)null==i[t]?i[t]=e:0===i[t]&&(i[t]=.001*o)}for(let e=2;e>=0;e--)i[e]/=o;return a(i)}function O(t){return null!=t.isPrimitive}function U(t){return O(t)&&(t=[t.width,t.depth,t.height]),S(t)?null:"Symbol sizes may not be negative values"}function S(t){if(Array.isArray(t)){for(const e of t)if(!S(e))return!1;return!0}return null==t||t>=0}function V(t,e,s,u=i()){const a=t||0,m=e||0,c=s||0;return 0!==a&&r(u,u,-a/180*Math.PI),0!==m&&n(u,u,m/180*Math.PI),0!==c&&o(u,u,c/180*Math.PI),u}function X(t,e){return null!=e.minDemResolution?e.minDemResolution:p(t)?e.minDemResolutionForPoints:.01*h(t)}const Z={"bottom-left":s(0,0),bottom:s(.5,0),"bottom-right":s(1,0),left:s(0,.5),center:s(.5,.5),right:s(1,.5),"top-left":s(0,1),top:s(.5,1),"top-right":s(1,1)};export{R as computeCentroid,V as computeObjectRotation,D as computeObjectScale,X as demResolutionForBoundingBox,F as enlargeExtent,S as isValidSize,I as mixinColorAndOpacity,Z as namedAnchorToHUDMaterialAnchorPos,B as overrideColor,z as updateVertexAttributeAuxpos1w,U as validateSymbolLayerSize};
5
+ import{isSome as t,isNone as e}from"../../../../core/maybe.js";import{g as r,r as n,o}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{f as s}from"../../../../chunks/vec2f64.js";import{O as u,d as m}from"../../../../chunks/vec3f64.js";import{s as a}from"../../../../chunks/vec4.js";import{b as l,O as c}from"../../../../chunks/vec4f64.js";import{projectPoint as f}from"../../../../geometry/projection.js";import{isPoint as p,maximumDimension as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as g}from"../../../../geometry/support/aaBoundingRect.js";import{ringsCentroid as y}from"../../../../geometry/support/centroid.js";import{getPointOnPath as d,getPathLength as j}from"../../../../geometry/support/coordsUtils.js";import{makeDehydratedPoint as x}from"../../../../layers/graphics/dehydratedFeatures.js";import{isHydratedGeometry as b,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{VertexAttribute as w}from"../../webgl-engine/lib/VertexAttribute.js";function R(t,e){if("point"===t.type)return P(t,e,!1);if(b(t))switch(t.type){case"extent":return P(t.center,e,!1);case"polygon":return P(t.centroid,e,!1);case"polyline":return P(A(t),e,!0);case"mesh":return P(t.origin,e,!1)}else switch(t.type){case"extent":return P(k(t),e,!0);case"polygon":return P(M(t),e,!0);case"polyline":return P(A(t),e,!0)}}function A(t){const e=t.paths[0];if(!e||0===e.length)return null;const r=d(e,j(e)/2);return x(r[0],r[1],r[2],t.spatialReference)}function k(t){const e=isFinite(t.zmin);return x(.5*(t.xmax+t.xmin),.5*(t.ymax+t.ymin),e?.5*(t.zmax+t.zmin):void 0,t.spatialReference)}function M(t){const e=t.rings[0];if(!e||0===e.length)return null;const r=y(t.rings,t.hasZ);return x(r[0],r[1],r[2],t.spatialReference)}function P(t,e,r){const n=r?t:v(t);return e&&t?f(t,n,e)?n:null:n}function F(t,e,r,n=0){if(t){e||(e=g());const o=t;let i=.5*o.width*(r-1),s=.5*o.height*(r-1);return o.width<1e-7*o.height?i+=s/20:o.height<1e-7*o.width&&(s+=i/20),a(e,o.xmin-i-n,o.ymin-s-n,o.xmax+i+n,o.ymax+s+n),e}return null}function z(t,e){for(let r=0;r<t.geometries.length;++r){const n=t.geometries[r].getMutableAttribute(w.AUXPOS1);n&&n.data[3]!==e&&(n.data[3]=e,t.geometryVertexAttrsUpdated(t.geometryRecords[r]))}}function B(e,r){const n=l(c);return t(e)&&(n[0]=e[0],n[1]=e[1],n[2]=e[2]),t(r)?n[3]=r:t(e)&&e.length>3&&(n[3]=e[3]),n}function D(e,r,n,o,i,s=[0,0,0,0]){for(let u=0;u<3;++u)t(e)&&null!=e[u]?s[u]=e[u]:t(n)&&null!=n[u]?s[u]=n[u]:s[u]=i[u];return t(r)?s[3]=r:t(o)?s[3]=o:s[3]=i[3],s}function I(t=u,r,n,o=1){const i=new Array(3);if(e(r)||e(n))i[0]=1,i[1]=1,i[2]=1;else{let e,o=0;for(let s=2;s>=0;s--){const u=t[s];let m;const a=null!=u,l=0===s&&!e&&!a,c=n[s];"symbol-value"===u||l?m=0!==c?r[s]/c:1:a&&"proportional"!==u&&isFinite(u)&&(m=0!==c?u/c:1),null!=m&&(i[s]=m,e=m,o=Math.max(o,Math.abs(m)))}for(let t=2;t>=0;t--)null==i[t]?i[t]=e:0===i[t]&&(i[t]=.001*o)}for(let e=2;e>=0;e--)i[e]/=o;return m(i)}function O(t){return null!=t.isPrimitive}function U(t){return O(t)&&(t=[t.width,t.depth,t.height]),S(t)?null:"Symbol sizes may not be negative values"}function S(t){if(Array.isArray(t)){for(const e of t)if(!S(e))return!1;return!0}return null==t||t>=0}function V(t,e,s,u=i()){const m=t||0,a=e||0,l=s||0;return 0!==m&&r(u,u,-m/180*Math.PI),0!==a&&n(u,u,a/180*Math.PI),0!==l&&o(u,u,l/180*Math.PI),u}function X(t,e){return null!=e.minDemResolution?e.minDemResolution:p(t)?e.minDemResolutionForPoints:.01*h(t)}const Z={"bottom-left":s(0,0),bottom:s(.5,0),"bottom-right":s(1,0),left:s(0,.5),center:s(.5,.5),right:s(1,.5),"top-left":s(0,1),top:s(.5,1),"top-right":s(1,1)};export{R as computeCentroid,V as computeObjectRotation,I as computeObjectScale,X as demResolutionForBoundingBox,F as enlargeExtent,S as isValidSize,B as mixinColorAndOpacity,Z as namedAnchorToHUDMaterialAnchorPos,D as overrideColor,z as updateVertexAttributeAuxpos1w,U as validateSymbolLayerSize};
@@ -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{isNone as t,isSome as e,unwrapOr as o}from"../../../../core/maybe.js";import{slice as n}from"../../../../core/typedArrayUtil.js";import{d as r}from"../../../../chunks/vec2.js";import{s as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as a,lonLatToWebMercatorComparable as u}from"../../../../geometry/projection.js";import{getReferenceEllipsoid as c}from"../../../../geometry/projectionEllipsoid.js";import{CounterClockwiseMode as l,pathsToTriangulationInfo as p}from"../../../../geometry/support/triangulationUtils.js";import{ViewingMode as f}from"../../../ViewingMode.js";import{WHITE_UNIT as m}from"./constants.js";import{applyPerVertexElevationAlignment as E}from"./elevationAlignmentUtils.js";import{DRAPED_Z as h}from"../../terrain/OverlayRenderer.js";import{PrimitiveType as T,VertexAttribute as y}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as g}from"../../webgl-engine/lib/Geometry.js";import{C as A}from"../../../../chunks/RibbonLine.glsl.js";function O(t){const e=[],o=[];b(t,o,e);const n=o[0][1].data,r=e[0][1].length,i=new Uint16Array(r);return j(t,o,e),S(t,o,e,i),F(t,o,e,i),U(t,o,e,i),v(t,o,e,i),w(t,o,e,i),C(t,o,e,n),new g(o,e,T.Line)}function R(t,e,o,n){const r="polygon"===t.type?l.CCW_IS_HOLE:l.NONE,i="polygon"===t.type?t.rings:t.paths,{position:s,outlines:a}=p(i,t.hasZ,r),u=new Float64Array(s.length),c=E(s,t.spatialReference,0,u,0,s,0,s.length/3,e,o,n),f=null!=c;return{lines:f?I(a,s,u):[],projectionSuccess:f,sampledElevation:c}}function I(t,e,o){const n=new Array;for(const{index:r,count:i}of t){if(i<=1)continue;const t=3*r,s=t+3*i;n.push({position:e.subarray(t,s),mapPosition:o?o.subarray(t,s):void 0})}return n}function d(t,e){const o="polygon"===t.type?l.CCW_IS_HOLE:l.NONE,n="polygon"===t.type?t.rings:t.paths,{position:r,outlines:i}=p(n,!1,o),s=a(r,t.spatialReference,0,r,e,0,r.length/3);for(let a=2;a<r.length;a+=3)r[a]=h;return{lines:s?I(i,r):[],projectionSuccess:s}}function b(t,e,o){const{attributeData:{position:r},removeDuplicateStartEnd:i}=t,s=D(r)&&i===P.REMOVE,a=r.length/3-(s?1:0),u=new Uint32Array(2*(a-1)),c=s?n(r,0,r.length-3):r;let l=0;for(let n=0;n<a-1;n++)u[l++]=n,u[l++]=n+1;e.push([y.POSITION,{size:3,data:c,exclusive:s}]),o.push([y.POSITION,u])}function j(e,o,n){const r=e.attributeData.mapPosition;t(r)||(n.push([y.MAPPOS,n[0][1]]),o.push([y.MAPPOS,{size:3,data:r}]))}function S(t,n,r,i){if(e(t.attributeData.colorFeature))return;const s=t.attributeData.color;n.push([y.COLOR,{size:4,data:o(s,m)}]),r.push([y.COLOR,i])}function U(e,o,n,r){const i=e.attributeData.colorFeature;t(i)||(o.push([y.COLORFEATUREATTRIBUTE,{size:1,data:new Float32Array([i])}]),n.push([y.COLOR,r]))}function F(t,n,r,i){if(e(t.attributeData.sizeFeature))return;const s=t.attributeData.size;n.push([y.SIZE,{size:1,data:[o(s,1)]}]),r.push([y.SIZE,i])}function v(e,o,n,r){const i=e.attributeData.sizeFeature;t(i)||(o.push([y.SIZEFEATUREATTRIBUTE,{size:1,data:new Float32Array([i])}]),n.push([y.SIZEFEATUREATTRIBUTE,r]))}function w(e,o,n,r){const i=e.attributeData.opacityFeature;t(i)||(o.push([y.OPACITYFEATUREATTRIBUTE,{size:1,data:new Float32Array([i])}]),n.push([y.OPACITYFEATUREATTRIBUTE,r]))}function C(e,o,n,s){if(t(e.overlayInfo)||e.overlayInfo.renderCoordsHelper.viewingMode!==f.Global||!e.overlayInfo.spatialReference.isGeographic)return;const a=new Float64Array(s.length),l=c(e.overlayInfo.spatialReference);for(let t=0;t<a.length;t+=3)u(s,t,a,t,l);const p=s.length/3,m=new Float32Array(p+1);let E=z,h=N,T=0,g=0;i(E,a[g++],a[g++],a[g++]),m[0]=0;for(let t=1;t<p+1;++t)t===p&&(g=0),i(h,a[g++],a[g++],a[g++]),T+=r(E,h),m[t]=T,[E,h]=[h,E];o.push([y.DISTANCETOSTART,{size:1,data:m}]),n.push([y.DISTANCETOSTART,n[0][1]])}function D(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}var P;!function(t){t[t.KEEP=0]="KEEP",t[t.REMOVE=1]="REMOVE"}(P||(P={}));const z=s(),N=s();function L(t){switch(t){case"butt":return A.BUTT;case"square":return A.SQUARE;case"round":return A.ROUND;default:return null}}export{P as RemoveDuplicateStartEnd,O as createGeometry,R as geometryToRenderInfo,d as geometryToRenderInfoDraped,L as parseCapType};
5
+ import"../../../../core/has.js";import{isNone as t,isSome as e,unwrapOr as o}from"../../../../core/maybe.js";import{slice as n}from"../../../../core/typedArrayUtil.js";import{d as r}from"../../../../chunks/vec2.js";import{s as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as a,lonLatToWebMercatorComparable as u}from"../../../../geometry/projection.js";import{getReferenceEllipsoid as c}from"../../../../geometry/projectionEllipsoid.js";import{CounterClockwiseMode as l,pathsToTriangulationInfo as p}from"../../../../geometry/support/triangulationUtils.js";import{ViewingMode as f}from"../../../ViewingMode.js";import{WHITE_UNIT as m}from"./constants.js";import{applyPerVertexElevationAlignment as E}from"./elevationAlignmentUtils.js";import{DRAPED_Z as h}from"../../terrain/OverlayRenderer.js";import{PrimitiveType as T}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as g}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as y}from"../../webgl-engine/lib/VertexAttribute.js";import{C as A}from"../../../../chunks/RibbonLine.glsl.js";function O(t){const e=[],o=[];d(t,o,e);const n=o[0][1].data,r=e[0][1].length,i=new Uint16Array(r);return j(t,o,e),S(t,o,e,i),w(t,o,e,i),U(t,o,e,i),F(t,o,e,i),v(t,o,e,i),C(t,o,e,n),new g(o,e,T.Line)}function R(t,e,o,n){const r="polygon"===t.type?l.CCW_IS_HOLE:l.NONE,i="polygon"===t.type?t.rings:t.paths,{position:s,outlines:a}=p(i,t.hasZ,r),u=new Float64Array(s.length),c=E(s,t.spatialReference,0,u,0,s,0,s.length/3,e,o,n),f=null!=c;return{lines:f?b(a,s,u):[],projectionSuccess:f,sampledElevation:c}}function b(t,e,o){const n=new Array;for(const{index:r,count:i}of t){if(i<=1)continue;const t=3*r,s=t+3*i;n.push({position:e.subarray(t,s),mapPosition:o?o.subarray(t,s):void 0})}return n}function I(t,e){const o="polygon"===t.type?l.CCW_IS_HOLE:l.NONE,n="polygon"===t.type?t.rings:t.paths,{position:r,outlines:i}=p(n,!1,o),s=a(r,t.spatialReference,0,r,e,0,r.length/3);for(let a=2;a<r.length;a+=3)r[a]=h;return{lines:s?b(i,r):[],projectionSuccess:s}}function d(t,e,o){const{attributeData:{position:r},removeDuplicateStartEnd:i}=t,s=D(r)&&i===P.REMOVE,a=r.length/3-(s?1:0),u=new Uint32Array(2*(a-1)),c=s?n(r,0,r.length-3):r;let l=0;for(let n=0;n<a-1;n++)u[l++]=n,u[l++]=n+1;e.push([y.POSITION,{size:3,data:c,exclusive:s}]),o.push([y.POSITION,u])}function j(e,o,n){const r=e.attributeData.mapPosition;t(r)||(n.push([y.MAPPOS,n[0][1]]),o.push([y.MAPPOS,{size:3,data:r}]))}function S(t,n,r,i){if(e(t.attributeData.colorFeature))return;const s=t.attributeData.color;n.push([y.COLOR,{size:4,data:o(s,m)}]),r.push([y.COLOR,i])}function U(e,o,n,r){const i=e.attributeData.colorFeature;t(i)||(o.push([y.COLORFEATUREATTRIBUTE,{size:1,data:new Float32Array([i])}]),n.push([y.COLOR,r]))}function w(t,n,r,i){if(e(t.attributeData.sizeFeature))return;const s=t.attributeData.size;n.push([y.SIZE,{size:1,data:[o(s,1)]}]),r.push([y.SIZE,i])}function F(e,o,n,r){const i=e.attributeData.sizeFeature;t(i)||(o.push([y.SIZEFEATUREATTRIBUTE,{size:1,data:new Float32Array([i])}]),n.push([y.SIZEFEATUREATTRIBUTE,r]))}function v(e,o,n,r){const i=e.attributeData.opacityFeature;t(i)||(o.push([y.OPACITYFEATUREATTRIBUTE,{size:1,data:new Float32Array([i])}]),n.push([y.OPACITYFEATUREATTRIBUTE,r]))}function C(e,o,n,s){if(t(e.overlayInfo)||e.overlayInfo.renderCoordsHelper.viewingMode!==f.Global||!e.overlayInfo.spatialReference.isGeographic)return;const a=new Float64Array(s.length),l=c(e.overlayInfo.spatialReference);for(let t=0;t<a.length;t+=3)u(s,t,a,t,l);const p=s.length/3,m=new Float32Array(p+1);let E=z,h=N,T=0,g=0;i(E,a[g++],a[g++],a[g++]),m[0]=0;for(let t=1;t<p+1;++t)t===p&&(g=0),i(h,a[g++],a[g++],a[g++]),T+=r(E,h),m[t]=T,[E,h]=[h,E];o.push([y.DISTANCETOSTART,{size:1,data:m}]),n.push([y.DISTANCETOSTART,n[0][1]])}function D(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}var P;!function(t){t[t.KEEP=0]="KEEP",t[t.REMOVE=1]="REMOVE"}(P||(P={}));const z=s(),N=s();function L(t){switch(t){case"butt":return A.BUTT;case"square":return A.SQUARE;case"round":return A.ROUND;default:return null}}export{P as RemoveDuplicateStartEnd,O as createGeometry,R as geometryToRenderInfo,I as geometryToRenderInfoDraped,L as parseCapType};
@@ -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{adjustStaticAGOUrl as e}from"../../../../core/devEnvironmentUtils.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{a as o}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as u}from"../../../../chunks/mat4f64.js";import{m as n,f as l,E as c,l as m,n as d,e as f}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{empty as x,expandWithVec3 as g}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as h,BufferViewVec4f as b,BufferViewVec2f as R,BufferViewVec4u8 as v,BufferViewVec4u16 as B,BufferViewVec3u8 as M,BufferViewVec3u16 as y}from"../../../../geometry/support/buffer/BufferView.js";import{t as T,a as w,s as O}from"../../../../chunks/vec32.js";import{t as j,s as E}from"../../../../chunks/vec42.js";import{createBuffer as C}from"../../../../geometry/support/buffer/utils.js";import{DefaultLoadingContext as S}from"../../glTF/DefaultLoadingContext.js";import{load as N}from"../../glTF/loader.js";import{triangleFanToTriangles as A,triangleStripToTriangles as I,trianglesToTriangles as L}from"../../glTF/internal/indexUtils.js";import{load as F,processLoadResult as k}from"./wosrLoader.js";import{AlphaDiscardMode as P,CullFaceOptions as _,VertexAttribute as G}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as V}from"../../webgl-engine/lib/Geometry.js";import{Texture as z}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as D}from"../../webgl-engine/materials/DefaultMaterial.js";import{COLOR_GAMMA as U}from"../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{n as q}from"../../../../chunks/vec22.js";import{c as $,f as K}from"../../../../chunks/vec43.js";import{c as Q}from"../../../../chunks/vec33.js";async function H(s,o){const i=J(e(s));if("wosr"===i.fileType){const e=await(o.cache?o.cache.loadWOSR(i.url,o):F(i.url,o)),t=k(e,o);return{lods:[t],referenceBoundingBox:t.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const a=await(o.cache?o.cache.loadGLTF(i.url,o,o.usePBR):N(new S(o.streamDataRequester),i.url,o,o.usePBR)),u=t(a.model.meta,"ESRI_proxyEllipsoid");a.meta.isEsriSymbolResource&&r(u)&&-1!==a.meta.uri.indexOf("/RealisticTrees/")&&ee(a,u);const n=a.meta.isEsriSymbolResource?{usePBR:o.usePBR,isSchematic:!1,treeRendering:a.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:o.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},l={...o.materialParamsMixin,treeRendering:a.customMeta.esriTreeRendering};if(null!=i.specifiedLodIndex){const e=X(a,n,l,i.specifiedLodIndex);let t=e[0].boundingBox;if(0!==i.specifiedLodIndex){t=X(a,n,l,0)[0].boundingBox}return{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1,remove:a.remove}}const c=X(a,n,l);return{lods:c,referenceBoundingBox:c[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1,remove:a.remove}}function J(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(t)return{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function X(e,t,s,a){const u=e.model,n=i(),l=new Array,c=new Map,m=new Map;return u.lods.forEach(((e,i)=>{if(void 0!==a&&i!==a)return;const d={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:r(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:x()};l.push(d),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=u.materials.get(e.material),l=r(e.attributes.texCoord0),f=r(e.attributes.normal),p=Y(a.alphaMode);if(!c.has(i)){if(l){if(r(a.textureColor)&&!m.has(a.textureColor)){const e=u.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:p!==P.Opaque};m.set(a.textureColor,new z(e.data,t))}if(r(a.textureNormal)&&!m.has(a.textureNormal)){const e=u.textures.get(a.textureNormal);m.set(a.textureNormal,new z(e.data,e.parameters))}if(r(a.textureOcclusion)&&!m.has(a.textureOcclusion)){const e=u.textures.get(a.textureOcclusion);m.set(a.textureOcclusion,new z(e.data,e.parameters))}if(r(a.textureEmissive)&&!m.has(a.textureEmissive)){const e=u.textures.get(a.textureEmissive);m.set(a.textureEmissive,new z(e.data,e.parameters))}if(r(a.textureMetallicRoughness)&&!m.has(a.textureMetallicRoughness)){const e=u.textures.get(a.textureMetallicRoughness);m.set(a.textureMetallicRoughness,new z(e.data,e.parameters))}}const o=a.color[0]**(1/U),n=a.color[1]**(1/U),d=a.color[2]**(1/U),x=a.emissiveFactor[0]**(1/U),g=a.emissiveFactor[1]**(1/U),h=a.emissiveFactor[2]**(1/U),b=r(a.textureColor)&&l?m.get(a.textureColor):null;c.set(i,new D({...t,transparent:p===P.Blend,textureAlphaMode:p,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,n,d],ambient:[o,n,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?_.None:_.Back,vertexColors:!!e.attributes.color,vertexTangents:!!e.attributes.tangent,normals:f?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:r(b)?b.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:r(a.textureNormal)&&l?m.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:r(b)&&!!b.params.preMultiplyAlpha,occlusionTextureId:r(a.textureOcclusion)&&l?m.get(a.textureOcclusion).id:void 0,emissiveTextureId:r(a.textureEmissive)&&l?m.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:r(a.textureMetallicRoughness)&&l?m.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[x,g,h],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...s}))}const x=Z(e.indices||e.attributes.position.count,e.primitiveType),S=e.attributes.position.count,N=C(h,S);T(N,e.attributes.position,e.transform);const A=[[G.POSITION,{data:N.typedBuffer,size:N.elementCount,exclusive:!0}]],I=[[G.POSITION,x]];if(r(e.attributes.normal)){const t=C(h,S);o(n,e.transform),w(t,e.attributes.normal,n),A.push([G.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([G.NORMAL,x])}if(r(e.attributes.tangent)){const t=C(b,S);o(n,e.transform),j(t,e.attributes.tangent,n),A.push([G.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([G.TANGENT,x])}if(r(e.attributes.texCoord0)){const t=C(R,S);q(t,e.attributes.texCoord0),A.push([G.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([G.UV0,x])}if(r(e.attributes.color)){const t=C(v,S);if(4===e.attributes.color.elementCount)e.attributes.color instanceof b?E(t,e.attributes.color,255):e.attributes.color instanceof v?$(t,e.attributes.color):e.attributes.color instanceof B&&E(t,e.attributes.color,1/256);else{K(t,255,255,255,255);const r=new M(t.buffer,0,4);e.attributes.color instanceof h?O(r,e.attributes.color,255):e.attributes.color instanceof M?Q(r,e.attributes.color):e.attributes.color instanceof y&&O(r,e.attributes.color,1/256)}A.push([G.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([G.COLOR,x])}const L=new V(A,I);d.stageResources.geometries.push(L),d.stageResources.materials.push(c.get(i)),l&&(r(a.textureColor)&&d.stageResources.textures.push(m.get(a.textureColor)),r(a.textureNormal)&&d.stageResources.textures.push(m.get(a.textureNormal)),r(a.textureOcclusion)&&d.stageResources.textures.push(m.get(a.textureOcclusion)),r(a.textureEmissive)&&d.stageResources.textures.push(m.get(a.textureEmissive)),r(a.textureMetallicRoughness)&&d.stageResources.textures.push(m.get(a.textureMetallicRoughness))),d.numberOfVertices+=S;const F=L.boundingInfo;r(F)&&(g(d.boundingBox,F.getBBMin()),g(d.boundingBox,F.getBBMax()))}))})),l}function Y(e){switch(e){case"BLEND":return P.Blend;case"MASK":return P.Mask;case"OPAQUE":case null:case void 0:return P.Opaque}}function Z(e,t){switch(t){case W.TRIANGLES:return L(e);case W.TRIANGLE_STRIP:return I(e);case W.TRIANGLE_FAN:return A(e)}}function ee(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const i of o.parts){const o=i.attributes.normal;if(s(o))return;const x=i.attributes.position,g=x.count,b=p(),R=p(),B=p(),M=C(v,g),y=C(h,g),T=a(u(),i.transform);for(let s=0;s<g;s++){x.getVec(s,R),o.getVec(s,b),n(R,R,i.transform),l(B,R,t.center),c(B,B,t.radius);const a=B[2],u=m(B),p=Math.min(.45+.55*u*u,1);c(B,B,t.radius),n(B,B,T),d(B,B),r+1!==e.model.lods.length&&e.model.lods.length>1&&f(B,B,b,a>-1?.2:Math.min(-4*a-3.8,1)),y.setVec(s,B),M.set(s,0,255*p),M.set(s,1,255*p),M.set(s,2,255*p),M.set(s,3,255)}i.attributes.normal=y,i.attributes.color=M}}}export{H as fetch,X as gltfToEngineResources,J as parseUrl};
5
+ import{adjustStaticAGOUrl as e}from"../../../../core/devEnvironmentUtils.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{a as o}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as u}from"../../../../chunks/mat4f64.js";import{m as n,f as l,E as c,l as m,n as d,e as f}from"../../../../chunks/vec3.js";import{c as p}from"../../../../chunks/vec3f64.js";import{empty as x,expandWithVec3 as g}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as b,BufferViewVec4f as h,BufferViewVec2f as R,BufferViewVec4u8 as v,BufferViewVec4u16 as B,BufferViewVec3u8 as M,BufferViewVec3u16 as w}from"../../../../geometry/support/buffer/BufferView.js";import{t as y,a as T,s as j}from"../../../../chunks/vec32.js";import{t as O,s as E}from"../../../../chunks/vec42.js";import{createBuffer as C}from"../../../../geometry/support/buffer/utils.js";import{DefaultLoadingContext as S}from"../../glTF/DefaultLoadingContext.js";import{load as A}from"../../glTF/loader.js";import{triangleFanToTriangles as N,triangleStripToTriangles as I,trianglesToTriangles as L}from"../../glTF/internal/indexUtils.js";import{load as F,processLoadResult as k}from"./wosrLoader.js";import{AlphaDiscardMode as P,CullFaceOptions as V}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as _}from"../../webgl-engine/lib/Geometry.js";import{Texture as G}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as z}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as D}from"../../webgl-engine/materials/DefaultMaterial.js";import{COLOR_GAMMA as U}from"../../webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{n as q}from"../../../../chunks/vec22.js";import{c as $,f as K}from"../../../../chunks/vec43.js";import{c as Q}from"../../../../chunks/vec33.js";async function H(s,o){const i=J(e(s));if("wosr"===i.fileType){const e=await(o.cache?o.cache.loadWOSR(i.url,o):F(i.url,o)),t=k(e,o);return{lods:[t],referenceBoundingBox:t.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const a=await(o.cache?o.cache.loadGLTF(i.url,o,o.usePBR):A(new S(o.streamDataRequester),i.url,o,o.usePBR)),u=t(a.model.meta,"ESRI_proxyEllipsoid");a.meta.isEsriSymbolResource&&r(u)&&-1!==a.meta.uri.indexOf("/RealisticTrees/")&&ee(a,u);const n=a.meta.isEsriSymbolResource?{usePBR:o.usePBR,isSchematic:!1,treeRendering:a.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:o.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},l={...o.materialParamsMixin,treeRendering:a.customMeta.esriTreeRendering};if(null!=i.specifiedLodIndex){const e=X(a,n,l,i.specifiedLodIndex);let t=e[0].boundingBox;if(0!==i.specifiedLodIndex){t=X(a,n,l,0)[0].boundingBox}return{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1,remove:a.remove}}const c=X(a,n,l);return{lods:c,referenceBoundingBox:c[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1,remove:a.remove}}function J(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(t)return{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function X(e,t,s,a){const u=e.model,n=i(),l=new Array,c=new Map,m=new Map;return u.lods.forEach(((e,i)=>{if(void 0!==a&&i!==a)return;const d={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:r(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:x()};l.push(d),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=u.materials.get(e.material),l=r(e.attributes.texCoord0),f=r(e.attributes.normal),p=Y(a.alphaMode);if(!c.has(i)){if(l){if(r(a.textureColor)&&!m.has(a.textureColor)){const e=u.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:p!==P.Opaque};m.set(a.textureColor,new G(e.data,t))}if(r(a.textureNormal)&&!m.has(a.textureNormal)){const e=u.textures.get(a.textureNormal);m.set(a.textureNormal,new G(e.data,e.parameters))}if(r(a.textureOcclusion)&&!m.has(a.textureOcclusion)){const e=u.textures.get(a.textureOcclusion);m.set(a.textureOcclusion,new G(e.data,e.parameters))}if(r(a.textureEmissive)&&!m.has(a.textureEmissive)){const e=u.textures.get(a.textureEmissive);m.set(a.textureEmissive,new G(e.data,e.parameters))}if(r(a.textureMetallicRoughness)&&!m.has(a.textureMetallicRoughness)){const e=u.textures.get(a.textureMetallicRoughness);m.set(a.textureMetallicRoughness,new G(e.data,e.parameters))}}const o=a.color[0]**(1/U),n=a.color[1]**(1/U),d=a.color[2]**(1/U),x=a.emissiveFactor[0]**(1/U),g=a.emissiveFactor[1]**(1/U),b=a.emissiveFactor[2]**(1/U),h=r(a.textureColor)&&l?m.get(a.textureColor):null;c.set(i,new D({...t,transparent:p===P.Blend,textureAlphaMode:p,textureAlphaCutoff:a.alphaCutoff,diffuse:[o,n,d],ambient:[o,n,d],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?V.None:V.Back,vertexColors:!!e.attributes.color,vertexTangents:!!e.attributes.tangent,normals:f?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:r(h)?h.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:r(a.textureNormal)&&l?m.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:r(h)&&!!h.params.preMultiplyAlpha,occlusionTextureId:r(a.textureOcclusion)&&l?m.get(a.textureOcclusion).id:void 0,emissiveTextureId:r(a.textureEmissive)&&l?m.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:r(a.textureMetallicRoughness)&&l?m.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[x,g,b],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...s}))}const x=Z(e.indices||e.attributes.position.count,e.primitiveType),S=e.attributes.position.count,A=C(b,S);y(A,e.attributes.position,e.transform);const N=[[z.POSITION,{data:A.typedBuffer,size:A.elementCount,exclusive:!0}]],I=[[z.POSITION,x]];if(r(e.attributes.normal)){const t=C(b,S);o(n,e.transform),T(t,e.attributes.normal,n),N.push([z.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([z.NORMAL,x])}if(r(e.attributes.tangent)){const t=C(h,S);o(n,e.transform),O(t,e.attributes.tangent,n),N.push([z.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([z.TANGENT,x])}if(r(e.attributes.texCoord0)){const t=C(R,S);q(t,e.attributes.texCoord0),N.push([z.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([z.UV0,x])}if(r(e.attributes.color)){const t=C(v,S);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h?E(t,e.attributes.color,255):e.attributes.color instanceof v?$(t,e.attributes.color):e.attributes.color instanceof B&&E(t,e.attributes.color,1/256);else{K(t,255,255,255,255);const r=new M(t.buffer,0,4);e.attributes.color instanceof b?j(r,e.attributes.color,255):e.attributes.color instanceof M?Q(r,e.attributes.color):e.attributes.color instanceof w&&j(r,e.attributes.color,1/256)}N.push([z.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),I.push([z.COLOR,x])}const L=new _(N,I);d.stageResources.geometries.push(L),d.stageResources.materials.push(c.get(i)),l&&(r(a.textureColor)&&d.stageResources.textures.push(m.get(a.textureColor)),r(a.textureNormal)&&d.stageResources.textures.push(m.get(a.textureNormal)),r(a.textureOcclusion)&&d.stageResources.textures.push(m.get(a.textureOcclusion)),r(a.textureEmissive)&&d.stageResources.textures.push(m.get(a.textureEmissive)),r(a.textureMetallicRoughness)&&d.stageResources.textures.push(m.get(a.textureMetallicRoughness))),d.numberOfVertices+=S;const F=L.boundingInfo;r(F)&&(g(d.boundingBox,F.getBBMin()),g(d.boundingBox,F.getBBMax()))}))})),l}function Y(e){switch(e){case"BLEND":return P.Blend;case"MASK":return P.Mask;case"OPAQUE":case null:case void 0:return P.Opaque}}function Z(e,t){switch(t){case W.TRIANGLES:return L(e);case W.TRIANGLE_STRIP:return I(e);case W.TRIANGLE_FAN:return N(e)}}function ee(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const i of o.parts){const o=i.attributes.normal;if(s(o))return;const x=i.attributes.position,g=x.count,h=p(),R=p(),B=p(),M=C(v,g),w=C(b,g),y=a(u(),i.transform);for(let s=0;s<g;s++){x.getVec(s,R),o.getVec(s,h),n(R,R,i.transform),l(B,R,t.center),c(B,B,t.radius);const a=B[2],u=m(B),p=Math.min(.45+.55*u*u,1);c(B,B,t.radius),n(B,B,y),d(B,B),r+1!==e.model.lods.length&&e.model.lods.length>1&&f(B,B,h,a>-1?.2:Math.min(-4*a-3.8,1)),w.setVec(s,B),M.set(s,0,255*p),M.set(s,1,255*p),M.set(s,2,255*p),M.set(s,3,255)}i.attributes.normal=w,i.attributes.color=M}}}export{H as fetch,X as gltfToEngineResources,J as parseUrl};
@@ -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"../../../../geometry.js";import{isSome as t}from"../../../../core/maybe.js";import{projectBuffer as i}from"../../../../geometry/projection.js";import{pathsToTriangulationInfo as o,CounterClockwiseMode as e}from"../../../../geometry/support/triangulationUtils.js";import{applyPerVertexElevationAlignment as n}from"./elevationAlignmentUtils.js";import{DRAPED_Z as s}from"../../terrain/OverlayRenderer.js";import{VertexAttribute as a}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as r}from"../../webgl-engine/lib/Geometry.js";import u from"../../../../geometry/Extent.js";import p from"../../../../geometry/Polygon.js";function c(i){const o=[[a.POSITION,i.indices]],e=[[a.POSITION,{size:3,data:i.attributeData.position,exclusive:!0}]];return t(i.attributeData.color)&&(e.push([a.COLOR,{size:4,data:i.attributeData.color,exclusive:!0}]),o.push([a.COLOR,new Uint32Array(i.indices.length)])),t(i.attributeData.uvMapSpace)&&(e.push([a.UVMAPSPACE,{size:4,data:i.attributeData.uvMapSpace,exclusive:!0}]),o.push([a.UVMAPSPACE,i.indices])),t(i.attributeData.boundingRect)&&(e.push([a.BOUNDINGRECT,{size:9,data:i.attributeData.boundingRect,exclusive:!0}]),o.push([a.BOUNDINGRECT,i.indices])),t(i.attributeData.mapPosition)&&(e.push([a.MAPPOS,{size:3,data:i.attributeData.mapPosition,exclusive:!0}]),o.push([a.MAPPOS,i.indices])),new r(e,o)}function l(i){const o=[[a.POSITION,i.indices],[a.UV0,i.indices]],e=[[a.POSITION,{size:3,data:i.attributeData.position,exclusive:!0}],[a.UV0,{size:2,data:i.attributeData.uv0,exclusive:!0}]];return t(i.attributeData.mapPosition)&&(e.push([a.MAPPOS,{size:3,data:i.attributeData.mapPosition,exclusive:!0}]),o.push([a.MAPPOS,i.indices])),new r(e,o)}function m(t){switch(t.type){case"extent":if(t instanceof u)return p.fromExtent(t);break;case"polygon":return t}return null}function f(t,i,s,a){const r=o(t.rings,t.hasZ,e.CCW_IS_HOLE),u=new Float64Array(r.position.length),p=n(r.position,t.spatialReference,0,u,0,r.position,0,r.position.length/3,i,s,a),c=null!=p;return{position:r.position,mapPosition:u,polygons:b(r.polygons,r.position,u),outlines:g(r.outlines,r.position,u),projectionSuccess:c,sampledElevation:p}}function d(t,n){const a=o(t.rings,!1,e.CCW_IS_HOLE),r=i(a.position,t.spatialReference,0,a.position,n,0,a.position.length/3);for(let i=2;i<a.position.length;i+=3)a.position[i]=s;return{position:a.position,polygons:b(a.polygons,a.position),outlines:g(a.outlines,a.position),projectionSuccess:r}}function g(t,i,o){const e=new Array;for(const{index:n,count:s}of t){if(s<=1)continue;const t=3*n,a=t+3*s;e.push({index:n,count:s,position:i.subarray(t,a),mapPosition:o?o.subarray(t,a):void 0})}return e}function b(t,i,o){const e=new Array;for(const{index:n,count:s,holeIndices:a,pathLengths:r}of t){if(s<=1)continue;const t=3*n,u=t+3*s,p=a.map((t=>t-n));e.push({index:n,count:s,holeIndices:p,pathLengths:r,position:i.subarray(t,u),mapPosition:o?o.subarray(t,u):void 0})}return e}export{c as createColorGeometry,l as createWaterGeometry,m as geometryAsPolygon,f as geometryToRenderInfo,d as geometryToRenderInfoDraped};
5
+ import"../../../../geometry.js";import{isSome as t}from"../../../../core/maybe.js";import{projectBuffer as i}from"../../../../geometry/projection.js";import{pathsToTriangulationInfo as o,CounterClockwiseMode as e}from"../../../../geometry/support/triangulationUtils.js";import{applyPerVertexElevationAlignment as n}from"./elevationAlignmentUtils.js";import{DRAPED_Z as s}from"../../terrain/OverlayRenderer.js";import{Geometry as a}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as r}from"../../webgl-engine/lib/VertexAttribute.js";import u from"../../../../geometry/Extent.js";import p from"../../../../geometry/Polygon.js";function c(i){const o=[[r.POSITION,i.indices]],e=[[r.POSITION,{size:3,data:i.attributeData.position,exclusive:!0}]];return t(i.attributeData.color)&&(e.push([r.COLOR,{size:4,data:i.attributeData.color,exclusive:!0}]),o.push([r.COLOR,new Uint32Array(i.indices.length)])),t(i.attributeData.uvMapSpace)&&(e.push([r.UVMAPSPACE,{size:4,data:i.attributeData.uvMapSpace,exclusive:!0}]),o.push([r.UVMAPSPACE,i.indices])),t(i.attributeData.boundingRect)&&(e.push([r.BOUNDINGRECT,{size:9,data:i.attributeData.boundingRect,exclusive:!0}]),o.push([r.BOUNDINGRECT,i.indices])),t(i.attributeData.mapPosition)&&(e.push([r.MAPPOS,{size:3,data:i.attributeData.mapPosition,exclusive:!0}]),o.push([r.MAPPOS,i.indices])),new a(e,o)}function l(i){const o=[[r.POSITION,i.indices],[r.UV0,i.indices]],e=[[r.POSITION,{size:3,data:i.attributeData.position,exclusive:!0}],[r.UV0,{size:2,data:i.attributeData.uv0,exclusive:!0}]];return t(i.attributeData.mapPosition)&&(e.push([r.MAPPOS,{size:3,data:i.attributeData.mapPosition,exclusive:!0}]),o.push([r.MAPPOS,i.indices])),new a(e,o)}function m(t){switch(t.type){case"extent":if(t instanceof u)return p.fromExtent(t);break;case"polygon":return t}return null}function d(t,i,s,a){const r=o(t.rings,t.hasZ,e.CCW_IS_HOLE),u=new Float64Array(r.position.length),p=n(r.position,t.spatialReference,0,u,0,r.position,0,r.position.length/3,i,s,a),c=null!=p;return{position:r.position,mapPosition:u,polygons:b(r.polygons,r.position,u),outlines:g(r.outlines,r.position,u),projectionSuccess:c,sampledElevation:p}}function f(t,n){const a=o(t.rings,!1,e.CCW_IS_HOLE),r=i(a.position,t.spatialReference,0,a.position,n,0,a.position.length/3);for(let i=2;i<a.position.length;i+=3)a.position[i]=s;return{position:a.position,polygons:b(a.polygons,a.position),outlines:g(a.outlines,a.position),projectionSuccess:r}}function g(t,i,o){const e=new Array;for(const{index:n,count:s}of t){if(s<=1)continue;const t=3*n,a=t+3*s;e.push({index:n,count:s,position:i.subarray(t,a),mapPosition:o?o.subarray(t,a):void 0})}return e}function b(t,i,o){const e=new Array;for(const{index:n,count:s,holeIndices:a,pathLengths:r}of t){if(s<=1)continue;const t=3*n,u=t+3*s,p=a.map((t=>t-n));e.push({index:n,count:s,holeIndices:p,pathLengths:r,position:i.subarray(t,u),mapPosition:o?o.subarray(t,u):void 0})}return e}export{c as createColorGeometry,l as createWaterGeometry,m as geometryAsPolygon,d as geometryToRenderInfo,f as geometryToRenderInfoDraped};
@@ -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 e}from"../../../../core/compilerUtils.js";import{isNone as r,isSome as t}from"../../../../core/maybe.js";import{defaultPrimitive as a}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{primitiveLodResources as s}from"./primitiveObjectSymbolUtils.js";import{hasEdges as i}from"../support/edgeUtils.js";import{VertexAttribute as o}from"../../webgl-engine/lib/basicInterfaces.js";import{geometriesFromLodLevelResources as u}from"../../webgl-engine/lib/lodRendering/LodResources.js";const b={primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:{bytesPerFeature:0,bytesPerCoordinate:0,bytesPerFeatureLabel:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}}};function P(e){if("web-style"===e.type)return b;return d(e.symbolLayers.toArray().map((r=>m(e,r))))}function d(e){let t=0,a=0,s=0,i=!1,o=0;const u={bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}};for(const b of e)r(b)||(t+=b.primitivesPerFeature,a+=b.primitivesPerCoordinate,s+=b.drawCallsPerFeature,u.bytesPerFeature+=b.memory.bytesPerFeature,u.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.bytesPerCoordinate+=b.memory.bytesPerCoordinate,u.draped.bytesPerFeature+=b.memory.bytesPerFeature,u.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.draped.bytesPerCoordinate+=b.memory.bytesPerCoordinate,i=i||b.estimated,++o);return{primitivesPerFeature:t,primitivesPerCoordinate:a,drawCallsPerFeature:s,estimated:i,memory:u,numComplexities:o}}function y(e){const r=d(e);return r.numComplexities>0&&(r.primitivesPerFeature/=r.numComplexities,r.primitivesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.bytesPerCoordinate/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities,r.memory.draped.bytesPerCoordinate/=r.numComplexities),r}const n={};function m(r,s){const o=l(r,s),u=i(s)?2:0;switch(s.type){case"extrude":return{primitivesPerFeature:-4,primitivesPerCoordinate:4,drawCallsPerFeature:u,estimated:!1,memory:o};case"fill":return"mesh-3d"===r.type?{primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:u,estimated:!1,memory:o}:t(s.outline)&&s.outline.size>0?{primitivesPerFeature:-4,primitivesPerCoordinate:3,drawCallsPerFeature:0,estimated:!1,memory:o}:{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"water":return{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"line":return{primitivesPerFeature:-2,primitivesPerCoordinate:2,drawCallsPerFeature:0,estimated:!1,memory:o};case"object":if(s.resource&&s.resource.href)return{primitivesPerFeature:16,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:o};return{...F(s.resource&&s.resource.primitive||a),memory:o};case"path":{const r=3,t=3,a=10;let i=0,u=0;switch(s.profile){case"circle":i=a;break;case"quad":i=4;break;default:return void e(s.profile)}switch(s.join){case"round":u=r;break;case"miter":case"bevel":u=1;break;default:return void e(s.join)}const b=2*i,P=i*u*2;let d=-2*P-b;switch(s.cap){case"none":break;case"butt":case"square":d+=2*(i-1);break;case"round":d+=2*(i*(t-1)*2+i);break;default:return}return{primitivesPerFeature:d,primitivesPerCoordinate:P+b,drawCallsPerFeature:0,estimated:!1,memory:o}}case"text":case"icon":return{primitivesPerFeature:2,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:o};default:return}}function l(r,a){const s="point-3d"===r.type;switch(a.type){case"extrude":return a.edges&&a.edges.size>0?C.EXTRUDE_EDGES:C.EXTRUDE;case"fill":return t(a.outline)&&a.outline.size>0?C.FILL_OUTLINE:C.FILL;case"water":return C.FILL;case"line":return"round"===a.join?C.LINE_ROUND:C.LINE_MITER;case"path":switch(a.join){case"round":switch(a.profile){case"circle":return C.PATH_ROUND_CIRCLE;case"quad":return C.PATH_ROUND_QUAD;default:return void e(a.profile)}case"miter":case"bevel":switch(a.profile){case"circle":return C.PATH_MITER_CIRCLE;case"quad":return C.PATH_MITER_QUAD;default:return void e(a.profile)}default:return void e(a.join)}case"object":return s?C.OBJECT_POINT:C.OBJECT_POLYGON;case"icon":case"text":return s?C.ICON_POINT:C.ICON_POLYGON;default:return}}function F(e){let r=n[e];if(r)return r;const t=s(e,null);return r={primitivesPerFeature:u(t.levels[0]).reduce(((e,r)=>e+r.indices.get(o.POSITION).length/3),0),primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1},n[e]=r,r}const C={ICON_POINT:{bytesPerFeature:7127.413186968842,bytesPerFeatureLabel:4826.302896296296,bytesPerCoordinate:0,draped:{bytesPerFeature:3929.4396628895197,bytesPerFeatureLabel:3550.1332222222227,bytesPerCoordinate:0}},ICON_POLYGON:{bytesPerFeature:9329.452613976147,bytesPerFeatureLabel:3675.3372604938268,bytesPerCoordinate:60.177252982212096,draped:{bytesPerFeature:6190.247450139383,bytesPerFeatureLabel:3744.074358024691,bytesPerCoordinate:59.488211068026104}},OBJECT_POINT:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0,draped:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0}},OBJECT_POLYGON:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506,draped:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506}},LINE_MITER:{bytesPerFeature:7321.028181375921,bytesPerFeatureLabel:4048.0226716049388,bytesPerCoordinate:186.55621386363578,draped:{bytesPerFeature:4246.856619435009,bytesPerFeatureLabel:3852.3737679012347,bytesPerCoordinate:163.47884002621583}},LINE_ROUND:{bytesPerFeature:7482.205842738954,bytesPerFeatureLabel:4045.886987654321,bytesPerCoordinate:191.5452524171851,draped:{bytesPerFeature:4473.481387957992,bytesPerFeatureLabel:3842.1112395061728,bytesPerCoordinate:167.27703460226945}},PATH_MITER_CIRCLE:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275,draped:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275}},PATH_ROUND_CIRCLE:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957,draped:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957}},PATH_MITER_QUAD:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203,draped:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203}},PATH_ROUND_QUAD:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826,draped:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826}},FILL:{bytesPerFeature:9478.244183633637,bytesPerFeatureLabel:3713.816824691358,bytesPerCoordinate:95.9343604185578,draped:{bytesPerFeature:6287.911108168086,bytesPerFeatureLabel:3790.785032098766,bytesPerCoordinate:83.08783220478168}},FILL_OUTLINE:{bytesPerFeature:13085.871870349445,bytesPerFeatureLabel:3392.613241975309,bytesPerCoordinate:118.63968023169875,draped:{bytesPerFeature:8437.199992480122,bytesPerFeatureLabel:3973.5431172839503,bytesPerCoordinate:106.33556817014312}},EXTRUDE:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477,draped:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477}},EXTRUDE_EDGES:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312,draped:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312}}};export{y as averageSymbolComplexities,P as defaultSymbolComplexity,m as defaultSymbolLayerComplexity,l as defaultSymbolLayerMemoryComplexity,b as emptySymbolComplexity,C as memoryEstimators,d as totalSymbolComplexities};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{isNone as r,isSome as t}from"../../../../core/maybe.js";import{defaultPrimitive as a}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{primitiveLodResources as s}from"./primitiveObjectSymbolUtils.js";import{hasEdges as i}from"../support/edgeUtils.js";import{VertexAttribute as o}from"../../webgl-engine/lib/VertexAttribute.js";import{geometriesFromLodLevelResources as u}from"../../webgl-engine/lib/lodRendering/LodResources.js";const b={primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:{bytesPerFeature:0,bytesPerCoordinate:0,bytesPerFeatureLabel:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}}};function P(e){if("web-style"===e.type)return b;return d(e.symbolLayers.toArray().map((r=>m(e,r))))}function d(e){let t=0,a=0,s=0,i=!1,o=0;const u={bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0,draped:{bytesPerFeature:0,bytesPerFeatureLabel:0,bytesPerCoordinate:0}};for(const b of e)r(b)||(t+=b.primitivesPerFeature,a+=b.primitivesPerCoordinate,s+=b.drawCallsPerFeature,u.bytesPerFeature+=b.memory.bytesPerFeature,u.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.bytesPerCoordinate+=b.memory.bytesPerCoordinate,u.draped.bytesPerFeature+=b.memory.bytesPerFeature,u.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,u.draped.bytesPerCoordinate+=b.memory.bytesPerCoordinate,i=i||b.estimated,++o);return{primitivesPerFeature:t,primitivesPerCoordinate:a,drawCallsPerFeature:s,estimated:i,memory:u,numComplexities:o}}function y(e){const r=d(e);return r.numComplexities>0&&(r.primitivesPerFeature/=r.numComplexities,r.primitivesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.bytesPerCoordinate/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities,r.memory.draped.bytesPerCoordinate/=r.numComplexities),r}const n={};function m(r,s){const o=l(r,s),u=i(s)?2:0;switch(s.type){case"extrude":return{primitivesPerFeature:-4,primitivesPerCoordinate:4,drawCallsPerFeature:u,estimated:!1,memory:o};case"fill":return"mesh-3d"===r.type?{primitivesPerFeature:0,primitivesPerCoordinate:0,drawCallsPerFeature:u,estimated:!1,memory:o}:t(s.outline)&&s.outline.size>0?{primitivesPerFeature:-4,primitivesPerCoordinate:3,drawCallsPerFeature:0,estimated:!1,memory:o}:{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"water":return{primitivesPerFeature:-2,primitivesPerCoordinate:1,drawCallsPerFeature:0,estimated:!1,memory:o};case"line":return{primitivesPerFeature:-2,primitivesPerCoordinate:2,drawCallsPerFeature:0,estimated:!1,memory:o};case"object":if(s.resource&&s.resource.href)return{primitivesPerFeature:16,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!0,memory:o};return{...F(s.resource&&s.resource.primitive||a),memory:o};case"path":{const r=3,t=3,a=10;let i=0,u=0;switch(s.profile){case"circle":i=a;break;case"quad":i=4;break;default:return void e(s.profile)}switch(s.join){case"round":u=r;break;case"miter":case"bevel":u=1;break;default:return void e(s.join)}const b=2*i,P=i*u*2;let d=-2*P-b;switch(s.cap){case"none":break;case"butt":case"square":d+=2*(i-1);break;case"round":d+=2*(i*(t-1)*2+i);break;default:return}return{primitivesPerFeature:d,primitivesPerCoordinate:P+b,drawCallsPerFeature:0,estimated:!1,memory:o}}case"text":case"icon":return{primitivesPerFeature:2,primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1,memory:o};default:return}}function l(r,a){const s="point-3d"===r.type;switch(a.type){case"extrude":return a.edges&&a.edges.size>0?C.EXTRUDE_EDGES:C.EXTRUDE;case"fill":return t(a.outline)&&a.outline.size>0?C.FILL_OUTLINE:C.FILL;case"water":return C.FILL;case"line":return"round"===a.join?C.LINE_ROUND:C.LINE_MITER;case"path":switch(a.join){case"round":switch(a.profile){case"circle":return C.PATH_ROUND_CIRCLE;case"quad":return C.PATH_ROUND_QUAD;default:return void e(a.profile)}case"miter":case"bevel":switch(a.profile){case"circle":return C.PATH_MITER_CIRCLE;case"quad":return C.PATH_MITER_QUAD;default:return void e(a.profile)}default:return void e(a.join)}case"object":return s?C.OBJECT_POINT:C.OBJECT_POLYGON;case"icon":case"text":return s?C.ICON_POINT:C.ICON_POLYGON;default:return}}function F(e){let r=n[e];if(r)return r;const t=s(e,null);return r={primitivesPerFeature:u(t.levels[0]).reduce(((e,r)=>e+r.indices.get(o.POSITION).length/3),0),primitivesPerCoordinate:0,drawCallsPerFeature:0,estimated:!1},n[e]=r,r}const C={ICON_POINT:{bytesPerFeature:7127.413186968842,bytesPerFeatureLabel:4826.302896296296,bytesPerCoordinate:0,draped:{bytesPerFeature:3929.4396628895197,bytesPerFeatureLabel:3550.1332222222227,bytesPerCoordinate:0}},ICON_POLYGON:{bytesPerFeature:9329.452613976147,bytesPerFeatureLabel:3675.3372604938268,bytesPerCoordinate:60.177252982212096,draped:{bytesPerFeature:6190.247450139383,bytesPerFeatureLabel:3744.074358024691,bytesPerCoordinate:59.488211068026104}},OBJECT_POINT:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0,draped:{bytesPerFeature:2350.5884192634558,bytesPerFeatureLabel:4446.651003703703,bytesPerCoordinate:0}},OBJECT_POLYGON:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506,draped:{bytesPerFeature:4583.807620302299,bytesPerFeatureLabel:3665.342685185186,bytesPerCoordinate:60.11621818101506}},LINE_MITER:{bytesPerFeature:7321.028181375921,bytesPerFeatureLabel:4048.0226716049388,bytesPerCoordinate:186.55621386363578,draped:{bytesPerFeature:4246.856619435009,bytesPerFeatureLabel:3852.3737679012347,bytesPerCoordinate:163.47884002621583}},LINE_ROUND:{bytesPerFeature:7482.205842738954,bytesPerFeatureLabel:4045.886987654321,bytesPerCoordinate:191.5452524171851,draped:{bytesPerFeature:4473.481387957992,bytesPerFeatureLabel:3842.1112395061728,bytesPerCoordinate:167.27703460226945}},PATH_MITER_CIRCLE:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275,draped:{bytesPerFeature:9010.489006415351,bytesPerFeatureLabel:4230.9109,bytesPerCoordinate:4618.2594178027275}},PATH_ROUND_CIRCLE:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957,draped:{bytesPerFeature:4104.727250200398,bytesPerFeatureLabel:4251.8525,bytesPerCoordinate:8019.043777064957}},PATH_MITER_QUAD:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203,draped:{bytesPerFeature:9416.372942261387,bytesPerFeatureLabel:4241.2757,bytesPerCoordinate:3176.7222742582203}},PATH_ROUND_QUAD:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826,draped:{bytesPerFeature:6614.431545308682,bytesPerFeatureLabel:4206.7461,bytesPerCoordinate:5141.817789093826}},FILL:{bytesPerFeature:9478.244183633637,bytesPerFeatureLabel:3713.816824691358,bytesPerCoordinate:95.9343604185578,draped:{bytesPerFeature:6287.911108168086,bytesPerFeatureLabel:3790.785032098766,bytesPerCoordinate:83.08783220478168}},FILL_OUTLINE:{bytesPerFeature:13085.871870349445,bytesPerFeatureLabel:3392.613241975309,bytesPerCoordinate:118.63968023169875,draped:{bytesPerFeature:8437.199992480122,bytesPerFeatureLabel:3973.5431172839503,bytesPerCoordinate:106.33556817014312}},EXTRUDE:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477,draped:{bytesPerFeature:19459.53727140414,bytesPerFeatureLabel:3743.7045209876546,bytesPerCoordinate:372.6819978900477}},EXTRUDE_EDGES:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312,draped:{bytesPerFeature:22266.888534913724,bytesPerFeatureLabel:3064.3193358024696,bytesPerCoordinate:374.3725221561312}}};export{y as averageSymbolComplexities,P as defaultSymbolComplexity,m as defaultSymbolLayerComplexity,l as defaultSymbolLayerMemoryComplexity,b as emptySymbolComplexity,C as memoryEstimators,d as totalSymbolComplexities};
@@ -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 e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import n from"../../../../core/Logger.js";import{decodeRGB as r,decodeIntensity as o}from"./LEPCC.js";import{VertexAttribute as i}from"../../webgl-engine/lib/basicInterfaces.js";const a=n.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function u(t,n,r){let o="",i=0;for(;i<r;){const a=t[n+i];if(a<128)o+=String.fromCharCode(a),i++;else if(a>=192&&a<224){if(i+1>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const u=(31&a)<<6|63&t[n+i+1];o+=String.fromCharCode(u),i+=2}else if(a>=224&&a<240){if(i+2>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const u=(15&a)<<12|(63&t[n+i+1])<<6|63&t[n+i+2];o+=String.fromCharCode(u),i+=3}else{if(!(a>=240&&a<248))throw new e("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const u=(7&a)<<18|(63&t[n+i+1])<<12|(63&t[n+i+2])<<6|63&t[n+i+3];if(u>=65536){const e=55296+(u-65536>>10),t=56320+(1023&u);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(u);i+=4}}}return o}function s(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],a=i.valueType||i.type,u=h[a];n.fields[i.property]=u(e,r),r+=m[a].BYTES_PER_ELEMENT}return n.byteCount=r,n}function c(t,n,r){const o=[];let i,a,s=0;for(a=0;a<t;a+=1){if(i=n[a],i>0){if(o.push(u(r,s,i-1)),0!==r[s+i-1])throw new e("string-array-error","Invalid string array: missing null termination.")}else o.push(null);s+=i}return o}function f(e,t){return new(0,m[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function l(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function b(n,r,o){const i=null!=r.header?s(n,r.header):{byteOffset:0,byteCount:0,fields:{count:o}},a={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let u=i.byteCount;for(let s=0;s<r.ordering.length;s++){const n=r.ordering[s],o=t(r[n]);if(o.count=i.fields.count,"String"===o.valueType){if(o.byteOffset=u,o.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==o.encoding)throw new e("unsupported-encoding","Unsupported String encoding.",{encoding:o.encoding})}else{if(!A(o.valueType))throw new e("unsupported-value-type","Unsupported binary valueType",{valueType:o.valueType});{const e=O(o.valueType);u+=u%e!=0?e-u%e:0,o.byteOffset=u,o.byteCount=e*o.valuesPerElement*o.count}}u+=o.byteCount,a.entries[n]=o}return a.byteCount=u-a.byteOffset,a}function d(t,n,r){if(n!==t&&a.error(`Invalid ${r} buffer size\n expected: ${t}, actual: ${n})`),n<t)throw new e("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:n})}function y(e){return{isDraco:!1,isLegacy:!1,color:null!=e.color,normal:null!=e.normal,uv0:null!=e.uv0,uvRegion:null!=e.uvRegion,featureIndex:null!=e.faceRange&&null!=e.featureId}}function g(e,t){const n=s(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,a=null!=i.vertexCount?i.vertexCount:i.count;for(const s of t.ordering){if(!t.vertexAttributes[s])continue;const e={...t.vertexAttributes[s],byteOffset:r,count:a},n=C[s]?C[s]:"_"+s;o.vertexAttributes[n]=e,r+=O(e.valueType)*e.valuesPerElement*a}const u=i.faceCount;if(t.faces&&u){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:u};o.faces[e]=n,r+=O(n.valueType)*n.valuesPerElement*u}}const c=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&c){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:c};o.featureAttributes[e]=n;r+=("UInt64"===n.valueType?8:O(n.valueType))*n.valuesPerElement*c}}return d(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}function w(e,t){return!(!e||!e.compressedAttributes||"draco"!==e.compressedAttributes.encoding)?v(e.compressedAttributes.attributes):e?y(e):p(t)}function p(e){const t={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e.ordering)if(e.vertexAttributes[n])switch(n){case"position":break;case"normal":t.normal=!0;break;case"color":t.color=!0;break;case"uv0":t.uv0=!0;break;case"region":t.uvRegion=!0}return e.featureAttributes&&e.featureAttributeOrder&&(t.featureIndex=!0),t}function v(e){const t={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e)switch(n){case"position":break;case"normal":t.normal=!0;break;case"uv0":t.uv0=!0;break;case"color":t.color=!0;break;case"uv-region":t.uvRegion=!0;break;case"feature-index":t.featureIndex=!0}return t}const C={position:i.POSITION,normal:i.NORMAL,color:i.COLOR,uv0:i.UV0,region:i.UVREGION};function I(t,n,i){if("lepcc-rgb"===t.encoding)return r(n);if("lepcc-intensity"===t.encoding)return o(n);if(null!=t.encoding&&""!==t.encoding)throw new e("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(a.warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(a.warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const u=b(n,t,i);d(u.byteOffset+u.byteCount,n.byteLength,"attribute");const s=u.entries.attributeValues||u.entries.objectIds;if(s){if("String"===s.valueType){const e=u.entries.attributeByteCounts,t=f(n,e),r=l(n,s);return c(e.count,t,r)}return f(n,s)}throw new e("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const m={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},h={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function A(e){return m.hasOwnProperty(e)}function O(e){return A(e)?m[e].BYTES_PER_ELEMENT:0}export{b as createAttributeDataIndex,w as createGeometryDescriptor,v as createGeometryDescriptorForDraco,y as createGeometryDescriptorFromDefinition,p as createGeometryDescriptorFromSchema,g as createGeometryIndexFromSchema,l as createRawView,f as createTypedView,O as getBytesPerValue,A as isValueType,I as readBinaryAttribute,s as readHeader,c as readStringArray,h as valueType2ArrayBufferReader,m as valueType2TypedArrayClassMap};
5
+ import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import n from"../../../../core/Logger.js";import{decodeRGB as r,decodeIntensity as o}from"./LEPCC.js";import{VertexAttribute as i}from"../../webgl-engine/lib/VertexAttribute.js";const u=n.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function a(t,n,r){let o="",i=0;for(;i<r;){const u=t[n+i];if(u<128)o+=String.fromCharCode(u),i++;else if(u>=192&&u<224){if(i+1>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&u)<<6|63&t[n+i+1];o+=String.fromCharCode(a),i+=2}else if(u>=224&&u<240){if(i+2>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&u)<<12|(63&t[n+i+1])<<6|63&t[n+i+2];o+=String.fromCharCode(a),i+=3}else{if(!(u>=240&&u<248))throw new e("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&u)<<18|(63&t[n+i+1])<<12|(63&t[n+i+2])<<6|63&t[n+i+3];if(a>=65536){const e=55296+(a-65536>>10),t=56320+(1023&a);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(a);i+=4}}}return o}function s(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],u=i.valueType||i.type,a=h[u];n.fields[i.property]=a(e,r),r+=m[u].BYTES_PER_ELEMENT}return n.byteCount=r,n}function c(t,n,r){const o=[];let i,u,s=0;for(u=0;u<t;u+=1){if(i=n[u],i>0){if(o.push(a(r,s,i-1)),0!==r[s+i-1])throw new e("string-array-error","Invalid string array: missing null termination.")}else o.push(null);s+=i}return o}function f(e,t){return new(0,m[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function l(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function b(n,r,o){const i=null!=r.header?s(n,r.header):{byteOffset:0,byteCount:0,fields:{count:o}},u={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let a=i.byteCount;for(let s=0;s<r.ordering.length;s++){const n=r.ordering[s],o=t(r[n]);if(o.count=i.fields.count,"String"===o.valueType){if(o.byteOffset=a,o.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==o.encoding)throw new e("unsupported-encoding","Unsupported String encoding.",{encoding:o.encoding})}else{if(!A(o.valueType))throw new e("unsupported-value-type","Unsupported binary valueType",{valueType:o.valueType});{const e=O(o.valueType);a+=a%e!=0?e-a%e:0,o.byteOffset=a,o.byteCount=e*o.valuesPerElement*o.count}}a+=o.byteCount,u.entries[n]=o}return u.byteCount=a-u.byteOffset,u}function d(t,n,r){if(n!==t&&u.error(`Invalid ${r} buffer size\n expected: ${t}, actual: ${n})`),n<t)throw new e("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:n})}function y(e){return{isDraco:!1,isLegacy:!1,color:null!=e.color,normal:null!=e.normal,uv0:null!=e.uv0,uvRegion:null!=e.uvRegion,featureIndex:null!=e.faceRange&&null!=e.featureId}}function g(e,t){const n=s(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,u=null!=i.vertexCount?i.vertexCount:i.count;for(const s of t.ordering){if(!t.vertexAttributes[s])continue;const e={...t.vertexAttributes[s],byteOffset:r,count:u},n=C[s]?C[s]:"_"+s;o.vertexAttributes[n]=e,r+=O(e.valueType)*e.valuesPerElement*u}const a=i.faceCount;if(t.faces&&a){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:a};o.faces[e]=n,r+=O(n.valueType)*n.valuesPerElement*a}}const c=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&c){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:c};o.featureAttributes[e]=n;r+=("UInt64"===n.valueType?8:O(n.valueType))*n.valuesPerElement*c}}return d(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}function w(e,t){return!(!e||!e.compressedAttributes||"draco"!==e.compressedAttributes.encoding)?v(e.compressedAttributes.attributes):e?y(e):p(t)}function p(e){const t={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e.ordering)if(e.vertexAttributes[n])switch(n){case"position":break;case"normal":t.normal=!0;break;case"color":t.color=!0;break;case"uv0":t.uv0=!0;break;case"region":t.uvRegion=!0}return e.featureAttributes&&e.featureAttributeOrder&&(t.featureIndex=!0),t}function v(e){const t={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e)switch(n){case"position":break;case"normal":t.normal=!0;break;case"uv0":t.uv0=!0;break;case"color":t.color=!0;break;case"uv-region":t.uvRegion=!0;break;case"feature-index":t.featureIndex=!0}return t}const C={position:i.POSITION,normal:i.NORMAL,color:i.COLOR,uv0:i.UV0,region:i.UVREGION};function I(t,n,i){if("lepcc-rgb"===t.encoding)return r(n);if("lepcc-intensity"===t.encoding)return o(n);if(null!=t.encoding&&""!==t.encoding)throw new e("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(u.warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(u.warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const a=b(n,t,i);d(a.byteOffset+a.byteCount,n.byteLength,"attribute");const s=a.entries.attributeValues||a.entries.objectIds;if(s){if("String"===s.valueType){const e=a.entries.attributeByteCounts,t=f(n,e),r=l(n,s);return c(e.count,t,r)}return f(n,s)}throw new e("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const m={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},h={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function A(e){return m.hasOwnProperty(e)}function O(e){return A(e)?m[e].BYTES_PER_ELEMENT:0}export{b as createAttributeDataIndex,w as createGeometryDescriptor,v as createGeometryDescriptorForDraco,y as createGeometryDescriptorFromDefinition,p as createGeometryDescriptorFromSchema,g as createGeometryIndexFromSchema,l as createRawView,f as createTypedView,O as getBytesPerValue,A as isValueType,I as readBinaryAttribute,s as readHeader,c as readStringArray,h as valueType2ArrayBufferReader,m as valueType2TypedArrayClassMap};
@@ -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};