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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (624) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
  5. package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
  6. package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
  7. package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
  8. package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 0d02c6ad1f4688bfa374.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
  10. package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
  11. package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
  16. package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
  17. package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
  18. package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
  19. package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
  20. package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
  22. package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
  23. package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
  24. package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 2c8fe9bc988c3c5760a5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
  26. package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
  27. package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
  28. package/assets/esri/core/workers/chunks/37c03cfc19086ce631c6.js +1 -0
  29. package/assets/esri/core/workers/chunks/391e96192d1ec4e55ce2.js +1 -0
  30. package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
  31. package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
  32. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  33. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  34. package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  37. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
  38. package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
  39. package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
  40. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
  42. package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
  43. package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
  44. package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
  45. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
  46. package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
  47. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
  48. package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
  51. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
  52. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  53. package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
  55. package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
  56. package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
  57. package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
  58. package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
  59. package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
  60. package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
  61. package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
  62. package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +1 -0
  63. package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
  64. package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
  65. package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
  66. package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
  67. package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
  68. package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
  69. package/assets/esri/core/workers/chunks/aeaa1667c2d9f1b3366b.js +1 -0
  70. package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
  71. package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +1 -0
  72. package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
  73. package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
  74. package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
  75. package/assets/esri/core/workers/chunks/bac9fc90e6756e211160.js +1 -0
  76. package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +1 -0
  77. package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
  78. package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
  79. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
  80. package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
  81. package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +1 -0
  82. package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
  83. package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
  84. package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
  85. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
  86. package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
  87. package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
  88. package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
  89. package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → e0c8d61c7a85ce15499a.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
  91. package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
  92. package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
  93. package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
  94. package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
  95. package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
  96. package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
  97. package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
  98. package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
  99. package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
  100. package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
  101. package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
  102. package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
  103. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
  104. package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
  105. package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
  106. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  107. package/assets/esri/themes/base/_mixins.scss +4 -1
  108. package/assets/esri/themes/base/icons/style.scss +11 -2
  109. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
  110. package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
  111. package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
  112. package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
  113. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
  114. package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
  115. package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
  116. package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
  117. package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
  118. package/assets/esri/themes/base/widgets/_Print.scss +24 -11
  119. package/assets/esri/themes/base/widgets/_Search.scss +4 -2
  120. package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
  121. package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
  122. package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
  123. package/assets/esri/themes/dark/main.css +1 -1
  124. package/assets/esri/themes/dark-blue/main.css +1 -1
  125. package/assets/esri/themes/dark-green/main.css +1 -1
  126. package/assets/esri/themes/dark-purple/main.css +1 -1
  127. package/assets/esri/themes/dark-red/main.css +1 -1
  128. package/assets/esri/themes/light/main.css +1 -1
  129. package/assets/esri/themes/light/view.css +1 -1
  130. package/assets/esri/themes/light-blue/main.css +1 -1
  131. package/assets/esri/themes/light-green/main.css +1 -1
  132. package/assets/esri/themes/light-purple/main.css +1 -1
  133. package/assets/esri/themes/light-red/main.css +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  137. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  138. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  139. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  140. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  141. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  142. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  143. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  144. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  145. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  146. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  147. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  148. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  149. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  150. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  151. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  152. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  153. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  154. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  155. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  156. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  157. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  158. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  159. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  160. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  161. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  162. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  163. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  164. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  165. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  166. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  167. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  168. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  169. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  170. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  171. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  172. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  173. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  174. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  175. package/chunks/BlendLayers.glsl.js +2 -2
  176. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  177. package/chunks/CheckerBoard.glsl.js +3 -3
  178. package/chunks/Clouds.glsl.js +2 -2
  179. package/chunks/CloudsComposition.glsl.js +1 -1
  180. package/chunks/ColorMaterial.glsl.js +12 -12
  181. package/chunks/ComponentShader.glsl.js +21 -21
  182. package/chunks/Compositing.glsl.js +1 -1
  183. package/chunks/DefaultMaterial.glsl.js +33 -33
  184. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  185. package/chunks/Fog.glsl.js +10 -12
  186. package/chunks/HUDMaterial.glsl.js +2 -2
  187. package/chunks/HighlightComposition.glsl.js +5 -5
  188. package/chunks/ImageMaterial.glsl.js +6 -6
  189. package/chunks/LaserlinePath.glsl.js +8 -8
  190. package/chunks/LineCallout.glsl.js +6 -6
  191. package/chunks/MeasurementArrow.glsl.js +1 -1
  192. package/chunks/NativeLine.glsl.js +1 -1
  193. package/chunks/Path.glsl.js +5 -5
  194. package/chunks/Pattern.glsl.js +9 -9
  195. package/chunks/PointRenderer.glsl.js +14 -14
  196. package/chunks/Precipitation.glsl.js +91 -0
  197. package/chunks/RealisticTree.glsl.js +21 -21
  198. package/chunks/RibbonLine.glsl.js +11 -11
  199. package/chunks/SMAA.glsl.js +40 -40
  200. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  201. package/chunks/ShadowCast.glsl.js +6 -6
  202. package/chunks/ShadowHighlight.glsl.js +4 -4
  203. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  204. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  205. package/chunks/Stars.glsl.js +3 -3
  206. package/chunks/Terrain.glsl.js +3 -3
  207. package/chunks/TextureOnly.glsl.js +2 -2
  208. package/chunks/WaterSurface.glsl.js +22 -22
  209. package/chunks/boundedPlane.js +1 -1
  210. package/chunks/pe.js +1 -1
  211. package/chunks/vec3.js +1 -1
  212. package/chunks/vxlLayer.js +1 -1
  213. package/core/accessorSupport/ensureType.js +1 -1
  214. package/core/accessorSupport/get.js +1 -1
  215. package/core/accessorSupport/read.js +1 -1
  216. package/core/accessorSupport/set.js +1 -1
  217. package/core/accessorSupport/watch.js +1 -1
  218. package/core/accessorSupport/write.js +1 -1
  219. package/core/clock.js +1 -1
  220. package/core/jsonMap.js +1 -1
  221. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  222. package/core/loadAll.js +1 -1
  223. package/core/promiseUtils.js +1 -1
  224. package/core/reactiveUtils.js +1 -1
  225. package/form/ExpressionInfo.js +1 -1
  226. package/geometry/pe.js +1 -1
  227. package/geometry/support/axisAngleDegrees.js +1 -1
  228. package/geometry/support/frustum.js +1 -1
  229. package/geometry/support/plane.js +1 -1
  230. package/interfaces.d.ts +263 -35
  231. package/layers/VectorTileLayer.js +1 -1
  232. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  233. package/layers/graphics/featureConversionUtils.js +1 -1
  234. package/layers/support/LayerContingentValuesCache.js +1 -1
  235. package/layers/support/TileInfo.js +1 -1
  236. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  237. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  238. package/package.json +2 -2
  239. package/popup/content/AttachmentsContent.js +1 -1
  240. package/popup/content/support/mediaInfoTypes.js +1 -1
  241. package/rest/print.js +1 -1
  242. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  243. package/support/arcadeOnDemand.js +1 -1
  244. package/support/featureFlags.js +1 -1
  245. package/support/revision.js +1 -1
  246. package/symbols/FillSymbol3DLayer.js +1 -1
  247. package/symbols/IconSymbol3DLayer.js +1 -1
  248. package/symbols/LabelSymbol3D.js +1 -1
  249. package/symbols/ObjectSymbol3DLayer.js +1 -1
  250. package/symbols/PointSymbol3D.js +1 -1
  251. package/symbols/Symbol3D.js +1 -1
  252. package/symbols/WebStyleSymbol.js +1 -1
  253. package/symbols/cim/CIMSymbolHelper.js +1 -1
  254. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  255. package/symbols/cim/cimAnalyzer.js +1 -1
  256. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  257. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  258. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  259. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  260. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  261. package/symbols/support/Symbol3DIconOutline.js +1 -1
  262. package/symbols/support/Symbol3DOutline.js +1 -1
  263. package/symbols/support/Symbol3DVerticalOffset.js +1 -1
  264. package/symbols/support/Thumbnail.js +1 -1
  265. package/symbols/support/previewCIMSymbol.js +1 -1
  266. package/symbols/support/previewSymbol2D.js +1 -1
  267. package/symbols/support/previewSymbol3D.js +1 -1
  268. package/symbols/support/previewWebStyleSymbol.js +1 -1
  269. package/symbols/support/svgUtils.js +1 -1
  270. package/symbols/support/webStyleSymbolUtils.js +1 -1
  271. package/symbols.js +1 -1
  272. package/views/2d/MapViewConstraints.js +1 -1
  273. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  274. package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
  275. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  276. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  277. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  278. package/views/2d/viewpointUtils.js +1 -1
  279. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  280. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  281. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  282. package/views/3d/environment/CloudsComposition.js +1 -1
  283. package/views/3d/environment/CloudsGenerator.js +1 -1
  284. package/views/3d/environment/CloudsPresets.js +1 -1
  285. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  286. package/views/3d/environment/Fog.glsl.js +1 -1
  287. package/views/3d/environment/Fog.js +1 -1
  288. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  289. package/views/3d/environment/Precipitation.glsl.js +5 -0
  290. package/views/3d/environment/Precipitation.js +5 -0
  291. package/views/3d/environment/PrecipitationTechnique.js +5 -0
  292. package/views/3d/environment/RainyWeather.js +1 -1
  293. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  294. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  295. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  296. package/views/3d/environment/SnowyWeather.js +5 -0
  297. package/views/3d/environment/Stars.glsl.js +1 -1
  298. package/views/3d/environment/Stars.js +1 -1
  299. package/views/3d/environment/weather.js +1 -1
  300. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  301. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  302. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  303. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  304. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  305. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  306. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  307. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  308. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  309. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  310. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  311. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  312. package/views/3d/layers/GraphicsView3D.js +1 -1
  313. package/views/3d/layers/I3SMeshView3D.js +1 -1
  314. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  315. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  316. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  317. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  320. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  321. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  322. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  323. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  324. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  325. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  326. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  327. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  328. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  329. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  330. package/views/3d/layers/graphics/lineUtils.js +1 -1
  331. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  332. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  333. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  334. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  335. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  336. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  337. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  338. package/views/3d/layers/support/patternUtils.js +1 -1
  339. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  340. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  341. package/views/3d/support/LaserLineRenderer.js +1 -1
  342. package/views/3d/support/LaserlinePathData.js +1 -1
  343. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  344. package/views/3d/support/sunUtils.js +1 -1
  345. package/views/3d/terrain/OverlayRenderer.js +1 -1
  346. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  347. package/views/3d/terrain/TerrainRenderer.js +1 -1
  348. package/views/3d/terrain/TerrainSurface.js +1 -1
  349. package/views/3d/terrain/Tile.js +1 -1
  350. package/views/3d/terrain/terrainUtils.js +1 -1
  351. package/views/3d/terrain/tileUtils.js +1 -1
  352. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  353. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  354. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  355. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  356. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  358. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  359. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  360. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  361. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  362. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  363. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  364. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  365. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  366. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  367. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  368. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  370. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  371. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  372. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  373. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  374. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  375. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  376. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  377. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  378. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  379. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  380. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  381. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  382. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  383. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  384. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  385. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  386. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  387. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  388. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  389. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  390. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  391. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  392. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
  393. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  394. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  395. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  396. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  397. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  398. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  399. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  400. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  401. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  402. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  403. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  404. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  405. package/views/3d/webgl-engine/lib/Material.js +1 -1
  406. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  407. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  408. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  409. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  410. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  411. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  412. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  413. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  414. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  415. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  416. package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
  417. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  418. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  419. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  420. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  422. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  423. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  424. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  425. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  426. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  427. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  428. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  429. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  433. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  434. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  435. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  436. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  437. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  438. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  439. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  440. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  441. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  442. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  443. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  444. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  445. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  446. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  447. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  448. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  449. package/views/3d/webgl-engine/parts/Model.js +1 -1
  450. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  451. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  452. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  453. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  454. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  455. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  456. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  457. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  458. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  459. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  460. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  461. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  462. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  463. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  464. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  465. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  466. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  467. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  468. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  469. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  470. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  471. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  472. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  473. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  474. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  475. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  476. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  477. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  478. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  479. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  480. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  481. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  482. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  483. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  484. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  485. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  486. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  487. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  488. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  489. package/views/MapView.js +1 -1
  490. package/views/SceneView.js +1 -1
  491. package/views/View.js +1 -1
  492. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  493. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  494. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  495. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  496. package/views/interactive/dragEventPipeline.js +1 -1
  497. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  498. package/views/support/DefaultsFromMap.js +1 -1
  499. package/views/support/WatchUpdatingTracking.js +1 -1
  500. package/views/support/projectionUtils.js +5 -0
  501. package/views/webgl/BufferObject.js +1 -1
  502. package/views/webgl/InstanceCounter.js +1 -1
  503. package/views/webgl/Program.js +1 -1
  504. package/views/webgl/rasterUtils.js +1 -1
  505. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  506. package/widgets/Attachments.js +1 -1
  507. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  508. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  509. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  510. package/widgets/BasemapGallery.js +1 -1
  511. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  512. package/widgets/FeatureForm/InputField.js +1 -1
  513. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  514. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  515. package/widgets/FeatureTable.js +1 -1
  516. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  517. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  518. package/widgets/Popup/PopupViewModel.js +1 -1
  519. package/widgets/Popup/actionUtils.js +1 -1
  520. package/widgets/Search/support/locatorUtils.js +1 -1
  521. package/widgets/Search.js +1 -1
  522. package/widgets/Slice/SliceViewModel.js +1 -1
  523. package/widgets/Slider/SliderViewModel.js +1 -1
  524. package/widgets/Slider.js +1 -1
  525. package/widgets/Weather/WeatherViewModel.js +1 -1
  526. package/widgets/Weather/css.js +1 -1
  527. package/widgets/Weather/enums.js +5 -0
  528. package/widgets/Weather.js +1 -1
  529. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  530. package/widgets/support/InteractiveToolViewModel.js +1 -1
  531. package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
  532. package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
  533. package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
  534. package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
  535. package/assets/components/assets/calcite-icon/squareF16.json +0 -1
  536. package/assets/components/assets/calcite-icon/squareF24.json +0 -1
  537. package/assets/components/assets/calcite-icon/squareF32.json +0 -1
  538. package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
  539. package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
  540. package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
  541. package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
  542. package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
  543. package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
  544. package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
  545. package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
  546. package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
  547. package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
  548. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
  549. package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
  550. package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
  551. package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
  552. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
  553. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
  554. package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
  555. package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
  556. package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
  557. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
  558. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
  559. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
  560. package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
  561. package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
  562. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
  563. package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
  564. package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
  565. package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
  566. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
  567. package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
  568. package/assets/esri/core/workers/chunks/5383a8f3e4ec1a8a4fcd.js +0 -1
  569. package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
  570. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
  571. package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
  572. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
  573. package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
  574. package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
  575. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  576. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
  577. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
  578. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
  579. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
  580. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
  581. package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
  582. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
  583. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
  584. package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
  585. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
  586. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  587. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
  588. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
  589. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
  590. package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
  591. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
  592. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
  593. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
  594. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
  595. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
  596. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
  597. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
  598. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
  599. package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
  600. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
  601. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
  602. package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
  603. package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
  604. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
  605. package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
  606. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
  607. package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
  608. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
  609. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
  610. package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
  611. package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
  612. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
  613. package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
  614. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
  615. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  616. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
  617. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
  618. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
  619. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
  620. package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
  621. package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
  622. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
  623. package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
  624. package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{isSome as t,isNone as r,unwrapOr as a,get as o}from"../../../../core/maybe.js";import{f as s,t as n}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{f as l,m as c,a as u}from"../../../../chunks/mat4.js";import{b as m,c as h}from"../../../../chunks/mat4f64.js";import{b as p,a as f,d,n as g,f as x,c as _}from"../../../../chunks/vec3.js";import{Z as y,O as b,c as v}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{projectVectorToDehydratedPoint as C,projectBuffer as O,computeTranslationToOriginAndRotation as A,canProjectWithoutEngine as M}from"../../../../geometry/projection.js";import{create as E,empty as w,expandWithBuffer as N,intersectsClippingArea as j}from"../../../../geometry/support/aaBoundingBox.js";import R from"../../../../geometry/support/MeshComponent.js";import P from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import{BufferViewVec3f64 as I,BufferViewVec3f as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as F,a as S}from"../../../../chunks/vec32.js";import{transformPosition as L,transformNormal as U,projectNormalToPCPF as V,transformTangent as G,projectTangentToPCPF as $}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as D}from"../../../../layers/graphics/dehydratedFeatures.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{perObjectElevationAligner as z}from"./ElevationAligners.js";import{needsElevationUpdates3D as q}from"./elevationAlignmentUtils.js";import{ElevationContext as H}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as W}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as Y}from"./Graphics3DSymbolLayer.js";import{createMaterial as Z}from"../support/edgeUtils.js";import{parseColorMixMode as J,encodeSymbolColor as K}from"../support/symbolColorUtils.js";import Q from"../../support/debugFlags.js";import{AlphaDiscardMode as X,CullFaceOptions as ee,VertexAttribute as te,PrimitiveType as re}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as ae}from"../../webgl-engine/lib/Geometry.js";import{generateDefaultIndexArray as oe}from"../../webgl-engine/lib/geometryDataUtils.js";import{Object3D as se}from"../../webgl-engine/lib/Object3D.js";import{Texture as ne}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as le}from"../../webgl-engine/materials/NativeLineMaterial.js";import{TextureWrapMode as ce}from"../../../webgl/enums.js";const ue=["mesh"];class me extends Y{constructor(e,t,r,a){super(e,t,r,a),this._materials=new Map,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){Q.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new le({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new le({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(Array.from(this._materials.values(),(e=>e.material))),this._context.stage.removeMany(Array.from(this._textures.values())),this._materials.clear(),this._textures.clear()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ue,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t,new H),a=e.renderingInfo;return this._createAs3DShape(t,a,r,t.uid)}layerOpacityChanged(e,r){const a=this._getLayerOpacity();return this._materials.forEach((e=>{e.material.setParameters({layerOpacity:a});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>{const o=r(e);t(o)&&o.layerOpacityChanged(a,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,q)}slicePlaneEnabledChanged(e,r){return this._materials.forEach((e=>{e.material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),e.forEach((e=>{const a=r(e);t(a)&&a.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._materials.forEach((t=>t.material.setParameters({usePBR:e}))),!0}pixelRatioChanged(){return!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return r(t)?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),a=!!e.vertexAttributes.color,o=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:a,hasVertexTangents:o,uid:`vc:${a},vt:${o},vct${t},svc:${r}`}}_materialProperties(e,t,r){const a=this._materialPropertiesDefault(e,r);if(!t.material)return a;const{color:o,colorTexture:s,normalTexture:n,doubleSided:i,alphaCutoff:l,alphaMode:c}=t.material,u=this._colorOrTextureUid(o),m=this._colorOrTextureUid(s),h=this._colorOrTextureUid(n);if(a.color=o,a.colorTexture=s,a.normalTexture=n,a.uid=`${a.uid},cmuid:${u},ctmuid:${m},ntmuid:${h},ds:${i},ac:${l},am:${c}`,t.material instanceof P){const{metallic:e,roughness:r,metallicRoughnessTexture:o,emissiveColor:s,emissiveTexture:n,occlusionTexture:i}=t.material,l=this._colorOrTextureUid(o),c=this._colorOrTextureUid(s),u=this._colorOrTextureUid(n),m=this._colorOrTextureUid(i);a.metallic=e,a.roughness=r,a.metallicRoughnessTexture=o,a.emissiveColor=s,a.emissiveTexture=n,a.occlusionTexture=i,a.uid=`${a.uid},mrm:${e},mrr:${r},mrt:${l},emuid:${c},etmuid:${u},otmuid:${m}`}return a}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data?e.data:e.url}_getInternalTextureId(e){const r=this._getInternalTexture(e,X.Opaque);return t(r)?r.id:null}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const a=`${e.contentHash}/${t}`;let o=this._textures.get(a);return o||(o=new ne(r,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:t!==X.Opaque}),this._textures.set(a,o),this._context.stage.add(o),this._context.stage.loadImmediate(o)),o}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return ce.CLAMP_TO_EDGE;case"mirror":return ce.MIRRORED_REPEAT;default:return ce.REPEAT}}_setInternalMaterialParameters(r,a){if(t(r.color)&&this._setInternalColorValueParameters(r.color,a),t(r.colorTexture)){const e=this._getInternalTexture(r.colorTexture,a.textureAlphaMode);t(e)?(a.textureId=e.id,a.textureAlphaPremultiplied=!!e.params.preMultiplyAlpha):a.textureId=void 0}t(r.normalTexture)&&(a.normalTextureId=this._getInternalTextureId(r.normalTexture)),t(r.emissiveColor)&&(a.emissiveFactor=e.toUnitRGB(r.emissiveColor)),t(r.emissiveTexture)&&(a.emissiveTextureId=this._getInternalTextureId(r.emissiveTexture)),t(r.occlusionTexture)&&(a.occlusionTextureId=this._getInternalTextureId(r.occlusionTexture)),t(r.metallicRoughnessTexture)&&(a.metallicRoughnessTextureId=this._getInternalTextureId(r.metallicRoughnessTexture))}_setExternalMaterialParameters(r){const a=this._drivenProperties.color;let o=t(this.symbolLayer.material)?this.symbolLayer.material.colorMixMode:null;if(a)r.externalColor=T;else{const a=t(this.symbolLayer.material)?this.symbolLayer.material.color:null;t(a)?r.externalColor=e.toUnitRGBA(a):(o=null,r.externalColor=T)}o&&(r.colorMixMode=o),r.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(r(t))return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(e,r){var a,o,s;const n=null==(a=r.material)?void 0:a.color,i=null==(o=r.material)?void 0:o.colorTexture,l=null==(s=r.material)?void 0:s.alphaMode,c="blend"===l,u=!("opaque"===l)&&(this._hasTransparentVertexColors(e)||t(n)&&n.a<1||t(i)&&i.transparent||c),m=this._materialProperties(e,r,u),h=this._materials.get(m.uid);if(h)return h.material;const p={material:null,isComponentTransparent:u,alphaMode:r.material?r.material.alphaMode:"opaque"},f=null==m.metallicRoughnessTexture&&null==m.metallic&&null==m.roughness,d={usePBR:this._usePBR(),isSchematic:f,vertexColors:m.hasVertexColors,symbolColors:m.hasSymbolVertexColors,vertexTangents:m.hasVertexTangents,ambient:y,diffuse:b,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ee.None,layerOpacity:this._getLayerOpacity(),slicePlaneEnabled:this._context.slicePlaneEnabled,initTextureTransparent:!0};f||(d.mrrFactors=[null!=m.metallic?m.metallic:1,null!=m.roughness?m.roughness:1,.5]),r.material&&(d.doubleSided=r.material.doubleSided,d.cullFace=r.material.doubleSided?ee.None:ee.Back,d.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(d),this._setMaterialTransparentParameter(d,p),this._setInternalMaterialParameters(m,d);const g=new ie(d);return p.material=g,this._materials.set(m.uid,p),this._context.stage.add(g),g}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?X.MaskBlend:X.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?X.Opaque:"mask"===t.alphaMode?X.Mask:X.Blend}_addDebugNormals(e,t,r,a){const o=t.length,s=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*s,e.extent.height*s,e.extent.zmax-e.extent.zmin),i=[],l=[],c=[],u=[];for(let m=0;m<o;m++){const e=t[m],r=e.vertexAttributes.get(te.POSITION),a=e.vertexAttributes.get(te.NORMAL),o=e.indices.get(te.POSITION),s=e.indices.get(te.NORMAL),h=r.data,d=a.data;for(let t=0;t<o.length;t++){const e=3*o[t],r=3*s[t];for(let t=0;t<3;t++)i.push(h[e+t]);for(let t=0;t<3;t++)i.push(h[e+t]+d[r+t]*n);if(l.push(l.length),l.push(l.length),t%3==0){this._calculateFaceNormal(h,o,t,ge),this._getFaceVertices(h,o,t,pe,fe,de),p(pe,pe,fe),p(pe,pe,de),f(pe,pe,1/3);for(let e=0;e<3;e++)c.push(pe[e]);for(let e=0;e<3;e++)c.push(pe[e]+ge[e]*n);u.push(u.length),u.push(u.length)}}}const h=new ae([[te.POSITION,{data:i,size:3,exclusive:!0}]],[[te.POSITION,new Uint32Array(l)]],re.Line);t.push(h),r.push(this._debugVertexNormalMaterial),a.push(m(a[0]));const d=new ae([[te.POSITION,{data:c,size:3,exclusive:!0}]],[[te.POSITION,new Uint32Array(u)]],re.Line);t.push(d),r.push(this._debugFaceNormalMaterial),a.push(m(a[0]))}_createAs3DShape(e,r,a,o){const s=e.geometry;if("mesh"!==s.type)return null;const n=this._createGeometryInfo(s,r);if(!n)return null;const{geometries:i,materials:l,transformations:c,objectTransformation:u}=n;Q.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(s,i,l,c);const m=new se({geometries:i,materials:l,transformations:c,metadata:{layerUid:this._context.layer.uid,graphicUid:o}});m.transformation=u;const h=this._createEdgeMaterial(),p=t(h)?{baseMaterial:l[0],edgeMaterials:[h],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,f=new W(this,m,i,null,null,z,a,p);return f.needsElevationUpdates=q(a.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.elevationContext.centerPointInElevationSR=this._getCenterPointInElevationSR(m),f.alignedSampledElevation=z(f,f.elevationContext,this._context.elevationProvider,this._context.renderCoordsHelper),f}_getCenterPointInElevationSR(e){const t=D(0,0,0,this._context.elevationProvider.spatialReference);return C([e.transformation[12],e.transformation[13],e.transformation[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,a){switch(r.shading||"flat"){case"source":return this._createComponentNormalsSource(e,t,r,a);case"flat":return this._createComponentNormalsFlat(e,a);case"smooth":return this._createComponentNormalsSmooth(e,a);default:return}}_createComponentNormalsSource(e,t,a,o){if(r(t))return this._createComponentNormalsFlat(e,o);let s=!1;if(!a.trustSourceNormals)for(let r=0;r<o.length;r+=3){this._calculateFaceNormal(e,o,r,ge);for(let e=0;e<3;e++){const a=3*o[r+e];pe[0]=t[a+0],pe[1]=t[a+1],pe[2]=t[a+2],d(ge,pe)<0&&(t[a+0]=-t[a+0],t[a+1]=-t[a+1],t[a+2]=-t[a+2],s=!0)}}return{normals:t,indices:o,didFlipNormals:s}}_createComponentNormalsFlat(e,t){const r=new Float32Array(t.length),a=new Uint32Array(3*t.length);for(let o=0;o<t.length;o+=3){const s=this._calculateFaceNormal(e,t,o,ge);for(let e=0;e<3;e++)r[o+e]=s[e],a[o+e]=o/3}return{normals:r,indices:a,didFlipNormals:!1}}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const a=this._calculateFaceNormal(e,t,s,ge);for(let e=0;e<3;e++){const o=t[s+e];let n=r[o];n||(n={normal:v(),count:0},r[o]=n),p(n.normal,n.normal,a),n.count++}}const a=new Float32Array(3*t.length),o=new Uint32Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)a[3*s+t]=e.normal[t];o[s]=s}return{normals:a,indices:o,didFlipNormals:!1}}_getFaceVertices(e,t,r,a,o,s){const n=3*t[r+0],i=3*t[r+1],l=3*t[r+2];a[0]=e[n+0],a[1]=e[n+1],a[2]=e[n+2],o[0]=e[i+0],o[1]=e[i+1],o[2]=e[i+2],s[0]=e[l+0],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,a){return this._getFaceVertices(e,t,r,pe,fe,de),x(fe,fe,pe),x(de,de,pe),_(pe,fe,de),g(a,pe),a}_getOrCreateComponents(e){return a(e.components,be)}_createPositionBuffer(e,r){let a=e.vertexAttributes.position;const o=r.reprojection===ve.ECEF?r.transformBeforeProject:null;if(t(o)&&(a=L(a,new Float64Array(a.length),o)),r.reprojection===ve.NONE)return r.needsBufferCopy?new Float64Array(a):a;const s=t(o)?a:new Float64Array(a.length);return O(a,e.spatialReference,0,s,this._context.renderCoordsHelper.spatialReference,0,a.length/3),s}_createNormalBuffer(e,a,o){let s=e.vertexAttributes.normal;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=U(s,new Float32Array(s.length),n));if("local"===this._context.graphicsCoreOwner.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return V(s,i,a,e.spatialReference,l)}_createTangentBuffer(e,a,o){let s=e.vertexAttributes.tangent;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=G(s,new Float32Array(s.length),n));if("local"===this._context.graphicsCoreOwner.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return $(s,i,a,e.spatialReference,l)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=J(o(this.symbolLayer,"material","colorMixMode")),a=new Uint8Array(4);return K(t,r,a),a}return null}_createBuffers(e,r){const a=e.vertexAttributes&&e.vertexAttributes.position;if(!a)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,s=e.vertexAttributes.uv,n=e.vertexAttributes.tangent;if(t(o)&&o.length!==a.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(t(n)&&n.length/4!=a.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(t(s)&&s.length/2!=a.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const i=this._computeReprojectionInfo(e),l=this._createPositionBuffer(e,i),c=this._createColorBuffer(e),u=this._createSymbolColorBuffer(r),m=this._createNormalBuffer(e,l,i),p=this._createTangentBuffer(e,l,i);return{positionBuffer:l,normalBuffer:m,tangentBuffer:p,uvBuffer:s,colorBuffer:c,symbolColorBuffer:u,objectTransformation:i.reprojection===ve.NONE&&t(i.objectTransformation)?i.objectTransformation:this._transformOriginLocal(e,l,m,p),geometryTransformation:i.reprojection===ve.NONE&&t(i.geometryTransformation)?i.geometryTransformation:h()}}_computeReprojectionInfo(e){const r=t(e.transform),a=r&&e.transform.geographic||this._context.renderCoordsHelper.viewingMode===k.Local?ve.NONE:ve.ECEF;if(r){if(a===ve.NONE){const t=h();A(e.spatialReference,e.transform.origin,t,this._context.renderCoordsHelper.spatialReference);return{reprojection:a,objectTransformation:t,geometryTransformation:m(e.transform.localMatrix),needsBufferCopy:!1}}const t=l(h(),e.transform.origin);return c(t,t,e.transform.localMatrix),{reprojection:a,transformBeforeProject:t,needsBufferCopy:!0}}return{reprojection:a,needsBufferCopy:!0}}_transformOriginLocal(e,r,a,o){const i=this._context.renderCoordsHelper.spatialReference,l=e.anchor;he[0]=l.x,he[1]=l.y,he[2]=l.z;const c=h();A(e.spatialReference,he,c,i);const m=I.fromTypedArray(r);if(u(xe,c),F(m,m,xe),t(a)||t(o)){if(s(_e,c),n(_e,_e),t(a)){const e=B.fromTypedArray(a);S(e,e,_e)}if(t(o)){const e=B.fromTypedArray(o,4*o.BYTES_PER_ELEMENT);S(e,e,_e)}}return c}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,a=t.faces;if(a){let e=-1;for(let t=0;t<a.length;t++){const r=a[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces?t.faces:oe(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes&&e.vertexAttributes.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference;let a;const o=t.length/3;return e.spatialReference.equals(r)?a=t:(a=new Float64Array(t.length),O(e.vertexAttributes.position,e.spatialReference,0,a,r,0,o)),w(ye),N(ye,a,0,o),!j(ye,this._context.clippingExtent)}_createGeometryInfo(e,a){if(!M(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,a);if(r(o))return null;const{positionBuffer:s,uvBuffer:n,colorBuffer:i,symbolColorBuffer:l,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,p=this._getOrCreateComponents(e),f=[],d=[],g=[];let x=!1;for(const r of p){if(!this._validateFaces(e,r))return null;const a=this._getOrCreateFaces(e,r);if(0===a.length)continue;const o=this._createComponentNormals(s,c,r,a);o.didFlipNormals&&(x=!0);const m=[[te.POSITION,{size:3,data:s,exclusive:!0}],[te.NORMAL,{size:3,data:o.normals,exclusive:!0}]],p=[[te.POSITION,a],[te.NORMAL,o.indices]];t(i)&&(m.push([te.COLOR,{size:4,data:i,exclusive:!0}]),p.push([te.COLOR,a])),t(l)&&(m.push([te.SYMBOLCOLOR,{size:4,data:l,exclusive:!0}]),p.push([te.SYMBOLCOLOR,new Uint16Array(a.length)])),t(n)&&(m.push([te.UV0,{size:2,data:n,exclusive:!0}]),p.push([te.UV0,a])),t(u)&&(m.push([te.TANGENT,{size:4,data:u,exclusive:!0}]),p.push([te.TANGENT,a]));const _=new ae(m,p);f.push(_),d.push(h),g.push(this._getOrCreateMaterial(e,r))}return x&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:f,transformations:d,materials:g,objectTransformation:m}}_createEdgeMaterial(){const e={opacity:this._getLayerOpacity()};return Z(this.symbolLayer,e)}}const he=v(),pe=v(),fe=v(),de=v(),ge=v(),xe=h(),_e=i(),ye=E(),be=[new R];var ve;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(ve||(ve={}));export{me as Graphics3DMeshFillSymbolLayer,me as default};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import{isSome as t,isNone as r,unwrapOr as a,get as o}from"../../../../core/maybe.js";import{f as s,t as n}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{f as l,m as c,a as u}from"../../../../chunks/mat4.js";import{b as m,c as h}from"../../../../chunks/mat4f64.js";import{b as p,a as f,d,n as g,f as x,c as _}from"../../../../chunks/vec3.js";import{Z as y,O as b,c as v}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{projectVectorToDehydratedPoint as C,projectBuffer as O,computeTranslationToOriginAndRotation as A,canProjectWithoutEngine as M}from"../../../../geometry/projection.js";import{create as w,empty as E,expandWithBuffer as N,intersectsClippingArea as j}from"../../../../geometry/support/aaBoundingBox.js";import R from"../../../../geometry/support/MeshComponent.js";import P from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import{BufferViewVec3f64 as I,BufferViewVec3f as B}from"../../../../geometry/support/buffer/BufferView.js";import{t as F,a as S}from"../../../../chunks/vec32.js";import{transformPosition as L,transformNormal as U,projectNormalToPCPF as V,transformTangent as G,projectTangentToPCPF as $}from"../../../../geometry/support/meshUtils/projection.js";import{makeDehydratedPoint as D}from"../../../../layers/graphics/dehydratedFeatures.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{perObjectElevationAligner as z}from"./ElevationAligners.js";import{needsElevationUpdates3D as q}from"./elevationAlignmentUtils.js";import{ElevationContext as H}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as W}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as Y}from"./Graphics3DSymbolLayer.js";import{createMaterial as Z}from"../support/edgeUtils.js";import{parseColorMixMode as J,encodeSymbolColor as K}from"../support/symbolColorUtils.js";import Q from"../../support/debugFlags.js";import{AlphaDiscardMode as X,CullFaceOptions as ee,PrimitiveType as te}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as re}from"../../webgl-engine/lib/Geometry.js";import{generateDefaultIndexArray as ae}from"../../webgl-engine/lib/geometryDataUtils.js";import{Object3D as oe}from"../../webgl-engine/lib/Object3D.js";import{Texture as se}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as ne}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as ie}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as le}from"../../webgl-engine/materials/NativeLineMaterial.js";import{TextureWrapMode as ce}from"../../../webgl/enums.js";const ue=["mesh"];class me extends Y{constructor(e,t,r,a){super(e,t,r,a),this._materials=new Map,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){Q.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new le({color:[1,0,1,1]}),this._debugFaceNormalMaterial=new le({color:[0,1,1,1]}))}destroy(){super.destroy(),this._context.stage.removeMany(Array.from(this._materials.values(),(e=>e.material))),this._context.stage.removeMany(Array.from(this._textures.values())),this._materials.clear(),this._textures.clear()}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,ue,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t,new H),a=e.renderingInfo;return this._createAs3DShape(t,a,r,t.uid)}layerOpacityChanged(e,r){const a=this._getLayerOpacity();return this._materials.forEach((e=>{e.material.setParameters({layerOpacity:a});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>{const o=r(e);t(o)&&o.layerOpacityChanged(a,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,q)}slicePlaneEnabledChanged(e,r){return this._materials.forEach((e=>{e.material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled})})),e.forEach((e=>{const a=r(e);t(a)&&a.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._materials.forEach((t=>t.material.setParameters({usePBR:e}))),!0}pixelRatioChanged(){return!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(t){return r(t)?"-":t instanceof e?t.toHex():t.contentHash}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),a=!!e.vertexAttributes.color,o=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:a,hasVertexTangents:o,uid:`vc:${a},vt:${o},vct${t},svc:${r}`}}_materialProperties(e,t,r){const a=this._materialPropertiesDefault(e,r);if(!t.material)return a;const{color:o,colorTexture:s,normalTexture:n,doubleSided:i,alphaCutoff:l,alphaMode:c}=t.material,u=this._colorOrTextureUid(o),m=this._colorOrTextureUid(s),h=this._colorOrTextureUid(n);if(a.color=o,a.colorTexture=s,a.normalTexture=n,a.uid=`${a.uid},cmuid:${u},ctmuid:${m},ntmuid:${h},ds:${i},ac:${l},am:${c}`,t.material instanceof P){const{metallic:e,roughness:r,metallicRoughnessTexture:o,emissiveColor:s,emissiveTexture:n,occlusionTexture:i}=t.material,l=this._colorOrTextureUid(o),c=this._colorOrTextureUid(s),u=this._colorOrTextureUid(n),m=this._colorOrTextureUid(i);a.metallic=e,a.roughness=r,a.metallicRoughnessTexture=o,a.emissiveColor=s,a.emissiveTexture=n,a.occlusionTexture=i,a.uid=`${a.uid},mrm:${e},mrr:${r},mrt:${l},emuid:${c},etmuid:${u},otmuid:${m}`}return a}_setInternalColorValueParameters(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}_getLoadableTextureResource(e){return e.data?e.data:e.url}_getInternalTextureId(e){const r=this._getInternalTexture(e,X.Opaque);return t(r)?r.id:null}_getInternalTexture(e,t){const r=this._getLoadableTextureResource(e);if(!r)return null;const a=`${e.contentHash}/${t}`;let o=this._textures.get(a);return o||(o=new se(r,{mipmap:!0,wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,preMultiplyAlpha:t!==X.Opaque}),this._textures.set(a,o),this._context.stage.add(o),this._context.stage.loadImmediate(o)),o}_castTextureWrap(e="repeat"){if("string"==typeof e){const t=this._castTextureWrapIndividual(e);return{s:t,t}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return ce.CLAMP_TO_EDGE;case"mirror":return ce.MIRRORED_REPEAT;default:return ce.REPEAT}}_setInternalMaterialParameters(r,a){if(t(r.color)&&this._setInternalColorValueParameters(r.color,a),t(r.colorTexture)){const e=this._getInternalTexture(r.colorTexture,a.textureAlphaMode);t(e)?(a.textureId=e.id,a.textureAlphaPremultiplied=!!e.params.preMultiplyAlpha):a.textureId=void 0}t(r.normalTexture)&&(a.normalTextureId=this._getInternalTextureId(r.normalTexture)),t(r.emissiveColor)&&(a.emissiveFactor=e.toUnitRGB(r.emissiveColor)),t(r.emissiveTexture)&&(a.emissiveTextureId=this._getInternalTextureId(r.emissiveTexture)),t(r.occlusionTexture)&&(a.occlusionTextureId=this._getInternalTextureId(r.occlusionTexture)),t(r.metallicRoughnessTexture)&&(a.metallicRoughnessTextureId=this._getInternalTextureId(r.metallicRoughnessTexture))}_setExternalMaterialParameters(r){const a=this._drivenProperties.color;let o=t(this.symbolLayer.material)?this.symbolLayer.material.colorMixMode:null;if(a)r.externalColor=T;else{const a=t(this.symbolLayer.material)?this.symbolLayer.material.color:null;t(a)?r.externalColor=e.toUnitRGBA(a):(o=null,r.externalColor=T)}o&&(r.colorMixMode=o),r.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const t=e.vertexAttributes.color;if(r(t))return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}_getOrCreateMaterial(e,r){var a,o,s;const n=null==(a=r.material)?void 0:a.color,i=null==(o=r.material)?void 0:o.colorTexture,l=null==(s=r.material)?void 0:s.alphaMode,c="blend"===l,u=!("opaque"===l)&&(this._hasTransparentVertexColors(e)||t(n)&&n.a<1||t(i)&&i.transparent||c),m=this._materialProperties(e,r,u),h=this._materials.get(m.uid);if(h)return h.material;const p={material:null,isComponentTransparent:u,alphaMode:r.material?r.material.alphaMode:"opaque"},f=null==m.metallicRoughnessTexture&&null==m.metallic&&null==m.roughness,d={usePBR:this._usePBR(),isSchematic:f,vertexColors:m.hasVertexColors,symbolColors:m.hasSymbolVertexColors,vertexTangents:m.hasVertexTangents,ambient:y,diffuse:b,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:ee.None,layerOpacity:this._getLayerOpacity(),slicePlaneEnabled:this._context.slicePlaneEnabled,initTextureTransparent:!0};f||(d.mrrFactors=[null!=m.metallic?m.metallic:1,null!=m.roughness?m.roughness:1,.5]),r.material&&(d.doubleSided=r.material.doubleSided,d.cullFace=r.material.doubleSided?ee.None:ee.Back,d.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(d),this._setMaterialTransparentParameter(d,p),this._setInternalMaterialParameters(m,d);const g=new ie(d);return p.material=g,this._materials.set(m.uid,p),this._context.stage.add(g),g}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTransparentParameter(e,t){e.transparent=this.needsDrivenTransparentPass||t.isComponentTransparent||e.layerOpacity<1||e.opacity<1||e.externalColor&&e.externalColor[3]<1,"auto"===t.alphaMode?e.textureAlphaMode=e.transparent?X.MaskBlend:X.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?X.Opaque:"mask"===t.alphaMode?X.Mask:X.Blend}_addDebugNormals(e,t,r,a){const o=t.length,s=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*s,e.extent.height*s,e.extent.zmax-e.extent.zmin),i=[],l=[],c=[],u=[];for(let m=0;m<o;m++){const e=t[m],r=e.vertexAttributes.get(ne.POSITION),a=e.vertexAttributes.get(ne.NORMAL),o=e.indices.get(ne.POSITION),s=e.indices.get(ne.NORMAL),h=r.data,d=a.data;for(let t=0;t<o.length;t++){const e=3*o[t],r=3*s[t];for(let t=0;t<3;t++)i.push(h[e+t]);for(let t=0;t<3;t++)i.push(h[e+t]+d[r+t]*n);if(l.push(l.length),l.push(l.length),t%3==0){this._calculateFaceNormal(h,o,t,ge),this._getFaceVertices(h,o,t,pe,fe,de),p(pe,pe,fe),p(pe,pe,de),f(pe,pe,1/3);for(let e=0;e<3;e++)c.push(pe[e]);for(let e=0;e<3;e++)c.push(pe[e]+ge[e]*n);u.push(u.length),u.push(u.length)}}}const h=new re([[ne.POSITION,{data:i,size:3,exclusive:!0}]],[[ne.POSITION,new Uint32Array(l)]],te.Line);t.push(h),r.push(this._debugVertexNormalMaterial),a.push(m(a[0]));const d=new re([[ne.POSITION,{data:c,size:3,exclusive:!0}]],[[ne.POSITION,new Uint32Array(u)]],te.Line);t.push(d),r.push(this._debugFaceNormalMaterial),a.push(m(a[0]))}_createAs3DShape(e,r,a,o){const s=e.geometry;if("mesh"!==s.type)return null;const n=this._createGeometryInfo(s,r);if(!n)return null;const{geometries:i,materials:l,transformations:c,objectTransformation:u}=n;Q.DRAW_MESH_GEOMETRY_NORMALS&&this._addDebugNormals(s,i,l,c);const m=new oe({geometries:i,materials:l,transformations:c,metadata:{layerUid:this._context.layer.uid,graphicUid:o}});m.transformation=u;const h=this._createEdgeMaterial(),p=t(h)?{baseMaterial:l[0],edgeMaterials:[h],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,f=new W(this,m,i,null,null,z,a,p);return f.needsElevationUpdates=q(a.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.elevationContext.centerPointInElevationSR=this._getCenterPointInElevationSR(m),f.alignedSampledElevation=z(f,f.elevationContext,this._context.elevationProvider,this._context.renderCoordsHelper),f}_getCenterPointInElevationSR(e){const t=D(0,0,0,this._context.elevationProvider.spatialReference);return C([e.transformation[12],e.transformation[13],e.transformation[14]],this._context.renderCoordsHelper.spatialReference,t),t}_createComponentNormals(e,t,r,a){switch(r.shading||"flat"){case"source":return this._createComponentNormalsSource(e,t,r,a);case"flat":return this._createComponentNormalsFlat(e,a);case"smooth":return this._createComponentNormalsSmooth(e,a);default:return}}_createComponentNormalsSource(e,t,a,o){if(r(t))return this._createComponentNormalsFlat(e,o);let s=!1;if(!a.trustSourceNormals)for(let r=0;r<o.length;r+=3){this._calculateFaceNormal(e,o,r,ge);for(let e=0;e<3;e++){const a=3*o[r+e];pe[0]=t[a+0],pe[1]=t[a+1],pe[2]=t[a+2],d(ge,pe)<0&&(t[a+0]=-t[a+0],t[a+1]=-t[a+1],t[a+2]=-t[a+2],s=!0)}}return{normals:t,indices:o,didFlipNormals:s}}_createComponentNormalsFlat(e,t){const r=new Float32Array(t.length),a=new Uint32Array(3*t.length);for(let o=0;o<t.length;o+=3){const s=this._calculateFaceNormal(e,t,o,ge);for(let e=0;e<3;e++)r[o+e]=s[e],a[o+e]=o/3}return{normals:r,indices:a,didFlipNormals:!1}}_createComponentNormalsSmooth(e,t){const r={};for(let s=0;s<t.length;s+=3){const a=this._calculateFaceNormal(e,t,s,ge);for(let e=0;e<3;e++){const o=t[s+e];let n=r[o];n||(n={normal:v(),count:0},r[o]=n),p(n.normal,n.normal,a),n.count++}}const a=new Float32Array(3*t.length),o=new Uint32Array(3*t.length);for(let s=0;s<t.length;s++){const e=r[t[s]];1!==e.count&&(g(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)a[3*s+t]=e.normal[t];o[s]=s}return{normals:a,indices:o,didFlipNormals:!1}}_getFaceVertices(e,t,r,a,o,s){const n=3*t[r+0],i=3*t[r+1],l=3*t[r+2];a[0]=e[n+0],a[1]=e[n+1],a[2]=e[n+2],o[0]=e[i+0],o[1]=e[i+1],o[2]=e[i+2],s[0]=e[l+0],s[1]=e[l+1],s[2]=e[l+2]}_calculateFaceNormal(e,t,r,a){return this._getFaceVertices(e,t,r,pe,fe,de),x(fe,fe,pe),x(de,de,pe),_(pe,fe,de),g(a,pe),a}_getOrCreateComponents(e){return a(e.components,be)}_createPositionBuffer(e,r){let a=e.vertexAttributes.position;const o=r.reprojection===ve.ECEF?r.transformBeforeProject:null;if(t(o)&&(a=L(a,new Float64Array(a.length),o)),r.reprojection===ve.NONE)return r.needsBufferCopy?new Float64Array(a):a;const s=t(o)?a:new Float64Array(a.length);return O(a,e.spatialReference,0,s,this._context.renderCoordsHelper.spatialReference,0,a.length/3),s}_createNormalBuffer(e,a,o){let s=e.vertexAttributes.normal;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=U(s,new Float32Array(s.length),n));if("local"===this._context.graphicsCoreOwner.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return V(s,i,a,e.spatialReference,l)}_createTangentBuffer(e,a,o){let s=e.vertexAttributes.tangent;if(r(s))return null;const n=o.reprojection===ve.ECEF?o.transformBeforeProject:null;t(n)&&(s=G(s,new Float32Array(s.length),n));if("local"===this._context.graphicsCoreOwner.view.viewingMode||o.reprojection===ve.NONE)return o.needsBufferCopy&&e.vertexAttributes.normal===s?new Float32Array(s):s;const i=e.vertexAttributes.position,l=t(n)?s:new Float32Array(s.length);return $(s,i,a,e.spatialReference,l)}_createColorBuffer(e){return e.vertexAttributes.color}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=J(o(this.symbolLayer,"material","colorMixMode")),a=new Uint8Array(4);return K(t,r,a),a}return null}_createBuffers(e,r){const a=e.vertexAttributes&&e.vertexAttributes.position;if(!a)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,s=e.vertexAttributes.uv,n=e.vertexAttributes.tangent;if(t(o)&&o.length!==a.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(t(n)&&n.length/4!=a.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(t(s)&&s.length/2!=a.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const i=this._computeReprojectionInfo(e),l=this._createPositionBuffer(e,i),c=this._createColorBuffer(e),u=this._createSymbolColorBuffer(r),m=this._createNormalBuffer(e,l,i),p=this._createTangentBuffer(e,l,i);return{positionBuffer:l,normalBuffer:m,tangentBuffer:p,uvBuffer:s,colorBuffer:c,symbolColorBuffer:u,objectTransformation:i.reprojection===ve.NONE&&t(i.objectTransformation)?i.objectTransformation:this._transformOriginLocal(e,l,m,p),geometryTransformation:i.reprojection===ve.NONE&&t(i.geometryTransformation)?i.geometryTransformation:h()}}_computeReprojectionInfo(e){const r=t(e.transform),a=r&&e.transform.geographic||this._context.renderCoordsHelper.viewingMode===k.Local?ve.NONE:ve.ECEF;if(r){if(a===ve.NONE){const t=h();A(e.spatialReference,e.transform.origin,t,this._context.renderCoordsHelper.spatialReference);return{reprojection:a,objectTransformation:t,geometryTransformation:m(e.transform.localMatrix),needsBufferCopy:!1}}const t=l(h(),e.transform.origin);return c(t,t,e.transform.localMatrix),{reprojection:a,transformBeforeProject:t,needsBufferCopy:!0}}return{reprojection:a,needsBufferCopy:!0}}_transformOriginLocal(e,r,a,o){const i=this._context.renderCoordsHelper.spatialReference,l=e.anchor;he[0]=l.x,he[1]=l.y,he[2]=l.z;const c=h();A(e.spatialReference,he,c,i);const m=I.fromTypedArray(r);if(u(xe,c),F(m,m,xe),t(a)||t(o)){if(s(_e,c),n(_e,_e),t(a)){const e=B.fromTypedArray(a);S(e,e,_e)}if(t(o)){const e=B.fromTypedArray(o,4*o.BYTES_PER_ELEMENT);S(e,e,_e)}}return c}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,a=t.faces;if(a){let e=-1;for(let t=0;t<a.length;t++){const r=a[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,t){return t.faces?t.faces:ae(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes&&e.vertexAttributes.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference;let a;const o=t.length/3;return e.spatialReference.equals(r)?a=t:(a=new Float64Array(t.length),O(e.vertexAttributes.position,e.spatialReference,0,a,r,0,o)),E(ye),N(ye,a,0,o),!j(ye,this._context.clippingExtent)}_createGeometryInfo(e,a){if(!M(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,a);if(r(o))return null;const{positionBuffer:s,uvBuffer:n,colorBuffer:i,symbolColorBuffer:l,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:h}=o,p=this._getOrCreateComponents(e),f=[],d=[],g=[];let x=!1;for(const r of p){if(!this._validateFaces(e,r))return null;const a=this._getOrCreateFaces(e,r);if(0===a.length)continue;const o=this._createComponentNormals(s,c,r,a);o.didFlipNormals&&(x=!0);const m=[[ne.POSITION,{size:3,data:s,exclusive:!0}],[ne.NORMAL,{size:3,data:o.normals,exclusive:!0}]],p=[[ne.POSITION,a],[ne.NORMAL,o.indices]];t(i)&&(m.push([ne.COLOR,{size:4,data:i,exclusive:!0}]),p.push([ne.COLOR,a])),t(l)&&(m.push([ne.SYMBOLCOLOR,{size:4,data:l,exclusive:!0}]),p.push([ne.SYMBOLCOLOR,new Uint16Array(a.length)])),t(n)&&(m.push([ne.UV0,{size:2,data:n,exclusive:!0}]),p.push([ne.UV0,a])),t(u)&&(m.push([ne.TANGENT,{size:4,data:u,exclusive:!0}]),p.push([ne.TANGENT,a]));const _=new re(m,p);f.push(_),d.push(h),g.push(this._getOrCreateMaterial(e,r))}return x&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:f,transformations:d,materials:g,objectTransformation:m}}_createEdgeMaterial(){const e={opacity:this._getLayerOpacity()};return Z(this.symbolLayer,e)}}const he=v(),pe=v(),fe=v(),de=v(),ge=v(),xe=h(),_e=i(),ye=w(),be=[new R];var ve;!function(e){e[e.NONE=0]="NONE",e[e.ECEF=1]="ECEF"}(ve||(ve={}));export{me as Graphics3DMeshFillSymbolLayer,me 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 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 P,geometryToRenderInfo as C,createColorGeometry as U,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=P(e.geometry);if(r(n))return null;z.renderData=C(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),_=U({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=P(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=U({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),e.layerUid,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),e.layerUid,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 e from"../../../../Color.js";import{isSome as t,isNone as r,unwrap as o}from"../../../../core/maybe.js";import{getMetersPerUnitForSR as i}from"../../../../core/unitUtils.js";import{e as a}from"../../../../chunks/earcut.js";import{I as n}from"../../../../chunks/mat4f64.js";import{s}from"../../../../chunks/vec2.js";import{f as l,a as u}from"../../../../chunks/vec2f64.js";import{b as c,s as m}from"../../../../chunks/vec4.js";import{t as h}from"../../../../chunks/common.js";import{create as d,empty as p,expandWithBuffer as g,intersectsClippingArea as y,expandWithAABB as f}from"../../../../geometry/support/aaBoundingBox.js";import{create as _,empty as v,expandPointInPlace as x}from"../../../../geometry/support/aaBoundingRect.js";import{perVertexElevationAligner as D}from"./ElevationAligners.js";import{SymbolUpdateType as b,elevationModeChangeUpdateType as C,needsElevationUpdates2D as E}from"./elevationAlignmentUtils.js";import{ElevationContext as w}from"./ElevationContext.js";import G from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as S}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as j}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as T,geometryToRenderInfo as A,createWaterGeometry as P,geometryToRenderInfoDraped as U}from"./polygonUtils.js";import{Object3D as M}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as B}from"../../webgl-engine/lib/RenderGeometry.js";import{WaterMaterial as O}from"../../webgl-engine/materials/WaterMaterial.js";import{defaultWaterMaterialParameters as R,wavePresets as L}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const N=["polyline","polygon","extent"];class V extends j{constructor(e,t,r,o){super(e,t,r,o)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,N,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t,new w);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(t(this._material))return;const r={...R},o=this.symbolLayer.color;t(o)&&(r.color=e.toUnitRGBA(o));const i=this._getCombinedOpacity(o,{hasIntrinsicColor:!0});r.color=[r.color[0],r.color[1],r.color[2],i],r.transparent=i<1||this.needsDrivenTransparentPass,r.waveDirection=t(this.symbolLayer.waveDirection)?V.headingVectorFromAngle(this.symbolLayer.waveDirection):l(0,0);const a=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,n=L[a];r.waveStrength=n.waveStrength,r.waveTextureRepeat=n.textureRepeat,r.waveVelocity=n.waveVelocity,r.flowStrength=n.perturbationStrength,r.slicePlaneEnabled=this._context.slicePlaneEnabled,r.isDraped=this.draped,this._material=new O(r),this._context.stage.add(this._material)}layerOpacityChanged(){if(r(this._material))return!0;const e=this._material.parameters.color,t=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),o=t<1||this.needsDrivenTransparentPass;return this._material.setParameters({color:[e[0],e[1],e[2],t],transparent:o}),!0}layerElevationInfoChanged(e,t,r){const o=this._elevationContext.mode,i=C(V.elevationModeChangeTypes,r,o);if(i!==b.UPDATE)return i;const a=E(o);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>a))}slicePlaneEnabledChanged(){return t(this._material)&&this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_createAs3DShape(e,t,o){const i=T(e.geometry);if(r(i))return null;z.renderData=A(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);const a=z.renderData.position.length/3;if(z.uvCoords=new Float64Array(2*a),z.outNum=0,z.outGeometries=[],z.outTransforms=[],z.outMaterials=[],this._create3DShapeGeometries(z),this._logGeometryCreationWarnings(z.renderData,i.rings,"rings","WaterSymbol3DLayer"),0===z.outNum)return null;this._createUVCoordsFromVertices(z.uvCoords,z.renderData.mapPosition,a,this._context.elevationProvider.spatialReference);const n=new M({geometries:z.outGeometries,materials:z.outMaterials,transformations:z.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:o}}),s=new S(this,n,z.outGeometries,null,null,D,t);return s.alignedSampledElevation=z.renderData.sampledElevation,s.needsElevationUpdates=E(t.mode),s}_createUVCoordsFromVertices(e,t,r,o){const a=i(o);v(I);for(let i=0;i<r;i++)s(W,t[3*i+0],t[3*i+1]),x(I,W);c(I,I,a);const n=I[0]%V.unitSizeOfTexture,l=I[1]%V.unitSizeOfTexture;F[0]=I[0]-n,F[1]=I[1]-l;for(let i=0;i<r;i++)e[2*i+0]=(t[3*i+0]*a-F[0])/V.unitSizeOfTexture,e[2*i+1]=(t[3*i+1]*a-F[1])/V.unitSizeOfTexture}_create3DShapeGeometries(e){const r=e.renderData.polygons,i=e.uvCoords;for(const{count:s,index:l,position:u,mapPosition:c,holeIndices:m}of r){if(t(this._context.clippingExtent)&&(p(k),g(k,c),!y(k,this._context.clippingExtent)))continue;const r=a(c,m,3);if(0===r.length)continue;const h=new Uint32Array(r),d=new Float64Array(i.buffer,2*l*i.BYTES_PER_ELEMENT,2*s),f=P({indices:h,attributeData:{position:u,uv0:d,mapPosition:c}});e.outGeometries.push(f),e.outMaterials.push(o(this._material)),e.outTransforms.push(n),e.outNum++}}_createAsOverlay(e){const t=T(e.geometry);if(r(t))return null;o(this._material).renderPriority=this._renderPriority,Y.renderData=U(t,this._context.overlaySR);const i=Y.renderData.position.length/3;return Y.uvCoords=new Float64Array(2*i),Y.outNum=0,Y.outGeometries=[],Y.outBoundingBox=p(),Y.layerUid=this._context.layer.uid,Y.graphicsUid=e.uid,this._createAsOverlayWater(Y),this._logGeometryCreationWarnings(Y.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===Y.outNum?null:(this._createUVCoordsFromVertices(Y.uvCoords,Y.renderData.position,i,this._context.overlaySR),Y.outNum>0?new G(this,Y.outGeometries,Y.outBoundingBox):null)}_createAsOverlayWater(e){const t=e.uvCoords,r=e.renderData.polygons;for(const{position:i,holeIndices:n,index:s,count:l}of r){if(p(k),g(k,i),!y(k,this._context.clippingExtent))continue;f(e.outBoundingBox,k);const r=a(i,n,3);if(0===r.length)continue;const u=new Uint32Array(r),c=new Float64Array(t.buffer,2*s*t.BYTES_PER_ELEMENT,2*l),h=P({indices:u,attributeData:{position:i,uv0:c}}),d=new B(h,o(this._material),e.layerUid,e.graphicsUid),_=k;m(d.boundingSphere,.5*(_[0]+_[3]),.5*(_[1]+_[4]),0,.5*Math.sqrt((_[3]-_[0])*(_[3]-_[0])+(_[4]-_[1])*(_[4]-_[1]))),e.outGeometries.push(d),e.outNum++}}static headingVectorFromAngle(e){const t=u(),r=h(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}get test(){return{create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}V.unitSizeOfTexture=100,V.elevationModeChangeTypes={definedChanged:b.RECREATE,staysOnTheGround:b.NONE,onTheGroundChanged:b.RECREATE};const F=u(),I=_(),W=u(),k=d(),z={renderData:null,uvCoords:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null},Y={renderData:null,uvCoords:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};export{V as Graphics3DWaterSymbolLayer,V as default};
5
+ import e from"../../../../Color.js";import{isSome as t,isNone as r,unwrap as o}from"../../../../core/maybe.js";import{getMetersPerUnitForSR as i}from"../../../../core/unitUtils.js";import{e as a}from"../../../../chunks/earcut.js";import{I as n}from"../../../../chunks/mat4f64.js";import{s}from"../../../../chunks/vec2.js";import{f as l,a as u}from"../../../../chunks/vec2f64.js";import{b as c,s as m}from"../../../../chunks/vec4.js";import{t as h}from"../../../../chunks/common.js";import{create as d,empty as p,expandWithBuffer as g,intersectsClippingArea as y,expandWithAABB as f}from"../../../../geometry/support/aaBoundingBox.js";import{create as _,empty as v,expandPointInPlace as x}from"../../../../geometry/support/aaBoundingRect.js";import{perVertexElevationAligner as D}from"./ElevationAligners.js";import{SymbolUpdateType as b,elevationModeChangeUpdateType as C,needsElevationUpdates2D as E}from"./elevationAlignmentUtils.js";import{ElevationContext as w}from"./ElevationContext.js";import G from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as S}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as j}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as T,geometryToRenderInfo as A,createWaterGeometry as U,geometryToRenderInfoDraped as P}from"./polygonUtils.js";import{Object3D as M}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as B}from"../../webgl-engine/lib/RenderGeometry.js";import{WaterMaterial as O}from"../../webgl-engine/materials/WaterMaterial.js";import{defaultWaterMaterialParameters as R,wavePresets as L}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const N=["polyline","polygon","extent"];class V extends j{constructor(e,t,r,o){super(e,t,r,o)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._material),this._material=null}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,N,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t,new w);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(t(this._material))return;const r={...R},o=this.symbolLayer.color;t(o)&&(r.color=e.toUnitRGBA(o));const i=this._getCombinedOpacity(o,{hasIntrinsicColor:!0});r.color=[r.color[0],r.color[1],r.color[2],i],r.transparent=i<1||this.needsDrivenTransparentPass,r.waveDirection=t(this.symbolLayer.waveDirection)?V.headingVectorFromAngle(this.symbolLayer.waveDirection):l(0,0);const a=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,n=L[a];r.waveStrength=n.waveStrength,r.waveTextureRepeat=n.textureRepeat,r.waveVelocity=n.waveVelocity,r.flowStrength=n.perturbationStrength,r.slicePlaneEnabled=this._context.slicePlaneEnabled,r.isDraped=this.draped,this._material=new O(r),this._context.stage.add(this._material)}layerOpacityChanged(){if(r(this._material))return!0;const e=this._material.parameters.color,t=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),o=t<1||this.needsDrivenTransparentPass;return this._material.setParameters({color:[e[0],e[1],e[2],t],transparent:o}),!0}layerElevationInfoChanged(e,t,r){const o=this._elevationContext.mode,i=C(V.elevationModeChangeTypes,r,o);if(i!==b.UPDATE)return i;const a=E(o);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>a))}slicePlaneEnabledChanged(){return t(this._material)&&this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}pixelRatioChanged(){return!0}_createAs3DShape(e,t,o){const i=T(e.geometry);if(r(i))return null;z.renderData=A(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);const a=z.renderData.position.length/3;if(z.uvCoords=new Float64Array(2*a),z.outNum=0,z.outGeometries=[],z.outTransforms=[],z.outMaterials=[],this._create3DShapeGeometries(z),this._logGeometryCreationWarnings(z.renderData,i.rings,"rings","WaterSymbol3DLayer"),0===z.outNum)return null;this._createUVCoordsFromVertices(z.uvCoords,z.renderData.mapPosition,a,this._context.elevationProvider.spatialReference);const n=new M({geometries:z.outGeometries,materials:z.outMaterials,transformations:z.outTransforms,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:o}}),s=new S(this,n,z.outGeometries,null,null,D,t);return s.alignedSampledElevation=z.renderData.sampledElevation,s.needsElevationUpdates=E(t.mode),s}_createUVCoordsFromVertices(e,t,r,o){const a=i(o);v(I);for(let i=0;i<r;i++)s(W,t[3*i+0],t[3*i+1]),x(I,W);c(I,I,a);const n=I[0]%V.unitSizeOfTexture,l=I[1]%V.unitSizeOfTexture;F[0]=I[0]-n,F[1]=I[1]-l;for(let i=0;i<r;i++)e[2*i+0]=(t[3*i+0]*a-F[0])/V.unitSizeOfTexture,e[2*i+1]=(t[3*i+1]*a-F[1])/V.unitSizeOfTexture}_create3DShapeGeometries(e){const r=e.renderData.polygons,i=e.uvCoords;for(const{count:s,index:l,position:u,mapPosition:c,holeIndices:m}of r){if(t(this._context.clippingExtent)&&(p(k),g(k,c),!y(k,this._context.clippingExtent)))continue;const r=a(c,m,3);if(0===r.length)continue;const h=new Uint32Array(r),d=new Float64Array(i.buffer,2*l*i.BYTES_PER_ELEMENT,2*s),f=U({indices:h,attributeData:{position:u,uv0:d,mapPosition:c}});e.outGeometries.push(f),e.outMaterials.push(o(this._material)),e.outTransforms.push(n),e.outNum++}}_createAsOverlay(e){const t=T(e.geometry);if(r(t))return null;o(this._material).renderPriority=this._renderPriority,Y.renderData=P(t,this._context.overlaySR);const i=Y.renderData.position.length/3;return Y.uvCoords=new Float64Array(2*i),Y.outNum=0,Y.outGeometries=[],Y.outBoundingBox=p(),Y.layerUid=this._context.layer.uid,Y.graphicsUid=e.uid,this._createAsOverlayWater(Y),this._logGeometryCreationWarnings(Y.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===Y.outNum?null:(this._createUVCoordsFromVertices(Y.uvCoords,Y.renderData.position,i,this._context.overlaySR),Y.outNum>0?new G(this,Y.outGeometries,Y.outBoundingBox):null)}_createAsOverlayWater(e){const t=e.uvCoords,r=e.renderData.polygons;for(const{position:i,holeIndices:n,index:s,count:l}of r){if(p(k),g(k,i),!y(k,this._context.clippingExtent))continue;f(e.outBoundingBox,k);const r=a(i,n,3);if(0===r.length)continue;const u=new Uint32Array(r),c=new Float64Array(t.buffer,2*s*t.BYTES_PER_ELEMENT,2*l),h=U({indices:u,attributeData:{position:i,uv0:c}}),d=new B(h,o(this._material),{layerUid:e.layerUid,graphicUid:e.graphicsUid}),_=k;m(d.boundingSphere,.5*(_[0]+_[3]),.5*(_[1]+_[4]),0,.5*Math.sqrt((_[3]-_[0])*(_[3]-_[0])+(_[4]-_[1])*(_[4]-_[1]))),e.outGeometries.push(d),e.outNum++}}static headingVectorFromAngle(e){const t=u(),r=h(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}get test(){return{create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}V.unitSizeOfTexture=100,V.elevationModeChangeTypes={definedChanged:b.RECREATE,staysOnTheGround:b.NONE,onTheGroundChanged:b.RECREATE};const F=u(),I=_(),W=u(),k=d(),z={renderData:null,uvCoords:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null},Y={renderData:null,uvCoords:null,outNum:0,outBoundingBox:null,outGeometries:null,outMaterials:null,outTransforms:null};export{V as Graphics3DWaterSymbolLayer,V 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};