@arcgis/core 4.33.0-next.20250210 → 4.33.0-next.20250212

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 (562) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/ArcadeModuleResolver.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/support/FeatureSet.js +1 -1
  9. package/arcade/featureset/support/Guid.js +1 -1
  10. package/arcade/featureset/support/cache.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3c23e567cfb7372c44ba.js → 0a5689348d544090006d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 1249fd2f83caeaefd8ce.js} +1 -1
  21. package/assets/esri/core/workers/chunks/135fb580d8afd8d60811.js +1 -0
  22. package/assets/esri/core/workers/chunks/{946a9890f3621d1dfbc5.js → 144e534d4ac1aafab60d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cee3a38b92a48a58c4d0.js → 152becae48572299b07f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f200dca22f9f9bbb8670.js → 17213c3fc63f580e5b73.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
  28. package/assets/esri/core/workers/chunks/24e6476f32ad2014d39d.js +1 -0
  29. package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
  30. package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
  31. package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
  33. package/assets/esri/core/workers/chunks/{5fbdb5fea7d6676fcf19.js → 2c1a85a801cb4d9d737e.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7f87cf3d6a365d987f69.js → 30bd5b3204e09f516ea2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
  36. package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
  37. package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{c04091eea7089dc2e864.js → 35bcb0622234b38d85b4.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{92984981afcbb95828cd.js → 37cfd102b6ab5b959f9d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
  41. package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
  42. package/assets/esri/core/workers/chunks/3ba85f1d660b8887f963.js +314 -0
  43. package/assets/esri/core/workers/chunks/{1d51c064045e9c47bd2e.js → 3bad184751fcb26c003c.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{e468bf4ec7402942ad8c.js → 3ebdd0701e77bb28c75d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{a559db8654b4f83fd79b.js → 3f6516af411256d90a03.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{c83b26ff96e39266adc2.js → 4300c80fa10c5d9141e8.js} +1 -1
  48. package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
  49. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js → 486df1e042204b90b0dd.js} +2 -2
  50. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js.LICENSE.txt → 486df1e042204b90b0dd.js.LICENSE.txt} +1 -1
  51. package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
  52. package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
  53. package/assets/esri/core/workers/chunks/52f61e1f5972a72b6b54.js +1 -0
  54. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js → 5693d9ce4472a4c5959f.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js.LICENSE.txt → 5693d9ce4472a4c5959f.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{1accbc048b74857269e4.js → 57924f4909f2cbe5d64c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js → 5b56b271afb0fadf48b4.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js.LICENSE.txt → 5b56b271afb0fadf48b4.js.LICENSE.txt} +1 -1
  60. package/assets/esri/core/workers/chunks/{b3aeda290470dcb2bdd2.js → 5cf08ee5114273163e09.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js → 6518954889df2e781c47.js} +2 -2
  65. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js.LICENSE.txt → 6518954889df2e781c47.js.LICENSE.txt} +1 -1
  66. package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
  67. package/assets/esri/core/workers/chunks/{220b12654b94c94f8d8a.js → 6fa1f1e431aae1794ce3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
  69. package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
  70. package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
  74. package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
  75. package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
  76. package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
  77. package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
  78. package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
  79. package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
  80. package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
  81. package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
  82. package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
  83. package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
  84. package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
  85. package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
  86. package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
  89. package/assets/esri/core/workers/chunks/{e6087eda5e3b7e5ad3e1.js → a12afed58acff17708ca.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
  92. package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
  93. package/assets/esri/core/workers/chunks/{95ad76e58452b60fb79f.js → a864ef9b584c83ebf6ae.js} +1 -1
  94. package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
  95. package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js → b0952b81d5be214262dd.js} +2 -2
  97. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js.LICENSE.txt → b0952b81d5be214262dd.js.LICENSE.txt} +1 -1
  98. package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
  99. package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js → b83151b03bbeba466f82.js} +2 -2
  102. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js.LICENSE.txt → b83151b03bbeba466f82.js.LICENSE.txt} +1 -1
  103. package/assets/esri/core/workers/chunks/bf0bf2b912d668575a9b.js +1 -0
  104. package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → c061cad8323f0469e7e4.js} +1 -1
  105. package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
  106. package/assets/esri/core/workers/chunks/{fef135e55706d84d1947.js → c4ce3c35b52b7999e877.js} +1 -1
  107. package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
  108. package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
  109. package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
  110. package/assets/esri/core/workers/chunks/cc8eb975a543556f88ae.js +1 -0
  111. package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
  112. package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
  113. package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
  114. package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
  115. package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
  116. package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → d7b260d6187f29e0c136.js} +1 -1
  119. package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +1 -0
  120. package/assets/esri/core/workers/chunks/de87009542886fad9a2f.js +2 -0
  121. package/assets/esri/core/workers/chunks/{b765670b47d209d7655a.js.LICENSE.txt → de87009542886fad9a2f.js.LICENSE.txt} +1 -1
  122. package/assets/esri/core/workers/chunks/{bb73cd34fbae935ccbcc.js → dff4a9d656b84fe3e052.js} +1 -1
  123. package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
  124. package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
  125. package/assets/esri/core/workers/chunks/e490f70f192780d7ad50.js +1 -0
  126. package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
  127. package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
  128. package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
  129. package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f088e7db4e7ac85aaff1.js +1 -0
  132. package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → f0d28fe4deb7cd894765.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f52ed527b46c316eb369.js +1 -0
  136. package/assets/esri/core/workers/chunks/{140d0c4285c6978103ea.js → f5ce6af342c02a4b0d15.js} +7 -7
  137. package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
  138. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  139. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  140. package/assets/esri/themes/base/_core.scss +4 -0
  141. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
  142. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
  143. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
  144. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
  145. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
  146. package/assets/esri/themes/dark/main.css +1 -1
  147. package/assets/esri/themes/light/main.css +1 -1
  148. package/assets/esri/themes/light/view.css +1 -1
  149. package/chunks/Bufferer-B-V7yYm-.js +5 -0
  150. package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
  151. package/chunks/Envelope.js +1 -1
  152. package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
  153. package/chunks/Geometry.js +1 -1
  154. package/chunks/OperatorClip.js +1 -1
  155. package/chunks/OperatorCut.js +1 -1
  156. package/chunks/OperatorGeneralize.js +1 -1
  157. package/chunks/OperatorGeodesicBuffer.js +1 -1
  158. package/chunks/OperatorGeodeticArea.js +1 -1
  159. package/chunks/OperatorGeodeticDistance.js +1 -1
  160. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  161. package/chunks/OperatorProximity.js +1 -1
  162. package/chunks/OperatorProximityGeodesic.js +1 -1
  163. package/chunks/OperatorShapePreservingLength.js +1 -1
  164. package/chunks/OperatorShapePreservingProject.js +1 -1
  165. package/chunks/Point2D.js +1 -1
  166. package/chunks/ProjectionTransformation.js +1 -1
  167. package/chunks/QuadraticBezier.js +1 -1
  168. package/chunks/ShadowHighlight.glsl.js +2 -4
  169. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  170. package/chunks/disjointOperator.js +1 -1
  171. package/chunks/distanceOperator.js +1 -1
  172. package/chunks/lyr3DWorker.js +1 -1
  173. package/core/Accessor.js +1 -1
  174. package/core/Collection.js +1 -1
  175. package/core/Logger.js +1 -1
  176. package/core/ObjectPool.js +1 -1
  177. package/core/RandomLCG.js +1 -1
  178. package/core/XHRAdapter.js +1 -1
  179. package/core/accessorSupport/watch.js +1 -1
  180. package/core/pbf.js +1 -1
  181. package/core/sql/UnknownTimeZone.js +1 -1
  182. package/core/sql.js +1 -1
  183. package/core/workers/RemoteClient.js +1 -1
  184. package/editing/sharedTemplates/SharedTemplate.d.ts +4 -0
  185. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  186. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  187. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  188. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  189. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  190. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  191. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  192. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  193. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  194. package/editing/sharedTemplates/executor/builders/pointAtAllVerticesOfLine.js +1 -1
  195. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfLine.js +1 -1
  196. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfRadial.js +1 -1
  197. package/editing/sharedTemplates/executor/builders/pointAtEndOfLine.js +1 -1
  198. package/editing/sharedTemplates/executor/builders/pointAtInteriorVertices.js +1 -1
  199. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  200. package/editing/sharedTemplates/executor/builders/pointAtNotBeginningOfLine.js +1 -1
  201. package/editing/sharedTemplates/executor/builders/pointAtNotEndOfLine.js +1 -1
  202. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  203. package/editing/sharedTemplates/executor/builders/pointAtPolygonNotStart.js +1 -1
  204. package/editing/sharedTemplates/executor/builders/pointAtPolygonStart.js +1 -1
  205. package/editing/sharedTemplates/executor/builders/pointIdentity.js +1 -1
  206. package/editing/sharedTemplates/executor/builders/pointPrimaryIdentity.js +1 -1
  207. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  208. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  209. package/editing/sharedTemplates/executor/builders/polygonIdentity.js +1 -1
  210. package/editing/sharedTemplates/executor/builders/polygonPrimaryIdentity.js +1 -1
  211. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  212. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  213. package/editing/sharedTemplates/executor/builders/twoPointLines.js +1 -1
  214. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  215. package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
  216. package/editing/sharedTemplates/executor/support/executorUtils.js +1 -1
  217. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  218. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  219. package/editing/sharedTemplates/templateDefinitions/parts/builders/builderUtils.js +1 -1
  220. package/editing/templateUtils.js +1 -1
  221. package/geometry/SpatialReference.js +1 -1
  222. package/geometry/operators/extendOperator.js +1 -1
  223. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  224. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  225. package/geometry/operators/gx/operatorBuffer.js +1 -1
  226. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  227. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  228. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  229. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  230. package/geometry/operators/gx/operatorOffset.js +1 -1
  231. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  232. package/geometry/operators/gx/operatorSimplify.js +1 -1
  233. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  234. package/geometry/operators/gx/operatorUnion.js +1 -1
  235. package/geometry/operators/isNearOperator.js +1 -1
  236. package/geometry/operators/json/disjointOperator.js +1 -1
  237. package/geometry/operators/projectOperator.js +1 -1
  238. package/geometry/operators/reshapeOperator.js +1 -1
  239. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  240. package/geometry/operators/support/apiConverter.js +1 -1
  241. package/geometry/operators/support/initNoPeFactory.js +1 -1
  242. package/geometry/operators/support/jsonConverter.js +1 -1
  243. package/geometry/support/DoubleArray.js +1 -1
  244. package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
  245. package/geometry/support/MeshTexture.js +1 -1
  246. package/geometry/support/MeshTransform.js +1 -1
  247. package/geometry/support/UCharArray.js +5 -0
  248. package/geometry/support/UShortArray.js +5 -0
  249. package/geometry/support/buffer/BufferPool.js +1 -1
  250. package/geometry/support/buffer/BufferView.js +1 -1
  251. package/geometry/support/buffer/internals/Mat3.js +1 -1
  252. package/geometry/support/buffer/internals/Mat4.js +1 -1
  253. package/geometry/support/buffer/internals/Scalar.js +1 -1
  254. package/geometry/support/buffer/internals/Vec2.js +1 -1
  255. package/geometry/support/buffer/internals/Vec3.js +1 -1
  256. package/geometry/support/buffer/internals/Vec4.js +1 -1
  257. package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
  258. package/identity/OAuthInfo.js +1 -1
  259. package/interfaces.d.ts +124 -68
  260. package/layers/VectorTileLayer.js +1 -1
  261. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  262. package/layers/mixins/EditBusLayer.js +1 -1
  263. package/layers/mixins/PublishableLayer.js +1 -1
  264. package/layers/mixins/operationalLayers.js +1 -1
  265. package/layers/save/featureLayerUtils.js +1 -1
  266. package/layers/save/utils.js +1 -1
  267. package/layers/support/AggregateField.js +1 -1
  268. package/layers/support/CodedValueDomain.js +1 -1
  269. package/layers/support/Field.js +1 -1
  270. package/layers/support/ImageElement.js +1 -1
  271. package/layers/support/InheritedDomain.js +1 -1
  272. package/layers/support/LOD.js +1 -1
  273. package/layers/support/LabelClass.js +1 -1
  274. package/layers/support/LabelExpressionInfo.js +1 -1
  275. package/layers/support/OrderByInfo.js +1 -1
  276. package/layers/support/PurgeOptions.js +1 -1
  277. package/layers/support/RangeDomain.js +1 -1
  278. package/layers/support/Sublayer.js +1 -1
  279. package/layers/support/SubtypeSublayer.js +1 -1
  280. package/layers/support/TileInfo.js +1 -1
  281. package/layers/support/TilemapCache.js +1 -1
  282. package/layers/support/VideoElement.js +1 -1
  283. package/layers/support/commonProperties.js +1 -1
  284. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  285. package/layers/support/source/DataLayerSource.js +1 -1
  286. package/layers/support/wmsUtils.js +1 -1
  287. package/networks/Network.js +1 -1
  288. package/networks/RulesTable.js +1 -1
  289. package/networks/UtilityNetwork.js +1 -1
  290. package/networks/support/typeUtils.js +1 -1
  291. package/package.json +3 -3
  292. package/portal/Portal.js +1 -1
  293. package/renderers/support/RasterSymbolizer.js +1 -1
  294. package/rest/print.js +1 -1
  295. package/rest/support/AttachmentQuery.js +1 -1
  296. package/rest/support/ClosestFacilityParameters.js +1 -1
  297. package/rest/support/DirectionLine.js +1 -1
  298. package/rest/support/DirectionPoint.js +1 -1
  299. package/rest/support/JobInfo.js +1 -1
  300. package/rest/support/NetworkFeatureSet.js +1 -1
  301. package/rest/support/PointBarrier.js +1 -1
  302. package/rest/support/PolygonBarrier.js +1 -1
  303. package/rest/support/PolylineBarrier.js +1 -1
  304. package/rest/support/Query.js +1 -1
  305. package/rest/support/RelationshipQuery.js +1 -1
  306. package/rest/support/RouteInfo.js +1 -1
  307. package/rest/support/RouteParameters.js +1 -1
  308. package/rest/support/ServiceAreaParameters.js +1 -1
  309. package/rest/support/Stop.js +1 -1
  310. package/rest/support/TopFeaturesQuery.js +1 -1
  311. package/support/revision.js +1 -1
  312. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  313. package/symbols/FillSymbol3DLayer.js +1 -1
  314. package/symbols/IconSymbol3DLayer.js +1 -1
  315. package/symbols/LineSymbol3DLayer.js +1 -1
  316. package/symbols/ObjectSymbol3DLayer.js +1 -1
  317. package/symbols/PathSymbol3DLayer.js +1 -1
  318. package/symbols/TextSymbol3DLayer.js +1 -1
  319. package/symbols/WaterSymbol3DLayer.js +1 -1
  320. package/symbols/cim/OverrideHelper.js +1 -1
  321. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  322. package/symbols/cim/effects/EffectArrow.js +1 -1
  323. package/symbols/cim/effects/EffectBuffer.js +1 -1
  324. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  325. package/symbols/cim/effects/EffectCut.js +1 -1
  326. package/symbols/cim/effects/EffectDashes.js +1 -1
  327. package/symbols/cim/effects/EffectDonut.js +1 -1
  328. package/symbols/cim/effects/EffectJog.js +1 -1
  329. package/symbols/cim/effects/EffectMove.js +1 -1
  330. package/symbols/cim/effects/EffectOffset.js +1 -1
  331. package/symbols/cim/effects/EffectReverse.js +1 -1
  332. package/symbols/cim/effects/EffectRotate.js +1 -1
  333. package/symbols/cim/effects/EffectScale.js +1 -1
  334. package/symbols/cim/effects/EffectWave.js +1 -1
  335. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  336. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  337. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  338. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  339. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  340. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  341. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  342. package/symbols/support/ElevationInfo.js +1 -1
  343. package/time/TimeExtent.js +1 -1
  344. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  345. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  346. package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
  347. package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
  348. package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
  349. package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
  350. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  351. package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
  352. package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
  353. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  354. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  355. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  356. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  358. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  359. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  360. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  361. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  362. package/views/2d/layers/LayerView2D.js +1 -1
  363. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  364. package/views/2d/layers/RouteLayerView2D.js +1 -1
  365. package/views/2d/layers/features/FeatureContainer.js +1 -1
  366. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  367. package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
  368. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  369. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  370. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  371. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  372. package/views/2d/layers/support/HighlightCounter.js +1 -1
  373. package/views/2d/tiling/TileCoverage.js +1 -1
  374. package/views/2d/tiling/TileKey.js +1 -1
  375. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  376. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  377. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  378. package/views/3d/layers/I3SMeshView3D.js +1 -1
  379. package/views/3d/layers/MediaLayerView3D.js +1 -1
  380. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  381. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  382. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  383. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  384. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  385. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  386. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  387. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  388. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  389. package/views/3d/layers/graphics/GraphicsCorePerformanceInfo.js +1 -1
  390. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  391. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  392. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  393. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  394. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  395. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  396. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  397. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  398. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  399. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  400. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  401. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  402. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  403. package/views/3d/state/Frustum.js +1 -1
  404. package/views/3d/support/DisplayQualityProfile.js +1 -1
  405. package/views/3d/support/QualitySettings.js +1 -1
  406. package/views/3d/terrain/OverlayManager.js +1 -1
  407. package/views/3d/terrain/TerrainSurface.js +1 -1
  408. package/views/3d/terrain/TextureFader.js +1 -1
  409. package/views/3d/terrain/TilingScheme.js +1 -1
  410. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  411. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  412. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  413. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  414. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  415. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  416. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  417. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  418. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  420. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  421. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  422. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  423. package/views/SceneView.js +1 -1
  424. package/views/View.js +1 -1
  425. package/views/View2D.js +1 -1
  426. package/views/draw/DrawAction.js +1 -1
  427. package/views/draw/drawSurfaces.js +1 -1
  428. package/views/input/BrowserEventSource.js +1 -1
  429. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  430. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  431. package/views/layers/LayerView.js +1 -1
  432. package/views/support/Scheduler.js +1 -1
  433. package/views/support/imageReprojection.js +1 -1
  434. package/views/webgl/FramebufferObject.js +1 -1
  435. package/views/webgl/Parameters.js +1 -1
  436. package/views/webgl/RenderingContext.js +1 -1
  437. package/views/webgl/ShaderBuilder.js +1 -1
  438. package/views/webgl/Texture.js +1 -1
  439. package/webscene/Environment.js +1 -1
  440. package/webscene/SunLighting.js +1 -1
  441. package/webscene/VirtualLighting.js +1 -1
  442. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  443. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  444. package/widgets/AreaMeasurement2D.js +1 -1
  445. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  446. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  447. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  448. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  449. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  450. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  451. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  452. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  453. package/widgets/BatchAttributeForm.js +1 -1
  454. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  455. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  456. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  457. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  458. package/widgets/DistanceMeasurement2D.js +1 -1
  459. package/widgets/Editor/AddAssociationWorkflow.js +5 -0
  460. package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
  461. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  462. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  463. package/widgets/Editor/EditorViewModel.js +1 -1
  464. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  465. package/widgets/Editor/UpdateWorkflow.js +1 -1
  466. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  467. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  468. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  469. package/widgets/Editor/modelUploadUtils.js +1 -1
  470. package/widgets/Editor/workflowUtils.js +1 -1
  471. package/widgets/Editor.js +1 -1
  472. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  473. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  474. package/widgets/Feature/FeatureViewModel.js +1 -1
  475. package/widgets/Feature/support/featureUtils.js +1 -1
  476. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  477. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
  478. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
  479. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  480. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
  481. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  482. package/widgets/FeatureForm.js +1 -1
  483. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  484. package/widgets/LayerList/LayerListItem.js +1 -1
  485. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  486. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  487. package/widgets/OrientedImageryViewer/constants.js +1 -1
  488. package/widgets/OrientedImageryViewer/galleryUtils.js +5 -0
  489. package/widgets/OrientedImageryViewer/utils.js +1 -1
  490. package/widgets/OrientedImageryViewer.js +1 -1
  491. package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
  492. package/widgets/Search/SearchViewModel.js +1 -1
  493. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  494. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  495. package/widgets/Sketch/support/sketchUtils.js +1 -1
  496. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
  497. package/widgets/Widget.js +1 -1
  498. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  499. package/widgets/support/FilterBuilder.js +1 -1
  500. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  501. package/widgets/support/FilterCondition.js +1 -1
  502. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
  503. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  504. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  505. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  506. package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
  507. package/assets/esri/core/workers/chunks/08c4b585290efc98ca5d.js +0 -1
  508. package/assets/esri/core/workers/chunks/117e7a12af77c761efb5.js +0 -1
  509. package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
  510. package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
  511. package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
  512. package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
  513. package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
  514. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  515. package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
  516. package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
  517. package/assets/esri/core/workers/chunks/324a5547c64a3bae670d.js +0 -1
  518. package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +0 -1
  519. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  520. package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
  521. package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
  522. package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
  523. package/assets/esri/core/workers/chunks/5be7cf1564e756c24066.js +0 -1
  524. package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
  525. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  526. package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
  527. package/assets/esri/core/workers/chunks/6d79ec15d1858839f576.js +0 -1
  528. package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
  529. package/assets/esri/core/workers/chunks/7966c245a073c85f04b1.js +0 -1
  530. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  531. package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
  532. package/assets/esri/core/workers/chunks/8bd51b5b392dfacc922f.js +0 -1
  533. package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
  534. package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
  535. package/assets/esri/core/workers/chunks/9c6380af3bc3130658e1.js +0 -1
  536. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  537. package/assets/esri/core/workers/chunks/b18620fc15707e4413a1.js +0 -1
  538. package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
  539. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
  540. package/assets/esri/core/workers/chunks/b765670b47d209d7655a.js +0 -2
  541. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
  542. package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
  543. package/assets/esri/core/workers/chunks/c249ad935f54d3b49ae3.js +0 -1
  544. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  545. package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
  546. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  547. package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
  548. package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
  549. package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
  550. package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
  551. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  552. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  553. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
  554. package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
  555. package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
  556. package/assets/esri/core/workers/chunks/faf9063420262ea40fd8.js +0 -1
  557. package/chunks/Bufferer-DjC-SKTJ.js +0 -5
  558. package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
  559. package/editing/sharedTemplates/support/sharedTemplateUtils.js +0 -5
  560. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
  561. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
  562. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as u}from"../../../../core/string.js";import{dataComponents as m}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as _,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as x}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as b}from"../../../../support/arcadeOnDemand.js";import{CIMSymbolHelper as v}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as S}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as P}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as R}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as w}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import{focusAreaHUDColor as z}from"../../../FocusAreas.js";import{transparentUnit as O}from"./constants.js";import{perObjectElevationAligner as j}from"./ElevationAligners.js";import{SymbolUpdateType as M,elevationModeChangeUpdateType as I,needsElevationUpdates2D as T}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as E}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A}from"./graphicUtils.js";import{ApplyRendererDiffResult as U}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as L}from"./placementUtils.js";import{placePointOnGeometry as G,updateStageObjectGeometry as V,getLocalOriginForPoint as H,extendPointGraphicElevationContext as k,createStageObject as B}from"./pointUtils.js";import{initFastSymbolUpdatesState as N,updateFastSymbolUpdatesState as $,evaluateModelTransformScale as W,ConvertOptions as q}from"../support/FastSymbolUpdates.js";import{createTexture as J,requiresHalfTexelOffset as Z,defaultBoundingBox as K,defaultSymbolSizeRatio as Q,defaultTexSize as X}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as Y}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as ee}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as te}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as re}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ie}from"../../webgl-engine/materials/HUDMaterial.js";const se=f(0,0,1),oe=16,ae=1.5,ne=[X*Q,X*Q];class le extends F{getCachedSize(){return{size:this._getIconSize()}}constructor(e,t,r,i){super(e,t,r,i),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbolLayer),i=ue(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):oe);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._overrideHelperClass;let r=this._cimData;if(t&&r&&r.symbol||this.logger.error("Can't create texture, CIM data is undefined"),r.primitiveOverrides){r=s(r);const i=r.primitiveOverrides;t.evaluateOverrides(i,e,this._arcadeInfo.geometryType,null,null),t.applyOverrides(r.symbol,i)}const i=u(JSON.stringify(r));let o=this._cimSymbolTextures.get(i);if(o)return o;const a=this._context.sharedResources.cimSymbolRasterizer,n=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;n&&t.applyDictionaryTextOverrides(r.symbol,e,n,null);const l=null!=this._cimScaleFactorOrFunction?S(this._cimScaleFactorOrFunction,e):1;1!==l&&r.symbol&&P(r.symbol,l,!0);const c=v.getEnvelope(r,null,a.resourceManager);if(c?.width&&c.height){const e=c.x+c.width/2,t=c.y+c.height/2,i=a.rasterize({type:"cim",data:r},c.width,c.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),s=new w({x:-c.x/c.width-.5,y:(c.height+c.y)/c.height-.5});this._cimMaterialParametersInfo.anchorPosition=me("relative",s),o=new re(i,{width:i?.width??1,height:i?.height??1,reloadable:!0})}else o=new re(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(i,o),this._context.stage.add(o),o}_prepareMaterialParameters(){const e={anchorPosition:me(this.symbolLayer.anchor,this.symbolLayer.anchorPosition),rotation:this.symbolLayer.angle},t=this.symbol;if(ce(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),(0!==e.rotation||this._drivenProperties.rotation)&&(e.hasRotation=!0);const r=!has("disable-feature:non-occluded-hud");return e.occlusionTest=!r,e.occludedFragmentFade=r,e.horizonCullingEnabled=r&&this._context.spherical,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(he(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>J(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Z(t),e.distanceFieldBoundingBox=K;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Q,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=de(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const s=this._context.sharedResources.cimSymbolRasterizer,o=[],a=t,n=a?.symbol;v.fetchResources(n,s.resourceManager,o,r),v.fetchFonts(n,s.resourceManager,o);const c=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&o.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),o.length>0&&(await Promise.all(o),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await b(t,this._context.layer.spatialReference,c),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js");this._cimScaleFactorOrFunction=(e,t,s)=>{const o=i(r,e,{$view:s},"esriGeometryPoint",t);return null!==o?o:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource?.href?null:this.symbolLayer.resource?.primitive??R}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=he(this._getPrimitive())?ae:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(he(this._getPrimitive()))return O;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_createMaterialAndAddToStage(e,t){const r=this._context.spherical;if(this._cimData){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new ie(e,r),this._cimSymbolMaterials.set(e.textureId??0,i),t.add(i)),i}if(this._fastUpdates=N(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new ie(e,r),t.add(this._materials[0]),this._context.graphicsCoreOwner.view.focusAreas.activePolygons.length>0){e.isFocused=!1;const i=this._context.stage.view.focusAreas.style;e.color=z(e.color,i),e.outlineColor=z(e.outlineColor,i),this._materials[1]=new ie(e,r),t.add(this._materials[1])}return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){const r=Array.from(e.size);for(let e=0;e<3;e++){const t=r[e];t&&"symbol-value"!==t&&"proportional"!==t&&(r[e]=c(t))}if("symbol-value"===r[0])return 1;if(isFinite(+r[0]))return+r[0]/t;if(isFinite(+r[2]))return+r[2]/t}return 1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading??0:0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];const s=G(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const o=this._context.stage.view.focusAreas.containsGeometry(s);if(this._cimData){if(!this._cimData.symbol)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,isFocused:o,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(s,this._context.stage);const a=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;i=[e.parameters.width/a,e.parameters.height/a]}else i=this._size,r=o||1===this._materials.length?this._materials[0]:this._materials[1];if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a),l=this._getDrivenRotation(a);let c=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=d(i[0]*c,i[1]*c),u=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,n,l,h,e.layer.uid):this._createAs3DShape(t,s,r,n,l,h,u,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}updateGeometry(e,t){if(this.draped||!this._validateGeometry(t))return!1;const{elevationContext:r,stageObject:i}=e;if(r.mode!==this.getGeometryElevationMode(t))return!1;const s=G(t);if(!s)return!1;const o=V(i,this._context,s,r);if(null==o)return!1;const a=H(this._context,s);return i.geometries[0].localOrigin===a&&(e.alignedSampledElevation=o,k(e,s,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=I(le.elevationModeChangeTypes,r,i);if(s!==M.UPDATE)return s;const o=T(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return U.RecreateSymbol;if(!$(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return U.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return U.FastUpdate}updateFocus(e,t){t.forEach((t=>{const r=this._context.stage.view.focusAreas.containsGeometry(t.graphic.geometry);t.layers.forEach((i=>{if(i?.graphics3DSymbolLayer===this){i.stageObject.geometries.some((e=>e.material.parameters.isFocused!==r))&&e(t)}}))}))}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=ue(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(u.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=de(c,m),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push((()=>{this._forEachMaterial((e=>e.setParameters({rotation:r,hasRotation:i})))})),delete t.angle}_defaultElevationInfoNoZ(){return pe}_createAs3DShape(e,t,r,i,s,o,a,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layer.uid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:c}),u=ee(r,{normal:se,color:i,rotation:s,size:o,centerOffsetAndDistance:_e,featureAttribute:l,objectAndLayerIdColor:h}),m=B(this._context,t,u,a,n);if(null==m)return null;const d=new D(this,m.object,[u],null,null,j,a);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=T(a.mode)||"absolute-height"===a.mode,d.getScreenSize=this._createScreenSizeGetter(o,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),k(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,o,a){r.renderPriority=this._renderPriority;const n=_();g(t,n,this._context.overlaySR),n[2]=Y;const l=this._context.clippingExtent;if(null!=l&&!x(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),u=ee(r,{normal:se,position:n,color:i,rotation:s,size:o,featureAttribute:c,objectAndLayerIdColor:h}),m=new te(u,{layerUid:a,graphicUid:e.uid}),d=new E(this,[m],null,this._context.drapeSourceRenderer);return d.getScreenSize=this._createScreenSizeGetter(o,c),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=W(fe,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=f(e,e,e),r=h(1),i=e*r,s=f(i,i,i);return new q({size:!0,color:!0,rotation:!0,opacity:!1},t,s,r)}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function ce(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function he(e){return null!=e&&("cross"===e||"x"===e)}function ue(e){const t=m(e);return"application/json"===t?.mediaType?t.data:void 0}function me(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in L?L[e]:L.center}function de({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}le.PRIMITIVE_SIZE=ne,le.elevationModeChangeTypes={definedChanged:M.UPDATE,staysOnTheGround:M.NONE,onTheGroundChanged:M.RECREATE};const pe={mode:"relative-to-ground",offset:0},_e=y(0,0,0,1),fe=_();export{le as Graphics3DIconSymbolLayer};
5
+ import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as u}from"../../../../core/string.js";import{dataComponents as m}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as _,fromValues as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as x}from"../../../../geometry/support/aaBoundingBox.js";import{createRendererExpression as b}from"../../../../support/arcadeOnDemand.js";import{CIMSymbolHelper as v}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as S}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as P}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as R}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as w}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as C}from"../../../../symbols/support/utils.js";import{focusAreaHUDColor as z}from"../../../FocusAreas.js";import{transparentUnit as O}from"./constants.js";import{perObjectElevationAligner as j}from"./ElevationAligners.js";import{SymbolUpdateType as M,elevationModeChangeUpdateType as I,needsElevationUpdates2D as T}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as E}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as F}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as A}from"./graphicUtils.js";import{ApplyRendererDiffResult as U}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as L}from"./placementUtils.js";import{placePointOnGeometry as G,updateStageObjectGeometry as V,getLocalOriginForPoint as H,extendPointGraphicElevationContext as k,createStageObject as B}from"./pointUtils.js";import{initFastSymbolUpdatesState as N,updateFastSymbolUpdatesState as $,evaluateModelTransformScale as W,ConvertOptions as q}from"../support/FastSymbolUpdates.js";import{createTexture as J,requiresHalfTexelOffset as Z,defaultBoundingBox as K,defaultSymbolSizeRatio as Q,defaultTexSize as X}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as Y}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as ee}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as te}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as re}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ie}from"../../webgl-engine/materials/HUDMaterial.js";const se=f(0,0,1),oe=16,ae=1.5,ne=[X*Q,X*Q];class le extends F{static{this.PRIMITIVE_SIZE=ne}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:M.UPDATE,staysOnTheGround:M.NONE,onTheGroundChanged:M.RECREATE}}constructor(e,t,r,i){super(e,t,r,i),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=C(this.symbolLayer),i=ue(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=A(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):oe);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e){const t=this._overrideHelperClass;let r=this._cimData;if(t&&r&&r.symbol||this.logger.error("Can't create texture, CIM data is undefined"),r.primitiveOverrides){r=s(r);const i=r.primitiveOverrides;t.evaluateOverrides(i,e,this._arcadeInfo.geometryType,null,null),t.applyOverrides(r.symbol,i)}const i=u(JSON.stringify(r));let o=this._cimSymbolTextures.get(i);if(o)return o;const a=this._context.sharedResources.cimSymbolRasterizer,n=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;n&&t.applyDictionaryTextOverrides(r.symbol,e,n,null);const l=null!=this._cimScaleFactorOrFunction?S(this._cimScaleFactorOrFunction,e):1;1!==l&&r.symbol&&P(r.symbol,l,!0);const c=v.getEnvelope(r,null,a.resourceManager);if(c?.width&&c.height){const e=c.x+c.width/2,t=c.y+c.height/2,i=a.rasterize({type:"cim",data:r},c.width,c.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),s=new w({x:-c.x/c.width-.5,y:(c.height+c.y)/c.height-.5});this._cimMaterialParametersInfo.anchorPosition=me("relative",s),o=new re(i,{width:i?.width??1,height:i?.height??1,reloadable:!0})}else o=new re(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(i,o),this._context.stage.add(o),o}_prepareMaterialParameters(){const e={anchorPosition:me(this.symbolLayer.anchor,this.symbolLayer.anchorPosition),rotation:this.symbolLayer.angle},t=this.symbol;if(ce(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),(0!==e.rotation||this._drivenProperties.rotation)&&(e.hasRotation=!0);const r=!has("disable-feature:non-occluded-hud");return e.occlusionTest=!r,e.occludedFragmentFade=r,e.horizonCullingEnabled=r&&this._context.spherical,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(he(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>J(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=Z(t),e.distanceFieldBoundingBox=K;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/Q,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=de(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const s=this._context.sharedResources.cimSymbolRasterizer,o=[],a=t,n=a?.symbol;v.fetchResources(n,s.resourceManager,o,r),v.fetchFonts(n,s.resourceManager,o);const c=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&o.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),o.length>0&&(await Promise.all(o),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await b(t,this._context.layer.spatialReference,c),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js");this._cimScaleFactorOrFunction=(e,t,s)=>{const o=i(r,e,{$view:s},"esriGeometryPoint",t);return null!==o?o:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource?.href?null:this.symbolLayer.resource?.primitive??R}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=he(this._getPrimitive())?ae:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(he(this._getPrimitive()))return O;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_createMaterialAndAddToStage(e,t){const r=this._context.spherical;if(this._cimData){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new ie(e,r),this._cimSymbolMaterials.set(e.textureId??0,i),t.add(i)),i}if(this._fastUpdates=N(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new ie(e,r),t.add(this._materials[0]),this._context.graphicsCoreOwner.view.focusAreas.activePolygons.length>0){e.isFocused=!1;const i=this._context.stage.view.focusAreas.style;e.color=z(e.color,i),e.outlineColor=z(e.outlineColor,i),this._materials[1]=new ie(e,r),t.add(this._materials[1])}return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor(e,t){if(this._drivenProperties.size&&e.size){const r=Array.from(e.size);for(let e=0;e<3;e++){const t=r[e];t&&"symbol-value"!==t&&"proportional"!==t&&(r[e]=c(t))}if("symbol-value"===r[0])return 1;if(isFinite(+r[0]))return+r[0]/t;if(isFinite(+r[2]))return+r[2]/t}return 1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading??0:0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];const s=G(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const o=this._context.stage.view.focusAreas.containsGeometry(s);if(this._cimData){if(!this._cimData.symbol)return null;const e=this._generateTextureCIM(t),s={textureId:e.id,isFocused:o,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(s,this._context.stage);const a=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;i=[e.parameters.width/a,e.parameters.height/a]}else i=this._size,r=o||1===this._materials.length?this._materials[0]:this._materials[1];if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a),l=this._getDrivenRotation(a);let c=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=d(i[0]*c,i[1]*c),u=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,n,l,h,e.layer.uid):this._createAs3DShape(t,s,r,n,l,h,u,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}updateGeometry(e,t){if(this.draped||!this._validateGeometry(t))return!1;const{elevationContext:r,stageObject:i}=e;if(r.mode!==this.getGeometryElevationMode(t))return!1;const s=G(t);if(!s)return!1;const o=V(i,this._context,s,r);if(null==o)return!1;const a=H(this._context,s);return i.geometries[0].localOrigin===a&&(e.alignedSampledElevation=o,k(e,s,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=I(le.elevationModeChangeTypes,r,i);if(s!==M.UPDATE)return s;const o=T(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return U.RecreateSymbol;if(!$(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return U.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return U.FastUpdate}updateFocus(e,t){t.forEach((t=>{const r=this._context.stage.view.focusAreas.containsGeometry(t.graphic.geometry);t.layers.forEach((i=>{if(i?.graphics3DSymbolLayer===this){i.stageObject.geometries.some((e=>e.material.parameters.isFocused!==r))&&e(t)}}))}))}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=ue(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(u.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=de(c,m),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push((()=>{this._forEachMaterial((e=>e.setParameters({rotation:r,hasRotation:i})))})),delete t.angle}_defaultElevationInfoNoZ(){return pe}_createAs3DShape(e,t,r,i,s,o,a,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layer.uid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:c}),u=ee(r,{normal:se,color:i,rotation:s,size:o,centerOffsetAndDistance:_e,featureAttribute:l,objectAndLayerIdColor:h}),m=B(this._context,t,u,a,n);if(null==m)return null;const d=new D(this,m.object,[u],null,null,j,a);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=T(a.mode)||"absolute-height"===a.mode,d.getScreenSize=this._createScreenSizeGetter(o,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),k(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,o,a){r.renderPriority=this._renderPriority;const n=_();g(t,n,this._context.overlaySR),n[2]=Y;const l=this._context.clippingExtent;if(null!=l&&!x(l,n))return null;const c=this.getFastUpdateAttrValues(e),h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),u=ee(r,{normal:se,position:n,color:i,rotation:s,size:o,featureAttribute:c,objectAndLayerIdColor:h}),m=new te(u,{layerUid:a,graphicUid:e.uid}),d=new E(this,[m],null,this._context.drapeSourceRenderer);return d.getScreenSize=this._createScreenSizeGetter(o,c),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),d}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=W(fe,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=f(e,e,e),r=h(1),i=e*r,s=f(i,i,i);return new q({size:!0,color:!0,rotation:!0,opacity:!1},t,s,r)}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function ce(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function he(e){return null!=e&&("cross"===e||"x"===e)}function ue(e){const t=m(e);return"application/json"===t?.mediaType?t.data:void 0}function me(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in L?L[e]:L.center}function de({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}const pe={mode:"relative-to-ground",offset:0},_e=y(0,0,0,1),fe=_();export{le as Graphics3DIconSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as i,create as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderingInfo as s}from"../../../../renderers/support/RenderingInfo.js";import{textSymbolLayerSupportsVerticalOffset as o}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as a}from"./ElevationAligners.js";import{SymbolUpdateType as l,elevationModeChangeUpdateType as c,needsElevationUpdates2D as m}from"./elevationAlignmentUtils.js";import{ElevationContext as h}from"./ElevationContext.js";import{Graphics3DGraphicCreationContext as p}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DObject3DGraphicLayer as d}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as f}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as u}from"./Graphics3DSymbolLayer.js";import{computeCentroid as g}from"./graphicUtils.js";import{createStageObject as y,extendPointGraphicElevationContext as v}from"./pointUtils.js";import{SymbolComplexity as b}from"./SymbolComplexity.js";import{Attribute as x}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as C}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as _}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as O}from"../../webgl-engine/lib/VertexAttribute.js";import{LineCalloutMaterial as j,Parameters as E,uniqueMaterialIdentifier as P}from"../../webgl-engine/materials/LineCalloutMaterial.js";class U extends u{constructor(e,t){super(e,null,t,A),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new j(this._materialParameters,this._context.spherical),this._context.stage.add(this._materials[0])}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}_perInstanceMaterialParameters(e){const t=this._materialParameters;return t.horizontalScreenOffset=e.horizontalScreenOffset??0,t.centerOffsetUnits=e.centerOffsetUnits||"world",t}get _materialParameters(){const r=new E,n=this.symbol,s=n.callout;if(s.color){const t=e.toUnitRGBA(s.color);t[3]*=this._getLayerOpacity(),r.color=t}else r.color=i;if(r.size=t(s.size||0),n.verticalOffset){const{screenLength:e,minWorldLength:i,maxWorldLength:s}=n.verticalOffset;r.verticalOffset={screenLength:t(e),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}r.borderColor=null!=s.border?.color?e.toUnitRGBA(s.border.color):null;const o="object"===n.symbolLayers.at(0).type,a="label-3d"===n.type;return r.occlusionTest=!o&&!!has("disable-feature:non-occluded-hud"),r.shaderPolygonOffset=o?0:void 0,r.hudDepthAlignStart=a,r.hasSlicePlane=this._context.slicePlaneEnabled,r.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null,r}_defaultElevationInfoNoZ(){return S}createGraphics3DGraphic(e){const t=e.renderingInfo,r=e.graphic,i=this.setGraphicElevationContext(r,new h,t.elevationOffset||0),n=t.symbol,s="on-the-ground"===this._elevationContext.mode&&("cim"===n.type||!n.symbolLayers.some((e=>"object"===e.type||"text"===e.type)));if("label-3d"!==n.type&&s)return null;if("point-3d"===n.type&&n.symbolLayers.every((e=>"text"===e.type&&!o(e))))return null;const a=g(r.geometry);return null==a?null:this._createAs3DShape(a,i,t,r.uid)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,n=c(U.elevationModeChangeTypes,r,i);return n!==l.UPDATE||e.forEach((e=>{const r=t(e);null!=r&&this.updateGraphicElevationContext(e.graphic,r)})),n}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}setGraphicElevationContext(e,t,r=0){return super.setGraphicElevationContext(e,t),t.addOffsetRenderUnits(r),t}updateGraphicElevationContext(e,t){const{elevationContext:r,metadata:i}=t;this.setGraphicElevationContext(e,r,i?.elevationOffset??0),t.needsElevationUpdates=m(r.mode)}computeComplexity(){return new b({verticesPerFeature:6})}_getOrCreateMaterial(e){const t=this._perInstanceMaterialParameters(e),r=P(t);if(r===this._materials[0]?.uniqueMaterialIdentifier)return{material:this._materials[0],isUnique:!1};if(null!=e.materialCollection){let i=e.materialCollection.get(r);return null==i&&(i=new j(t,this._context.spherical),e.materialCollection.add(r,i)),{material:i,isUnique:!1}}return{material:new j(t,this._context.spherical),isUnique:!0}}_createAs3DShape(e,t,r,i){const n=this._context.layer.uid,s=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:i,layerUid:n}),o=this._getOrCreateMaterial(r),l=new _(o.material,w(r),null,C.Point,s),c=y(this._context,e,l,t,i);if(null==c)return null;const h=new d(this,c.object,[l],o.isUnique?[o.material]:null,null,a,t);return h.metadata=new f(r.elevationOffset),h.alignedSampledElevation=c.sampledElevation,h.needsElevationUpdates=m(t.mode),v(h,e,this._context.elevationProvider),h}}function w(e){const{translation:t,centerOffset:r}=e,i=new x(t?[t[0],t[1],t[2]]:[0,0,0],G,3,!0),n=new x(r?[r[0],r[1],r[2],r[3]]:[0,0,0,1],G,4,!0);return[[O.POSITION,i],[O.NORMAL,new x([0,0,1],G,3,!0)],[O.CENTEROFFSETANDDISTANCE,n]]}U.elevationModeChangeTypes={definedChanged:l.UPDATE,staysOnTheGround:l.UPDATE,onTheGroundChanged:l.RECREATE};const G=[0],S={mode:"relative-to-ground",offset:0},A={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class D extends s{constructor(e,t,i=r(),s=n(),o=0,a="world",l=0,c=null){super(e,t),this.translation=i,this.centerOffset=s,this.horizontalScreenOffset=o,this.centerOffsetUnits=a,this.elevationOffset=l,this.materialCollection=c}}class L extends p{}export{U as Graphics3DLineCalloutSymbolLayer,L as LineCalloutCreationContext,D as LineCalloutSymbolLayerRenderingInfo};
5
+ import e from"../../../../Color.js";import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as i,create as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderingInfo as s}from"../../../../renderers/support/RenderingInfo.js";import{textSymbolLayerSupportsVerticalOffset as o}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as a}from"./ElevationAligners.js";import{SymbolUpdateType as l,elevationModeChangeUpdateType as c,needsElevationUpdates2D as m}from"./elevationAlignmentUtils.js";import{ElevationContext as h}from"./ElevationContext.js";import{Graphics3DGraphicCreationContext as p}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DObject3DGraphicLayer as d}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as f}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as u}from"./Graphics3DSymbolLayer.js";import{computeCentroid as g}from"./graphicUtils.js";import{createStageObject as y,extendPointGraphicElevationContext as v}from"./pointUtils.js";import{SymbolComplexity as b}from"./SymbolComplexity.js";import{Attribute as x}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as C}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as _}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as O}from"../../webgl-engine/lib/VertexAttribute.js";import{LineCalloutMaterial as j,Parameters as E,uniqueMaterialIdentifier as P}from"../../webgl-engine/materials/LineCalloutMaterial.js";class U extends u{static{this.elevationModeChangeTypes={definedChanged:l.UPDATE,staysOnTheGround:l.UPDATE,onTheGroundChanged:l.RECREATE}}constructor(e,t){super(e,null,t,A),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new j(this._materialParameters,this._context.spherical),this._context.stage.add(this._materials[0])}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}_perInstanceMaterialParameters(e){const t=this._materialParameters;return t.horizontalScreenOffset=e.horizontalScreenOffset??0,t.centerOffsetUnits=e.centerOffsetUnits||"world",t}get _materialParameters(){const r=new E,n=this.symbol,s=n.callout;if(s.color){const t=e.toUnitRGBA(s.color);t[3]*=this._getLayerOpacity(),r.color=t}else r.color=i;if(r.size=t(s.size||0),n.verticalOffset){const{screenLength:e,minWorldLength:i,maxWorldLength:s}=n.verticalOffset;r.verticalOffset={screenLength:t(e),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}r.borderColor=null!=s.border?.color?e.toUnitRGBA(s.border.color):null;const o="object"===n.symbolLayers.at(0).type,a="label-3d"===n.type;return r.occlusionTest=!o&&!!has("disable-feature:non-occluded-hud"),o&&(r.shaderPolygonOffset=0),r.hudDepthAlignStart=a,r.hasSlicePlane=this._context.slicePlaneEnabled,r.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null,r}_defaultElevationInfoNoZ(){return S}createGraphics3DGraphic(e){const t=e.renderingInfo,r=e.graphic,i=this.setGraphicElevationContext(r,new h,t.elevationOffset||0),n=t.symbol,s="on-the-ground"===this._elevationContext.mode&&("cim"===n.type||!n.symbolLayers.some((e=>"object"===e.type||"text"===e.type)));if("label-3d"!==n.type&&s)return null;if("point-3d"===n.type&&n.symbolLayers.every((e=>"text"===e.type&&!o(e))))return null;const a=g(r.geometry);return null==a?null:this._createAs3DShape(a,i,t,r.uid)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,n=c(U.elevationModeChangeTypes,r,i);return n!==l.UPDATE||e.forEach((e=>{const r=t(e);null!=r&&this.updateGraphicElevationContext(e.graphic,r)})),n}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}setGraphicElevationContext(e,t,r=0){return super.setGraphicElevationContext(e,t),t.addOffsetRenderUnits(r),t}updateGraphicElevationContext(e,t){const{elevationContext:r,metadata:i}=t;this.setGraphicElevationContext(e,r,i?.elevationOffset??0),t.needsElevationUpdates=m(r.mode)}computeComplexity(){return new b({verticesPerFeature:6})}_getOrCreateMaterial(e){const t=this._perInstanceMaterialParameters(e),r=P(t);if(r===this._materials[0]?.uniqueMaterialIdentifier)return{material:this._materials[0],isUnique:!1};if(null!=e.materialCollection){let i=e.materialCollection.get(r);return null==i&&(i=new j(t,this._context.spherical),e.materialCollection.add(r,i)),{material:i,isUnique:!1}}return{material:new j(t,this._context.spherical),isUnique:!0}}_createAs3DShape(e,t,r,i){const n=this._context.layer.uid,s=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:i,layerUid:n}),o=this._getOrCreateMaterial(r),l=new _(o.material,w(r),null,C.Point,s),c=y(this._context,e,l,t,i);if(null==c)return null;const h=new d(this,c.object,[l],o.isUnique?[o.material]:null,null,a,t);return h.metadata=new f(r.elevationOffset),h.alignedSampledElevation=c.sampledElevation,h.needsElevationUpdates=m(t.mode),v(h,e,this._context.elevationProvider),h}}function w(e){const{translation:t,centerOffset:r}=e,i=new x(t?[t[0],t[1],t[2]]:[0,0,0],G,3,!0),n=new x(r?[r[0],r[1],r[2],r[3]]:[0,0,0,1],G,4,!0);return[[O.POSITION,i],[O.NORMAL,new x([0,0,1],G,3,!0)],[O.CENTEROFFSETANDDISTANCE,n]]}const G=[0],S={mode:"relative-to-ground",offset:0},A={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class D extends s{constructor(e,t,i=r(),s=n(),o=0,a="world",l=0,c=null){super(e,t),this.translation=i,this.centerOffset=s,this.horizontalScreenOffset=o,this.centerOffsetUnits=a,this.elevationOffset=l,this.materialCollection=c}}class L extends p{}export{U as Graphics3DLineCalloutSymbolLayer,L as LineCalloutCreationContext,D as LineCalloutSymbolLayerRenderingInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{px2pt as t,pt2px as r}from"../../../../core/screenUtils.js";import{fromValues as i,clone as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import s from"../../../../geometry/Extent.js";import n from"../../../../geometry/Polygon.js";import{create as o,fromBuffer as l,intersectsClippingArea as h,empty as m,expandWithAABB as p,expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as d}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as y}from"./ElevationAligners.js";import{SymbolUpdateType as u,elevationModeChangeUpdateType as _,needsElevationUpdates2D as g}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as f}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M}from"./Graphics3DSymbolLayer.js";import{ApplyRendererDiffResult as L}from"./interfaces.js";import{parseCapType as E,parseLineMarkerStyle as P}from"./lineUtils.js";import{initFastSymbolUpdatesState as v,updateFastSymbolUpdatesState as C,getAttributeValue as R,ConvertOptions as w}from"../support/FastSymbolUpdates.js";import{debugFlags as x}from"../../support/debugFlags.js";import{createGeometry as D}from"../../support/engineContent/line.js";import{geometryToRenderInfo as k,geometryToRenderInfoDraped as j}from"../../support/renderInfoUtils/line.js";import{Object3D as S}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as A}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as U}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as z}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as W}from"../../webgl-engine/materials/RibbonLineMaterial.js";const G=["polyline","polygon","extent"],O=new w({size:!0,color:!0,rotation:!1,opacity:!0});class V extends M{constructor(e,t,r,i){super(e,t,r,i)}async doLoad(){if(this._fastUpdates=v(this._context.renderer,O),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:t(1))<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t=!1){const r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);this._patternHidesLine&&!t&&(r[3]=0);const i={width:this._computeMaterialWidth(this.symbolLayer?.size),color:r,hasPolygonOffset:!0,join:this.symbolLayer.join||"miter",cap:E(this.symbolLayer.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:z(this.symbolLayer.pattern)};return this._fastUpdates?.visualVariables?{...i,...this._fastUpdates.materialParameters}:i}get _materialColor(){return this.symbolLayer.material?.color}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[H.Line]&&(this._materials[H.Line]=new W(this._getMaterialParameters(!1)),this._context.stage.add(this._materials[H.Line])),this._materials[H.Line]}get _ringMaterial(){return null==this._materials[H.Ring]&&(this._materials[H.Ring]=new W(this._getMaterialParameters(!0)),this._context.stage.add(this._materials[H.Ring])),this._materials[H.Ring]}get _wireframeLineMaterial(){return null==this._materials[H.LineWireframe]&&(this._materials[H.LineWireframe]=new W({...this._getMaterialParameters(!1),wireframe:!0}),this._context.stage.add(this._materials[H.LineWireframe])),this._materials[H.LineWireframe]}get _wireframeRingMaterial(){return null==this._materials[H.RingWireframe]&&(this._materials[H.RingWireframe]=new W({...this._getMaterialParameters(!0),wireframe:!0}),this._context.stage.add(this._materials[H.RingWireframe])),this._materials[H.RingWireframe]}get _markerMaterial(){return null==this._materials[H.Marker]&&null!=this.symbolLayer.marker&&(this._materials[H.Marker]=new U({...this._getMaterialParameters(!1,!0),placement:this.symbolLayer.marker.placement,markerPrimitive:P(this.symbolLayer.marker.style)}),this._context.stage.add(this._materials[H.Marker])),this._materials[H.Marker]}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0}_getDrivenSize(e){return this._drivenProperties.size&&e.size?r(d(e.size)):1}_getDrivenColor(e){const t=i(1,1,1,1);return this._drivenProperties.color&&e.color&&(t[0]=e.color[0],t[1]=e.color[1],t[2]=e.color[2],e.color.length>0&&(t[3]=e.color[3])),this._drivenProperties.opacity&&e.opacity&&(t[3]=e.opacity),t}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,G,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.draped?this._createAsOverlay(e,this._context.layer.uid):this._createAs3DShape(e,r,t.uid)}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return L.RecreateSymbol;{const e=this._fastUpdates;if(!C(e,t,O))return L.RecreateSymbol;this._forEachMaterial((t=>t?.setParameters(e.materialParameters)))}}return L.FastUpdate}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue),delete t.size),"complete"===t.cap?.type&&(r.cap=E(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push((()=>this._forEachMaterial((e=>e?.setParameters(r)))))}layerOpacityChanged(){this._forEachMaterial(((e,t)=>this._updateMaterialLayerOpacity(e,t===H.Marker)))}_forEachMaterial(e){this._materials.forEach(e)}_updateMaterialLayerOpacity(e,t=!1){if(null==e)return;const r=e.parameters.color,a=this.symbolLayer?.material?.color,s=this._patternHidesLine&&!t?0:this._getCombinedOpacity(a),n=i(r[0],r[1],r[2],s);e.setParameters({color:n})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=_(V.elevationModeChangeTypes,r,i);if(a!==u.UPDATE)return a;const s=g(i);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>s))}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};return this._forEachMaterial((t=>t?.setParameters(e))),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=I(e.graphic.geometry),a="polygon"===i.type?i.rings:i.paths,s=new Array,n=o(),m=k(i,this._context.elevationProvider,this._context.renderCoordsHelper,t),p="polygon"===i.type?"rings":"paths";this._logGeometryCreationWarnings(m,a,p,"LineSymbol3DLayer");for(let o=0;o<m.lines.length;o++){const t=m.lines[o],a=t.position,p=t.mapPositions;if(null!=this._context.clippingExtent&&(l(p,n),!h(n,this._context.clippingExtent)))continue;const c=this._createGeometry("polygon"===i.type?this._ringMaterial:this._lineMaterial,e,a,p,i.type,F.ELEVATED,r);s.push(c),x.LINE_WIREFRAMES&&s.push(c.instantiate({material:"polygon"===i.type?this._wireframeRingMaterial:this._wireframeLineMaterial})),null!=this._markerMaterial&&s.push(c.instantiate({material:this._markerMaterial}))}if(0===s.length)return null;const c=new S({geometries:s,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:r}),d=new b(this,c,s,null,null,y,t);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=g(t.mode),d}_createGeometry(e,t,r,i,a,s,n){const o=s===F.DRAPED?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,l="polygon"===a,h=this._fastUpdates?.visualVariables.color,m=this._fastUpdates?.visualVariables.size,p=this._fastUpdates?.visualVariables.opacity,c=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:this._context.layer.uid}),d={position:r,size:m?null:this._getDrivenSize(t.renderingInfo),color:h?null:this._getDrivenColor(t.renderingInfo),sizeFeature:m?R(m.field,t.graphic):null,colorFeature:h?R(h.field,t.graphic):null,opacityFeature:p?R(p.field,t.graphic):null};return D(e,{overlayInfo:o,removeDuplicateStartEnd:l,mapPositions:i,attributeData:d},c)}_createAsOverlay(e,t){const r=e.graphic,i=I(r.geometry),a="polygon"===i.type?i.rings:i.paths,s="polygon"===i.type?this._ringMaterial:this._lineMaterial;s.renderPriority=this._renderPriority;const n=x.LINE_WIREFRAMES?"polygon"===i.type?this._wireframeRingMaterial:this._wireframeLineMaterial:null,d=this._markerMaterial;null!=n&&(n.renderPriority=this._renderPriority-.001),null!=d&&(d.renderPriority=this._renderPriority-.002);const y=new Array,u=o(),_=m(),g=j(i,this._context.overlaySR),b="polygon"===i.type?"rings":"paths";this._logGeometryCreationWarnings(g,a,b,"LineSymbol3DLayer");for(const o of g.lines){if(l(o.position,u),!h(u,this._context.clippingExtent))continue;p(_,u);const a=a=>{const s=this._createGeometry(a,e,o.position,void 0,i.type,F.DRAPED,r.uid),n=new A(s,{layerUid:t,graphicUid:r.uid});y.push(n)};if(null!=d){a(d);const e=this.symbolLayer.marker.placement;"begin"!==e&&"begin-end"!==e||c(u,o.position,0,1),"end"!==e&&"begin-end"!==e||c(u,o.position,o.position.length-3,1)}a(s),x.LINE_WIREFRAMES&&a(n)}return new f(this,y,_,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return null!=e&&"style"===e.type&&"none"===e.style}_computeMaterialWidth(e){return e=e??t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r(1):1:r(e)}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&T(this._getCombinedOpacityAndColor(this._materialColor),this._materials[H.Marker],e));if("collection"===i.type)return;const s="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,n=this._getCombinedOpacityAndColor(s);r.useMaterialColor&&T(a(n),this._materials[H.Marker],e),this._patternHidesLine&&(n[3]=0),T(n,this._materials[H.Line],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,n=s?a.newValue:null,o=null==n&&null==this._markerColor;n&&T(this._getCombinedOpacityAndColor(n),i,e);const l=r.diff.style?.newValue;return l&&e.symbolLayerStatePatches.push((()=>i.setParameters({markerPrimitive:P(l)}))),delete t.marker,{changed:s,useMaterialColor:o}}}function I(e){switch(e.type){case"extent":if(e instanceof s)return n.fromExtent(e);break;case"polygon":case"polyline":return e}return null}function T(e,t,r){null!=t&&r.symbolLayerStatePatches.push((()=>t.setParameters({color:e})))}var F,H;V.elevationModeChangeTypes={definedChanged:u.RECREATE,staysOnTheGround:u.NONE,onTheGroundChanged:u.RECREATE},function(e){e[e.DRAPED=0]="DRAPED",e[e.ELEVATED=1]="ELEVATED"}(F||(F={})),function(e){e[e.Line=0]="Line",e[e.Ring=1]="Ring",e[e.LineWireframe=2]="LineWireframe",e[e.RingWireframe=3]="RingWireframe",e[e.Marker=4]="Marker"}(H||(H={}));export{V as Graphics3DLineSymbolLayer};
5
+ import e from"../../../../core/Error.js";import{px2pt as t,pt2px as r}from"../../../../core/screenUtils.js";import{fromValues as i,clone as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import s from"../../../../geometry/Extent.js";import n from"../../../../geometry/Polygon.js";import{create as o,fromBuffer as l,intersectsClippingArea as h,empty as m,expandWithAABB as p,expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as d}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as y}from"./ElevationAligners.js";import{SymbolUpdateType as u,elevationModeChangeUpdateType as _,needsElevationUpdates2D as g}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as f}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M}from"./Graphics3DSymbolLayer.js";import{ApplyRendererDiffResult as L}from"./interfaces.js";import{parseCapType as E,parseLineMarkerStyle as P}from"./lineUtils.js";import{initFastSymbolUpdatesState as v,updateFastSymbolUpdatesState as C,getAttributeValue as R,ConvertOptions as w}from"../support/FastSymbolUpdates.js";import{debugFlags as x}from"../../support/debugFlags.js";import{createGeometry as D}from"../../support/engineContent/line.js";import{geometryToRenderInfo as k,geometryToRenderInfoDraped as j}from"../../support/renderInfoUtils/line.js";import{Object3D as S}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as A}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as U}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as z}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as W}from"../../webgl-engine/materials/RibbonLineMaterial.js";const G=["polyline","polygon","extent"],O=new w({size:!0,color:!0,rotation:!1,opacity:!0});class V extends M{static{this.elevationModeChangeTypes={definedChanged:u.RECREATE,staysOnTheGround:u.NONE,onTheGroundChanged:u.RECREATE}}constructor(e,t,r,i){super(e,t,r,i)}async doLoad(){if(this._fastUpdates=v(this._context.renderer,O),!this._drivenProperties.size){if((null!=this.symbolLayer.size?this.symbolLayer.size:t(1))<0)throw new e("graphics3dlinesymbollayer:invalid-size","Symbol sizes may not be negative values")}}_getMaterialParameters(e,t=!1){const r=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);this._patternHidesLine&&!t&&(r[3]=0);const i={width:this._computeMaterialWidth(this.symbolLayer?.size),color:r,hasPolygonOffset:!0,join:this.symbolLayer.join||"miter",cap:E(this.symbolLayer.cap||"butt"),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:z(this.symbolLayer.pattern)};return this._fastUpdates?.visualVariables?{...i,...this._fastUpdates.materialParameters}:i}get _materialColor(){return this.symbolLayer.material?.color}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return null==this._materials[H.Line]&&(this._materials[H.Line]=new W(this._getMaterialParameters(!1)),this._context.stage.add(this._materials[H.Line])),this._materials[H.Line]}get _ringMaterial(){return null==this._materials[H.Ring]&&(this._materials[H.Ring]=new W(this._getMaterialParameters(!0)),this._context.stage.add(this._materials[H.Ring])),this._materials[H.Ring]}get _wireframeLineMaterial(){return null==this._materials[H.LineWireframe]&&(this._materials[H.LineWireframe]=new W({...this._getMaterialParameters(!1),wireframe:!0}),this._context.stage.add(this._materials[H.LineWireframe])),this._materials[H.LineWireframe]}get _wireframeRingMaterial(){return null==this._materials[H.RingWireframe]&&(this._materials[H.RingWireframe]=new W({...this._getMaterialParameters(!0),wireframe:!0}),this._context.stage.add(this._materials[H.RingWireframe])),this._materials[H.RingWireframe]}get _markerMaterial(){return null==this._materials[H.Marker]&&null!=this.symbolLayer.marker&&(this._materials[H.Marker]=new U({...this._getMaterialParameters(!1,!0),placement:this.symbolLayer.marker.placement,markerPrimitive:P(this.symbolLayer.marker.style)}),this._context.stage.add(this._materials[H.Marker])),this._materials[H.Marker]}destroy(){super.destroy(),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0}_getDrivenSize(e){return this._drivenProperties.size&&e.size?r(d(e.size)):1}_getDrivenColor(e){const t=i(1,1,1,1);return this._drivenProperties.color&&e.color&&(t[0]=e.color[0],t[1]=e.color[1],t[2]=e.color[2],e.color.length>0&&(t[3]=e.color[3])),this._drivenProperties.opacity&&e.opacity&&(t[3]=e.opacity),t}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,G,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.draped?this._createAsOverlay(e,this._context.layer.uid):this._createAs3DShape(e,r,t.uid)}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return L.RecreateSymbol;{const e=this._fastUpdates;if(!C(e,t,O))return L.RecreateSymbol;this._forEachMaterial((t=>t?.setParameters(e.materialParameters)))}}return L.FastUpdate}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff,r={};"complete"===t.size?.type&&(r.width=this._computeMaterialWidth(t.size.newValue),delete t.size),"complete"===t.cap?.type&&(r.cap=E(t.cap.newValue??"butt"),delete t.cap);const i=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,i),e.symbolLayerStatePatches.push((()=>this._forEachMaterial((e=>e?.setParameters(r)))))}layerOpacityChanged(){this._forEachMaterial(((e,t)=>this._updateMaterialLayerOpacity(e,t===H.Marker)))}_forEachMaterial(e){this._materials.forEach(e)}_updateMaterialLayerOpacity(e,t=!1){if(null==e)return;const r=e.parameters.color,a=this.symbolLayer?.material?.color,s=this._patternHidesLine&&!t?0:this._getCombinedOpacity(a),n=i(r[0],r[1],r[2],s);e.setParameters({color:n})}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,a=_(V.elevationModeChangeTypes,r,i);if(a!==u.UPDATE)return a;const s=g(i);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>s))}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};return this._forEachMaterial((t=>t?.setParameters(e))),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const i=I(e.graphic.geometry),a="polygon"===i.type?i.rings:i.paths,s=new Array,n=o(),m=k(i,this._context.elevationProvider,this._context.renderCoordsHelper,t),p="polygon"===i.type?"rings":"paths";this._logGeometryCreationWarnings(m,a,p,"LineSymbol3DLayer");for(let o=0;o<m.lines.length;o++){const t=m.lines[o],a=t.position,p=t.mapPositions;if(null!=this._context.clippingExtent&&(l(p,n),!h(n,this._context.clippingExtent)))continue;const c=this._createGeometry("polygon"===i.type?this._ringMaterial:this._lineMaterial,e,a,p,i.type,F.ELEVATED,r);s.push(c),x.LINE_WIREFRAMES&&s.push(c.instantiate({material:"polygon"===i.type?this._wireframeRingMaterial:this._wireframeLineMaterial})),null!=this._markerMaterial&&s.push(c.instantiate({material:this._markerMaterial}))}if(0===s.length)return null;const c=new S({geometries:s,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:r}),d=new b(this,c,s,null,null,y,t);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=g(t.mode),d}_createGeometry(e,t,r,i,a,s,n){const o=s===F.DRAPED?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,l="polygon"===a,h=this._fastUpdates?.visualVariables.color,m=this._fastUpdates?.visualVariables.size,p=this._fastUpdates?.visualVariables.opacity,c=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:this._context.layer.uid}),d={position:r,size:m?null:this._getDrivenSize(t.renderingInfo),color:h?null:this._getDrivenColor(t.renderingInfo),sizeFeature:m?R(m.field,t.graphic):null,colorFeature:h?R(h.field,t.graphic):null,opacityFeature:p?R(p.field,t.graphic):null};return D(e,{overlayInfo:o,removeDuplicateStartEnd:l,mapPositions:i,attributeData:d},c)}_createAsOverlay(e,t){const r=e.graphic,i=I(r.geometry),a="polygon"===i.type?i.rings:i.paths,s="polygon"===i.type?this._ringMaterial:this._lineMaterial;s.renderPriority=this._renderPriority;const n=x.LINE_WIREFRAMES?"polygon"===i.type?this._wireframeRingMaterial:this._wireframeLineMaterial:null,d=this._markerMaterial;null!=n&&(n.renderPriority=this._renderPriority-.001),null!=d&&(d.renderPriority=this._renderPriority-.002);const y=new Array,u=o(),_=m(),g=j(i,this._context.overlaySR),b="polygon"===i.type?"rings":"paths";this._logGeometryCreationWarnings(g,a,b,"LineSymbol3DLayer");for(const o of g.lines){if(l(o.position,u),!h(u,this._context.clippingExtent))continue;p(_,u);const a=a=>{const s=this._createGeometry(a,e,o.position,void 0,i.type,F.DRAPED,r.uid),n=new A(s,{layerUid:t,graphicUid:r.uid});y.push(n)};if(null!=d){a(d);const e=this.symbolLayer.marker.placement;"begin"!==e&&"begin-end"!==e||c(u,o.position,0,1),"end"!==e&&"begin-end"!==e||c(u,o.position,o.position.length-3,1)}a(s),x.LINE_WIREFRAMES&&a(n)}return new f(this,y,_,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return null!=e&&"style"===e.type&&"none"===e.style}_computeMaterialWidth(e){return e=e??t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?r(1):1:r(e)}_prepareMaterialPatch(e,t,r){const i=t.material;if(null==i)return void(r.changed&&r.useMaterialColor&&T(this._getCombinedOpacityAndColor(this._materialColor),this._materials[H.Marker],e));if("collection"===i.type)return;const s="complete"===i.type?i.newValue?.color:"complete"===i.diff.color?.type?i.diff.color.newValue:null,n=this._getCombinedOpacityAndColor(s);r.useMaterialColor&&T(a(n),this._materials[H.Marker],e),this._patternHidesLine&&(n[3]=0),T(n,this._materials[H.Line],e),delete t.material}_prepareMarkerPatch(e,t){const r=t.marker,i=this._markerMaterial;if(null==r||"partial"!==r.type||null==r.diff||null!=r.diff.placement||null!=r.diff.style&&"complete"!==r.diff.style.type||null!=r.diff.color&&"complete"!==r.diff.color.type||null==i)return{changed:!1,useMaterialColor:null==this._markerColor};const a=r.diff.color,s=null!=a,n=s?a.newValue:null,o=null==n&&null==this._markerColor;n&&T(this._getCombinedOpacityAndColor(n),i,e);const l=r.diff.style?.newValue;return l&&e.symbolLayerStatePatches.push((()=>i.setParameters({markerPrimitive:P(l)}))),delete t.marker,{changed:s,useMaterialColor:o}}}function I(e){switch(e.type){case"extent":if(e instanceof s)return n.fromExtent(e);break;case"polygon":case"polyline":return e}return null}function T(e,t,r){null!=t&&r.symbolLayerStatePatches.push((()=>t.setParameters({color:e})))}var F,H;!function(e){e[e.DRAPED=0]="DRAPED",e[e.ELEVATED=1]="ELEVATED"}(F||(F={})),function(e){e[e.Line=0]="Line",e[e.Ring=1]="Ring",e[e.LineWireframe=2]="LineWireframe",e[e.RingWireframe=3]="RingWireframe",e[e.Marker=4]="Marker"}(H||(H={}));export{V as Graphics3DLineSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{normalFromMat4 as r,fromMat4 as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as a,multiply as s,invert as i,getTranslation as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c,IDENTITY as u,clone as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as p,g as h,h as d,t as g,q as x,n as _,b as T,f as b,d as y,e as v}from"../../../../chunks/vec32.js";import{ZEROS as w,ONES as R,create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as A}from"../../../../geometry/projection.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as P}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToPoint as E}from"../../../../geometry/projection/projectVectorToPoint.js";import{create as O,fromBuffer as I,intersectsClippingArea as N}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as S}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as U,getContinuousIndexArray as B}from"../../../../geometry/support/Indices.js";import F from"../../../../geometry/support/MeshComponent.js";import D from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import G from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as L,isAbsoluteVertexSpace as V}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as $,isPlateCarree as H}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as k}from"../../../../chunks/vec3.js";import{transformNormal as q,transformVectorENUPlateCarree as z,VectorType as W,transformVectorWMPlateCarree as Y,projectNormalToPCPF as J,transformTangent as K,projectTangentToPCPF as Q}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as X}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{makeDehydratedPoint as Z}from"../../../../layers/graphics/dehydratedPoint.js";import{MeshTransformUpdateAction as ee}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as te}from"../../../ViewingMode.js";import{isEncodedMeshTexture as re}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as oe}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as ne}from"./ElevationAligners.js";import{needsElevationUpdates3D as ae,evaluateElevationInfoAtPoint as se}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ie}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as le}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as ce}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as ue,MeshFastUpdateProcessor as me}from"./MeshFastUpdateProcessor.js";import{createMaterial as fe}from"../support/edgeUtils.js";import{parseColorMixMode as pe,encodeSymbolColor as he}from"../support/symbolColorUtils.js";import{debugFlags as de}from"../../support/debugFlags.js";import{Attribute as ge}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as xe,CullFaceOptions as _e}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as Te}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as be}from"../../webgl-engine/lib/Geometry.js";import{Object3D as ye}from"../../webgl-engine/lib/Object3D.js";import{Texture as ve}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as we}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as Re}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Me}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Ae,schematicMRRFactors as Ce}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as Pe}from"../../../webgl/enums.js";const Ee=["mesh"];class Oe extends ce{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new ue,this._fastUpdateProcessor=new me,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){de.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Me({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Me({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Me({color:[0,1,1,1]}))}destroy(){super.destroy(),this._textures.forEach((e=>e.unload())),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Ee,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>t(e)?.layerOpacityChanged(r,this._context.isAsync)))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ae)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync))),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case ee.EnableFastUpdates:if(n)return!0;break;case ee.DisableFastUpdates:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,ee.EnableFastUpdates)&&(e.autoDisableFastTransformUpdates((()=>this.updateTransform(e,t,r,ee.DisableFastUpdates))),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=ot,{origin:i,transform:l}=r;if(!C(t,p(Xe,i.x,i.y,i.z??0),s,a))return!1;switch(o){case ee.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case ee.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case ee.UpdateFastLocalOrigin:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerPointInElevationSR=this._getCenterPointInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>se(e,u,c,m,t);return e.alignedSampledElevation=ne(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates((()=>this.updateTransform(e,t,r,ee.DisableFastUpdates))),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=We(n),p=We(a),h=Ye(s),d=We(i),g=Ye(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof D){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:f}=t.material,p=We(n),h=Ye(a),d=We(i),g=We(c),x=Ye(u),_=We(m),T=Ye(f);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=Ve(s),o.normalTextureTransform=Ve(l),o.emissiveTextureTransform=Ve(u),o.occlusionTextureTransform=Ve(f),o.metallicRoughnessTextureTransform=Ve(a),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${p},mrtt:${h},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_getInternalTextureId(e){const t=this._getInternalTexture(e,xe.Opaque);return t?.id}_getInternalTexture(e,t){const r=ze(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let n=this._textures.get(o);if(!n){let a=null;const s=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,i={wrap:$e(e.wrap),noUnpackFlip:!0,maxAnisotropy:s,mipmap:s>1};re(r)?(a=r.data,i.preMultiplyAlpha=!1,i.encoding=r.encoding):(a=r,i.preMultiplyAlpha=t!==xe.Opaque,i.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),n=new ve(a,i),this._textures.set(o,n),n.load(this._context.stage.renderView.renderingContext),this._context.stage.add(n),n.events.on("unloaded",(()=>{this._textures.delete(o)}))}return n}_setInternalMaterialTextureParameters(t,r){if(null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture))}_setInternalMaterialParameters(e,t){null!=e.color&&qe(e.color,t),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=oe(e.colorTextureTransform),t.normalTextureTransformMatrix=oe(e.normalTextureTransform);const r=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:f;t.scale=[r[0],r[1]],t.occlusionTextureTransformMatrix=oe(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=oe(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=oe(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=this.symbolLayer.material?.colorMixMode??null;if(r)t.externalColor=j;else{const r=this.symbolLayer.material?.color??null;r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=j)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_getOrCreateMaterial(t,r){const o=r.material?.color,n=r.material?.colorTexture,a=r.material?.alphaMode,s="blend"===a,i=!("opaque"===a)&&(ke(t)||null!=o&&o.a<1||n?.transparent||s),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return this._setInternalMaterialTextureParameters(l,c.material.parameters),c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=je({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),f={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:w,diffuse:R,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:_e.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled};f.mrrFactors=m?Ce:[l.metallic,l.roughness,Ae[2]],r.material&&(f.doubleSided=r.material.doubleSided,f.cullFace=r.material.doubleSided?_e.None:_e.Back,f.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(f),this._setMaterialTransparentParameter(f,u),this._setInternalMaterialParameters(l,f);const p=new Re(f,this._context);return u.material=p,this._materialInfoCache.set(l.uid,u),this._context.stage.add(p),p}_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?xe.MaskBlend:xe.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?xe.Opaque:"mask"===t.alphaMode?xe.Mask:xe.Blend}_createFaceDebugNormals(e,t){const o=t.length,a=e.spatialReference.isGeographic?20015077/180:1,s=.1*Math.max(e.extent.width*a,e.extent.height*a,e.extent.zmax-e.extent.zmin),i=[],l=[],c=t[0].transformation,u=r(n(),c);for(let r=0;r<o;r++){const e=t[r].attributes.get(we.POSITION);if(!e)continue;const o=e.data,n=e.indices;for(let t=0;t<n.length;t+=3)Ge(o,n,t,tt),De(o,n,t,Xe,Ze,et),h(Xe,Xe,Ze),h(Xe,Xe,et),d(Xe,Xe,1/3),g(Xe,Xe,c),i.push(...Xe),x(tt,tt,u),_(tt,tt),T(Xe,Xe,tt,s),i.push(...Xe),l.push(l.length),l.push(l.length)}return i.length?new be(this._debugFaceNormalMaterial,[[we.POSITION,new ge(i,l,3,!0)]],null,Te.Line):null}_createPerVertexDebugVectors(e,t,a,s,i){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*i*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],h=t[0].transformation,d=r(n(),h);a===we.TANGENT&&o(d,h);for(let r=0;r<l;r++){const e=t[r],o=e.attributes.get(we.POSITION),n=e.attributes.get(a);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;p(Xe,s[e+0],s[e+1],s[e+2]),g(Xe,Xe,h),m.push(...Xe),p(Ze,l[r+0],l[r+1],l[r+2]),x(Ze,Ze,d),_(Ze,Ze),T(Xe,Xe,Ze,u),m.push(...Xe),f.push(f.length),f.push(f.length)}}return m.length?new be(s,[[we.POSITION,new ge(m,f,3,!0)]],null,Te.Line):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(de.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,we.NORMAL,this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,we.TANGENT,this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=new ye({geometries:s,layerUid:this._context.layer.uid,graphicUid:o,isElevationSource:!0});l.transformation=i;const c=fe(this.symbolLayer,{opacity:this._getLayerOpacity()}),u=c?new le(s[0].material,c,this._context.slicePlaneEnabled):null,m=new ie(this,l,s,null,null,ne,r,u);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=ae(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,m.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:f,renderCoordsHelper:p}=this._context,h=(e,t)=>se(e,f,r,p,t);return m.alignedSampledElevation=ne(m,r,f.spatialReference,h,p),m}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!L(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return a===te.Global&&"local"===o||a===te.Local&&$(s,r)&&"georeferenced"===o&&!r.isGeographic}_getCenterPointInElevationSR(e){const t=Z(0,0,0,this._context.elevationProvider.spatialReference??null);return E([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_passthroughReprojectionInfo(e){return e.reprojection===st.NONE&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(t.reprojection===st.NONE)return{position:n,georeferencedPositionBuffer:o};const a=t.reprojection===st.RENDER?t.transformBeforeProject:null;a&&(n=k(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return P(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=o.reprojection===st.RENDER?o.transformBeforeProject:null;s&&(a=q(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(o.reprojection===st.NONE)return a;if("local"===i){if(!H(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return z(a,W.NORMAL,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Y(a,W.NORMAL,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return J(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=o.reprojection===st.RENDER?o.transformBeforeProject:null;s&&(a=K(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(o.reprojection===st.NONE)return a;if("local"===i){if(!H(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return z(a,W.TANGENT,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Y(a,W.TANGENT,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return Q(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=pe(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return he(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),u=Je(e),m=this._createSymbolColorBuffer(t),f=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:f,tangent:p}:this._transformOriginLocal(e,i,f,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:u,symbolColorBuffer:m,objectTransformation:d,geometryTransformation:s.reprojection===st.NONE&&s.geometryTransformation?s.geometryTransformation:c()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?$(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?st.NONE:st.RENDER:st.NONE;if(V(t))return{reprojection:r};const o=t.origin,n=c(),i=e.transform?.localMatrix??u;if(r===st.NONE){C(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:m(i)}}const l=a(c(),o);return s(l,l,i),{reprojection:r,transformBeforeProject:l}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Qe[0]=a.x,Qe[1]=a.y,Qe[2]=a.z??0;const s=c();C(e.spatialReference,Qe,s,n),i(rt,s);const{position:l,normal:u,tangent:m}=e.vertexAttributes,f=t===l?new Float64Array(t.length):t;k(f,t,rt);const p=r?r===u?new Float32Array(r.length):r:null,h=o?o===m?new Float32Array(o.length):o:null;return r&&p&&q(r,p,rt),o&&h&&K(o,h,rt),{transformation:s,position:f,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[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}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=X(e,r??e.spatialReference);return!!o&&(I(o,nt),!N(nt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!A(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:f}=o,p=Le(e),h=new Array;let d=!1;const g=l(Xe,m),x=this._context.localOriginFactory.getOrigin(g);for(const l of p){if(!this._validateFaces(e,l))return null;const t=Ne(e,l);if(0===t.length)continue;const o=Se(n,c,l,t);o.didFlipNormals&&(d=!0);const m=[[we.POSITION,new ge(n,t,3,!0)],[we.NORMAL,new ge(o.normals,o.indices,3,!0)]];s&&m.push([we.COLOR,new ge(s,t,4,!0)]),i&&m.push([we.SYMBOLCOLOR,new ge(i,U(t.length),4,!0)]),a&&m.push([we.UV0,new ge(a,t,2,!0)]),u&&m.push([we.TANGENT,new ge(u,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),g=this._getOrCreateMaterial(e,l),_=new be(g,m,null,Te.Mesh,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&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:h,objectTransformation:m}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return t!==te.Local||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class Ie{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ne(e,t){return t.faces??B(e.vertexAttributes.position.length/3)}function Se(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Be(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Fe(e,o)}}function Ue(e,t){const r=S(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ge(e,t,n,tt);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Ie(r,o,!1)}function Be(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ge(e,o,a,tt);for(let e=0;e<3;e++){const r=3*o[a+e];Xe[0]=t[r],Xe[1]=t[r+1],Xe[2]=t[r+2],b(tt,Xe)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Ie(t,o,n)}function Fe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ge(e,t,a,tt);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),h(s.normal,s.normal,o),s.count++}}const o=S(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(_(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Ie(o,n,!1)}function De(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ge(e,t,r,o){return De(e,t,r,Xe,Ze,et),y(Ze,Ze,Xe),y(et,et,Xe),v(Xe,Ze,et),_(o,Xe),o}function Le(e){return e.components??at}function Ve(e){if(!e)return null;const{scale:r,offset:o,rotation:n}=e;return{scale:r,offset:o,rotation:t(n)}}function $e(e="repeat"){if("string"==typeof e){const t=He(e);return{s:t,t}}return{s:He(e.horizontal),t:He(e.vertical)}}function He(e){switch(e){case"clamp":return Pe.CLAMP_TO_EDGE;case"mirror":return Pe.MIRRORED_REPEAT;default:return Pe.REPEAT}}function ke(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function qe(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}function ze(e){return e.data??e.url}function We(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function Ye(e){const{offset:t,scale:r,rotation:o}=e??Ke;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function Je(e){return e.vertexAttributes.color}const Ke=new G,Qe=M(),Xe=M(),Ze=M(),et=M(),tt=M(),rt=c(),ot=c(),nt=O(),at=[new F];var st;!function(e){e[e.NONE=0]="NONE",e[e.RENDER=1]="RENDER"}(st||(st={}));export{Oe as Graphics3DMeshFillSymbolLayer};
5
+ import e from"../../../../Color.js";import"../../../../core/has.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{normalFromMat4 as r,fromMat4 as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as a,multiply as s,invert as i,getTranslation as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c,IDENTITY as u,clone as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as h,g as p,h as d,t as g,q as x,n as _,b as T,f as b,d as y,e as v}from"../../../../chunks/vec32.js";import{ZEROS as w,ONES as R,create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as A}from"../../../../geometry/projection.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as P}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToPoint as E}from"../../../../geometry/projection/projectVectorToPoint.js";import{create as O,fromBuffer as I,intersectsClippingArea as N}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as S}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as U,getContinuousIndexArray as B}from"../../../../geometry/support/Indices.js";import F from"../../../../geometry/support/MeshComponent.js";import D from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import G from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as L,isAbsoluteVertexSpace as V}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as $,isPlateCarree as H}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as k}from"../../../../chunks/vec3.js";import{transformNormal as q,transformVectorENUPlateCarree as z,VectorType as W,transformVectorWMPlateCarree as Y,projectNormalToPCPF as J,transformTangent as K,projectTangentToPCPF as Q}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as X}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{makeDehydratedPoint as Z}from"../../../../layers/graphics/dehydratedPoint.js";import{MeshTransformUpdateAction as ee}from"../../../../layers/graphics/sources/interfaces.js";import{ViewingMode as te}from"../../../ViewingMode.js";import{isEncodedMeshTexture as re}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as oe}from"../../glTF/internal/TextureTransformUtils.js";import{perObjectElevationAligner as ne}from"./ElevationAligners.js";import{needsElevationUpdates3D as ae,evaluateElevationInfoAtPoint as se}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ie}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as le}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as ce}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as ue,MeshFastUpdateProcessor as me}from"./MeshFastUpdateProcessor.js";import{createMaterial as fe}from"../support/edgeUtils.js";import{parseColorMixMode as he,encodeSymbolColor as pe}from"../support/symbolColorUtils.js";import{debugFlags as de}from"../../support/debugFlags.js";import{Attribute as ge}from"../../webgl-engine/lib/Attribute.js";import{AlphaDiscardMode as xe,CullFaceOptions as _e}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as Te}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as be}from"../../webgl-engine/lib/Geometry.js";import{Object3D as ye}from"../../webgl-engine/lib/Object3D.js";import{Texture as ve}from"../../webgl-engine/lib/Texture.js";import{VertexAttribute as we}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as Re}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Me}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Ae,schematicMRRFactors as Ce}from"../../webgl-engine/materials/pbrUtils.js";import{TextureWrapMode as Pe}from"../../../webgl/enums.js";const Ee=["mesh"];class Oe extends ce{constructor(e,t,r,o){super(e,t,r,o),this._materialInfoCache=new ue,this._fastUpdateProcessor=new me,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){de.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Me({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Me({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Me({color:[0,1,1,1]}))}destroy(){super.destroy(),this._textures.forEach((e=>e.unload())),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Ee,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters((e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTransparentParameter(t,e),e.material.setParameters({transparent:t.transparent})})),e.forEach((e=>t(e)?.layerOpacityChanged(r,this._context.isAsync)))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ae)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters((({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),e.forEach((e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync))),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters((({material:t})=>t.setParameters({usePBR:e}))),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case ee.EnableFastUpdates:if(n)return!0;break;case ee.DisableFastUpdates:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,ee.EnableFastUpdates)&&(e.autoDisableFastTransformUpdates((()=>this.updateTransform(e,t,r,ee.DisableFastUpdates))),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=ot,{origin:i,transform:l}=r;if(!C(t,h(Xe,i.x,i.y,i.z??0),s,a))return!1;switch(o){case ee.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case ee.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case ee.UpdateFastLocalOrigin:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerPointInElevationSR=this._getCenterPointInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>se(e,u,c,m,t);return e.alignedSampledElevation=ne(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates((()=>this.updateTransform(e,t,r,ee.DisableFastUpdates))),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=We(n),h=We(a),p=Ye(s),d=We(i),g=Ye(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${h},cttuid:${p},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof D){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:f}=t.material,h=We(n),p=Ye(a),d=We(i),g=We(c),x=Ye(u),_=We(m),T=Ye(f);o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=Ve(s),o.normalTextureTransform=Ve(l),o.emissiveTextureTransform=Ve(u),o.occlusionTextureTransform=Ve(f),o.metallicRoughnessTextureTransform=Ve(a),o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${h},mrtt:${p},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${T}`}return o}_getInternalTextureId(e){const t=this._getInternalTexture(e,xe.Opaque);return t?.id}_getInternalTexture(e,t){const r=ze(e);if(!r)return null;const o=`${e.contentHash}/${t}`;let n=this._textures.get(o);if(!n){let a=null;const s=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,i={wrap:$e(e.wrap),noUnpackFlip:!0,maxAnisotropy:s,mipmap:s>1};re(r)?(a=r.data,i.preMultiplyAlpha=!1,i.encoding=r.encoding):(a=r,i.preMultiplyAlpha=t!==xe.Opaque),n=new ve(a,i),this._textures.set(o,n),n.load(this._context.stage.renderView.renderingContext),this._context.stage.add(n),n.events.on("unloaded",(()=>{this._textures.delete(o)}))}return n}_setInternalMaterialTextureParameters(t,r){if(null!=t.colorTexture){const e=this._getInternalTexture(t.colorTexture,r.textureAlphaMode);e?(r.textureId=e.id,r.textureAlphaPremultiplied=!!e.parameters.preMultiplyAlpha):r.textureId=void 0}t.normalTexture&&(r.normalTextureId=this._getInternalTextureId(t.normalTexture)),t.emissiveColor&&(r.emissiveFactor=e.toUnitRGB(t.emissiveColor)),t.emissiveTexture&&(r.emissiveTextureId=this._getInternalTextureId(t.emissiveTexture)),t.occlusionTexture&&(r.occlusionTextureId=this._getInternalTextureId(t.occlusionTexture)),t.metallicRoughnessTexture&&(r.metallicRoughnessTextureId=this._getInternalTextureId(t.metallicRoughnessTexture))}_setInternalMaterialParameters(e,t){null!=e.color&&qe(e.color,t),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=oe(e.colorTextureTransform),t.normalTextureTransformMatrix=oe(e.normalTextureTransform);const r=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:f;t.scale=[r[0],r[1]],t.occlusionTextureTransformMatrix=oe(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=oe(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=oe(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t){const r=this._drivenProperties.color;let o=this.symbolLayer.material?.colorMixMode??null;if(r)t.externalColor=j;else{const r=this.symbolLayer.material?.color??null;r?t.externalColor=e.toUnitRGBA(r):(o=null,t.externalColor=j)}o&&(t.colorMixMode=o),t.castShadows=!!this.symbolLayer.castShadows}_getOrCreateMaterial(t,r){const o=r.material?.color,n=r.material?.colorTexture,a=r.material?.alphaMode,s="blend"===a,i=!("opaque"===a)&&(ke(t)||null!=o&&o.a<1||n?.transparent||s),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return this._setInternalMaterialTextureParameters(l,c.material.parameters),c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=je({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),f={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:w,diffuse:R,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:_e.None,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled};f.mrrFactors=m?Ce:[l.metallic,l.roughness,Ae[2]],r.material&&(f.doubleSided=r.material.doubleSided,f.cullFace=r.material.doubleSided?_e.None:_e.Back,f.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(f),this._setMaterialTransparentParameter(f,u),this._setInternalMaterialParameters(l,f);const h=new Re(f,this._context);return u.material=h,this._materialInfoCache.set(l.uid,u),this._context.stage.add(h),h}_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?xe.MaskBlend:xe.Opaque:e.textureAlphaMode="opaque"===t.alphaMode?xe.Opaque:"mask"===t.alphaMode?xe.Mask:xe.Blend}_createFaceDebugNormals(e,t){const o=t.length,a=e.spatialReference.isGeographic?20015077/180:1,s=.1*Math.max(e.extent.width*a,e.extent.height*a,e.extent.zmax-e.extent.zmin),i=[],l=[],c=t[0].transformation,u=r(n(),c);for(let r=0;r<o;r++){const e=t[r].attributes.get(we.POSITION);if(!e)continue;const o=e.data,n=e.indices;for(let t=0;t<n.length;t+=3)Ge(o,n,t,tt),De(o,n,t,Xe,Ze,et),p(Xe,Xe,Ze),p(Xe,Xe,et),d(Xe,Xe,1/3),g(Xe,Xe,c),i.push(...Xe),x(tt,tt,u),_(tt,tt),T(Xe,Xe,tt,s),i.push(...Xe),l.push(l.length),l.push(l.length)}return i.length?new be(this._debugFaceNormalMaterial,[[we.POSITION,new ge(i,l,3,!0)]],null,Te.Line):null}_createPerVertexDebugVectors(e,t,a,s,i){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*i*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,d=r(n(),p);a===we.TANGENT&&o(d,p);for(let r=0;r<l;r++){const e=t[r],o=e.attributes.get(we.POSITION),n=e.attributes.get(a);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;h(Xe,s[e+0],s[e+1],s[e+2]),g(Xe,Xe,p),m.push(...Xe),h(Ze,l[r+0],l[r+1],l[r+2]),x(Ze,Ze,d),_(Ze,Ze),T(Xe,Xe,Ze,u),m.push(...Xe),f.push(f.length),f.push(f.length)}}return m.length?new be(s,[[we.POSITION,new ge(m,f,3,!0)]],null,Te.Line):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(de.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,we.NORMAL,this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,we.TANGENT,this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=new ye({geometries:s,layerUid:this._context.layer.uid,graphicUid:o,isElevationSource:!0});l.transformation=i;const c=fe(this.symbolLayer,{opacity:this._getLayerOpacity()}),u=c?new le(s[0].material,c,this._context.slicePlaneEnabled):null,m=new ie(this,l,s,null,null,ne,r,u);this._fastUpdateProcessor.onAddGraphic(),m.needsElevationUpdates=ae(r.mode),m.useObjectOriginAsAttachmentOrigin=!0,m.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerPointInElevationSR=this._getCenterPointInElevationSR(l.transformation);const{elevationProvider:f,renderCoordsHelper:h}=this._context,p=(e,t)=>se(e,f,r,h,t);return m.alignedSampledElevation=ne(m,r,f.spatialReference,p,h),m}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!L(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return a===te.Global&&"local"===o||a===te.Local&&$(s,r)&&"georeferenced"===o&&!r.isGeographic}_getCenterPointInElevationSR(e){const t=Z(0,0,0,this._context.elevationProvider.spatialReference??null);return E([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,t),t}_passthroughReprojectionInfo(e){return e.reprojection===st.NONE&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(t.reprojection===st.NONE)return{position:n,georeferencedPositionBuffer:o};const a=t.reprojection===st.RENDER?t.transformBeforeProject:null;a&&(n=k(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return P(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=o.reprojection===st.RENDER?o.transformBeforeProject:null;s&&(a=q(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(o.reprojection===st.NONE)return a;if("local"===i){if(!H(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return z(a,W.NORMAL,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Y(a,W.NORMAL,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return J(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=o.reprojection===st.RENDER?o.transformBeforeProject:null;s&&(a=K(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(o.reprojection===st.NONE)return a;if("local"===i){if(!H(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return z(a,W.TANGENT,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Y(a,W.TANGENT,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return Q(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){if(this._requiresSymbolVertexColors()){const t=this._getVertexOpacityAndColor(e),r=he(this.symbolLayer?.material?.colorMixMode),o=new Uint8Array(4);return pe(t,r,o),o}return null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),u=Je(e),m=this._createSymbolColorBuffer(t),f=this._createNormalBuffer(e,i,l,s),h=this._createTangentBuffer(e,i,l,s),p=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:f,tangent:h}:this._transformOriginLocal(e,i,f,h);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:p,colorBuffer:u,symbolColorBuffer:m,objectTransformation:d,geometryTransformation:s.reprojection===st.NONE&&s.geometryTransformation?s.geometryTransformation:c()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?$(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?st.NONE:st.RENDER:st.NONE;if(V(t))return{reprojection:r};const o=t.origin,n=c(),i=e.transform?.localMatrix??u;if(r===st.NONE){C(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:m(i)}}const l=a(c(),o);return s(l,l,i),{reprojection:r,transformBeforeProject:l}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Qe[0]=a.x,Qe[1]=a.y,Qe[2]=a.z??0;const s=c();C(e.spatialReference,Qe,s,n),i(rt,s);const{position:l,normal:u,tangent:m}=e.vertexAttributes,f=t===l?new Float64Array(t.length):t;k(f,t,rt);const h=r?r===u?new Float32Array(r.length):r:null,p=o?o===m?new Float32Array(o.length):o:null;return r&&h&&q(r,h,rt),o&&p&&K(o,p,rt),{transformation:s,position:f,normal:h,tangent:p}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[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}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=X(e,r??e.spatialReference);return!!o&&(I(o,nt),!N(nt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!A(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:c,tangentBuffer:u,objectTransformation:m,geometryTransformation:f}=o,h=Le(e),p=new Array;let d=!1;const g=l(Xe,m),x=this._context.localOriginFactory.getOrigin(g);for(const l of h){if(!this._validateFaces(e,l))return null;const t=Ne(e,l);if(0===t.length)continue;const o=Se(n,c,l,t);o.didFlipNormals&&(d=!0);const m=[[we.POSITION,new ge(n,t,3,!0)],[we.NORMAL,new ge(o.normals,o.indices,3,!0)]];s&&m.push([we.COLOR,new ge(s,t,4,!0)]),i&&m.push([we.SYMBOLCOLOR,new ge(i,U(t.length),4,!0)]),a&&m.push([we.UV0,new ge(a,t,2,!0)]),u&&m.push([we.TANGENT,new ge(u,t,4,!0)]);const h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),g=this._getOrCreateMaterial(e,l),_=new be(g,m,null,Te.Mesh,h);_.transformation=f,_.localOrigin=x,p.push(_)}return d&&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:p,objectTransformation:m}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial(((e,t)=>{t.setParameters(e.parameters)}))}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return t!==te.Local||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}}class Ie{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ne(e,t){return t.faces??B(e.vertexAttributes.position.length/3)}function Se(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Be(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Fe(e,o)}}function Ue(e,t){const r=S(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ge(e,t,n,tt);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Ie(r,o,!1)}function Be(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ge(e,o,a,tt);for(let e=0;e<3;e++){const r=3*o[a+e];Xe[0]=t[r],Xe[1]=t[r+1],Xe[2]=t[r+2],b(tt,Xe)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Ie(t,o,n)}function Fe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ge(e,t,a,tt);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),p(s.normal,s.normal,o),s.count++}}const o=S(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(_(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Ie(o,n,!1)}function De(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ge(e,t,r,o){return De(e,t,r,Xe,Ze,et),y(Ze,Ze,Xe),y(et,et,Xe),v(Xe,Ze,et),_(o,Xe),o}function Le(e){return e.components??at}function Ve(e){if(!e)return null;const{scale:r,offset:o,rotation:n}=e;return{scale:r,offset:o,rotation:t(n)}}function $e(e="repeat"){if("string"==typeof e){const t=He(e);return{s:t,t}}return{s:He(e.horizontal),t:He(e.vertical)}}function He(e){switch(e){case"clamp":return Pe.CLAMP_TO_EDGE;case"mirror":return Pe.MIRRORED_REPEAT;default:return Pe.REPEAT}}function ke(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function qe(t,r){r.diffuse=e.toUnitRGB(t),r.opacity=t.a}function ze(e){return e.data??e.url}function We(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function Ye(e){const{offset:t,scale:r,rotation:o}=e??Ke;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function Je(e){return e.vertexAttributes.color}const Ke=new G,Qe=M(),Xe=M(),Ze=M(),et=M(),tt=M(),rt=c(),ot=c(),nt=O(),at=[new F];var st;!function(e){e[e.NONE=0]="NONE",e[e.RENDER=1]="RENDER"}(st||(st={}));export{Oe as Graphics3DMeshFillSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{e as i}from"../../../../chunks/earcut.js";import{create as r,fromBuffer as s,intersectsClippingArea as o,empty as n,expandWithAABB as a}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as l,doubleSubArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as p,floatSubArray as h}from"../../../../geometry/support/FloatArray.js";import{SymbolUpdateType as u,elevationModeChangeUpdateType as d,needsElevationUpdates2D as m}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as y}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as _}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as f}from"./graphicUtils.js";import{ApplyRendererDiffResult as b}from"./interfaces.js";import{parseCapType as x}from"./lineUtils.js";import{geometryAsPolygon as O,createIndices3D as v,createColorGeometry as D,PolygonCreationDataBase as C}from"./polygonUtils.js";import{initFastSymbolUpdatesState as S,updateFastSymbolUpdatesState as j,getAttributeValue as A,ConvertOptions as P}from"../support/FastSymbolUpdates.js";import{createMaterial as U,uvElevationAligner as E}from"../support/patternUtils.js";import{createMapSpaceUVCoords as G,createMapSpaceUVCoordsDraped as L}from"../support/uvUtils.js";import{createGeometry as F}from"../../support/engineContent/line.js";import{geometryToRenderInfo as w,geometryToRenderInfoDraped as R}from"../../support/renderInfoUtils/polygon.js";import{Object3D as I}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as M}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as V}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as B}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";const z=["polyline","polygon","extent"],H=new P({size:!1,color:!0,rotation:!1,opacity:!1});class N extends g{constructor(e,t,i,r){super(e,t,i,r),this._needsUV=!1}async doLoad(){this._fastUpdates=S(this._context.renderer,H)}_createMaterials(){if(this._materials.length>0)return;const e=this.symbolLayer?.material?.color,i=this._getCombinedOpacityAndColor(e);this._materials[J.Fill]=U(this.symbolLayer,{color:i,forceTransparentMode:this.needsDrivenTransparentPass,discardInvisibleFragments:!0,polygonOffset:!1,hasVertexColors:!0,draped:this.draped,hasSlicePlane:this._context.slicePlaneEnabled,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[J.Fill]instanceof B;const r=this.symbolLayer.outline;if(K(r)){const e=V(r.pattern);this._materials[J.Outline]=new T({width:t(r.size),color:this._getOutlineColor(),hasPolygonOffset:!0,hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:e,cap:x(r.patternCap||"butt")})}this._context.stage.addMany(this._materials)}destroy(){super.destroy(),this._context.stage.removeMany(this._materials),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,z,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this._createMaterials(),this.draped?this._createAsOverlay(t,i):this._createAs3DShape(t,i,r)}applyRendererDiff(e,t){for(const i in e.diff){if("visualVariables"!==i)return b.RecreateSymbol;if(!j(this._fastUpdates,t,H))return b.RecreateSymbol;this._materials[J.Fill]?.setParameters(this._fastUpdates.materialParameters)}return b.FastUpdate}layerOpacityChanged(){if(null!=this._materials[J.Fill]){const e=this._materials[J.Fill].parameters.color,t=this.symbolLayer?.material?.color,i=this._getCombinedOpacity(t);this._materials[J.Fill].setParameters({color:[e[0],e[1],e[2],i],forceTransparentMode:this.needsDrivenTransparentPass})}if(null!=this._materials[J.Outline]){const e=this._materials[J.Outline].parameters.color;this._materials[J.Outline].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,s=d(N.elevationModeChangeTypes,i,r);if(s!==u.UPDATE)return s;const o=m(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){if(this._materials[J.Fill]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[J.Outline]){const e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[J.Outline].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,i){const r=O(e.geometry);if(!r)return null;const s=w(r,this._context.elevationProvider,this._context.renderCoordsHelper,i),o=new k(s,t,this._context.layer.uid,e.uid),n=o.renderData.position.length/3;if(this._needsUV&&(o.uvMapSpace=p(4*n,!0),o.boundingRect=l(9*n,!0),G(o.uvMapSpace,o.boundingRect,o.renderData.position,this._context.renderCoordsHelper)),o.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[J.Outline]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,r.rings,"rings","FillSymbol3DLayer"),0===o.outGeometries.length)return null;const a=new I({geometries:o.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:e.uid}),c=new _(this,a,o.outGeometries,null,null,E,i);return c.alignedSampledElevation=o.renderData.sampledElevation,c.needsElevationUpdates=m(i.mode),c}_createAs3DShapeFill(e,t){const i=t.renderData.polygons;for(const{position:r,mapPositions:n,holeIndices:a,index:l,count:p}of i){if(null!=this._context.clippingExtent&&(s(n,W),!o(W,this._context.clippingExtent)))continue;const i=v(n,a,this._context.elevationProvider.spatialReference);if(0===i.length)continue;const u=this._fastUpdates?.visualVariables.color,d=D({material:this._materials[J.Fill],indices:i,mapPositions:n,attributeData:{position:r,color:u?null:t.color,colorFeature:u?A(u.field,e):null,uvMapSpace:this._needsUV?h(t.uvMapSpace,4*l,4*p):null,boundingRect:this._needsUV?c(t.boundingRect,9*l,9*p):null,objectAndLayerIdColor:t.objectAndLayerIdColor}});t.outGeometries.push(d)}}_createAs3DShapeOutline(e){if(null==this._materials[J.Outline])return;const t=e.renderData.outlines;for(const{mapPositions:i,position:r}of t){if(null!=this._context.clippingExtent&&(s(i,W),!o(W,this._context.clippingExtent)))continue;const t=F(this._materials[J.Outline],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:i,attributeData:{position:r}},e.objectAndLayerIdColor);e.outGeometries.push(t)}}_createAsOverlay(e,t){const i=O(e.geometry);if(null==i)return null;this._materials[J.Fill].renderPriority=this._renderPriority+this._renderPriorityStep/2,null!=this._materials[J.Outline]&&(this._materials[J.Outline].renderPriority=this._renderPriority);const r=R(i,this._context.overlaySR),s=new q(r,t,this._context.layer.uid,e.uid),o=s.renderData.position.length/3;return this._needsUV&&(s.uvMapSpace=p(4*o,!0),L(s.uvMapSpace,s.renderData.position,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),s.outBoundingBox=n(),s.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(s),this._createAsOverlayFill(e,s),this._materials[J.Outline]&&this._createAsOverlayOutline(s),this._logGeometryCreationWarnings(s.renderData,i.rings,"rings","FillSymbol3DLayer"),0===s.outGeometries.length?null:new y(this,s.outGeometries,s.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){const r=t.renderData.polygons;for(const{position:n,holeIndices:l,index:c,count:p}of r){const r=s(n,W);if(!o(r,this._context.clippingExtent))continue;const u=i(n,l,3);if(0===u.length)continue;a(t.outBoundingBox,r);const d=this._fastUpdates?.visualVariables.color,m=D({material:this._materials[J.Fill],indices:u,attributeData:{position:n,color:d?null:t.color,colorFeature:d?A(d.field,e):null,uvMapSpace:this._needsUV?h(t.uvMapSpace,4*c,4*p):null,objectAndLayerIdColor:t.objectAndLayerIdColor}});t.outGeometries.push(new M(m,t))}}_createAsOverlayOutline(e){if(null==this._materials[J.Outline])return;const t=e.renderData.outlines;for(let i=0;i<t.length;++i){const{position:r}=t[i];if(s(r,W),!o(W,this._context.clippingExtent))continue;a(e.outBoundingBox,W);const n=F(this._materials[J.Outline],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:r}},e.objectAndLayerIdColor);e.outGeometries.push(new M(n,e))}}_getOutlineOpacity(){const e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(null!=e?e.a:0)}_getOutlineColor(){const t=this.symbolLayer?.outline?.color,i=this._getOutlineOpacity();return f(null!=t?e.toUnitRGB(t):null,i)}test(){return{...super.test(),createAsOverlay:(e,t)=>this._createAsOverlay(e,t),createAs3DShape:(e,t,i)=>this._createAs3DShape(e,t,i)}}}N.elevationModeChangeTypes={definedChanged:u.RECREATE,staysOnTheGround:u.NONE,onTheGroundChanged:u.RECREATE};const W=r();class k extends C{constructor(e,t,i,r){super(e,i,r),this.color=t}}class q extends C{constructor(e,t,i,r){super(e,i,r),this.color=t}}var J;function K(e){return null!=e?.size&&e.size>0&&null!=e.color&&(null==e.pattern||"style"!==e.pattern.type||"none"!==e.pattern.style)}!function(e){e[e.Fill=0]="Fill",e[e.Outline=1]="Outline"}(J||(J={}));export{N as Graphics3DPolygonFillSymbolLayer};
5
+ import e from"../../../../Color.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{e as i}from"../../../../chunks/earcut.js";import{fromBuffer as r,intersectsClippingArea as s,empty as o,expandWithAABB as n,create as a}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as l,doubleSubArray as c}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as p,floatSubArray as h}from"../../../../geometry/support/FloatArray.js";import{SymbolUpdateType as u,elevationModeChangeUpdateType as d,needsElevationUpdates2D as m}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as y}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as _}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as g}from"./Graphics3DSymbolLayer.js";import{mixinColorAndOpacity as f}from"./graphicUtils.js";import{ApplyRendererDiffResult as b}from"./interfaces.js";import{parseCapType as x}from"./lineUtils.js";import{geometryAsPolygon as O,createIndices3D as v,createColorGeometry as D,PolygonCreationDataBase as C}from"./polygonUtils.js";import{initFastSymbolUpdatesState as S,updateFastSymbolUpdatesState as j,getAttributeValue as A,ConvertOptions as P}from"../support/FastSymbolUpdates.js";import{createMaterial as U,uvElevationAligner as E}from"../support/patternUtils.js";import{createMapSpaceUVCoords as G,createMapSpaceUVCoordsDraped as L}from"../support/uvUtils.js";import{createGeometry as F}from"../../support/engineContent/line.js";import{geometryToRenderInfo as w,geometryToRenderInfoDraped as R}from"../../support/renderInfoUtils/polygon.js";import{Object3D as I}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as M}from"../../webgl-engine/lib/RenderGeometry.js";import{getStipplePatternForLinePattern as V}from"../../webgl-engine/materials/lineStippleUtils.js";import{PatternMaterial as B}from"../../webgl-engine/materials/PatternMaterial.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";const z=["polyline","polygon","extent"],H=new P({size:!1,color:!0,rotation:!1,opacity:!1});class N extends g{static{this.elevationModeChangeTypes={definedChanged:u.RECREATE,staysOnTheGround:u.NONE,onTheGroundChanged:u.RECREATE}}constructor(e,t,i,r){super(e,t,i,r),this._needsUV=!1}async doLoad(){this._fastUpdates=S(this._context.renderer,H)}_createMaterials(){if(this._materials.length>0)return;const e=this.symbolLayer?.material?.color,i=this._getCombinedOpacityAndColor(e);this._materials[J.Fill]=U(this.symbolLayer,{color:i,forceTransparentMode:this.needsDrivenTransparentPass,discardInvisibleFragments:!0,polygonOffset:!1,hasVertexColors:!0,draped:this.draped,hasSlicePlane:this._context.slicePlaneEnabled,...this._fastUpdates?.materialParameters}),this._needsUV=this._materials[J.Fill]instanceof B;const r=this.symbolLayer.outline;if(K(r)){const e=V(r.pattern);this._materials[J.Outline]=new T({width:t(r.size),color:this._getOutlineColor(),hasPolygonOffset:!0,hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:e,cap:x(r.patternCap||"butt")})}this._context.stage.addMany(this._materials)}destroy(){super.destroy(),this._context.stage.removeMany(this._materials),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,z,this.symbolLayer.type))return null;const i=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this._createMaterials(),this.draped?this._createAsOverlay(t,i):this._createAs3DShape(t,i,r)}applyRendererDiff(e,t){for(const i in e.diff){if("visualVariables"!==i)return b.RecreateSymbol;if(!j(this._fastUpdates,t,H))return b.RecreateSymbol;this._materials[J.Fill]?.setParameters(this._fastUpdates.materialParameters)}return b.FastUpdate}layerOpacityChanged(){if(null!=this._materials[J.Fill]){const e=this._materials[J.Fill].parameters.color,t=this.symbolLayer?.material?.color,i=this._getCombinedOpacity(t);this._materials[J.Fill].setParameters({color:[e[0],e[1],e[2],i],forceTransparentMode:this.needsDrivenTransparentPass})}if(null!=this._materials[J.Outline]){const e=this._materials[J.Outline].parameters.color;this._materials[J.Outline].setParameters({color:[e[0],e[1],e[2],this._getOutlineOpacity()]})}}layerElevationInfoChanged(e,t,i){const r=this._elevationContext.mode,s=d(N.elevationModeChangeTypes,i,r);if(s!==u.UPDATE)return s;const o=m(r);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){if(this._materials[J.Fill]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[J.Outline]){const e={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[J.Outline].setParameters(e)}return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,i){const r=O(e.geometry);if(!r)return null;const s=w(r,this._context.elevationProvider,this._context.renderCoordsHelper,i),o=new k(s,t,this._context.layer.uid,e.uid),n=o.renderData.position.length/3;if(this._needsUV&&(o.uvMapSpace=p(4*n,!0),o.boundingRect=l(9*n,!0),G(o.uvMapSpace,o.boundingRect,o.renderData.position,this._context.renderCoordsHelper)),o.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[J.Outline]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,r.rings,"rings","FillSymbol3DLayer"),0===o.outGeometries.length)return null;const a=new I({geometries:o.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:e.uid}),c=new _(this,a,o.outGeometries,null,null,E,i);return c.alignedSampledElevation=o.renderData.sampledElevation,c.needsElevationUpdates=m(i.mode),c}_createAs3DShapeFill(e,t){const i=t.renderData.polygons;for(const{position:o,mapPositions:n,holeIndices:a,index:l,count:p}of i){if(null!=this._context.clippingExtent&&(r(n,W),!s(W,this._context.clippingExtent)))continue;const i=v(n,a,this._context.elevationProvider.spatialReference);if(0===i.length)continue;const u=this._fastUpdates?.visualVariables.color,d=D({material:this._materials[J.Fill],indices:i,mapPositions:n,attributeData:{position:o,color:u?null:t.color,colorFeature:u?A(u.field,e):null,uvMapSpace:this._needsUV?h(t.uvMapSpace,4*l,4*p):null,boundingRect:this._needsUV?c(t.boundingRect,9*l,9*p):null,objectAndLayerIdColor:t.objectAndLayerIdColor}});t.outGeometries.push(d)}}_createAs3DShapeOutline(e){if(null==this._materials[J.Outline])return;const t=e.renderData.outlines;for(const{mapPositions:i,position:o}of t){if(null!=this._context.clippingExtent&&(r(i,W),!s(W,this._context.clippingExtent)))continue;const t=F(this._materials[J.Outline],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:i,attributeData:{position:o}},e.objectAndLayerIdColor);e.outGeometries.push(t)}}_createAsOverlay(e,t){const i=O(e.geometry);if(null==i)return null;this._materials[J.Fill].renderPriority=this._renderPriority+this._renderPriorityStep/2,null!=this._materials[J.Outline]&&(this._materials[J.Outline].renderPriority=this._renderPriority);const r=R(i,this._context.overlaySR),s=new q(r,t,this._context.layer.uid,e.uid),n=s.renderData.position.length/3;return this._needsUV&&(s.uvMapSpace=p(4*n,!0),L(s.uvMapSpace,s.renderData.position,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),s.outBoundingBox=o(),s.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(s),this._createAsOverlayFill(e,s),this._materials[J.Outline]&&this._createAsOverlayOutline(s),this._logGeometryCreationWarnings(s.renderData,i.rings,"rings","FillSymbol3DLayer"),0===s.outGeometries.length?null:new y(this,s.outGeometries,s.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,t){const o=t.renderData.polygons;for(const{position:a,holeIndices:l,index:c,count:p}of o){const o=r(a,W);if(!s(o,this._context.clippingExtent))continue;const u=i(a,l,3);if(0===u.length)continue;n(t.outBoundingBox,o);const d=this._fastUpdates?.visualVariables.color,m=D({material:this._materials[J.Fill],indices:u,attributeData:{position:a,color:d?null:t.color,colorFeature:d?A(d.field,e):null,uvMapSpace:this._needsUV?h(t.uvMapSpace,4*c,4*p):null,objectAndLayerIdColor:t.objectAndLayerIdColor}});t.outGeometries.push(new M(m,t))}}_createAsOverlayOutline(e){if(null==this._materials[J.Outline])return;const t=e.renderData.outlines;for(let i=0;i<t.length;++i){const{position:o}=t[i];if(r(o,W),!s(W,this._context.clippingExtent))continue;n(e.outBoundingBox,W);const a=F(this._materials[J.Outline],{overlayInfo:{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper},removeDuplicateStartEnd:!0,attributeData:{position:o}},e.objectAndLayerIdColor);e.outGeometries.push(new M(a,e))}}_getOutlineOpacity(){const e=this.symbolLayer?.outline?.color;return(this.draped?1:this._getLayerOpacity())*(null!=e?e.a:0)}_getOutlineColor(){const t=this.symbolLayer?.outline?.color,i=this._getOutlineOpacity();return f(null!=t?e.toUnitRGB(t):null,i)}test(){return{...super.test(),createAsOverlay:(e,t)=>this._createAsOverlay(e,t),createAs3DShape:(e,t,i)=>this._createAs3DShape(e,t,i)}}}const W=a();class k extends C{constructor(e,t,i,r){super(e,i,r),this.color=t}}class q extends C{constructor(e,t,i,r){super(e,i,r),this.color=t}}var J;function K(e){return null!=e?.size&&e.size>0&&null!=e.color&&(null==e.pattern||"style"!==e.pattern.type||"none"!==e.pattern.style)}!function(e){e[e.Fill=0]="Fill",e[e.Outline=1]="Outline"}(J||(J={}));export{N as Graphics3DPolygonFillSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{getMetersPerUnitForSR as t}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as i,create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as s}from"../../../../chunks/vec42.js";import{toRadian as a}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as l,fromBuffer as c,intersectsClippingArea as h,empty as m,expandWithAABB as u}from"../../../../geometry/support/aaBoundingBox.js";import{create as p,empty as d,expandPointInPlace as g}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as y,doubleSubArray as f}from"../../../../geometry/support/DoubleArray.js";import{perVertexElevationAligner as _}from"./ElevationAligners.js";import{SymbolUpdateType as x,elevationModeChangeUpdateType as v,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as C}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as j}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as S,createWaterGeometry as w,PolygonCreationDataBase as G}from"./polygonUtils.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as A}from"../../support/renderInfoUtils/polygon.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{Parameters as P,WaterMaterial as T}from"../../webgl-engine/materials/WaterMaterial.js";import{wavePresets as R}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const I=["polyline","polygon","extent"];class B extends j{constructor(e,t,r,o){super(e,t,r,o)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,I,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(this._materials[0])return;const t=new P,r=this.symbolLayer.color;null!=r&&(t.color=e.toUnitRGBA(r));const o=this._getCombinedOpacity(r,{hasIntrinsicColor:!0});t.color=[t.color[0],t.color[1],t.color[2],o],t.transparent=o<1||this.needsDrivenTransparentPass,t.waveDirection=null!=this.symbolLayer.waveDirection?U(this.symbolLayer.waveDirection):i(0,0);const n=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,s=R[n];t.waveStrength=s.waveStrength,t.waveTextureRepeat=s.textureRepeat,t.waveVelocity=s.waveVelocity,t.flowStrength=s.perturbationStrength,t.hasSlicePlane=this._context.slicePlaneEnabled,t.draped=this.draped,this._materials[0]=new T(t,this._context),this._context.stage.add(this._materials[0])}layerOpacityChanged(){if(null==this._materials[0])return;const e=this._materials[0].parameters.color,t=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),r=t<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],t],transparent:r})}layerElevationInfoChanged(e,t,r){const o=this._elevationContext.mode,i=v(B.elevationModeChangeTypes,r,o);if(i!==x.UPDATE)return i;const n=b(o);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>n))}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const o=S(e.geometry);if(null==o)return null;const i=E(o,this._context.elevationProvider,this._context.renderCoordsHelper,t),n=i.position.length/3,s=y(2*n);M(s,i.mapPositions,n,this._context.elevationProvider.spatialReference);const a=new N(i,s,this._context.layer.uid,e.uid);if(a.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(a),this._create3DShapeGeometries(a),this._logGeometryCreationWarnings(a.renderData,o.rings,"rings","WaterSymbol3DLayer"),0===a.outGeometries.length)return null;const l=new L({geometries:a.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:r}),c=new D(this,l,a.outGeometries,null,null,_,t);return c.alignedSampledElevation=a.renderData.sampledElevation,c.needsElevationUpdates=b(t.mode),c}_create3DShapeGeometries(e){const t=e.renderData.polygons,o=e.uvCoords;for(const{count:i,index:n,position:s,mapPositions:a,holeIndices:l}of t){if(null!=this._context.clippingExtent&&(c(a,k),!h(k,this._context.clippingExtent)))continue;const t=r(a,l,3);if(0===t.length)continue;const m=f(o,2*n,2*i),u=w({material:this._materials[0],indices:t,mapPositions:a,attributeData:{position:s,uv0:m}},e.objectAndLayerIdColor);e.outGeometries.push(u)}}_createAsOverlay(e){const t=S(e.geometry);if(null==t)return null;this._materials[0].renderPriority=this._renderPriority;const r=A(t,this._context.overlaySR),o=r.position.length/3,i=y(2*o);M(i,r.position,o,this._context.overlaySR);const n=new H(r,i,this._context.layer.uid,e.uid);return n.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),n.outBoundingBox=m(),this._createAsOverlayWater(n),this._logGeometryCreationWarnings(n.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===n.outGeometries.length?null:new C(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(e){const t=e.uvCoords,o=e.renderData.polygons;for(const{position:i,holeIndices:n,index:s,count:a}of o){if(c(i,k),!h(k,this._context.clippingExtent))continue;u(e.outBoundingBox,k);const o=r(i,n,3);if(0===o.length)continue;const l=f(t,2*s,2*a),m=w({material:this._materials[0],indices:o,attributeData:{position:i,uv0:l}},e.objectAndLayerIdColor);e.outGeometries.push(new O(m,e))}}test(){return{...super.test(),create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}function U(e){const t=n(),r=a(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}function M(e,r,i,n){const a=t(n);d(z);for(let t=0;t<i;t++)o(V,r[3*t],r[3*t+1]),g(z,V);s(z,z,a);const l=z[0]%B.unitSizeOfTexture,c=z[1]%B.unitSizeOfTexture;W[0]=z[0]-l,W[1]=z[1]-c;for(let t=0;t<i;t++)e[2*t]=(r[3*t]*a-W[0])/B.unitSizeOfTexture,e[2*t+1]=(r[3*t+1]*a-W[1])/B.unitSizeOfTexture}B.unitSizeOfTexture=100,B.elevationModeChangeTypes={definedChanged:x.RECREATE,staysOnTheGround:x.NONE,onTheGroundChanged:x.RECREATE};const W=n(),z=p(),V=n(),k=l();class N extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}class H extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}export{B as Graphics3DWaterSymbolLayer,U as headingVectorFromAngle};
5
+ import e from"../../../../Color.js";import{getMetersPerUnitForSR as t}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as i,create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as s}from"../../../../chunks/vec42.js";import{toRadian as a}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromBuffer as l,intersectsClippingArea as c,empty as h,expandWithAABB as m,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{empty as p,expandPointInPlace as d,create as g}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as y,doubleSubArray as f}from"../../../../geometry/support/DoubleArray.js";import{perVertexElevationAligner as _}from"./ElevationAligners.js";import{SymbolUpdateType as x,elevationModeChangeUpdateType as v,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as C}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as j}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as S,createWaterGeometry as w,PolygonCreationDataBase as G}from"./polygonUtils.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as A}from"../../support/renderInfoUtils/polygon.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{Parameters as P,WaterMaterial as T}from"../../webgl-engine/materials/WaterMaterial.js";import{wavePresets as R}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const I=["polyline","polygon","extent"];class B extends j{static{this.unitSizeOfTexture=100}static{this.elevationModeChangeTypes={definedChanged:x.RECREATE,staysOnTheGround:x.NONE,onTheGroundChanged:x.RECREATE}}constructor(e,t,r,o){super(e,t,r,o)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,I,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(this._materials[0])return;const t=new P,r=this.symbolLayer.color;null!=r&&(t.color=e.toUnitRGBA(r));const o=this._getCombinedOpacity(r,{hasIntrinsicColor:!0});t.color=[t.color[0],t.color[1],t.color[2],o],t.transparent=o<1||this.needsDrivenTransparentPass,t.waveDirection=null!=this.symbolLayer.waveDirection?U(this.symbolLayer.waveDirection):i(0,0);const n=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,s=R[n];t.waveStrength=s.waveStrength,t.waveTextureRepeat=s.textureRepeat,t.waveVelocity=s.waveVelocity,t.flowStrength=s.perturbationStrength,t.hasSlicePlane=this._context.slicePlaneEnabled,t.draped=this.draped,this._materials[0]=new T(t,this._context),this._context.stage.add(this._materials[0])}layerOpacityChanged(){if(null==this._materials[0])return;const e=this._materials[0].parameters.color,t=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),r=t<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],t],transparent:r})}layerElevationInfoChanged(e,t,r){const o=this._elevationContext.mode,i=v(B.elevationModeChangeTypes,r,o);if(i!==x.UPDATE)return i;const n=b(o);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>n))}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const o=S(e.geometry);if(null==o)return null;const i=E(o,this._context.elevationProvider,this._context.renderCoordsHelper,t),n=i.position.length/3,s=y(2*n);M(s,i.mapPositions,n,this._context.elevationProvider.spatialReference);const a=new N(i,s,this._context.layer.uid,e.uid);if(a.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(a),this._create3DShapeGeometries(a),this._logGeometryCreationWarnings(a.renderData,o.rings,"rings","WaterSymbol3DLayer"),0===a.outGeometries.length)return null;const l=new L({geometries:a.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:r}),c=new D(this,l,a.outGeometries,null,null,_,t);return c.alignedSampledElevation=a.renderData.sampledElevation,c.needsElevationUpdates=b(t.mode),c}_create3DShapeGeometries(e){const t=e.renderData.polygons,o=e.uvCoords;for(const{count:i,index:n,position:s,mapPositions:a,holeIndices:h}of t){if(null!=this._context.clippingExtent&&(l(a,k),!c(k,this._context.clippingExtent)))continue;const t=r(a,h,3);if(0===t.length)continue;const m=f(o,2*n,2*i),u=w({material:this._materials[0],indices:t,mapPositions:a,attributeData:{position:s,uv0:m}},e.objectAndLayerIdColor);e.outGeometries.push(u)}}_createAsOverlay(e){const t=S(e.geometry);if(null==t)return null;this._materials[0].renderPriority=this._renderPriority;const r=A(t,this._context.overlaySR),o=r.position.length/3,i=y(2*o);M(i,r.position,o,this._context.overlaySR);const n=new H(r,i,this._context.layer.uid,e.uid);return n.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),n.outBoundingBox=h(),this._createAsOverlayWater(n),this._logGeometryCreationWarnings(n.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===n.outGeometries.length?null:new C(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(e){const t=e.uvCoords,o=e.renderData.polygons;for(const{position:i,holeIndices:n,index:s,count:a}of o){if(l(i,k),!c(k,this._context.clippingExtent))continue;m(e.outBoundingBox,k);const o=r(i,n,3);if(0===o.length)continue;const h=f(t,2*s,2*a),u=w({material:this._materials[0],indices:o,attributeData:{position:i,uv0:h}},e.objectAndLayerIdColor);e.outGeometries.push(new O(u,e))}}test(){return{...super.test(),create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}function U(e){const t=n(),r=a(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}function M(e,r,i,n){const a=t(n);p(z);for(let t=0;t<i;t++)o(V,r[3*t],r[3*t+1]),d(z,V);s(z,z,a);const l=z[0]%B.unitSizeOfTexture,c=z[1]%B.unitSizeOfTexture;W[0]=z[0]-l,W[1]=z[1]-c;for(let t=0;t<i;t++)e[2*t]=(r[3*t]*a-W[0])/B.unitSizeOfTexture,e[2*t+1]=(r[3*t+1]*a-W[1])/B.unitSizeOfTexture}const W=n(),z=g(),V=n(),k=u();class N extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}class H extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}export{B as Graphics3DWaterSymbolLayer,U as headingVectorFromAngle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- class s{constructor(s,i,t){this.visible=s,this.missing=i,this.pending=t}}export{s as GraphicsCorePerformanceInfo};
5
+ class s{constructor(s,i,t,h){this.total=s,this.visible=i,this.missing=t,this.pending=h}}export{s as GraphicsCorePerformanceInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../../core/Evented.js";import{baseObjectMemory as e,estimateNumberMemory as i}from"../../../../../../core/memoryEstimations.js";import{PooledRBush as r,BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{getCentroidOptimizedGeometry as n}from"../../../../../../layers/graphics/centroid.js";import o from"../../../../../../layers/graphics/OptimizedGeometry.js";class u{constructor(t,e){this._index=t,this._view=e}get usedMemory(){return e+i}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(t){return this._view.getAttribute(this._index,t)}getAttributeAsTimestamp(t){return this._view.getAttributeAsTimestamp(this._index,t)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(t){return this._view.getCentroid(this._index,t)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(t){return new m(this._index,this._view,t)}}class m extends u{constructor(t,e,i){super(t,e),this._geometryOverride=i}getOptimizedGeometry(){return this._geometryOverride}getCentroid(t){return n(new o,this._geometryOverride,t.hasZ,t.hasM)}}class d{constructor(){this._tileBounds=new Map,this.events=new t,this.featureAdapter=h.shared}get usedMemory(){return e+e*this._tileBounds.size}addTile(t){const{featureCount:e}=t;if(0===e)return;const i=new r(9,(e=>t.getBounds(e))),s=new Array;for(let r=0;r<e;++r)s[r]=r;i.load(s),this._tileBounds.set(t,i),this.events.emit("changed")}removeTile(t){this._tileBounds.delete(t),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(t){for(const[e,i]of this._tileBounds)i.all((i=>t(new u(i,e))))}forEachInBounds(t,e){a.minX=t[0],a.minY=t[1],a.maxX=t[2],a.maxY=t[3];for(const[i,r]of this._tileBounds)r.search(a,(t=>e(new u(t,i))))}forEachBounds(t,e){for(const i of t)e(i.getBoundingBox())}getFullExtent(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const n of this._tileBounds.values()){const{minX:t,minY:o,maxX:u,maxY:m}=n.toJSON();e=Math.min(e,t),i=Math.min(i,o),r=Math.min(r,u),s=Math.min(s,m)}return{xmin:e,ymin:i,xmax:r,ymax:s,spatialReference:t}}}class h{getObjectId(t){return t.getObjectId()}getAttribute(t,e){return t.getAttribute(e)}getAttributeAsTimestamp(t,e){return t.getAttributeAsTimestamp(e)}getAttributes(t){return t.getAttributes()}getGeometry(t){return t.getOptimizedGeometry()}getCentroid(t,e){return t.getCentroid(e)}cloneWithGeometry(t,e){return t.cloneWithGeometry(e)}}h.shared=new h;const a=new s;export{u as FeatureHandle,d as TiledFeatureStore};
5
+ import t from"../../../../../../core/Evented.js";import{baseObjectMemory as e,estimateNumberMemory as i}from"../../../../../../core/memoryEstimations.js";import{PooledRBush as r,BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{getCentroidOptimizedGeometry as n}from"../../../../../../layers/graphics/centroid.js";import o from"../../../../../../layers/graphics/OptimizedGeometry.js";class u{constructor(t,e){this._index=t,this._view=e}get usedMemory(){return e+i}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(t){return this._view.getAttribute(this._index,t)}getAttributeAsTimestamp(t){return this._view.getAttributeAsTimestamp(this._index,t)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(t){return this._view.getCentroid(this._index,t)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(t){return new m(this._index,this._view,t)}}class m extends u{constructor(t,e,i){super(t,e),this._geometryOverride=i}getOptimizedGeometry(){return this._geometryOverride}getCentroid(t){return n(new o,this._geometryOverride,t.hasZ,t.hasM)}}class d{constructor(){this._tileBounds=new Map,this.events=new t,this.featureAdapter=h.shared}get usedMemory(){return e+e*this._tileBounds.size}addTile(t){const{featureCount:e}=t;if(0===e)return;const i=new r(9,(e=>t.getBounds(e))),s=new Array;for(let r=0;r<e;++r)s[r]=r;i.load(s),this._tileBounds.set(t,i),this.events.emit("changed")}removeTile(t){this._tileBounds.delete(t),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(t){for(const[e,i]of this._tileBounds)i.all((i=>t(new u(i,e))))}forEachInBounds(t,e){a.minX=t[0],a.minY=t[1],a.maxX=t[2],a.maxY=t[3];for(const[i,r]of this._tileBounds)r.search(a,(t=>e(new u(t,i))))}forEachBounds(t,e){for(const i of t)e(i.getBoundingBox())}getFullExtent(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const n of this._tileBounds.values()){const{minX:t,minY:o,maxX:u,maxY:m}=n.toJSON();e=Math.min(e,t),i=Math.min(i,o),r=Math.min(r,u),s=Math.min(s,m)}return{xmin:e,ymin:i,xmax:r,ymax:s,spatialReference:t}}}class h{static{this.shared=new h}getObjectId(t){return t.getObjectId()}getAttribute(t,e){return t.getAttribute(e)}getAttributeAsTimestamp(t,e){return t.getAttributeAsTimestamp(e)}getAttributes(t){return t.getAttributes()}getGeometry(t){return t.getOptimizedGeometry()}getCentroid(t,e){return t.getCentroid(e)}cloneWithGeometry(t,e){return t.cloneWithGeometry(e)}}const a=new s;export{u as FeatureHandle,d as TiledFeatureStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{nullUid as t}from"../../../../../../core/uid.js";import{property as r}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{glLayout as s}from"../../../../support/buffer/glUtil.js";import{ShaderOutput as n}from"../../../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as o}from"../../../../webgl-engine/effects/RenderPlugin.js";import{GLMaterials as a}from"../../../../webgl-engine/lib/GLMaterials.js";import{IntersectorType as l}from"../../../../webgl-engine/lib/IntersectorInterfaces.js";import{BoundingVolume as c}from"../../../../webgl-engine/lib/Object3D.js";import{RenderSlot as u}from"../../../../webgl-engine/lib/RenderSlot.js";import{DrawParameters as m}from"../../../../webgl-engine/materials/DrawParameters.js";import{HUDMaterial as d}from"../../../../webgl-engine/materials/HUDMaterial.js";let h=class extends o{constructor(e){super(e),this._glMaterials=null,this._produces=new Map,this._renderGeometries=new Map,this._vaoCache=null,this._drawParameters=new m,this._bufferWriter=null,this.slicePlaneEnabled=!1,this.isGround=!1,this.type=e.material instanceof d?l.HUD:l.OBJECT,this.layerUid=e.layerUid}get produces(){return this._produces}get numFeatures(){const e=6;let t=0;return this._renderGeometries.forEach((r=>t+=r.numElements/e)),t}get usedMemory(){let e=0;return this._renderGeometries.forEach((t=>{e+=t.vao.usedMemory})),e}intersect(e,r,i,s,n,o){const{material:a,_bufferWriter:l,layerUid:u}=this,m=this._renderGeometries;if(0!==m.size&&null!=l.intersect)for(const[d,h]of m){const{buffer:r,localOrigin:n,items:o}=h;l.intersect(r.data,a.parameters,n,e,i,s,((r,i,s,n,l,m)=>{const d=o.objectIds[s];o.visibilities[s]&&e.handleObjectIntersection({object:{id:t,graphicUid:d,layerUid:u,boundingVolumeWorldSpace:new c,geometries:[{material:a}]},geometryId:0,primIndex:s},r,i,n,null,l,m)}))}}initialize(){this._bufferWriter=this.material.createBufferWriter(),this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>t!==n.Highlight&&t!==n.ShadowHighlight&&e(t)))}))}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometry(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e,s=t.produces.get(i.slot);if(!s?.(r))return null;if(r===n.Highlight||r===n.ShadowHighlight)return null;const o=this._glMaterials.load(e.rctx,i.slot,r);return o?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(0===r.size)return;const{bind:i}=e,s=i.slot===u.OCCLUDER_MATERIAL||i.slot===u.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const o=t.program;for(const[a,l]of r){const{vao:e,localOrigin:r,drawCalls:a}=l;this._drawParameters.origin=r,o.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e),n.bindVAO(e),n.setPipelineState(t.getPipeline(!1,s));for(const i of a)n.drawArrays(t.primitiveType,i.start,i.count)}}initializeRenderContext(e,t){this._glMaterials=new a(this.material,e.materials),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,s(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}addRenderGeometry(e,t,r,i){this.removeRenderGeometry(e);const{data:s,elementCount:n}=t,o=this._vaoCache.newVao(s.byteLength);o.vertexBuffers.get("geometry").setSubData(new Uint8Array(s),0,0,s.byteLength);const a={localOrigin:i,numElements:n,buffer:t,items:r,vao:o,drawCalls:this._produceDrawCalls(r)};return this._renderGeometries.set(e,a),a}updateRenderGeometryVisibility(e,t){const r=this._renderGeometries.get(e);if(null==r)return;const{items:i}=r;if(i.visibilities.length!==t.length)throw new Error("Unexpected mismatch between old and new visibiltiy flag buffer length.");i.visibilities=t,r.drawCalls=this._produceDrawCalls(i)}removeRenderGeometry(e){const t=this._renderGeometries.get(e);null!=t&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}hasHighlightOptions(e){return!1}_produceDrawCalls(e){const{visibilities:t,ranges:r}=e,i=[];if(p(r)){if(0===r.numItems)return[];const e=r.numVertices;let s=null;for(let n=0;n<r.numItems;++n){t[n]?null==s?(s={start:n*e,count:e},i.push(s)):s.count+=e:s=null}}else{const e=r.counts,s=e.length;if(0===s)return[];let n=null,o=0;for(let r=0;r<s;++r){const s=t[r],a=e[r];s?null==n?(n={start:o,count:a},i.push(n)):n.count+=a:n=null,o+=a}}return i}};function p(e){return"numItems"in e}e([r({constructOnly:!0})],h.prototype,"material",void 0),h=e([i("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],h);export{h as DirectRenderer};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{nullUid as t}from"../../../../../../core/uid.js";import{property as r}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as i}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{glLayout as s}from"../../../../support/buffer/glUtil.js";import{ShaderOutput as n}from"../../../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as o}from"../../../../webgl-engine/effects/RenderPlugin.js";import{GLMaterials as a}from"../../../../webgl-engine/lib/GLMaterials.js";import{IntersectorType as l}from"../../../../webgl-engine/lib/IntersectorInterfaces.js";import{BoundingVolume as c}from"../../../../webgl-engine/lib/Object3D.js";import{RenderSlot as u}from"../../../../webgl-engine/lib/RenderSlot.js";import{DrawParameters as m}from"../../../../webgl-engine/materials/DrawParameters.js";import{HUDMaterial as d}from"../../../../webgl-engine/materials/HUDMaterial.js";let h=class extends o{constructor(e){super(e),this._glMaterials=null,this._produces=new Map,this._renderGeometries=new Map,this._vaoCache=null,this._drawParameters=new m,this._bufferWriter=null,this.slicePlaneEnabled=!1,this.isGround=!1,this.type=e.material instanceof d?l.HUD:l.OBJECT,this.layerUid=e.layerUid}get produces(){return this._produces}get numFeatures(){const e=6;let t=0;return this._renderGeometries.forEach((r=>t+=r.numElements/e)),t}get usedMemory(){let e=0;return this._renderGeometries.forEach((t=>{e+=t.vao.usedMemory})),e}intersect(e,r,i,s,n,o){const{material:a,_bufferWriter:l,layerUid:u}=this,m=this._renderGeometries;if(0!==m.size&&null!=l.intersect)for(const[d,h]of m){const{buffer:r,localOrigin:n,items:o}=h;l.intersect(r.data,a.parameters,n,e,i,s,((r,i,s,n,l,m)=>{const d=o.objectIds[s];o.visibilities[s]&&e.handleObjectIntersection({object:{id:t,graphicUid:d,layerUid:u,boundingVolumeWorldSpace:new c,geometries:[{material:a}]},geometryId:0,primIndex:s},r,i,n,null,l,m)}))}}initialize(){this._bufferWriter=this.material.createBufferWriter(),this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>t!==n.Highlight&&t!==n.ShadowHighlight&&e(t)))}))}destroy(){this._glMaterials.dispose();const e=this._renderGeometries.keys();for(const t of e)this.removeRenderGeometry(t)}acquireTechniques(e){const t=this.material;if(!t.shouldRender(e))return null;const{output:r,bind:i}=e,s=t.produces.get(i.slot);if(!s?.(r))return null;if(r===n.Highlight||r===n.ShadowHighlight)return null;const o=this._glMaterials.load(e.rctx,i.slot,r);return o?.beginSlot(i)}render(e,t){const r=this._renderGeometries;if(0===r.size)return;const{bind:i}=e,s=i.slot===u.OCCLUDER_MATERIAL||i.slot===u.TRANSPARENT_OCCLUDER_MATERIAL?i.slot:null,n=e.rctx;n.runAppleAmdDriverHelper(),n.bindTechnique(t,i,this.material.parameters);const o=t.program;for(const[a,l]of r){const{vao:e,localOrigin:r,drawCalls:a}=l;this._drawParameters.origin=r,o.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e),n.bindVAO(e),n.setPipelineState(t.getPipeline(!1,s));for(const i of a)n.drawArrays(t.primitiveType,i.start,i.count)}}initializeRenderContext(e,t){this._glMaterials=new a(this.material,e.materials),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,s(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}addRenderGeometry(e,t,r,i){this.removeRenderGeometry(e);const{data:s,elementCount:n}=t,o=this._vaoCache.newVao(s.byteLength);o.vertexBuffers.get("geometry").setSubData(new Uint8Array(s),0,0,s.byteLength);const a={localOrigin:i,numElements:n,buffer:t,items:r,vao:o,drawCalls:this._produceDrawCalls(r)};return this._renderGeometries.set(e,a),a}updateVisibility(e,t){const r=this._renderGeometries.get(e);if(null==r)return;const{items:i}=r;if(i.visibilities.length!==t.length)throw new Error("Unexpected mismatch between old and new visibility flag buffer length.");i.visibilities=t,r.drawCalls=this._produceDrawCalls(i)}removeRenderGeometry(e){const t=this._renderGeometries.get(e);null!=t&&(this._vaoCache.deleteVao(t.vao),this._renderGeometries.delete(e))}hasHighlightOptions(e){return!1}_produceDrawCalls(e){const{visibilities:t,ranges:r}=e,i=[];if(p(r)){if(0===r.numItems)return[];const e=r.numVertices;let s=null;for(let n=0;n<r.numItems;++n){t[n]?null==s?(s={start:n*e,count:e},i.push(s)):s.count+=e:s=null}}else{const e=r.counts,s=e.length;if(0===s)return[];let n=null,o=0;for(let r=0;r<s;++r){const s=t[r],a=e[r];s?null==n?(n={start:o,count:a},i.push(n)):n.count+=a:n=null,o+=a}}return i}};function p(e){return"numItems"in e}e([r({constructOnly:!0})],h.prototype,"material",void 0),h=e([i("esri.views.3d.layers.graphics.pipeline.rendering.DirectRenderer")],h);export{h as DirectRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import r from"../../../../../../core/Accessor.js";import"../../../../../../core/has.js";import{makeHandle as t}from"../../../../../../core/handleUtils.js";import{releaseMaybe as s}from"../../../../../../core/maybe.js";import{createAbortError as i}from"../../../../../../core/promiseUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{ONES as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewingMode as l}from"../../../../../ViewingMode.js";import{namedAnchorToHUDMaterialAnchorPos as c}from"../../placementUtils.js";import{DirectRenderer as m}from"./DirectRenderer.js";import{LodRenderer as u}from"./LodRenderer.js";import{defaultBoundingBox as h,createTexture as p,requiresHalfTexelOffset as f}from"../../../../support/engineContent/sdfPrimitives.js";import{CullFaceOptions as y}from"../../../../webgl-engine/lib/basicInterfaces.js";import{DefaultMaterial as g}from"../../../../webgl-engine/materials/DefaultMaterial.js";import{HUDMaterial as w}from"../../../../webgl-engine/materials/HUDMaterial.js";import{schematicMRRFactors as R}from"../../../../webgl-engine/materials/pbrUtils.js";let v=class extends r{constructor(e){super(),this.view=null,this.layerUid=null,this._materials=new Map,this._directRenderers=new Map,this._lodRenderers=new Map,this.totalFeatures=0,this.view=e.view,this.layerUid=e.layerUid}initialize(){}destroy(){this.removeAllHandles(),this._lodRenderers.forEach((e=>e.destroy()))}async createMaterial(e,r){const{view:i}=this,{sharedSymbolResources:o}=i;if(null==o)throw new Error("No shared symbol resources found!");const{textures:n}=o,a=i.state.viewingMode===l.Global;let d=null;switch(r){case"default":d=_(o,{physicalBasedRenderingEnabled:!0,slicePlaneEnabled:!1,castShadows:!0,isPrimitive:!0,screenSizePerspectiveEnabled:!0,doublePrecisionRequiresObfuscation:i._stage.renderView.renderingContext.driverTest.doublePrecisionRequiresObfuscation.result},a);break;case"hud":{const[e,r]=b(n,a);this.addHandles([t((()=>s(r)))]),d=e}break;default:throw new Error(`unable to create unknown material type ${r}`)}this._materials.set(e,d)}async createDirectRenderer(e){if(this._directRenderers.has(e))return;const r=this._materials.get(e);if(null==r)throw new Error(`material not found ${e}`);const{view:t}=this,s=new m({material:r,layerUid:this.layerUid});this._directRenderers.set(e,s),t._stage.addRenderPlugin(s),t._stage.renderView.renderer.updateHasFlags()}async createLoDRenderer(e,r,t){const s=new u({view:this.view,layerUid:this.layerUid}),o=e=>this._materials.get(e);if(await s.doLoad(r,o,t),t?.aborted)throw s.destroy(),i();this._lodRenderers.set(e,s)}async executeRenderCommands(e){for(const r of e)switch(r.id){case"add-direct-renderer-geometry":this._addDirectRendererGeometry(r);break;case"update-direct-renderer-visibility":this._updateDirectRendererVisibility(r);break;case"remove-direct-renderer-geometry":this._removeDirectRendererGeometry(r);break;case"add-lod-instances":this._addLodInstances(r);break;case"remove-lod-instances":this._removeLodInstances(r)}e.length>0&&this._updateFeatureCount()}_updateFeatureCount(){let e=0;for(const r of this._directRenderers.values())e+=r.numFeatures;for(const r of this._lodRenderers.values())e+=r.numFeatures;this._set("totalFeatures",e)}get usedMemory(){let e=0;for(const r of this._directRenderers.values())e+=r.usedMemory;for(const r of this._lodRenderers.values())e+=r.usedMemory;return e}_addDirectRendererGeometry({renderGeometryId:e,materialId:r,renderGeometryBuffer:t,renderGeometryBufferItems:s,localOrigin:i}){const o=this._directRenderers.get(r);null!=o?(o.addRenderGeometry(e,t,s,i),this.view._stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_updateDirectRendererVisibility(e){const{materialId:r,renderGeometryId:t,visibility:s}=e,i=this._directRenderers.get(r);null!=i?(i.updateRenderGeometryVisibility(t,s),this.view._stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_removeDirectRendererGeometry({renderGeometryId:e,materialId:r}){const t=this._directRenderers.get(r);null!=t?t.removeRenderGeometry(e):console.error("no renderer assigned to provided material")}_addLodInstances({lodRendererId:e,renderGeometryId:r,data:t}){const s=this._lodRenderers.get(e);if(null==s)throw new Error("no lod renderer assigned to provided lod renderer Id");s.addInstances(r,t)}_removeLodInstances({lodRendererId:e,renderGeometryId:r}){const t=this._lodRenderers.get(e);if(null==t)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(r)}};function b(e,r){const t={anchorPosition:c.center,occlusionTest:!0,hasSlicePlane:!1,color:[1,0,0,1],outlineColor:[0,0,0,1],outlineSize:1,distanceFieldBoundingBox:h},s=null;if(null!=e){const r=e.fromData("circle-icon",(()=>p("circle")));t.textureId=r.texture.id,t.textureIsSignedDistanceField=!0,t.sampleSignedDistanceFieldTexelCenter=f("circle")}return[new w(t,r),s]}function _(e,r,t){const s={usePBR:r.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:R,ambient:a,diffuse:a,hasSlicePlane:r.slicePlaneEnabled,castShadows:r.castShadows,offsetTransparentBackfaces:!r.isPrimitive};return I(s),r.screenSizePerspectiveEnabled&&(s.screenSizePerspective=e.screenSizePerspectiveSettings),s.externalColor=d,s.isInstanced=!0,new g(s,{spherical:t,doublePrecisionRequiresObfuscation:!0})}function I(e){const r=e.opacity??1,t=r<1;return e.transparent=t,e.opacity=r,e.cullFace=t?y.None:y.Back,e}e([o({readOnly:!0})],v.prototype,"totalFeatures",void 0),v=e([n("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],v);export{v as FeaturePipelineRenderManager,_ as createDefaultMaterial,b as createHudMaterial};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import r from"../../../../../../core/Accessor.js";import"../../../../../../core/has.js";import{makeHandle as t}from"../../../../../../core/handleUtils.js";import{releaseMaybe as s}from"../../../../../../core/maybe.js";import{createAbortError as i}from"../../../../../../core/promiseUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{ONES as d}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewingMode as l}from"../../../../../ViewingMode.js";import{namedAnchorToHUDMaterialAnchorPos as c}from"../../placementUtils.js";import{DirectRenderer as u}from"./DirectRenderer.js";import{LodRenderer as m}from"./LodRenderer.js";import{defaultBoundingBox as h,createTexture as p,requiresHalfTexelOffset as f}from"../../../../support/engineContent/sdfPrimitives.js";import{CullFaceOptions as g}from"../../../../webgl-engine/lib/basicInterfaces.js";import{DefaultMaterial as w}from"../../../../webgl-engine/materials/DefaultMaterial.js";import{HUDMaterial as v}from"../../../../webgl-engine/materials/HUDMaterial.js";import{schematicMRRFactors as y}from"../../../../webgl-engine/materials/pbrUtils.js";let R=class extends r{constructor(e){super(),this.view=null,this.layerUid=null,this._materials=new Map,this._directRenderers=new Map,this._lodRenderers=new Map,this.totalFeatures=0,this.view=e.view,this.layerUid=e.layerUid}initialize(){}destroy(){this.removeAllHandles(),this._lodRenderers.forEach((e=>e.destroy()))}async createMaterial(e,r){const{view:i}=this,{sharedSymbolResources:o}=i;if(null==o)throw new Error("No shared symbol resources found!");const{textures:n}=o,d=i.state.viewingMode===l.Global;let a=null;switch(r){case"default":a=b(o,{physicalBasedRenderingEnabled:!0,slicePlaneEnabled:!1,castShadows:!0,isPrimitive:!0,screenSizePerspectiveEnabled:!0,doublePrecisionRequiresObfuscation:i._stage.renderView.renderingContext.driverTest.doublePrecisionRequiresObfuscation.result},d);break;case"hud":{const[e,r]=_(n,d);this.addHandles([t((()=>s(r)))]),a=e}break;default:throw new Error(`unable to create unknown material type ${r}`)}this._materials.set(e,a)}async createDirectRenderer(e){if(this._directRenderers.has(e))return;const r=this._materials.get(e);if(null==r)throw new Error(`material not found ${e}`);const{view:t}=this,s=new u({material:r,layerUid:this.layerUid});this._directRenderers.set(e,s),t._stage.addRenderPlugin(s),t._stage.renderView.renderer.updateHasFlags()}async createLoDRenderer(e,r,t){const s=new m({view:this.view,layerUid:this.layerUid}),o=e=>this._materials.get(e);if(await s.doLoad(r,o,t),t?.aborted)throw s.destroy(),i();this._lodRenderers.set(e,s)}async executeRenderCommands(e){for(const r of e)switch(r.id){case"add-direct-renderer-geometry":this._addDirectRendererGeometry(r);break;case"remove-direct-renderer-geometry":this._removeDirectRendererGeometry(r);break;case"add-lod-instances":this._addLodInstances(r);break;case"remove-lod-instances":this._removeLodInstances(r);break;case"update-visibility":this._updateVisibility(r)}e.length>0&&this._updateFeatureCount()}_updateFeatureCount(){let e=0;for(const r of this._directRenderers.values())e+=r.numFeatures;for(const r of this._lodRenderers.values())e+=r.numFeatures;this._set("totalFeatures",e)}get usedMemory(){let e=0;for(const r of this._directRenderers.values())e+=r.usedMemory;for(const r of this._lodRenderers.values())e+=r.usedMemory;return e}_addDirectRendererGeometry({groupId:e,rendererId:r,renderGeometryBuffer:t,renderGeometryBufferItems:s,localOrigin:i}){const o=this._directRenderers.get(r);null!=o?(o.addRenderGeometry(e,t,s,i),this.view._stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_removeDirectRendererGeometry({groupId:e,rendererId:r}){const t=this._directRenderers.get(r);null!=t?(t.removeRenderGeometry(e),this.view._stage.renderView.requestRender()):console.error("no renderer assigned to provided material")}_addLodInstances({rendererId:e,groupId:r,data:t}){const s=this._lodRenderers.get(e);if(null==s)throw new Error("no lod renderer assigned to provided lod renderer Id");s.addInstances(r,t),this.view._stage.renderView.requestRender()}_removeLodInstances({rendererId:e,groupId:r}){const t=this._lodRenderers.get(e);if(null==t)throw new Error("no lod renderer assigned to provided lod renderer Id");t.removeInstances(r),this.view._stage.renderView.requestRender()}_updateVisibility({rendererId:e,groupId:r,visibility:t}){const s=this._directRenderers.get(e)??this._lodRenderers.get(e);if(null==s)throw new Error("No renderer found with the provided id");s.updateVisibility(r,t),this.view._stage.renderView.requestRender()}};function _(e,r){const t={anchorPosition:c.center,occlusionTest:!0,hasSlicePlane:!1,color:[1,0,0,1],outlineColor:[0,0,0,1],outlineSize:1,distanceFieldBoundingBox:h},s=null;if(null!=e){const r=e.fromData("circle-icon",(()=>p("circle")));t.textureId=r.texture.id,t.textureIsSignedDistanceField=!0,t.sampleSignedDistanceFieldTexelCenter=f("circle")}return[new v(t,r),s]}function b(e,r,t){const s={usePBR:r.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:y,ambient:d,diffuse:d,hasSlicePlane:r.slicePlaneEnabled,castShadows:r.castShadows,offsetTransparentBackfaces:!r.isPrimitive};return I(s),r.screenSizePerspectiveEnabled&&(s.screenSizePerspective=e.screenSizePerspectiveSettings),s.externalColor=a,s.isInstanced=!0,new w(s,{spherical:t,doublePrecisionRequiresObfuscation:!0})}function I(e){const r=e.opacity??1,t=r<1;return e.transparent=t,e.opacity=r,e.cullFace=t?g.None:g.Back,e}e([o({readOnly:!0})],R.prototype,"totalFeatures",void 0),R=e([n("esri.views.3d.layers.graphics.pipeline.rendering.FeaturePipelineRenderManager")],R);export{R as FeaturePipelineRenderManager,b as createDefaultMaterial,_ as createHudMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../../chunks/tslib.es6.js";import has from"../../../../../../core/has.js";import{throwIfAborted as r}from"../../../../../../core/promiseUtils.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import"../../../../../../core/Error.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{VertexAttribute as n}from"../../../../webgl-engine/lib/VertexAttribute.js";import{LodRenderer as t}from"../../../../webgl-engine/lib/lodRendering/LodRenderer.js";import{LodComponentRenderGeometry as o,LodComponentResources as i,LodLevelResources as a,LodResources as d}from"../../../../webgl-engine/lib/lodRendering/LodResources.js";let l=class{constructor(e){this._optionalFields=new Array,this._instanceGroupToIndices=new Map,this._instanceIndexToFeatureId=new Map,this._disposeResourceHandles=new Array,this._lodRendererResources=null,this._numFeatures=0,this.layerUid=e.layerUid,this.view=e.view,this.sharedResources=this.view.sharedSymbolResources,this.scheduler=this.view.resourceController.scheduler}get numFeatures(){return this._numFeatures}get usedMemory(){const e=this._lodRendererResources?.lodRenderer,r=e?.symbol;return(r?.computeUsedMemory()??0)+16*this._instanceIndexToFeatureId.size}destroy(){this._disposeResourceHandles.forEach((e=>e()))}async doLoad(e,s,t){has("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(n.OBJECTANDLAYERIDCOLOR);const o=c((e=>s(e)),e),i=this.view._stage,a=o.getMaterials();i.addMany(a),this._addDisposeResource((()=>i.removeMany(a)));const d=o.getTextures();i.addMany(d),this._addDisposeResource((()=>{d.forEach((e=>e.unload())),i.removeMany(d)})),await Promise.all(d.map((e=>this.view._stage.schedule((()=>e.load(i.renderView.renderingContext)),t)))),r(t);const l=await this._createLodRenderer(o,t);this._lodRendererResources={lodRenderer:l,materials:a,textures:d}}addInstances(e,r){const s=this._lodRendererResources;if(null==s)return;const{featureIds:n,localTransforms:t,globalTransforms:o}=r,i=s.lodRenderer;if(null==i)return;const a=new Array,d=i.instanceData,l=n.length,c=this._instanceIndexToFeatureId;for(let u=0;u<l;++u){const e=n[u],r=d.addInstance(),s=d.view,i=16*u;s.localTransform.copyFromTypedBuffer(r,t,i),s.globalTransform.copyFromTypedBuffer(r,o,i),d.updateModelTransform(r),d.setVisible(r,!0),a.push(r),c.set(r,e)}this._instanceGroupToIndices.set(e,a),this._numFeatures+=l}removeInstances(e){const r=this._instanceGroupToIndices.get(e);if(null==r)return;const s=this._lodRendererResources;if(null==s)return;const n=s.lodRenderer.instanceData,t=this._instanceIndexToFeatureId;for(const o of r)n.removeInstance(o),t.delete(o);this._numFeatures-=r.length,this._instanceGroupToIndices.delete(e)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createLodRenderer(e,r){const s=this.view._stage,n={layerUid:this.layerUid,graphicUid:e=>this._instanceIndexToFeatureId.get(e)??-1,notifyGraphicGeometryChanged:e=>1,notifyGraphicVisibilityChanged:e=>1},o=new t({symbol:e,optionalFields:this._optionalFields,metadata:n,shaderTransformation:null},this.scheduler);return o.slicePlaneEnabled=!1,this._addDisposeResource((()=>{s.removeRenderPlugin(o),o.destroy()})),await s.addRenderPlugin(o,r),o}};function c(e,r){const s=r.levels.map((r=>{const s=r.components.map((r=>{const s=e(r.materialId);if(!u(s))throw new Error("LodRenderer only supports DefaultMaterial");const n=new o(s,r.renderGeometryBuffer.data,r.renderGeometryBuffer.elementCount,r.boundingInfo);return new i(n)}));return new a(s,r.minScreenSpaceRadius)}));return new d(s)}function u(e){return null!=e&&"materialType"in e&&"default"===e.materialType}l=e([s("esri.views.3d.layers.graphics.pipeline.rendering.LodRenderer")],l);export{l as LodRenderer,u as isDefaultMaterial};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import has from"../../../../../../core/has.js";import{throwIfAborted as r}from"../../../../../../core/promiseUtils.js";import"../../../../../../core/Logger.js";import"../../../../../../core/RandomLCG.js";import"../../../../../../core/Error.js";import{subclass as s}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{VertexAttribute as n}from"../../../../webgl-engine/lib/VertexAttribute.js";import{LodRenderer as t}from"../../../../webgl-engine/lib/lodRendering/LodRenderer.js";import{LodComponentRenderGeometry as o,LodComponentResources as i,LodLevelResources as a,LodResources as d}from"../../../../webgl-engine/lib/lodRendering/LodResources.js";let l=class{constructor(e){this._optionalFields=new Array,this._instanceGroupToIndices=new Map,this._instanceIndexToFeatureId=new Map,this._disposeResourceHandles=new Array,this._lodRendererResources=null,this._numFeatures=0,this.layerUid=e.layerUid,this.view=e.view,this.sharedResources=this.view.sharedSymbolResources,this.scheduler=this.view.resourceController.scheduler}get numFeatures(){return this._numFeatures}get usedMemory(){const e=this._lodRendererResources?.lodRenderer,r=e?.symbol;return(r?.computeUsedMemory()??0)+16*this._instanceIndexToFeatureId.size}destroy(){this._disposeResourceHandles.forEach((e=>e()))}async doLoad(e,s,t){has("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(n.OBJECTANDLAYERIDCOLOR);const o=c((e=>s(e)),e),i=this.view._stage,a=o.getMaterials();i.addMany(a),this._addDisposeResource((()=>i.removeMany(a)));const d=o.getTextures();i.addMany(d),this._addDisposeResource((()=>{d.forEach((e=>e.unload())),i.removeMany(d)})),await Promise.all(d.map((e=>this.view._stage.schedule((()=>e.load(i.renderView.renderingContext)),t)))),r(t);const l=await this._createLodRenderer(o,t);this._lodRendererResources={lodRenderer:l,materials:a,textures:d}}addInstances(e,r){const s=this._lodRendererResources;if(null==s)return;const n=s.lodRenderer;if(null==n)return;const{featureIds:t,localTransforms:o,globalTransforms:i,visibility:a}=r,d=new Array,l=n.instanceData,c=t.length,u=this._instanceIndexToFeatureId;for(let h=0;h<c;++h){const e=t[h],r=l.addInstance(),s=l.view,n=16*h;s.localTransform.copyFromTypedBuffer(r,o,n),s.globalTransform.copyFromTypedBuffer(r,i,n),l.updateModelTransform(r),l.setVisible(r,Boolean(a[h])),d.push(r),u.set(r,e)}this._instanceGroupToIndices.set(e,d),this._numFeatures+=c}removeInstances(e){const r=this._instanceGroupToIndices.get(e);if(null==r)return;const s=this._lodRendererResources;if(null==s)return;const n=s.lodRenderer.instanceData,t=this._instanceIndexToFeatureId;for(const o of r)n.removeInstance(o),t.delete(o);this._numFeatures-=r.length,this._instanceGroupToIndices.delete(e)}updateVisibility(e,r){const s=this._instanceGroupToIndices.get(e);if(null==s)return;const n=this._lodRendererResources;if(null==n)return;const t=s.length;if(t!==r.length)throw new Error("Unexpected mismatch instance count and visibility flag buffer length.");const o=n.lodRenderer.instanceData;for(let i=0;i<t;++i)o.setVisible(s[i],Boolean(r[i]))}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createLodRenderer(e,r){const s=this.view._stage,n={layerUid:this.layerUid,graphicUid:e=>this._instanceIndexToFeatureId.get(e)??-1,notifyGraphicGeometryChanged:e=>1,notifyGraphicVisibilityChanged:e=>1},o=new t({symbol:e,optionalFields:this._optionalFields,metadata:n,shaderTransformation:null},this.scheduler);return o.slicePlaneEnabled=!1,this._addDisposeResource((()=>{s.removeRenderPlugin(o),o.destroy()})),await s.addRenderPlugin(o,r),o}};function c(e,r){const s=r.levels.map((r=>{const s=r.components.map((r=>{const s=e(r.materialId);if(!u(s))throw new Error("LodRenderer only supports DefaultMaterial");const n=new o(s,r.renderGeometryBuffer.data,r.renderGeometryBuffer.elementCount,r.boundingInfo);return new i(n)}));return new a(s,r.minScreenSpaceRadius)}));return new d(s)}function u(e){return null!=e&&"materialType"in e&&"default"===e.materialType}l=e([s("esri.views.3d.layers.graphics.pipeline.rendering.LodRenderer")],l);export{l as LodRenderer,u as isDefaultMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}addDirectRendererGeometry(e,r,t){const{materialId:s,objectIds:d,visibilities:n}=r,a=this._context.getRenderGeometryBufferWriter(s);if(null==a)throw new Error(`no bufferwriter found for material ${s}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:o}=a.createBuffer(r,t);if(this._transferables.add(i.data),this._transferables.add(d.buffer),this._transferables.add(n.buffer),n.length!==o.numItems||d.length!==o.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");this._commands.push({id:"add-direct-renderer-geometry",materialId:s,renderGeometryId:e,renderGeometryBuffer:i,renderGeometryBufferItems:{objectIds:d,visibilities:n,ranges:{numVertices:o.numVerticesPerItem,numItems:o.numItems}},localOrigin:t})}updateDirectRendererGeometryVisibility(e,r,t){this._commands.push({id:"update-direct-renderer-visibility",materialId:e,renderGeometryId:r,visibility:t})}removeDirectRendererGeometry(e,r){this._commands.push({id:"remove-direct-renderer-geometry",materialId:e,renderGeometryId:r})}addLodInstances(e,r,t){this._commands.push({id:"add-lod-instances",lodRendererId:e,renderGeometryId:r,data:t}),this._transferables.add(t.featureIds.buffer),this._transferables.add(t.globalTransforms.buffer),this._transferables.add(t.localTransforms.buffer)}removeLodInstances(e,r){this._commands.push({id:"remove-lod-instances",lodRendererId:e,renderGeometryId:r})}append(e){if(e._context!==this._context)throw new Error("Cannot append encoders from different contexts");const{_commands:r,_transferables:t}=this;for(const s of e._commands)r.push(s);for(const s of e._transferables)t.add(s)}async dispatch(){const e=this._commands,r=Array.from(this._transferables);this._clearCommandBuffer(),await this._context.dispatchRenderCommands(e,r)}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}}export{e as RenderCommandEncoder};
5
+ class e{constructor(e){this._context=e,this._commands=[],this._transferables=new Set}addDirectRendererGeometry(e,r,t){const{materialId:s,objectIds:d,visibilities:n}=r,a=this._context.getRenderGeometryBufferWriter(s);if(null==a)throw new Error(`no bufferwriter found for material ${s}`);const{renderGeometryBuffer:i,renderGeometryBufferItems:o}=a.createBuffer(r,t);if(this._transferables.add(i.data),this._transferables.add(d.buffer),this._transferables.add(n.buffer),n.length!==o.numItems||d.length!==o.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");this._commands.push({id:"add-direct-renderer-geometry",rendererId:s,groupId:e,renderGeometryBuffer:i,renderGeometryBufferItems:{objectIds:d,visibilities:n,ranges:{numVertices:o.numVerticesPerItem,numItems:o.numItems}},localOrigin:t})}removeDirectRendererGeometry(e,r){this._commands.push({id:"remove-direct-renderer-geometry",rendererId:e,groupId:r})}addLodInstances(e,r,t){this._commands.push({id:"add-lod-instances",rendererId:e,groupId:r,data:t}),this._transferables.add(t.featureIds.buffer),this._transferables.add(t.globalTransforms.buffer),this._transferables.add(t.localTransforms.buffer),this._transferables.add(t.visibility.buffer)}removeLodInstances(e,r){this._commands.push({id:"remove-lod-instances",rendererId:e,groupId:r})}updateVisibility(e,r,t){this._commands.push({id:"update-visibility",rendererId:e,groupId:r,visibility:t}),this._transferables.add(t.buffer)}append(e){if(e._context!==this._context)throw new Error("Cannot append encoders from different contexts");const{_commands:r,_transferables:t}=this;for(const s of e._commands)r.push(s);for(const s of e._transferables)t.add(s)}async dispatch(){const e=this._commands,r=Array.from(this._transferables);this._clearCommandBuffer(),await this._context.dispatchRenderCommands(e,r)}_clearCommandBuffer(){this._commands=[],this._transferables.clear()}}export{e as RenderCommandEncoder};