@arcgis/core 4.28.0-next.20230919 → 4.28.0-next.20230921

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 (412) hide show
  1. package/Color.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/arcade/ArcadeDate.js +1 -1
  4. package/arcade/executionError.js +1 -1
  5. package/arcade/featureset/support/errorsupport.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/06621efb2573fad23b45.js +1 -0
  8. package/assets/esri/core/workers/chunks/072b4e041b8630c513a0.js +1 -0
  9. package/assets/esri/core/workers/chunks/101f776316a85b708927.js +1 -0
  10. package/assets/esri/core/workers/chunks/107546ef77a45d31c7ac.js +1 -0
  11. package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +1 -0
  12. package/assets/esri/core/workers/chunks/114269dda1d296893908.js +1 -0
  13. package/assets/esri/core/workers/chunks/126df6237fc80608344e.js +1 -0
  14. package/assets/esri/core/workers/chunks/134524cf6b1ebf208338.js +1 -0
  15. package/assets/esri/core/workers/chunks/17a36704e63ca1b34c5d.js +1 -0
  16. package/assets/esri/core/workers/chunks/1c83f47d446f2bca1721.js +1 -0
  17. package/assets/esri/core/workers/chunks/{09d395a9786607294689.js → 1c8469fbde39d85ee622.js} +1 -1
  18. package/assets/esri/core/workers/chunks/1cbaba30f55f00f7498b.js +1 -0
  19. package/assets/esri/core/workers/chunks/21a9c8aa2a9e9990df41.js +1 -0
  20. package/assets/esri/core/workers/chunks/{506874f562ce11f8914a.js → 243a4eed107d363dfad8.js} +1 -1
  21. package/assets/esri/core/workers/chunks/24629402c647ef6b5f6b.js +1 -0
  22. package/assets/esri/core/workers/chunks/2a1c1be9c202462cf54d.js +1 -0
  23. package/assets/esri/core/workers/chunks/2bb69d76a13564e8e455.js +1 -0
  24. package/assets/esri/core/workers/chunks/2d0d03cbea83c868edba.js +1 -0
  25. package/assets/esri/core/workers/chunks/2e130cb2f1038055c07b.js +1 -0
  26. package/assets/esri/core/workers/chunks/32ba4eba730e9232d964.js +1 -0
  27. package/assets/esri/core/workers/chunks/{b428fcb53ecc82b49e66.js → 332689bf60d246485993.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3619e04cbb6691549014.js +1 -0
  29. package/assets/esri/core/workers/chunks/37116fb4c68cf3c3890a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{3a7ad0d24264e2bc2e87.js → 3ca759f72d3bb29e9ea9.js} +22 -22
  31. package/assets/esri/core/workers/chunks/3dbfb4f370a874393822.js +1 -0
  32. package/assets/esri/core/workers/chunks/3f4e9b1663ec521bfe00.js +1 -0
  33. package/assets/esri/core/workers/chunks/406db5c90271a3a203d4.js +1 -0
  34. package/assets/esri/core/workers/chunks/4339ce8aaf87fabb80cc.js +1 -0
  35. package/assets/esri/core/workers/chunks/4369a6c1e0a82ab4db6a.js +1 -0
  36. package/assets/esri/core/workers/chunks/43ba2bacd0f7d19915f7.js +1 -0
  37. package/assets/esri/core/workers/chunks/44b8e75593b7df1843e1.js +1 -0
  38. package/assets/esri/core/workers/chunks/467a821d05df8ec0dc1c.js +1 -0
  39. package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +1 -0
  40. package/assets/esri/core/workers/chunks/53097659f31750c03a6d.js +1 -0
  41. package/assets/esri/core/workers/chunks/{c1141056581af072aee9.js → 580039dd491854ca325c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/59c00d6fba0fd1c03d01.js +1 -0
  43. package/assets/esri/core/workers/chunks/5a5720caa64a46daadf9.js +1 -0
  44. package/assets/esri/core/workers/chunks/5edb99b58549cd66b394.js +1 -0
  45. package/assets/esri/core/workers/chunks/6203ddf6caad3d356327.js +1 -0
  46. package/assets/esri/core/workers/chunks/652749dc847fcb887234.js +1 -0
  47. package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +1 -0
  48. package/assets/esri/core/workers/chunks/{e5c3beebd507e1dda35f.js → 749fc49246093d693227.js} +1 -1
  49. package/assets/esri/core/workers/chunks/74d3ecb1a06d9f81e2c5.js +1 -0
  50. package/assets/esri/core/workers/chunks/77c15b1c2729c780f75a.js +1 -0
  51. package/assets/esri/core/workers/chunks/7ea33aa455c5143affb1.js +1 -0
  52. package/assets/esri/core/workers/chunks/7ed70c96fbfe00792e7c.js +1 -0
  53. package/assets/esri/core/workers/chunks/8ab832468300cc4feb5a.js +1 -0
  54. package/assets/esri/core/workers/chunks/90771b0de3e520a1df9a.js +1 -0
  55. package/assets/esri/core/workers/chunks/94188fe381239d48a975.js +1 -0
  56. package/assets/esri/core/workers/chunks/a277c980ba8704939688.js +1 -0
  57. package/assets/esri/core/workers/chunks/b1746c022fe6edaeda55.js +1 -0
  58. package/assets/esri/core/workers/chunks/b449d6bd5851187d419f.js +1 -0
  59. package/assets/esri/core/workers/chunks/bbc0dcd316c5598bc9ad.js +1 -0
  60. package/assets/esri/core/workers/chunks/bc1dc6383e60e7e61d50.js +1 -0
  61. package/assets/esri/core/workers/chunks/bc6323bdc98013da6fe5.js +1 -0
  62. package/assets/esri/core/workers/chunks/bde89b2684b6185992ef.js +1 -0
  63. package/assets/esri/core/workers/chunks/c4bb67150ccd01ea6014.js +1 -0
  64. package/assets/esri/core/workers/chunks/{727548fffd4e270617d3.js → c6ea5aac232d1eca04dd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c8438c2d9ac48afe4033.js +1 -0
  66. package/assets/esri/core/workers/chunks/c9dfb145f0c1d93e0fbd.js +1 -0
  67. package/assets/esri/core/workers/chunks/cad260881653567bc8f9.js +1 -0
  68. package/assets/esri/core/workers/chunks/cec607d0138351a4952e.js +1 -0
  69. package/assets/esri/core/workers/chunks/d24afa6d8fd0061d9f00.js +1 -0
  70. package/assets/esri/core/workers/chunks/{f147269d85adfb4588ed.js → d9061beaa43065316062.js} +1 -1
  71. package/assets/esri/core/workers/chunks/dd7508d4016715371e0c.js +1 -0
  72. package/assets/esri/core/workers/chunks/dff1c3c38dda2bd1a9d6.js +1 -0
  73. package/assets/esri/core/workers/chunks/e55f7fc7eff0074ce0fc.js +1 -0
  74. package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +1 -0
  75. package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +1 -0
  76. package/assets/esri/core/workers/chunks/ed1fbc1bc8d50453e2f5.js +1 -0
  77. package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +1 -0
  78. package/assets/esri/core/workers/chunks/eef27d305023034084a4.js +1 -0
  79. package/assets/esri/core/workers/chunks/f38c54ada9e7012a2960.js +1 -0
  80. package/assets/esri/core/workers/chunks/f508ccfde6425dabe9ac.js +1 -0
  81. package/assets/esri/core/workers/chunks/f5e0ff5292b9fd18fc92.js +1 -0
  82. package/assets/esri/core/workers/chunks/f5eb8b5021620be7538e.js +1 -0
  83. package/assets/esri/images/portal/onlinemedialayer16.png +0 -0
  84. package/assets/esri/themes/base/widgets/_FeatureForm.scss +2 -1
  85. package/assets/esri/themes/dark/main.css +1 -1
  86. package/assets/esri/themes/light/main.css +1 -1
  87. package/assets/esri/themes/light/view.css +1 -1
  88. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm.json +1 -1
  89. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
  90. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
  91. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
  92. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
  93. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
  94. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
  95. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
  96. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
  97. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_en.json +1 -1
  98. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
  99. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
  100. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
  101. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
  102. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
  103. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
  104. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
  105. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
  106. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
  107. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
  108. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
  109. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
  110. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
  111. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nb.json +1 -1
  112. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
  113. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
  114. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
  115. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
  116. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
  117. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
  118. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
  119. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
  120. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
  121. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
  122. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
  123. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
  124. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
  125. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
  126. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
  127. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
  128. package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
  129. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace.json +1 -1
  130. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  131. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  132. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  133. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  134. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  135. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  136. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  137. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  138. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
  139. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  140. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  141. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  142. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  143. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  144. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  145. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  146. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  147. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  148. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  149. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  150. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  151. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  152. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  153. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  154. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  155. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  156. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  157. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  158. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  159. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  160. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  161. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  162. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  163. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  164. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  165. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  166. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  167. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  168. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  169. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  170. package/chunks/LaserlinePath.glsl.js +5 -1
  171. package/core/HandleOwner.js +1 -1
  172. package/core/MemCache.js +1 -1
  173. package/core/date.js +5 -0
  174. package/core/sql.js +1 -1
  175. package/core/string.js +1 -1
  176. package/interfaces.d.ts +60 -43
  177. package/intl/date.js +1 -1
  178. package/layers/GeoJSONLayer.js +1 -1
  179. package/layers/ImageryLayer.js +1 -1
  180. package/layers/VoxelWasmPerSceneView.js +1 -1
  181. package/layers/WFSLayer.js +1 -1
  182. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  183. package/layers/graphics/sources/MemorySource.js +1 -1
  184. package/layers/graphics/sources/WFSSource.js +1 -1
  185. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  186. package/layers/graphics/sources/csv/csv.js +1 -1
  187. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  188. package/layers/graphics/sources/geojson/geojson.js +1 -1
  189. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  190. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  191. package/{views/interactive/tooltip/tooltipInfoUnion.js → layers/graphics/sources/support/QueryEngineBuildLayer.js} +1 -0
  192. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  193. package/layers/mixins/SceneService.js +1 -1
  194. package/layers/ogc/wfsUtils.js +1 -1
  195. package/layers/save/utils.js +1 -1
  196. package/layers/support/editableLayers.js +1 -1
  197. package/layers/support/fieldUtils.js +1 -1
  198. package/layers/support/labelFormatUtils.js +1 -1
  199. package/layers/support/layersCreator.js +1 -1
  200. package/layers/support/rasterFunctionUtils.js +1 -1
  201. package/layers/support/rasterFunctions/creators/createBandIndexFunctions.js +1 -1
  202. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  203. package/layers/support/rasterFunctions/creators/createLocalFunctions.js +1 -1
  204. package/networks/support/utils.js +1 -1
  205. package/package.json +1 -1
  206. package/portal/PortalItem.js +1 -1
  207. package/portal/support/layersLoader.js +1 -1
  208. package/rest/geometryService/cut.js +1 -1
  209. package/rest/query/operations/query.js +1 -1
  210. package/rest/versionManagement/deleteVersion.js +1 -1
  211. package/rest/versionManagement/gdbVersion/alterVersion.js +1 -1
  212. package/rest/versionManagement/gdbVersion/post.js +1 -1
  213. package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
  214. package/rest/versionManagement/gdbVersion/serverVersionUtils.js +5 -0
  215. package/support/revision.js +1 -1
  216. package/time/timeZoneUtils.js +1 -1
  217. package/views/2d/engine/Stage.js +1 -1
  218. package/views/2d/engine/webgl/mesh/factories/WGLMeshFactory.js +1 -1
  219. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  220. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  221. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  222. package/views/2d/layers/features/sources/StreamSource.js +1 -1
  223. package/views/2d/layers/features/support/whereUtils.js +1 -1
  224. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  225. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  226. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  227. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  228. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  229. package/views/3d/environment/LocalAtmosphere.js +1 -1
  230. package/views/3d/externalRenderers/StageRenderer.js +1 -1
  231. package/views/3d/interactive/manipulatorUtils.js +1 -1
  232. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  233. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  234. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  235. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  236. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  237. package/views/3d/layers/MediaLayerView3D.js +1 -1
  238. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  239. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  240. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  245. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  246. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  247. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  248. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  249. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  250. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  251. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  252. package/views/3d/layers/support/patternUtils.js +1 -1
  253. package/views/3d/support/LaserLineRenderer.js +1 -1
  254. package/views/3d/support/StreamDataLoader.js +1 -1
  255. package/views/3d/support/dito.js +1 -1
  256. package/views/3d/support/engineContent/line.js +1 -1
  257. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  258. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  259. package/views/3d/terrain/OverlayRenderer.js +1 -1
  260. package/views/3d/terrain/TerrainRenderer.js +1 -1
  261. package/views/3d/terrain/TileRenderer.js +1 -1
  262. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  263. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  264. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  265. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +6 -6
  267. package/views/3d/webgl-engine/core/shaderLibrary/hud/AlignPixel.glsl.js +10 -12
  268. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDVisibility.glsl.js +8 -21
  269. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  270. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  271. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  272. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  273. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  274. package/views/3d/webgl-engine/lib/Attribute.js +1 -1
  275. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  276. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  277. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  278. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  279. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  280. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  281. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  282. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  283. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  284. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  285. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  286. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  287. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  288. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  289. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  290. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  291. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  292. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  293. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  294. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  295. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  296. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  297. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  298. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  299. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  300. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  301. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  302. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  303. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  304. package/views/View.js +1 -1
  305. package/views/draw/DrawGraphicTool.js +1 -1
  306. package/views/draw/support/HighlightHelper.js +1 -1
  307. package/views/draw/support/Reshape.js +1 -1
  308. package/views/draw/support/layerUtils.js +1 -1
  309. package/views/interactive/SegmentLabels.js +1 -1
  310. package/views/interactive/keybindings.js +1 -1
  311. package/views/interactive/tooltip/SketchTooltipInfo.js +1 -1
  312. package/views/interactive/tooltip/TooltipContentWithHelpMessage.js +1 -1
  313. package/views/interactive/tooltip/TooltipEditableField.js +1 -1
  314. package/views/interactive/tooltip/TranslateTooltipInfos.js +1 -1
  315. package/views/interactive/tooltip/content/Fields.js +5 -0
  316. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  317. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  318. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  319. package/views/layers/FeatureLayerView.js +1 -1
  320. package/views/webgl/FramebufferObject.js +1 -1
  321. package/webdoc/saveAPIKeyUtils.js +5 -0
  322. package/webdoc/webdocSaveUtils.js +1 -1
  323. package/widgets/BasemapGallery.js +1 -1
  324. package/widgets/BasemapLayerList.js +1 -1
  325. package/widgets/Bookmarks.js +1 -1
  326. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  327. package/widgets/Editor/EditorViewModel.js +1 -1
  328. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  329. package/widgets/Editor/UpdateWorkflow.js +1 -1
  330. package/widgets/Expand.js +1 -1
  331. package/widgets/Feature/FeatureRelationship.js +1 -1
  332. package/widgets/Feature/support/featureUtils.js +1 -1
  333. package/widgets/FeatureForm/EditableInput.js +1 -1
  334. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  335. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  336. package/widgets/FeatureForm.js +1 -1
  337. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  338. package/widgets/Fullscreen.js +1 -1
  339. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  340. package/widgets/Search.js +1 -1
  341. package/widgets/Swipe.js +1 -1
  342. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  343. package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
  344. package/widgets/UtilityNetworkTrace/support/UtilityHelper.js +1 -1
  345. package/widgets/UtilityNetworkTrace.js +1 -1
  346. package/widgets/support/SketchTooltipControls.js +1 -1
  347. package/widgets/support/globalCss.js +1 -1
  348. package/assets/esri/core/workers/chunks/0274b84548cb048562e4.js +0 -1
  349. package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +0 -1
  350. package/assets/esri/core/workers/chunks/0839b45999fcb556e460.js +0 -1
  351. package/assets/esri/core/workers/chunks/09589852b129bfb5624f.js +0 -1
  352. package/assets/esri/core/workers/chunks/132e9e6147304ffd128d.js +0 -1
  353. package/assets/esri/core/workers/chunks/1790ca4193d730f5f206.js +0 -1
  354. package/assets/esri/core/workers/chunks/1a449168d30a688e6128.js +0 -1
  355. package/assets/esri/core/workers/chunks/1c94624fd001c803a814.js +0 -1
  356. package/assets/esri/core/workers/chunks/25ab3bec45de900be36e.js +0 -1
  357. package/assets/esri/core/workers/chunks/273167b2dd46e58b8739.js +0 -1
  358. package/assets/esri/core/workers/chunks/2c5eb8aaad696fa16744.js +0 -1
  359. package/assets/esri/core/workers/chunks/353bad8530710a284592.js +0 -1
  360. package/assets/esri/core/workers/chunks/357d452b8522185cc433.js +0 -1
  361. package/assets/esri/core/workers/chunks/3c2be3d204e6bf87266a.js +0 -1
  362. package/assets/esri/core/workers/chunks/3c2c64832fb498bbaa83.js +0 -1
  363. package/assets/esri/core/workers/chunks/3c4d59018ce8502c65e7.js +0 -1
  364. package/assets/esri/core/workers/chunks/43eff89599f36d83924b.js +0 -1
  365. package/assets/esri/core/workers/chunks/4632ada4af99cab70a61.js +0 -1
  366. package/assets/esri/core/workers/chunks/481eab7879ed5d8a1f67.js +0 -1
  367. package/assets/esri/core/workers/chunks/4b3a5cc435435c81e6a5.js +0 -1
  368. package/assets/esri/core/workers/chunks/4f34fd8c2bb769541e9c.js +0 -1
  369. package/assets/esri/core/workers/chunks/4f5a0bc7411c0db33662.js +0 -1
  370. package/assets/esri/core/workers/chunks/56a4cea67cc579bf7547.js +0 -1
  371. package/assets/esri/core/workers/chunks/56afd89d08c874f620a1.js +0 -1
  372. package/assets/esri/core/workers/chunks/5b08d578521562b166e3.js +0 -1
  373. package/assets/esri/core/workers/chunks/5f938d6da9fd3f3edc74.js +0 -1
  374. package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +0 -1
  375. package/assets/esri/core/workers/chunks/656a8be4ce1bec721366.js +0 -1
  376. package/assets/esri/core/workers/chunks/7531ebc60e9ae61220e0.js +0 -1
  377. package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +0 -1
  378. package/assets/esri/core/workers/chunks/79683324be49aab79dd8.js +0 -1
  379. package/assets/esri/core/workers/chunks/7cdb4416afd5922cf5f3.js +0 -1
  380. package/assets/esri/core/workers/chunks/7e87bc83a0a2715e3016.js +0 -1
  381. package/assets/esri/core/workers/chunks/7f680cf24dd97d61bcd2.js +0 -1
  382. package/assets/esri/core/workers/chunks/7f797fed73cf7b48a686.js +0 -1
  383. package/assets/esri/core/workers/chunks/861609ebd3a77b787b0f.js +0 -1
  384. package/assets/esri/core/workers/chunks/869c3927f1e246cd1e42.js +0 -1
  385. package/assets/esri/core/workers/chunks/95371c0f5464f5daae9f.js +0 -1
  386. package/assets/esri/core/workers/chunks/962b99fd273709c726d3.js +0 -1
  387. package/assets/esri/core/workers/chunks/98fbcbb2115376d7ff62.js +0 -1
  388. package/assets/esri/core/workers/chunks/9abcd1d11bfd92f872ab.js +0 -1
  389. package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +0 -1
  390. package/assets/esri/core/workers/chunks/9dab9f6c07ececa7f851.js +0 -1
  391. package/assets/esri/core/workers/chunks/9ff6ce486898713af7e2.js +0 -1
  392. package/assets/esri/core/workers/chunks/a98a435d4dbea73f7517.js +0 -1
  393. package/assets/esri/core/workers/chunks/b05bb6e784e5453696be.js +0 -1
  394. package/assets/esri/core/workers/chunks/b51d0ec283f61f638a48.js +0 -1
  395. package/assets/esri/core/workers/chunks/b5ee6c0c07fa50410370.js +0 -1
  396. package/assets/esri/core/workers/chunks/b9cf8f02974aeb3ce208.js +0 -1
  397. package/assets/esri/core/workers/chunks/bdf13091bd0e1ab0db7e.js +0 -1
  398. package/assets/esri/core/workers/chunks/bef1a1218a94ab6e2b51.js +0 -1
  399. package/assets/esri/core/workers/chunks/c22c2b15fe5f2c97a2ae.js +0 -1
  400. package/assets/esri/core/workers/chunks/c880d2f0ff06b3bf731f.js +0 -1
  401. package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +0 -1
  402. package/assets/esri/core/workers/chunks/cc96be71fee49f07dcd4.js +0 -1
  403. package/assets/esri/core/workers/chunks/e4237360eef474d1f0ac.js +0 -1
  404. package/assets/esri/core/workers/chunks/e54ae2a4281dd58e0707.js +0 -1
  405. package/assets/esri/core/workers/chunks/e977e721f6f50e3c5f13.js +0 -1
  406. package/assets/esri/core/workers/chunks/ed31cf6688c0f7dac1f9.js +0 -1
  407. package/assets/esri/core/workers/chunks/f07a0ea10428adecea1a.js +0 -1
  408. package/assets/esri/core/workers/chunks/f1eab5c67ed808c18f86.js +0 -1
  409. package/assets/esri/core/workers/chunks/f2e7142a8db164940544.js +0 -1
  410. package/assets/esri/core/workers/chunks/f939b4166f76975f5da0.js +0 -1
  411. package/assets/esri/core/workers/chunks/ff4f4107a866e4a68386.js +0 -1
  412. package/layers/ogc/dateUtils.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.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,watch as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as g}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as h}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as d}from"../../SnappingVisualizer3D.js";import{screenToMap3D as m,hideManipulatorWhileDragging as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as w}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as _}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as f}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorCollection as v}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as P}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{acquire as V}from"../../../../interactive/snapping/SceneSnappingManagerPool.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as M}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as x}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as k}from"../../../../support/screenUtils.js";let b=class extends w{constructor(t){super(t),this._updatingHandles=new p,this.polygonState="initial",this.manipulators=new v,this._getSnappingContext=i((t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new S(new P("point",_(!0,!1,this.view.spatialReference))),visualizer:new d})))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o});const r=V(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new M({view:t}),this._updatingHandles.add((()=>this.stagedPoint),(t=>{this.analysisViewData.stagedPoint=null!=t?g(t,new l):null}),n),x(this,(()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.resnap(this._snappingManager,e)))})),this._setupManipulators(),this.addHandles([s((()=>this.state),(t=>{"measured"===t&&this.finishToolCreation()}),n),this.analysisViewData.path.on("change",(()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")}))])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return"ready"===this.state||"drawing"===this.polygonState?"crosshair":null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<3?(t.clear(),this.polygonState="initial"):(t.close(),this.polygonState="measured"),this._resetSnappingState()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",(()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some((t=>t.manipulator.grabbing));this.polygonState=t?"editing":"measured"}})),e=e=>{this.addHandles([f(e,((t,e,i,a)=>{const n=u(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:h}=j({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next((e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,d),t.location=d,e))).next(h),e.next(n).next(m(this.view)).next(...l).next((e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,g(e.mapEnd))}));const d=g(this.analysisViewData.path.getVertexPositionAsPoint(s))})),t(e)],e)};this.manipulators.forEach((({manipulator:t})=>{e(t)})),this.addHandles([this.manipulators.on("after-add",(({item:{manipulator:t}})=>{e(t)})),this.manipulators.on("after-remove",(({item:{manipulator:t}})=>this.removeHandles(t)))])}_handleImmediateDoubleClick(t){h(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!h(t))return;const e=k(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=k(t);this._hoverAt(e)}}_handleKeyDown(t){if("Enter"===t.key&&"drawing"===this.polygonState){if(null!=this.stagedPoint){const t=new l(this.stagedPoint);this.stagedPoint=null,this.analysisViewData.path.add(t)}this.finishMeasurement(),t.stopPropagation()}}_hoverAt(t){const{polygonState:e}=this;if(this.active&&("initial"===e||"drawing"===e)){const e=this._pick(t);if(null!=e&&null!=e.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._snappingManager,t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t);if(null!=i&&null!=i.mapPoint){const{mapPoint:t}=i,a=this._getSnappingContext(e),n=this._snappingOperation.update({point:t},this._snappingManager,a),s=g(n,new l);return this.analysisViewData.path.add(s),!0}return!1}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){return{snappingManager:this._snappingManager}}};t([o({readOnly:!0})],b.prototype,"state",null),t([o()],b.prototype,"polygonState",void 0),t([o({readOnly:!0})],b.prototype,"cursor",null),t([o()],b.prototype,"measurementView",void 0),t([o({constructOnly:!0})],b.prototype,"view",void 0),t([o({constructOnly:!0})],b.prototype,"analysis",void 0),t([o({constructOnly:!0})],b.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],b.prototype,"manipulators",void 0),t([o()],b.prototype,"updating",null),t([o()],b.prototype,"stagedPoint",null),t([o()],b.prototype,"snappingOptions",null),b=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],b);const O=b;export{O as default};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,watch as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as g}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as h}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{screenToMap3D as d,hideManipulatorWhileDragging as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as w}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as _}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as f}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorCollection as v}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as S}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as P}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{acquire as V}from"../../../../interactive/snapping/SceneSnappingManagerPool.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{SnappingOperation as M}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as x}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as k}from"../../../../support/screenUtils.js";let b=class extends w{constructor(t){super(t),this._updatingHandles=new p,this.polygonState="initial",this.manipulators=new v,this._getSnappingContext=i((t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new P(new S("point",_(!0,!1,this.view.spatialReference))),visualizer:new m})))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o});const r=V(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new M({view:t}),this._updatingHandles.add((()=>this.stagedPoint),(t=>{this.analysisViewData.stagedPoint=null!=t?g(t,new l):null}),n),x(this,(()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.resnap(this._snappingManager,e)))})),this._setupManipulators(),this.addHandles([s((()=>this.state),(t=>{"measured"===t&&this.finishToolCreation()}),n),this.analysisViewData.path.on("change",(()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")}))])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return"ready"===this.state||"drawing"===this.polygonState?"crosshair":null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<3?(t.clear(),this.polygonState="initial"):(t.close(),this.polygonState="measured"),this._resetSnappingState()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",(()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some((t=>t.manipulator.grabbing));this.polygonState=t?"editing":"measured"}})),e=e=>{this.addHandles([f(e,((t,e,i,a)=>{const n=u(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:h}=j({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next((e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,m),t.location=m,e))).next(h),e.next(n).next(d(this.view)).next(...l).next((e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,g(e.mapEnd))}));const m=g(this.analysisViewData.path.getVertexPositionAsPoint(s))})),t(e)],e)};this.manipulators.forEach((({manipulator:t})=>{e(t)})),this.addHandles([this.manipulators.on("after-add",(({item:{manipulator:t}})=>{e(t)})),this.manipulators.on("after-remove",(({item:{manipulator:t}})=>this.removeHandles(t)))])}_handleImmediateDoubleClick(t){h(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!h(t))return;const e=k(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=k(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;"Enter"===t.key&&"drawing"===this.polygonState&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&("initial"===e||"drawing"===e)){const e=this._pick(t);if(null!=e&&null!=e.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._snappingManager,t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t);if(null!=i&&null!=i.mapPoint){const{mapPoint:t}=i,a=this._getSnappingContext(e),n=this._snappingOperation.update({point:t},this._snappingManager,a),s=g(n,new l);return this.analysisViewData.path.add(s),!0}return!1}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){return{snappingManager:this._snappingManager}}};t([o({readOnly:!0})],b.prototype,"state",null),t([o()],b.prototype,"polygonState",void 0),t([o({readOnly:!0})],b.prototype,"cursor",null),t([o()],b.prototype,"measurementView",void 0),t([o({constructOnly:!0})],b.prototype,"view",void 0),t([o({constructOnly:!0})],b.prototype,"analysis",void 0),t([o({constructOnly:!0})],b.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],b.prototype,"manipulators",void 0),t([o()],b.prototype,"updating",null),t([o()],b.prototype,"stagedPoint",null),t([o()],b.prototype,"snappingOptions",null),b=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],b);const O=b;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{B as e}from"../../../../chunks/mat4.js";import{j as r}from"../../../../chunks/vec2.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{h as i,c}from"../../../../chunks/vec4.js";import{f as a}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as h}from"../../webgl-engine/lib/Geometry.js";import{RenderOccludedFlag as d}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as u}from"../../webgl-engine/lib/VertexAttribute.js";import{CheckerBoardMaterial as m}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class _ extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=d.OccludeAndTransparent,this._geometry=null,this._size=t(1,1),this._color1=a(1,.5,0,.5),this._color2=a(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){r(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){i(e,this._color1)||(c(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){i(e,this._color2)||(c(this._color2,e),this._updateMaterial())}_updateMaterial(){null!=this._checkerBoardMaterial&&this._checkerBoardMaterial.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new m({size:this._size,color1:this._color1,color2:this._color2,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:d.OccludeAndTransparent,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachExternalMaterial(e){null!=this._checkerBoardMaterial&&e(this._checkerBoardMaterial)}createGeometries(r){if(null==this._geometry||null==this._checkerBoardMaterial)return;const t=p;e(t,this.transform);const i=this._geometry,c=[],a=o();i.position.forEach((e=>{s(a,e,t),c.push(a[0],a[1],a[2])}));const l=[];i.uv.forEach((e=>{l.push(e[0],e[1])}));const d=new h(this._checkerBoardMaterial,[[u.POSITION,new n(c,3,!0),i.triangleIndices],[u.UV0,new n(l,2,!0),i.triangleIndices]]);r.addGeometry(d)}}const p=o();export{_ as MeasurementAreaVisualElement};
5
+ import{B as e}from"../../../../chunks/mat4.js";import{j as r}from"../../../../chunks/vec2.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as s}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{h as i,c}from"../../../../chunks/vec4.js";import{f as a}from"../../../../chunks/vec4f64.js";import{Object3DVisualElement as l}from"./Object3DVisualElement.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as h}from"../../webgl-engine/lib/Geometry.js";import{RenderOccludedFlag as d}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as u}from"../../webgl-engine/lib/VertexAttribute.js";import{CheckerBoardMaterial as m}from"../../webgl-engine/materials/CheckerBoardMaterial.js";class _ extends l{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=d.OccludeAndTransparent,this._geometry=null,this._size=t(1,1),this._color1=a(1,.5,0,.5),this._color2=a(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){r(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){i(e,this._color1)||(c(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){i(e,this._color2)||(c(this._color2,e),this._updateMaterial())}_updateMaterial(){null!=this._checkerBoardMaterial&&this._checkerBoardMaterial.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new m({size:this._size,color1:this._color1,color2:this._color2,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:d.OccludeAndTransparent,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachExternalMaterial(e){null!=this._checkerBoardMaterial&&e(this._checkerBoardMaterial)}createGeometries(r){if(null==this._geometry||null==this._checkerBoardMaterial)return;const t=p;e(t,this.transform);const i=this._geometry,c=[],a=o();i.position.forEach((e=>{s(a,e,t),c.push(a[0],a[1],a[2])}));const l=[];i.uv.forEach((e=>{l.push(e[0],e[1])}));const d=new h(this._checkerBoardMaterial,[[u.POSITION,new n(c,i.triangleIndices,3,!0)],[u.UV0,new n(l,i.triangleIndices,2,!0)]]);r.addGeometry(d)}}const p=o();export{_ as MeasurementAreaVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Evented.js";import{s as t,g as r,i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{h as n,c as o}from"../../../../chunks/vec4.js";import{f as a,c as l}from"../../../../chunks/vec4f32.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as u}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as _}from"./EngineVisualElement.js";import{LaserlineVisualElement as f}from"./LaserlineVisualElement.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createGeometry as y}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as O,geometryToRenderInfo as C}from"../../support/renderInfoUtils/line.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as v}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as b}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as j}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends _{constructor(t){super(t),this._attachmentOrigin=u(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=a(1,0,1,1),this._innerWidth=0,this._innerColor=a(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=R.OccludeAndTransparentStencil,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new f({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:e=>this._destroyExternalResources(e),recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyExternalResources(e),recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()}}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){n(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){n(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&n(e,this._stippleOffColor)||(this._stippleOffColor=e?l(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;t(P,0,0,0);let s=0;for(const t of e)t.computeAttachmentOrigin(D)&&(r(P,P,D),s++);return 0===s?null:(i(P,P,1/s),this.view.renderCoordsHelper.fromRenderCoords(P,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){null!=this.object3dResources.resources&&this.object3dResources.resources.material.setParameters(this._materialParameters),null!=this.drapedResources.resources&&this.drapedResources.resources.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===R.OccludeAndTransparentStencil?R.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_destroyExternalResources(e){e.geometries=[]}_createObject3DResources(e){const t=new j(this._materialParameters),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_createDrapedResources(){const e=new j(this._materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;if(null==t||null==i)return[];return O(t,i).lines.map((({position:t})=>{const s={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new v(y(e,s))}))}calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.vertexAttributes.get(b.POSITION),s=d(i.data.length);h(i.data,t.spatialReference,0,s,this.view.spatialReference,0,i.data.length/3),c(e,s)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(null==r)return;const i=C(r,this.view.elevationProvider,this.view.renderCoordsHelper,g.fromElevationInfo(this.elevationInfo??new m({mode:p(r,null)}))),s=new Array;for(const{position:n,mapPositions:o}of i.lines){const r={mapPositions:o,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(y(e,r)),s.push(n)}this._laserline.pathVerticalPlane=s}}const D=s(),P=s();export{w as OutlineVisualElement};
5
+ import e from"../../../../core/Evented.js";import{s as t,g as r,i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{h as n,c as o}from"../../../../chunks/vec4.js";import{f as a,c as l}from"../../../../chunks/vec4f32.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as u}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as p}from"../../../../support/elevationInfoUtils.js";import m from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as _}from"./EngineVisualElement.js";import{LaserlineVisualElement as f}from"./LaserlineVisualElement.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createGeometry as y}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as O,geometryToRenderInfo as C}from"../../support/renderInfoUtils/line.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as v}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as b}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as j}from"../../webgl-engine/materials/RibbonLineMaterial.js";class w extends _{constructor(t){super(t),this._attachmentOrigin=u(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=a(1,0,1,1),this._innerWidth=0,this._innerColor=a(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=R.OccludeAndTransparentStencil,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new f({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:e=>this._destroyExternalResources(e),recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyExternalResources(e),recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()}}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){n(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){n(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&n(e,this._stippleOffColor)||(this._stippleOffColor=e?l(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;t(P,0,0,0);let s=0;for(const t of e)t.computeAttachmentOrigin(D)&&(r(P,P,D),s++);return 0===s?null:(i(P,P,1/s),this.view.renderCoordsHelper.fromRenderCoords(P,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){null!=this.object3dResources.resources&&this.object3dResources.resources.material.setParameters(this._materialParameters),null!=this.drapedResources.resources&&this.drapedResources.resources.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===R.OccludeAndTransparentStencil?R.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_destroyExternalResources(e){e.geometries=[]}_createObject3DResources(e){const t=new j(this._materialParameters),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_createDrapedResources(){const e=new j(this._materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;if(null==t||null==i)return[];return O(t,i).lines.map((({position:t})=>{const s={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new v(y(e,s))}))}calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.attributes.get(b.POSITION),s=d(i.data.length);h(i.data,t.spatialReference,0,s,this.view.spatialReference,0,i.data.length/3),c(e,s)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(null==r)return;const i=C(r,this.view.elevationProvider,this.view.renderCoordsHelper,g.fromElevationInfo(this.elevationInfo??new m({mode:p(r,null)}))),s=new Array;for(const{position:n,mapPositions:o}of i.lines){const r={mapPositions:o,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(y(e,r)),s.push(n)}this._laserline.pathVerticalPlane=s}}const D=s(),P=s();export{w as OutlineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../../core/mathUtils.js";import{s as t}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{h as r,c as s}from"../../../../chunks/vec4.js";import{f as o}from"../../../../chunks/vec4f64.js";import{projectVectorToVector as n}from"../../../../geometry/projection/projectVectorToVector.js";import{expandWithBuffer as l}from"../../../../geometry/support/aaBoundingBox.js";import{sv3d as a}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as h}from"./Object3DVisualElement.js";import{evaluateElevationAlignmentAtPoint as u}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as m}from"../../layers/graphics/ElevationContext.js";import{requiresHalfTexelOffset as p,createTexture as _,defaultSymbolSizeRatio as c}from"../../support/engineContent/sdfPrimitives.js";import{createPointGeometry as g}from"../../webgl-engine/lib/GeometryUtil.js";import{VertexAttribute as d}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as f}from"../../webgl-engine/materials/HUDMaterial.js";class x extends h{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=o(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=o(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){const t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeAttribute()}}get color(){return this._color}set color(e){r(e,this._color)||(s(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){r(e,this._outlineColor)||(s(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material&&this._material.setParameters(this._materialParameters)}_updateSizeAttribute(){const e=this.object;if(null==e)return;const t=e.geometries[0];if(null==t)return;const i=t.getMutableAttribute(d.SIZE).data,r=this._geometrySize;i[0]=r,i[1]=r,e.geometryVertexAttrsUpdated(e.geometries[0])}get _materialParameters(){return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:p(this._primitive),distanceFieldBoundingBox:v,occlusionTest:!1,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,polygonOffset:!1,shaderPolygonOffset:0,drawInSecondSlot:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration}}get _geometrySize(){return this._size/S}createExternalResources(){this._texture=_(this._primitive,this._preferredTextureSize),this._material=new f(this._materialParameters);const e=this.view._stage;this._texture.load(e.renderView.renderingContext),e.add(this._texture)}destroyExternalResources(){if(this._texture){this.view._stage.remove(this._texture),this._texture.dispose(),this._texture=null}this._material=null}createGeometries(e){const t=this._createRenderGeometry();null!=t&&e.addGeometry(t)}forEachExternalMaterial(e){this._material&&e(this._material)}get _preferredTextureSize(){return e(2*this._geometrySize,16,128)}calculateMapBounds(e){const t=this.object?.geometries[0];if(!t)return!1;const i=t.vertexAttributes.get(d.POSITION);return n(i.data,this.view.renderCoordsHelper.spatialReference,y,this.view.spatialReference),l(e,y),!0}_createRenderGeometry(){const{geometry:e,_material:i}=this;if(null==e||null==i)return null;const{renderCoordsHelper:r,elevationProvider:s}=this.view,o=u(e,s,m.fromElevationInfo(this.elevationInfo),r),l=t(a.get(),e.x,e.y,o),h=a.get();n(l,e.spatialReference,h,r.spatialReference);const p=this._geometrySize;return g(i,null,h,null,[p,p],[0,0,0,1])}}const S=c,v=[S/2,S/2,1-S/2,1-S/2],y=i();export{x as PointVisualElement};
5
+ import{clamp as e}from"../../../../core/mathUtils.js";import{s as t}from"../../../../chunks/vec3.js";import{c as i}from"../../../../chunks/vec3f64.js";import{h as r,c as s}from"../../../../chunks/vec4.js";import{f as o}from"../../../../chunks/vec4f64.js";import{projectVectorToVector as n}from"../../../../geometry/projection/projectVectorToVector.js";import{expandWithBuffer as l}from"../../../../geometry/support/aaBoundingBox.js";import{sv3d as a}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as h}from"./Object3DVisualElement.js";import{evaluateElevationAlignmentAtPoint as u}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as m}from"../../layers/graphics/ElevationContext.js";import{requiresHalfTexelOffset as p,createTexture as _,defaultSymbolSizeRatio as c}from"../../support/engineContent/sdfPrimitives.js";import{createPointGeometry as g}from"../../webgl-engine/lib/GeometryUtil.js";import{VertexAttribute as d}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as f}from"../../webgl-engine/materials/HUDMaterial.js";class x extends h{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=o(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=o(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){const t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeAttribute()}}get color(){return this._color}set color(e){r(e,this._color)||(s(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){r(e,this._outlineColor)||(s(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material&&this._material.setParameters(this._materialParameters)}_updateSizeAttribute(){const e=this.object;if(null==e)return;const t=e.geometries[0];if(null==t)return;const i=t.getMutableAttribute(d.SIZE).data,r=this._geometrySize;i[0]=r,i[1]=r,e.geometryVertexAttrsUpdated(e.geometries[0])}get _materialParameters(){return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:p(this._primitive),distanceFieldBoundingBox:v,occlusionTest:!1,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,polygonOffset:!1,shaderPolygonOffset:0,drawInSecondSlot:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration}}get _geometrySize(){return this._size/S}createExternalResources(){this._texture=_(this._primitive,this._preferredTextureSize),this._material=new f(this._materialParameters);const e=this.view._stage;this._texture.load(e.renderView.renderingContext),e.add(this._texture)}destroyExternalResources(){if(this._texture){this.view._stage.remove(this._texture),this._texture.dispose(),this._texture=null}this._material=null}createGeometries(e){const t=this._createRenderGeometry();null!=t&&e.addGeometry(t)}forEachExternalMaterial(e){this._material&&e(this._material)}get _preferredTextureSize(){return e(2*this._geometrySize,16,128)}calculateMapBounds(e){const t=this.object?.geometries[0];if(!t)return!1;const i=t.attributes.get(d.POSITION);return n(i.data,this.view.renderCoordsHelper.spatialReference,y,this.view.spatialReference),l(e,y),!0}_createRenderGeometry(){const{geometry:e,_material:i}=this;if(null==e||null==i)return null;const{renderCoordsHelper:r,elevationProvider:s}=this.view,o=u(e,s,m.fromElevationInfo(this.elevationInfo),r),l=t(a.get(),e.x,e.y,o),h=a.get();n(l,e.spatialReference,h,r.spatialReference);const p=this._geometrySize;return g(i,null,h,null,[p,p],[0,0,0,1])}}const S=c,v=[S/2,S/2,1-S/2,1-S/2],y=i();export{x as PointVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e}from"../../../../core/reactiveUtils.js";import{d as t,b as r}from"../../../../chunks/mat4.js";import{a as i}from"../../../../chunks/mat4f64.js";import{o as s,n as a,f as o,c as n,h as c,g as u}from"../../../../chunks/vec3.js";import{c as l,Z as d}from"../../../../chunks/vec3f64.js";import{c as h}from"../../../../chunks/vec4.js";import{f as m}from"../../../../chunks/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as f}from"./EngineVisualElement.js";import{drapedZ as g}from"../../terrain/OverlayRenderer.js";import{Attribute as M}from"../../webgl-engine/lib/Attribute.js";import{Geometry as O}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as b}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as j}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as y}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as D}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";class z extends f{constructor(e){super(e),this._maxSize=0,this._position=l(),this._up=l(),this._right=l(),this._renderOccluded=b.OccludeAndTransparent,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=b.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyDrapedResources(e)}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){h(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){h(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new D(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new w(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r,forEach:e=>{e(t),r&&e(r)}}}_createObject3DGeometries(e,t,r){if(c(this._up,d)&&c(this._right,d))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new D(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new w(this._outlineMaterialParameters),i=this._createGeometries(t,r).map((e=>new j(e)));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e((()=>this.view.state.contentPixelRatio),(()=>{this.drapedResources.recreateGeometry()}))}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[]}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=this._quadGeometryData(r,i,s,e);if(!t)return[a];return[a,R(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=u(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(P,this._position),r(P,P,[a,a,a]),e.transformation=P}_setTransformDraped(e){if(0===e.length)return;const{view:{basemapTerrain:{overlayManager:i},state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=g;const u=v;u.spatialReference=i.renderer.spatialReference,u.x=c[0],u.y=c[1];const l=o*(this.view.overlayPixelSizeInMapUnits(u)*s),d=Math.min(this._maxSize,l);t(P,c),r(P,P,[d,d,1]);for(const t of e)t.transformation=P}_quadGeometryData(e,t,r,i){return new O(i,[[y.POSITION,new M([0,0,0,...t,...e,...r],3,!0),[0,1,2,1,2,3]]])}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}const P=i(),v=p(0,0,void 0,null);export{z as RightAngleQuadVisualElement};
5
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{d as t,b as r}from"../../../../chunks/mat4.js";import{a as i}from"../../../../chunks/mat4f64.js";import{o as s,n as a,f as o,c as n,h as c,g as u}from"../../../../chunks/vec3.js";import{c as l,Z as d}from"../../../../chunks/vec3f64.js";import{c as h}from"../../../../chunks/vec4.js";import{f as m}from"../../../../chunks/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as f}from"./EngineVisualElement.js";import{drapedZ as g}from"../../terrain/OverlayRenderer.js";import{Attribute as M}from"../../webgl-engine/lib/Attribute.js";import{Geometry as O}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as R}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as b}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as j}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as y}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as D}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";class z extends f{constructor(e){super(e),this._maxSize=0,this._position=l(),this._up=l(),this._right=l(),this._renderOccluded=b.OccludeAndTransparent,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=b.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:e=>this._destroyDrapedResources(e)}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){h(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){h(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,a(this._up,o(this._up,e,t)),a(this._right,o(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new D(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new w(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r,forEach:e=>{e(t),r&&e(r)}}}_createObject3DGeometries(e,t,r){if(c(this._up,d)&&c(this._right,d))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new D(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new w(this._outlineMaterialParameters),i=this._createGeometries(t,r).map((e=>new j(e)));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e((()=>this.view.state.contentPixelRatio),(()=>{this.drapedResources.recreateGeometry()}))}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[]}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),a=this._quadGeometryData(r,i,s,e);if(!t)return[a];return[a,R(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=u(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),a=Math.min(this._maxSize,s);t(P,this._position),r(P,P,[a,a,a]),e.transformation=P}_setTransformDraped(e){if(0===e.length)return;const{view:{basemapTerrain:{overlayManager:i},state:{contentPixelRatio:s}}}=this,{_position:a,_size:o}=this,c=n(_.get(),a);c[2]=g;const u=v;u.spatialReference=i.renderer.spatialReference,u.x=c[0],u.y=c[1];const l=o*(this.view.overlayPixelSizeInMapUnits(u)*s),d=Math.min(this._maxSize,l);t(P,c),r(P,P,[d,d,1]);for(const t of e)t.transformation=P}_quadGeometryData(e,t,r,i){return new O(i,[[y.POSITION,new M([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}const P=i(),v=p(0,0,void 0,null);export{z as RightAngleQuadVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import{getProjectiveTransform as s}from"../../../core/perspectiveUtils.js";import{debounce as a,isPromiseLike as o}from"../../../core/promiseUtils.js";import{on as d}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{a as p}from"../../../chunks/mat3f64.js";import{toExtent as c}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as h}from"../../../layers/support/MediaElementView.js";import{DrapeSourceType as u}from"./interfaces.js";import{LayerView3D as y}from"./LayerView3D.js";import{drapedZ as _}from"../terrain/OverlayRenderer.js";import{Attribute as g}from"../webgl-engine/lib/Attribute.js";import{Geometry as E}from"../webgl-engine/lib/Geometry.js";import{DirtyOperation as f,DirtyState as D}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as w}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as v}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as b}from"../webgl-engine/lib/UpdatePolicy.js";import{VertexAttribute as R}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as j}from"../webgl-engine/materials/ImageMaterial.js";import T from"../../layers/LayerView.js";import{TextureWrapMode as A}from"../../webgl/enums.js";let x=class extends(y(T)){constructor(){super(...arguments),this.type="media-3d",this.drapeSourceType=u.RasterImage,this.updatePolicy=b.ASYNC,this._uidToElement=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=a((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0)}initialize(){this._renderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const e=()=>this._updateWithLastDrapingExtent();this.addHandles([r((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))),d((()=>this.layer.effectiveSource),"change",e),d((()=>this.layer.effectiveSource),"refresh",e)]),this._updatingHandles.add((()=>this.suspended),e)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map((e=>i.queryElements(c(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){const t=new Set,r=[];this._renderedElements.forEach(((i,n)=>{e.has(n)||(t.add(n),null!=i.renderData&&r.push(i.renderData.renderGeometry),this._removeElement(n,i))})),this._renderer.removeGeometries(r,f.REMOVE)}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t=new h({spatialReference:this.view.spatialReference,element:e}),r={renderData:null,handle:i([this._updatingHandles.add((()=>e.opacity),(e=>{null!=r.renderData&&r.renderData.material.setParameters({opacity:e})})),this._updatingHandles.add((()=>t.coords),(()=>{null!=r.renderData?this._updateGeometry(t,r,r.renderData):this._initializeRenderData(t,r)})),this._updatingHandles.add((()=>e.content),(()=>this._initializeRenderData(t,r))),n(t)])};this._renderedElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e;if(null==r||null==i.content)return void(t.renderData=this._destroyRenderData(t.renderData));if(null!=t.renderData)return;const n=this._createTexture(i.content),s=n.load(this.view._stage.renderView.renderingContext);this.view._stage.add(n),o(s)&&this._updatingHandles.addPromise(s);const a=new j({initTextureTransparent:!0,textureId:n.id,opacity:i.opacity,transparent:!0,perspectiveInterpolation:!0}),d=this._getPositionAttributeArray(r),l=[0,0,1,0,1,1,0,1],m=this._getPerspectiveDivideAttributeArray(d,i.contentWidth,i.contentHeight),p=[0,1,2,0,2,3],c=new E(a,[[R.POSITION,new g(d,3,!0),p],[R.UV0,new g(l,2,!0),p],[R.PERSPECTIVEDIVIDE,new g(m,1,!0),p]]),h=new w(c,{layerUid:this.layer.uid,graphicUid:i.uid});this._renderer.addGeometries([h],f.ADD),t.renderData={renderGeometry:h,texture:n,material:a}}_updateGeometry(e,t,r){const{coords:i,element:n}=e;if(null==i||null==n.content)return void(t.renderData=this._destroyRenderData(t.renderData));const s=this._getPositionAttributeArray(i);r.renderGeometry.geometry.setAttributeData(R.POSITION,s);const a=this._getPerspectiveDivideAttributeArray(s,n.contentWidth,n.contentHeight);r.renderGeometry.geometry.setAttributeData(R.PERSPECTIVEDIVIDE,a),this._renderer.modifyGeometries([r.renderGeometry],D.GEOMETRY)}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],_,n[0],n[1],_,i[0],i[1],_,r[0],r[1],_]}_getPerspectiveDivideAttributeArray(e,t,r){s(P,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=P[6]/P[8]*t,n=P[7]/P[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e){if(null==e)return null;const t=e.texture;return t.unload(),this.view._stage.remove(t),this._renderer.removeGeometries([e.renderGeometry],f.REMOVE),null}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new v(e,{wrap:{s:A.CLAMP_TO_EDGE,t:A.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.setDrawTexturesDirty()})}get test(){const e=this;return{get numberOfElements(){return e._renderedElements.size}}}};e([l({readOnly:!0})],x.prototype,"type",void 0),e([l()],x.prototype,"layer",void 0),x=e([m("esri.views.3d.layers.MediaLayerView3D")],x);const P=p(),M=x;export{M as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{makeHandle as r,handlesGroup as i,destroyHandle as n}from"../../../core/handleUtils.js";import{getProjectiveTransform as s}from"../../../core/perspectiveUtils.js";import{debounce as a,isPromiseLike as o}from"../../../core/promiseUtils.js";import{on as d}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{a as p}from"../../../chunks/mat3f64.js";import{toExtent as c}from"../../../geometry/support/aaBoundingRect.js";import{MediaElementView as h}from"../../../layers/support/MediaElementView.js";import{DrapeSourceType as u}from"./interfaces.js";import{LayerView3D as y}from"./LayerView3D.js";import{drapedZ as _}from"../terrain/OverlayRenderer.js";import{Attribute as g}from"../webgl-engine/lib/Attribute.js";import{Geometry as E}from"../webgl-engine/lib/Geometry.js";import{DirtyOperation as f,DirtyState as D}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as w}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as v}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as b}from"../webgl-engine/lib/UpdatePolicy.js";import{VertexAttribute as R}from"../webgl-engine/lib/VertexAttribute.js";import{ImageMaterial as j}from"../webgl-engine/materials/ImageMaterial.js";import T from"../../layers/LayerView.js";import{TextureWrapMode as A}from"../../webgl/enums.js";let x=class extends(y(T)){constructor(){super(...arguments),this.type="media-3d",this.drapeSourceType=u.RasterImage,this.updatePolicy=b.ASYNC,this._uidToElement=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=a((async(e,t,r)=>{const i=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(i)}),0)}initialize(){this._renderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const e=()=>this._updateWithLastDrapingExtent();this.addHandles([r((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))),d((()=>this.layer.effectiveSource),"change",e),d((()=>this.layer.effectiveSource),"refresh",e)]),this._updatingHandles.add((()=>this.suspended),e)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}_updateWithLastDrapingExtent(){if(null==this._lastDrapingExtent||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch((()=>{})))}async _collectMediaElements(e,t,r){const i=this.layer.effectiveSource;return null==i?new Set:new Set((await Promise.all(e.map((e=>i.queryElements(c(e.extent,t),{signal:r}))))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){const t=new Set,r=[];this._renderedElements.forEach(((i,n)=>{e.has(n)||(t.add(n),null!=i.renderData&&r.push(i.renderData.renderGeometry),this._removeElement(n,i))})),this._renderer.removeGeometries(r,f.REMOVE)}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t=new h({spatialReference:this.view.spatialReference,element:e}),r={renderData:null,handle:i([this._updatingHandles.add((()=>e.opacity),(e=>{null!=r.renderData&&r.renderData.material.setParameters({opacity:e})})),this._updatingHandles.add((()=>t.coords),(()=>{null!=r.renderData?this._updateGeometry(t,r,r.renderData):this._initializeRenderData(t,r)})),this._updatingHandles.add((()=>e.content),(()=>this._initializeRenderData(t,r))),n(t)])};this._renderedElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch((()=>{}))),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:i}=e;if(null==r||null==i.content)return void(t.renderData=this._destroyRenderData(t.renderData));if(null!=t.renderData)return;const n=this._createTexture(i.content),s=n.load(this.view._stage.renderView.renderingContext);this.view._stage.add(n),o(s)&&this._updatingHandles.addPromise(s);const a=new j({initTextureTransparent:!0,textureId:n.id,opacity:i.opacity,transparent:!0,perspectiveInterpolation:!0}),d=this._getPositionAttributeArray(r),l=[0,0,1,0,1,1,0,1],m=this._getPerspectiveDivideAttributeArray(d,i.contentWidth,i.contentHeight),p=[0,1,2,0,2,3],c=new E(a,[[R.POSITION,new g(d,p,3,!0)],[R.UV0,new g(l,p,2,!0)],[R.PERSPECTIVEDIVIDE,new g(m,p,1,!0)]]),h=new w(c,{layerUid:this.layer.uid,graphicUid:i.uid});this._renderer.addGeometries([h],f.ADD),t.renderData={renderGeometry:h,texture:n,material:a}}_updateGeometry(e,t,r){const{coords:i,element:n}=e;if(null==i||null==n.content)return void(t.renderData=this._destroyRenderData(t.renderData));const s=this._getPositionAttributeArray(i);r.renderGeometry.geometry.setAttributeData(R.POSITION,s);const a=this._getPerspectiveDivideAttributeArray(s,n.contentWidth,n.contentHeight);r.renderGeometry.geometry.setAttributeData(R.PERSPECTIVEDIVIDE,a),this._renderer.modifyGeometries([r.renderGeometry],D.GEOMETRY)}_getPositionAttributeArray(e){const[t,r,i,n]=e.rings[0];return[t[0],t[1],_,n[0],n[1],_,i[0],i[1],_,r[0],r[1],_]}_getPerspectiveDivideAttributeArray(e,t,r){s(P,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const i=P[6]/P[8]*t,n=P[7]/P[8]*r;return[1,1+i,1+i+n,1+n]}_destroyRenderData(e){if(null==e)return null;const t=e.texture;return t.unload(),this.view._stage.remove(t),this._renderer.removeGeometries([e.renderGeometry],f.REMOVE),null}_createTexture(e){const r=e instanceof HTMLImageElement?e.naturalWidth:e.width,i=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new t("media-layer-view-3d","animation is not supported");return new v(e,{wrap:{s:A.CLAMP_TO_EDGE,t:A.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:r,height:i,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.setDrawTexturesDirty()})}get test(){const e=this;return{get numberOfElements(){return e._renderedElements.size}}}};e([l({readOnly:!0})],x.prototype,"type",void 0),e([l()],x.prototype,"layer",void 0),x=e([m("esri.views.3d.layers.MediaLayerView3D")],x);const P=p(),M=x;export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{binaryIndexOf as r}from"../../../core/arrayUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{estimateSize as n}from"../../../core/typedArrayUtil.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as u}from"../../../chunks/vec3.js";import{c as h}from"../../../chunks/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as p}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as g,extentContainsCoords2D as m}from"../../../geometry/support/contains.js";import{newDoubleArray as y,doubleArrayFrom as f}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as _}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as b}from"../../../layers/LayerConstants.js";import{estimateSize as v}from"../../../layers/graphics/dehydratedFeatures.js";import{makeDehydratedPoint as E}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayer as O}from"../../../support/basemapUtils.js";import{I3SPointsWorkerHandle as j}from"./I3SPointsWorkerHandle.js";import{LayerView3D as C}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as F}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as D}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as S,processAttributeEdits as G}from"./i3s/featureEditing.js";import{I3SGraphicsMap as A}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as P}from"./i3s/I3SOverrides.js";import{checkRecyclable as L,checkSpatialReferences as V,containsDraco as M,whenGraphicAttributes as R,getCachedAttributeValue as H}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as U}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import{PopupSceneLayerView as Q}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as T}from"./support/SceneLayerViewRequiredFields.js";import{debugFlags as B}from"../support/debugFlags.js";import{compute as k}from"../support/orientedBoundingBox.js";import{updatingProgress as z}from"../support/updatingProperties.js";import{Attribute as W}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as Z}from"../webgl-engine/lib/UpdatePolicy.js";import K from"../../layers/SceneLayerView.js";import{hasPopupTemplate as Y}from"../../layers/support/popupUtils.js";import{TaskPriority as $}from"../../support/Scheduler.js";const J=q();class X{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}}let ee=class extends(U(Q(C(K)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new A(((e,t,r)=>se(e,t,r)),(e=>this.processor.graphicsCore.recreateGraphics(e))),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then((()=>{L(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const t=this.view.resourceController?.memoryController;this._i3sOverrides=new P({view:this.view,layer:e,memoryController:t}),s(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()})):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new P({view:this.view,layer:this.layer,memoryController:e}),V(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new T({layerView:this}),this._updatingHandles.add((()=>this.layer.rangeInfos),(e=>this._rangeInfosChanged(e)),o),this._updatingHandles.add((()=>this.layer.renderer),((e,t)=>this._rendererChange(e,t))),this._updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.addHandles(a((()=>B.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&B.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||B.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),o)),this._set("processor",new F({owner:this,preferredUpdatePolicy:Z.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(e=>this._controller.updateElevationChanged(e.extent,e.spatialReference))),this.supportsHeightUnitConversion&&(this._verticalScale=_("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),M(this.layer.geometryDefinitions)&&(this._worker=new j((e=>this.view.resourceController.immediate.schedule(e)))),this.addHandles(this.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))),this.addHandles(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{this._setupQueryEngine(),this._updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),o),this._updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=s(this._treeDebugger),this._i3sOverrides=s(this._i3sOverrides),this._set("processor",s(this.processor)),this._controller=s(this._controller),this._queryEngine=s(this._queryEngine),this._worker=s(this._worker),this._memCache=s(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=s(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(e,t){return R(this.layer,e,this._getObjectIdField(),t,(()=>[...this.loadedGraphics.nodes()]))}getHit(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return S(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new j((e=>this.view.resourceController.immediate.schedule(e))));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,t,r){if(!ie(t)&&!re(t))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void i.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?ae(this.layer.fullExtent.clone(),.5):null,o=[],{featureIds:a,pointPositions:n}=ie(t)?await this._extractBinaryPointPositions(e,t,r):this._extractLegacyPointPositions(t);this._validatePositions(e,a,n,s,o);const l=this._controller.crsVertex,d=this.view.spatialReference;c(n,l,0,n,d,0,a.length);const u=ie(t)?e.level:0,h=this._createGraphics(a,n,e.index,u),p=new X(h,a,t.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,t.attributeDataInfo,r),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),oe(p),o.length>0&&(this._computeObb(e,o,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const i of p.graphics)this._verticalScale(i.geometry);const g=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(null!=g){const e=O(this.view.map,this.layer.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];g.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled&&!e&&Y(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0,t.length/3),e.serviceObb=k(new W(t,3)),i.isGeographic&&p(e.serviceObb.center,s,e.serviceObb.center,i)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=y(3*a),l=null!=e.serviceObb?e.serviceObb.center:[0,0,0],d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?f(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=y(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ne[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,t,r,s,o){if(null==s&&e.serviceObb)return;const a=t.length,n=3;for(let l=0;l<a;l++){const t=l*n;u(le,r[t],r[t+1],r[t+2]);const a=!Number.isNaN(r[2]);null==s||(a?g(s,le):m(s,le))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&i.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&i.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObb||o.push(le[0],le[1],le[2])}}_createGraphics(e,r,i,s){const o=e.length,a=3,n=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<o;h++){const o=e[h],c={};null!=o&&(c[n]=o);const p=o??t.generateUID(),g=h*a,m=isNaN(r[g+2])?void 0:r[g+2],y=E(r[g],r[g+1],m,u),f=this.loadedGraphics.get(p);if(null!=f)(null==f.level||f.level<s)&&(de.property="geometry",de.graphic=f,de.oldValue=f.geometry,de.newValue=y,f.geometry=y,f.level=s,l.graphicUpdateHandler(de)),d.push(f);else{const e=t.generateUID();d.push({objectId:p,uid:e,geometry:y,attributes:c,visible:!0,nodeIndex:i,level:s})}}return d}_updateNodeMemory(e){e.memory=4096+(null!=e.numFeatures?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>v(t)+e),n(e.featureIds)+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,s){this.loadedGraphics.hasNode(e.index)?i.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(t.featureIds,r,s),this.loadedGraphics.addNode(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),t.attributeInfo=r,this._attributeValuesChanged(t),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t&&null!=t.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t&&null!=t.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r&&null!=r.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){if(oe(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||b}_getGlobalIdField(){return this.layer.associatedLayer?.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,i=this._excludeObjectIdsSorted,s=this._getObjectIdField();for(const o of e.graphics){const e=o.visible,a=!t||this._evaluateClause(t,o),n=null==i||r(i,o.attributes[s])<0;o.visible=a&&n,e!==o.visible&&(de.graphic=o,de.property="visible",de.oldValue=e,de.newValue=o.visible,this.processor.graphicsCore.graphicUpdateHandler(de))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const e=()=>this.processor.featureStore;this._queryEngine=new D({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:$.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){G(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this.loadedGraphics.nodeCount,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this.loadedGraphics.nodeCount,loadedGraphics:this.loadedGraphics}}};e([l()],ee.prototype,"processor",void 0),e([l({type:w})],ee.prototype,"filter",void 0),e([l()],ee.prototype,"loadedGraphics",void 0),e([l()],ee.prototype,"i3slayer",null),e([l()],ee.prototype,"_controller",void 0),e([l()],ee.prototype,"updating",void 0),e([l()],ee.prototype,"suspended",void 0),e([l()],ee.prototype,"holeFilling",void 0),e([l(z)],ee.prototype,"updatingProgress",void 0),e([l()],ee.prototype,"updatingProgressValue",null),e([l(J.requiredFields)],ee.prototype,"requiredFields",null),e([l(J.availableFields)],ee.prototype,"availableFields",void 0),e([l()],ee.prototype,"_fieldsHelper",void 0),e([l({type:Number})],ee.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],ee.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],ee.prototype,"_excludeObjectIdsSorted",null),e([l({readOnly:!0})],ee.prototype,"lodFactor",null),e([l({readOnly:!0})],ee.prototype,"hasM",null),e([l({readOnly:!0})],ee.prototype,"hasZ",null),e([l()],ee.prototype,"contentVisible",null),e([l({readOnly:!0})],ee.prototype,"legendEnabled",null),ee=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],ee);const te=ee;function re(e){return"pointData"in e}function ie(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function se(e,t,r){const i=t.attributeInfo;if(null==i||null==i.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=H(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function oe(e){const t=e.attributeInfo,r=e.node.index;if(null!=t&&null!=t.loadedAttributes&&null!=t.attributeData)for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=H(t.attributeData[e],i))}}}function ae(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ne={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},le=h(),de={graphic:null,property:null,oldValue:null,newValue:null};export{te as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import{binaryIndexOf as r}from"../../../core/arrayUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{estimateSize as n}from"../../../core/typedArrayUtil.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as u}from"../../../chunks/vec3.js";import{c as h}from"../../../chunks/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as p}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as g,extentContainsCoords2D as m}from"../../../geometry/support/contains.js";import{newDoubleArray as y,doubleArrayFrom as f}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as _}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as b}from"../../../layers/LayerConstants.js";import{estimateSize as v}from"../../../layers/graphics/dehydratedFeatures.js";import{makeDehydratedPoint as E}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as x}from"../../../layers/graphics/hydratedFeatures.js";import I from"../../../layers/graphics/controllers/I3SOnDemandController.js";import w from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayer as O}from"../../../support/basemapUtils.js";import{I3SPointsWorkerHandle as j}from"./I3SPointsWorkerHandle.js";import{LayerView3D as C}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as F}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as D}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as S,processAttributeEdits as G}from"./i3s/featureEditing.js";import{I3SGraphicsMap as A}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as P}from"./i3s/I3SOverrides.js";import{checkRecyclable as L,checkSpatialReferences as V,containsDraco as M,whenGraphicAttributes as R,getCachedAttributeValue as H}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as U}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import{PopupSceneLayerView as Q}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as T}from"./support/SceneLayerViewRequiredFields.js";import{debugFlags as B}from"../support/debugFlags.js";import{compute as k}from"../support/orientedBoundingBox.js";import{updatingProgress as z}from"../support/updatingProperties.js";import{Vertices as W}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as Z}from"../webgl-engine/lib/UpdatePolicy.js";import K from"../../layers/SceneLayerView.js";import{hasPopupTemplate as Y}from"../../layers/support/popupUtils.js";import{TaskPriority as $}from"../../support/Scheduler.js";const J=q();class X{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}}let ee=class extends(U(Q(C(K)))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this.loadedGraphics=new A(((e,t,r)=>se(e,t,r)),(e=>this.processor.graphicsCore.recreateGraphics(e))),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then((()=>{L(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const t=this.view.resourceController?.memoryController;this._i3sOverrides=new P({view:this.view,layer:e,memoryController:t}),s(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()})):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new P({view:this.view,layer:this.layer,memoryController:e}),V(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new T({layerView:this}),this._updatingHandles.add((()=>this.layer.rangeInfos),(e=>this._rangeInfosChanged(e)),o),this._updatingHandles.add((()=>this.layer.renderer),((e,t)=>this._rendererChange(e,t))),this._updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.addHandles(a((()=>B.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&B.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||B.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),o)),this._set("processor",new F({owner:this,preferredUpdatePolicy:Z.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(e=>this._controller.updateElevationChanged(e.extent,e.spatialReference))),this.supportsHeightUnitConversion&&(this._verticalScale=_("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new I({layerView:this,scaleVisibilityEnabled:!1}),M(this.layer.geometryDefinitions)&&(this._worker=new j((e=>this.view.resourceController.immediate.schedule(e)))),this.addHandles(this.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))),this.addHandles(this.layer.on("edits",(e=>this._handleEdits(e)))),this.when((()=>{this._setupQueryEngine(),this._updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),o),this._updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=s(this._treeDebugger),this._i3sOverrides=s(this._i3sOverrides),this._set("processor",s(this.processor)),this._controller=s(this._controller),this._queryEngine=s(this._queryEngine),this._worker=s(this._worker),this._memCache=s(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=s(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(e,t){return R(this.layer,e,this._getObjectIdField(),t,(()=>[...this.loadedGraphics.nodes()]))}getHit(e){if(!this.loadedGraphics)return null;const t=x(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t&&t.attributes&&t.attributes[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return S(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new j((e=>this.view.resourceController.immediate.schedule(e))));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,t,r){if(!ie(t)&&!re(t))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void i.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?ae(this.layer.fullExtent.clone(),.5):null,o=[],{featureIds:a,pointPositions:n}=ie(t)?await this._extractBinaryPointPositions(e,t,r):this._extractLegacyPointPositions(t);this._validatePositions(e,a,n,s,o);const l=this._controller.crsVertex,d=this.view.spatialReference;c(n,l,0,n,d,0,a.length);const u=ie(t)?e.level:0,h=this._createGraphics(a,n,e.index,u),p=new X(h,a,t.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,t.attributeDataInfo,r),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),oe(p),o.length>0&&(this._computeObb(e,o,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const i of p.graphics)this._verticalScale(i.geometry);const g=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(null!=g){const e=O(this.view.map,this.layer.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];g.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled&&!e&&Y(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0,t.length/3),e.serviceObb=k(new W(t,3)),i.isGeographic&&p(e.serviceObb.center,s,e.serviceObb.center,i)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=y(3*a),l=null!=e.serviceObb?e.serviceObb.center:[0,0,0],d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?f(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=y(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ne[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,t,r,s,o){if(null==s&&e.serviceObb)return;const a=t.length,n=3;for(let l=0;l<a;l++){const t=l*n;u(le,r[t],r[t+1],r[t+2]);const a=!Number.isNaN(r[2]);null==s||(a?g(s,le):m(s,le))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&i.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&i.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObb||o.push(le[0],le[1],le[2])}}_createGraphics(e,r,i,s){const o=e.length,a=3,n=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<o;h++){const o=e[h],c={};null!=o&&(c[n]=o);const p=o??t.generateUID(),g=h*a,m=isNaN(r[g+2])?void 0:r[g+2],y=E(r[g],r[g+1],m,u),f=this.loadedGraphics.get(p);if(null!=f)(null==f.level||f.level<s)&&(de.property="geometry",de.graphic=f,de.oldValue=f.geometry,de.newValue=y,f.geometry=y,f.level=s,l.graphicUpdateHandler(de)),d.push(f);else{const e=t.generateUID();d.push({objectId:p,uid:e,geometry:y,attributes:c,visible:!0,nodeIndex:i,level:s})}}return d}_updateNodeMemory(e){e.memory=4096+(null!=e.numFeatures?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>v(t)+e),n(e.featureIds)+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,r,s){this.loadedGraphics.hasNode(e.index)?i.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(t.featureIds,r,s),this.loadedGraphics.addNode(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),t.attributeInfo=r,this._attributeValuesChanged(t),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t&&null!=t.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t&&null!=t.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r&&null!=r.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){if(oe(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map((e=>e.uid));this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||b}_getGlobalIdField(){return this.layer.associatedLayer?.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,i=this._excludeObjectIdsSorted,s=this._getObjectIdField();for(const o of e.graphics){const e=o.visible,a=!t||this._evaluateClause(t,o),n=null==i||r(i,o.attributes[s])<0;o.visible=a&&n,e!==o.visible&&(de.graphic=o,de.property="visible",de.oldValue=e,de.newValue=o.visible,this.processor.graphicsCore.graphicUpdateHandler(de))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const e=()=>this.processor.featureStore;this._queryEngine=new D({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:$.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}_handleEdits(e){G(this._attributeEditingContext,e)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this.loadedGraphics.nodeCount,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this.loadedGraphics.nodeCount,loadedGraphics:this.loadedGraphics}}};e([l()],ee.prototype,"processor",void 0),e([l({type:w})],ee.prototype,"filter",void 0),e([l()],ee.prototype,"loadedGraphics",void 0),e([l()],ee.prototype,"i3slayer",null),e([l()],ee.prototype,"_controller",void 0),e([l()],ee.prototype,"updating",void 0),e([l()],ee.prototype,"suspended",void 0),e([l()],ee.prototype,"holeFilling",void 0),e([l(z)],ee.prototype,"updatingProgress",void 0),e([l()],ee.prototype,"updatingProgressValue",null),e([l(J.requiredFields)],ee.prototype,"requiredFields",null),e([l(J.availableFields)],ee.prototype,"availableFields",void 0),e([l()],ee.prototype,"_fieldsHelper",void 0),e([l({type:Number})],ee.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],ee.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],ee.prototype,"_excludeObjectIdsSorted",null),e([l({readOnly:!0})],ee.prototype,"lodFactor",null),e([l({readOnly:!0})],ee.prototype,"hasM",null),e([l({readOnly:!0})],ee.prototype,"hasZ",null),e([l()],ee.prototype,"contentVisible",null),e([l({readOnly:!0})],ee.prototype,"legendEnabled",null),ee=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],ee);const te=ee;function re(e){return"pointData"in e}function ie(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function se(e,t,r){const i=t.attributeInfo;if(null==i||null==i.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=H(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function oe(e){const t=e.attributeInfo,r=e.node.index;if(null!=t&&null!=t.loadedAttributes&&null!=t.attributeData)for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=H(t.attributeData[e],i))}}}function ae(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ne={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},le=h(),de={graphic:null,property:null,oldValue:null,newValue:null};export{te as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import e from"../../../../core/PooledArray.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{p as o}from"../../../../chunks/mat4.js";import{a as c}from"../../../../chunks/mat4f64.js";import{a as n}from"../../../../chunks/vec2f64.js";import{e as l,i as h,s as p,c as u}from"../../../../chunks/vec3.js";import{Z as d,c as f}from"../../../../chunks/vec3f64.js";import{s as _,t as m,b as g}from"../../../../chunks/vec4.js";import{c as b}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{create as y,empty as G,offset as S,width as B,height as D,expand as w,intersects as N}from"../../../../geometry/support/aaBoundingRect.js";import{a as j,c as I,e as V}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{d as P,g as A,i as O,c as M}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as x,prepare as z,drawPoly as E}from"./deconflictorDebug.js";import{VisibilityGroup as T,VisibilityFlag as X}from"./enums.js";import{Camera as F}from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as Y}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";import{ScaleInfo as R}from"../../webgl-engine/materials/ScaleInfo.js";const U=f(),W=b(),H=b(),Z=f(),q=c(),J=M(),K=C(),Q=f(),$=y();class ii{constructor(){this.aabr=y(),this.distance=0,this.culled=!1,this.visible=!1}}class ti{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info={}}}var si;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(si||(si={}));class ei{constructor(){this.camera=new F,this.slicePlane=j(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),I(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let ri=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._runningViewState=new ei,this._state=si.Idle,this._active=new Map,this._visible=new Map,this._iterators=new li,this._accBinsNumX=15,this._accBinsNumY=20,this._accBinsSizeX=0,this._accBinsSizeY=0,this._accBins=null,this.accNumTests=0}destroy(){this._active.clear(),this._visible.clear(),this._iterators=null}setDirty(){!this._dirty&&this._active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==si.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/si.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case si.Idle:this._startUpdate(),i.madeProgress();case si.Process:if(this._state=si.Process,!this._processActiveGraphics(i))return;case si.Sort:if(this._state=si.Sort,!this._sortVisibleGraphics(i))return;case si.Deconflict:if(this._state=si.Deconflict,!this._deconflictVisibleGraphics(i))return;default:x(this,this._visible),this._state=si.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(null==i||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?.geometries.length??0))return!1;const s=t?.geometries[0],e=s?.material;return e instanceof k}_startUpdate(){z(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new ii,this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._visible.delete(i.graphics3DGraphic.graphic.uid),ai(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=o(q,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?J:null;let r=0;for(null!=e&&(l(e,d,this._runningViewState.camera.viewMatrix),e[3]=v(this.view.spatialReference).radius,r=P(e,d));!i.done;){i.madeProgress();const a=t.next();if(!0===a.done)return this._resetActiveGraphicsIterator(),!0;const o=a.value,c=o&&o.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(o,s,e,r),c.culled?this._visible.delete(o.graphics3DGraphic.graphic.uid):this._visible.set(o.graphics3DGraphic.graphic.uid,o))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===T.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled){this._setGraphicVisibility(r,!1);continue}const o=r.graphics3DGraphic,c=!s||o.isVisible();a.visible=c&&!this._isConflicted(r),a.visible&&this._addToBins(r),this._setGraphicVisibility(r,a.visible),E(a,a.visible)}return!1}_resetIterators(){this._iterators.active=null,this._iterators.visible=null,this._iterators.sort=null}_ensureActiveGraphicsIterator(){return this._iterators.active||(this._iterators.active=oi(this._active)),this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){return this._iterators.visible||(this._iterators.visible=oi(this._visible)),this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){return this._iterators.sort||(this._iterators.sort=ci(this._visible,this._iterators.sortArray,this.visibilityGroup)),this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(i,t,s,e){const r=i.graphics3DGraphic;if(r.destroyed)return;const a=i.info[this.visibilityGroup];if(!r.isVisible(T.GRAPHIC,X.DECONFLICTION))return void(a.culled=!0);const o=this.getGraphicsLayers(r);G(a.aabr);let c=null;for(const n of o){if(!this.layerSupportsDeconfliction(n))continue;const r=n.stageObject.geometries[0].material;if(null==c&&(c=ui,this._getProjectionInfo(n,t,c),c.isOutsideScreen||this._isCulledBySlice(i,U)||null!=s&&this._isCulledByHorizon(c,s,e)))return void(a.culled=!0);this._expandBoundingRect(a,n,r,c)}null==c?a.culled=!0:(a.distance=c.distance,a.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometries[0],o=a.material,c=A(r.boundingVolumeWorldSpace.bounds);l(U,c,e.viewMatrix);const n=a.vertexAttributes,u=n.get(Y.NORMAL).data,d=n.get(Y.AUXPOS1).data;o.applyShaderOffsetsView(U,u,r.transformation,d,e,s.scaleInfo,U),_(W,U[0],U[1],U[2],1),m(H,W,e.projectionMatrix),h(s.positionNDC,H,1/H[3]),o.applyShaderOffsetsNDC(s.positionNDC,d,e,s.positionNDC,Z),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(Z[2]),s.distance=Z[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),_(H,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),m(W,H,t),g(W,W,1/W[3]),p(s.positionView,U[0],U[1],U[2])}_isCulledByHorizon(i,t,s){return u(K.direction,i.positionView),p(K.origin,0,0,0),!!O(t,K,Q)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&V(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(hi);L(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=S(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,$),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),l=this.marginFactor;if(0!==l){const i=l*Math.min(B(n),D(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}w(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];let e=!0;for(let r=Math.floor(s.aabr[0]/this._accBinsSizeX);r<=Math.floor(s.aabr[2]/this._accBinsSizeX);r++)if(!(r<0||r>=this._accBinsNumX))for(let i=Math.floor(s.aabr[1]/this._accBinsSizeY);i<=Math.floor(s.aabr[3]/this._accBinsSizeY);i++){if(i<0||i>=this._accBinsNumY)continue;e=!1;const a=this._accBins[r][i];for(let i=0;i<a.length;i++){const e=a.data[i],r=e.info[this.visibilityGroup];if(r&&r.visible&&e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,N(r.aabr,s.aabr)))return!0}}return e}_initBins(i,t){if(null==this._accBins){this._accBins=[];for(let i=0;i<this._accBinsNumX;i++){this._accBins.push([]);const i=this._accBins[this._accBins.length-1];for(let t=0;t<this._accBinsNumY;t++)i.push(new e)}}else for(let s=0;s<this._accBinsNumX;s++)for(let i=0;i<this._accBinsNumY;i++)this._accBins[s][i].clear();this._accBinsSizeX=i/this._accBinsNumX,this._accBinsSizeY=t/this._accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this._accBinsSizeX),e=Math.floor(t.aabr[2]/this._accBinsSizeX),r=Math.floor(t.aabr[1]/this._accBinsSizeY),a=Math.floor(t.aabr[3]/this._accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this._accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this._accBinsNumY||this._accBins[o][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(this.visibilityGroup,X.DECONFLICTION,t),this.visibilityGroup===T.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function ai(i,t){const s=i.graphics3DGraphic;s.destroyed||s.setVisibilityFlag(t,X.DECONFLICTION,!0)}function*oi(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ci(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.visible=i.graphics3DGraphic.getVisibilityFlag(s,X.DECONFLICTION);const a=i.info&&i.info[s];r.prio=i.graphics3DGraphic.deconflictionPriority,r.distance=a?a.distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>i.prio!==t.prio?t.prio-i.prio:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?i.visible?-1:1:i.id-t.id));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([r({constructOnly:!0})],ri.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],ri.prototype,"updating",null),ri=i([a("esri.views.3d.layers.graphics.Deconflictor")],ri);class ni{constructor(){this.id=0,this.visible=!1,this.prio=0,this.distance=0}}class li{constructor(i=null,t=null,s=null){this.active=i,this.visible=t,this.sort=s,this.sortArray=new e({allocator:i=>i||new ni})}}const hi=n();class pi{constructor(){this.positionView=f(),this.positionNDC=f(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo=new R}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const ui=new pi;export{ri as Deconflictor,ti as DeconflictorGraphic,ei as DeconflictorViewState,si as State};
5
+ import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import e from"../../../../core/PooledArray.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{p as o}from"../../../../chunks/mat4.js";import{a as c}from"../../../../chunks/mat4f64.js";import{a as n}from"../../../../chunks/vec2f64.js";import{e as l,i as h,s as p,c as u}from"../../../../chunks/vec3.js";import{Z as d,c as f}from"../../../../chunks/vec3f64.js";import{s as _,t as m,b as g}from"../../../../chunks/vec4.js";import{c as b}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{create as y,empty as G,offset as S,width as B,height as D,expand as w,intersects as N}from"../../../../geometry/support/aaBoundingRect.js";import{a as j,c as I,e as V}from"../../../../chunks/boundedPlane.js";import{create as C}from"../../../../geometry/support/ray.js";import{d as P,g as A,i as O,c as M}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as x,prepare as z,drawPoly as E}from"./deconflictorDebug.js";import{VisibilityGroup as T,VisibilityFlag as X}from"./enums.js";import{Camera as F}from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as L}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as Y}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as k}from"../../webgl-engine/materials/HUDMaterial.js";import{ScaleInfo as R}from"../../webgl-engine/materials/ScaleInfo.js";const U=f(),W=b(),H=b(),Z=f(),q=c(),J=M(),K=C(),Q=f(),$=y();class ii{constructor(){this.aabr=y(),this.distance=0,this.culled=!1,this.visible=!1}}class ti{constructor(i,t){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info={}}}var si;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(si||(si={}));class ei{constructor(){this.camera=new F,this.slicePlane=j(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),I(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let ri=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(i){super(i),this._dirty=!1,this._runningViewState=new ei,this._state=si.Idle,this._active=new Map,this._visible=new Map,this._iterators=new li,this._accBinsNumX=15,this._accBinsNumY=20,this._accBinsSizeX=0,this._accBinsSizeY=0,this._accBins=null,this.accNumTests=0}destroy(){this._active.clear(),this._visible.clear(),this._iterators=null}setDirty(){!this._dirty&&this._active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==si.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/si.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case si.Idle:this._startUpdate(),i.madeProgress();case si.Process:if(this._state=si.Process,!this._processActiveGraphics(i))return;case si.Sort:if(this._state=si.Sort,!this._sortVisibleGraphics(i))return;case si.Deconflict:if(this._state=si.Deconflict,!this._deconflictVisibleGraphics(i))return;default:x(this,this._visible),this._state=si.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(null==i||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?.geometries.length??0))return!1;const s=t?.geometries[0],e=s?.material;return e instanceof k}_startUpdate(){z(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new ii,this._active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._visible.delete(i.graphics3DGraphic.graphic.uid),ai(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this._active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=o(q,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?J:null;let r=0;for(null!=e&&(l(e,d,this._runningViewState.camera.viewMatrix),e[3]=v(this.view.spatialReference).radius,r=P(e,d));!i.done;){i.madeProgress();const a=t.next();if(!0===a.done)return this._resetActiveGraphicsIterator(),!0;const o=a.value,c=o&&o.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(o,s,e,r),c.culled?this._visible.delete(o.graphics3DGraphic.graphic.uid):this._visible.set(o.graphics3DGraphic.graphic.uid,o))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===T.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled){this._setGraphicVisibility(r,!1);continue}const o=r.graphics3DGraphic,c=!s||o.isVisible();a.visible=c&&!this._isConflicted(r),a.visible&&this._addToBins(r),this._setGraphicVisibility(r,a.visible),E(a,a.visible)}return!1}_resetIterators(){this._iterators.active=null,this._iterators.visible=null,this._iterators.sort=null}_ensureActiveGraphicsIterator(){return this._iterators.active||(this._iterators.active=oi(this._active)),this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){return this._iterators.visible||(this._iterators.visible=oi(this._visible)),this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){return this._iterators.sort||(this._iterators.sort=ci(this._visible,this._iterators.sortArray,this.visibilityGroup)),this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(i,t,s,e){const r=i.graphics3DGraphic;if(r.destroyed)return;const a=i.info[this.visibilityGroup];if(!r.isVisible(T.GRAPHIC,X.DECONFLICTION))return void(a.culled=!0);const o=this.getGraphicsLayers(r);G(a.aabr);let c=null;for(const n of o){if(!this.layerSupportsDeconfliction(n))continue;const r=n.stageObject.geometries[0].material;if(null==c&&(c=ui,this._getProjectionInfo(n,t,c),c.isOutsideScreen||this._isCulledBySlice(i,U)||null!=s&&this._isCulledByHorizon(c,s,e)))return void(a.culled=!0);this._expandBoundingRect(a,n,r,c)}null==c?a.culled=!0:(a.distance=c.distance,a.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometries[0],o=a.material,c=A(r.boundingVolumeWorldSpace.bounds);l(U,c,e.viewMatrix);const n=a.attributes,u=n.get(Y.NORMAL).data,d=n.get(Y.AUXPOS1).data;o.applyShaderOffsetsView(U,u,r.transformation,d,e,s.scaleInfo,U),_(W,U[0],U[1],U[2],1),m(H,W,e.projectionMatrix),h(s.positionNDC,H,1/H[3]),o.applyShaderOffsetsNDC(s.positionNDC,d,e,s.positionNDC,Z),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(Z[2]),s.distance=Z[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),_(H,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),m(W,H,t),g(W,W,1/W[3]),p(s.positionView,U[0],U[1],U[2])}_isCulledByHorizon(i,t,s){return u(K.direction,i.positionView),p(K.origin,0,0,0),!!O(t,K,Q)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&V(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(hi);L(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=S(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,$),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),l=this.marginFactor;if(0!==l){const i=l*Math.min(B(n),D(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}w(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];let e=!0;for(let r=Math.floor(s.aabr[0]/this._accBinsSizeX);r<=Math.floor(s.aabr[2]/this._accBinsSizeX);r++)if(!(r<0||r>=this._accBinsNumX))for(let i=Math.floor(s.aabr[1]/this._accBinsSizeY);i<=Math.floor(s.aabr[3]/this._accBinsSizeY);i++){if(i<0||i>=this._accBinsNumY)continue;e=!1;const a=this._accBins[r][i];for(let i=0;i<a.length;i++){const e=a.data[i],r=e.info[this.visibilityGroup];if(r&&r.visible&&e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,N(r.aabr,s.aabr)))return!0}}return e}_initBins(i,t){if(null==this._accBins){this._accBins=[];for(let i=0;i<this._accBinsNumX;i++){this._accBins.push([]);const i=this._accBins[this._accBins.length-1];for(let t=0;t<this._accBinsNumY;t++)i.push(new e)}}else for(let s=0;s<this._accBinsNumX;s++)for(let i=0;i<this._accBinsNumY;i++)this._accBins[s][i].clear();this._accBinsSizeX=i/this._accBinsNumX,this._accBinsSizeY=t/this._accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this._accBinsSizeX),e=Math.floor(t.aabr[2]/this._accBinsSizeX),r=Math.floor(t.aabr[1]/this._accBinsSizeY),a=Math.floor(t.aabr[3]/this._accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this._accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this._accBinsNumY||this._accBins[o][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(this.visibilityGroup,X.DECONFLICTION,t),this.visibilityGroup===T.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function ai(i,t){const s=i.graphics3DGraphic;s.destroyed||s.setVisibilityFlag(t,X.DECONFLICTION,!0)}function*oi(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ci(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.visible=i.graphics3DGraphic.getVisibilityFlag(s,X.DECONFLICTION);const a=i.info&&i.info[s];r.prio=i.graphics3DGraphic.deconflictionPriority,r.distance=a?a.distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>i.prio!==t.prio?t.prio-i.prio:i.distance!==t.distance?i.distance-t.distance:i.visible!==t.visible?i.visible?-1:1:i.id-t.id));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([r({constructOnly:!0})],ri.prototype,"view",void 0),i([r({type:Boolean,readOnly:!0})],ri.prototype,"updating",null),ri=i([a("esri.views.3d.layers.graphics.Deconflictor")],ri);class ni{constructor(){this.id=0,this.visible=!1,this.prio=0,this.distance=0}}class li{constructor(i=null,t=null,s=null){this.active=i,this.visible=t,this.sort=s,this.sortArray=new e({allocator:i=>i||new ni})}}const hi=n();class pi{constructor(){this.positionView=f(),this.positionNDC=f(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo=new R}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const ui=new pi;export{ri as Deconflictor,ti as DeconflictorGraphic,ei as DeconflictorViewState,si as State};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{h as t}from"../../../../chunks/mat4.js";import{a as e}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as n}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as r}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as a}from"../../../../geometry/projection/projectBuffer.js";import{SampleElevationInfo as s}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as i}from"./graphicUtils.js";import{debugFlags as l}from"../../support/debugFlags.js";import{SamplePosition as m}from"../../support/ElevationProvider.js";import{isGeometryWithMapPositions as f}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{VertexAttribute as c}from"../../webgl-engine/lib/VertexAttribute.js";function u(t,e,o,n,r){const a=t.stageObject,s=a.geometries;let i=0;for(const l of s){if(!f(l))continue;const{update:t,averageGeometrySampledElevation:s}=A(l,e,o,n,r);i+=s,t&&a.geometryVertexAttrsUpdated(l)}return i/s.length}function p(e,n,a,s,m,f){const c=e.stageObject,u=n.centerPointInElevationSR;let p=0;if(c.usesVerticalDistanceToGround)s(u,j),i(c,j.verticalDistanceToGround),p=j.sampledElevation;else{s(u,j);"absolute-height"!==n.mode&&(p=j.sampledElevation)}const d=t(g,f??c.transformation),I=o(E,d[12],d[13],d[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=u.x,T[1]=u.y,T[2]=j.z,r(u.spatialReference,T,d,m.spatialReference)&&(f?t(f,d):c.transformation=d)):m.setAltitudeOfTransformation(j.z,d);const h=b/m.unitInMeters;return(Math.abs(d[12]-I[0])>=h||Math.abs(d[13]-I[1])>=h||Math.abs(d[14]-I[2])>=h)&&(f?t(f,d):c.transformation=d),p}const g=e();function d(t,e,n,a,s){const i=t.graphics3DSymbolLayer.lodRenderer;if(null==i)return 0;const m=e.centerPointInElevationSR;a(m,j);const f="absolute-height"!==e.mode?j.sampledElevation:0,c=i.instanceData,u=t.instanceIndex,p=v;c.getGlobalTransform(u,p);const g=o(E,p[12],p[13],p[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=m.x,T[1]=m.y,T[2]=j.z,r(m.spatialReference,T,p,s.spatialReference)&&c.setGlobalTransform(u,p)):s.setAltitudeOfTransformation(j.z,p);const d=b/s.unitInMeters;return(l.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(p[12]-g[0])>=d||Math.abs(p[13]-g[1])>=d||Math.abs(p[14]-g[2])>=d)&&c.setGlobalTransform(u,p),f}function I(t,e,o,n,r){const a=t.stageObject,s=a.geometries;if(0===s.length)return 0;let i=0,l=null,m=0,u=!1;for(const p of s){if(!f(p))continue;const t=p.vertexAttributes.get(c.POSITION);if(t!==l){const{update:a,averageGeometrySampledElevation:s}=A(p,e,o,n,r);m=s,l=t,u=a}u&&a.geometryVertexAttrsUpdated(p),i+=m}return i/s.length}const b=.01,T=n(),h=n(),S=n(),v=e(),E=n(),j=new s;function A(t,e,o,n,r){let s=!1;const i=t.transformation,f=e.requiresSampledElevationInfo;h[0]=i[12],h[1]=i[13],h[2]=i[14],t.invalidateBoundingInfo();const u=t.getMutableAttribute(c.POSITION),p=u.data,g=u.size,d=p.length/g,I=new m(t.mapPositions,o);let v=0,E=0;for(let m=0;m<d;m++){if(S[0]=p[v],S[1]=p[v+1],S[2]=p[v+2],n(I,j),f&&(E+=j.sampledElevation),l.TESTS_DISABLE_OPTIMIZATIONS)p[v]=I.array[I.offset],p[v+1]=I.array[I.offset+1],p[v+2]=j.z,a(p,o,v,p,r.spatialReference,v,1),p[v]-=h[0],p[v+1]-=h[1],p[v+2]-=h[2],s=!0;else{T[0]=p[v]+h[0],T[1]=p[v+1]+h[1],T[2]=p[v+2]+h[2],r.setAltitude(T,j.z),p[v]=T[0]-h[0],p[v+1]=T[1]-h[1],p[v+2]=T[2]-h[2];const t=b/r.unitInMeters;(Math.abs(S[0]-p[v])>=t||Math.abs(S[1]-p[v+1])>=t||Math.abs(S[2]-p[v+2])>=t)&&(s=!0)}v+=g,I.offset+=3}return E/=d,{update:s,averageGeometrySampledElevation:E}}export{d as perLodInstanceElevationAligner,p as perObjectElevationAligner,u as perVertexElevationAligner,I as sharedGeometryElevationAligner};
5
+ import{h as t}from"../../../../chunks/mat4.js";import{a as e}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as n}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as a}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as r}from"../../../../geometry/projection/projectBuffer.js";import{SampleElevationInfo as s}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as i}from"./graphicUtils.js";import{debugFlags as l}from"../../support/debugFlags.js";import{SamplePosition as m}from"../../support/ElevationProvider.js";import{isGeometryWithMapPositions as f}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{VertexAttribute as c}from"../../webgl-engine/lib/VertexAttribute.js";function u(t,e,o,n,a){const r=t.stageObject,s=r.geometries;let i=0;for(const l of s){if(!f(l))continue;const{update:t,averageGeometrySampledElevation:s}=M(l,e,o,n,a);i+=s,t&&r.geometryVertexAttrsUpdated(l)}return i/s.length}function p(e,n,r,s,m,f){const c=e.stageObject,u=n.centerPointInElevationSR;let p=0;if(c.usesVerticalDistanceToGround)s(u,j),i(c,j.verticalDistanceToGround),p=j.sampledElevation;else{s(u,j);"absolute-height"!==n.mode&&(p=j.sampledElevation)}const d=t(g,f??c.transformation),I=o(E,d[12],d[13],d[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=u.x,T[1]=u.y,T[2]=j.z,a(u.spatialReference,T,d,m.spatialReference)&&(f?t(f,d):c.transformation=d)):m.setAltitudeOfTransformation(j.z,d);const h=b/m.unitInMeters;return(Math.abs(d[12]-I[0])>=h||Math.abs(d[13]-I[1])>=h||Math.abs(d[14]-I[2])>=h)&&(f?t(f,d):c.transformation=d),p}const g=e();function d(t,e,n,r,s){const i=t.graphics3DSymbolLayer.lodRenderer;if(null==i)return 0;const m=e.centerPointInElevationSR;r(m,j);const f="absolute-height"!==e.mode?j.sampledElevation:0,c=i.instanceData,u=t.instanceIndex,p=v;c.getGlobalTransform(u,p);const g=o(E,p[12],p[13],p[14]);l.TESTS_DISABLE_OPTIMIZATIONS?(T[0]=m.x,T[1]=m.y,T[2]=j.z,a(m.spatialReference,T,p,s.spatialReference)&&c.setGlobalTransform(u,p)):s.setAltitudeOfTransformation(j.z,p);const d=b/s.unitInMeters;return(l.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(p[12]-g[0])>=d||Math.abs(p[13]-g[1])>=d||Math.abs(p[14]-g[2])>=d)&&c.setGlobalTransform(u,p),f}function I(t,e,o,n,a){const r=t.stageObject,s=r.geometries;if(0===s.length)return 0;let i=0,l=null,m=0,u=!1;for(const p of s){if(!f(p))continue;const t=p.attributes.get(c.POSITION);if(t!==l){const{update:r,averageGeometrySampledElevation:s}=M(p,e,o,n,a);m=s,l=t,u=r}u&&r.geometryVertexAttrsUpdated(p),i+=m}return i/s.length}const b=.01,T=n(),h=n(),S=n(),v=e(),E=n(),j=new s;function M(t,e,o,n,a){let s=!1;const i=t.transformation,f=e.requiresSampledElevationInfo;h[0]=i[12],h[1]=i[13],h[2]=i[14],t.invalidateBoundingInfo();const u=t.getMutableAttribute(c.POSITION),p=u.data,g=u.size,d=p.length/g,I=new m(t.mapPositions,o);let v=0,E=0;for(let m=0;m<d;m++){if(S[0]=p[v],S[1]=p[v+1],S[2]=p[v+2],n(I,j),f&&(E+=j.sampledElevation),l.TESTS_DISABLE_OPTIMIZATIONS)p[v]=I.array[I.offset],p[v+1]=I.array[I.offset+1],p[v+2]=j.z,r(p,o,v,p,a.spatialReference,v,1),p[v]-=h[0],p[v+1]-=h[1],p[v+2]-=h[2],s=!0;else{T[0]=p[v]+h[0],T[1]=p[v+1]+h[1],T[2]=p[v+2]+h[2],a.setAltitude(T,j.z),p[v]=T[0]-h[0],p[v+1]=T[1]-h[1],p[v+2]=T[2]-h[2];const t=b/a.unitInMeters;(Math.abs(S[0]-p[v])>=t||Math.abs(S[1]-p[v+1])>=t||Math.abs(S[2]-p[v+2])>=t)&&(s=!0)}v+=g,I.offset+=3}return E/=d,{update:s,averageGeometrySampledElevation:E}}export{d as perLodInstanceElevationAligner,p as perObjectElevationAligner,u as perVertexElevationAligner,I as sharedGeometryElevationAligner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as s}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{n}from"../../../../chunks/mat3.js";import{a as i}from"../../../../chunks/mat3f64.js";import{i as o,p as a}from"../../../../chunks/mat4.js";import{a as l}from"../../../../chunks/mat4f64.js";import{c,n as m,s as h,f as p,b as g,e as d}from"../../../../chunks/vec3.js";import{e as u,c as f}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as y}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,empty as _,expandWithBuffer as j,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as P}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as S,getZeroIndexArray as w}from"../../../../geometry/support/Indices.js";import{t as E}from"../../../../chunks/vec32.js";import{makeVertexCandidate as v,makeEdgeCandidate as C}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as L}from"../../../../renderers/support/renderingInfoUtils.js";import{ViewingMode as M}from"../../../ViewingMode.js";import{needsElevationUpdates3D as I,SampleElevationInfo as A}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as O}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as B,computeCentroid as D}from"./graphicUtils.js";import{ApplyRendererDiffResult as G}from"./interfaces.js";import{geometryAsPolygon as R}from"./polygonUtils.js";import{createMaterial as U}from"../support/edgeUtils.js";import{debugFlags as T}from"../../support/debugFlags.js";import{SamplePosition as k}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as V}from"../../support/renderInfoUtils/polygon.js";import{NormalType as N}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{Attribute as H}from"../../webgl-engine/lib/Attribute.js";import{CullFaceOptions as F}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as W}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as q}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as Z}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as J}from"../../webgl-engine/lib/Normals.js";import{Object3D as K}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as Q}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as X}from"../../webgl-engine/materials/DefaultMaterial.js";const Y=["polygon","extent"];class $ extends z{constructor(e,t,s,r){super(e,t,s,r),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=B(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const t=this.symbolLayer?.material?.color,s=this._getCombinedOpacityAndColor(t),r=u(s),n=s[3],i=n<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:r,ambient:r,opacity:n,transparent:i,cullFace:i?F.None:F.Back,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0,normalType:N.Compressed};this._materials[je.Main]=new X(o),this._materials[je.Bottom]=new X({...o,cullFace:F.Back}),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,Y,this.symbolLayer.type))return null;const s=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t);return this._createAs3DShape(t,e.renderingInfo,s,r,t.uid)}layerOpacityChanged(e,t){const s=this.symbolLayer?.material?.color,r=this._getCombinedOpacity(s),n=r<1||this.needsDrivenTransparentPass;this._materials[je.Main]?.setParameters({opacity:r,transparent:n}),this._materials[je.Bottom]?.setParameters({opacity:r,transparent:n});const i=this._getLayerOpacity();e.forEach((e=>{const s=t(e);null!=s&&s.layerOpacityChanged(i,this._context.isAsync)}))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,I)}slicePlaneEnabledChanged(e,t){return this._materials[je.Main]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[je.Bottom]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e.forEach((e=>{const s=t(e);null!=s&&s.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[je.Main]?.setParameters(e),this._materials[je.Bottom]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?L(e.size,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?G.RecreateSymbol:G.RecreateGraphics}async queryForSnapping(e,r,n,i){const o=this._getExtrusionSize(n)*this._context.renderCoordsHelper.unitInMeters/s(r),{objectId:a,target:l}=e,c=t(l);switch(c.z=(c.z??0)+o,e.type){case"edge":{const{start:s,end:r}=e,n=t(s),i=t(r);return n.z=(n.z??0)+o,i.z=(i.z??0)+o,[C(a,c,1/0,n,i)]}case"vertex":return[v(a,c,1/0),C(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,s,a,c){const m=R(e.geometry);if(null==m)return null;if(0===m.rings.length||!m.rings.some((e=>e.length>0)))return this._logGeometryValidationWarnings(m.rings,"rings","ExtrudeSymbol3DLayer"),null;const h=V(m,this._context.elevationProvider,this._context.renderCoordsHelper,a);this._logGeometryCreationWarnings(h,m.rings,"rings","ExtrudeSymbol3DLayer");const p=D(m);if(null==p)return null;const g=new Array,d=new Array,u=b(),w=l(),v=f(),C=this._context.renderCoordsHelper.viewingMode===M.Global;C||this._context.renderCoordsHelper.worldUpAtPosition(null,v),y(m.spatialReference,[p.x,p.y,0],w,this._context.renderCoordsHelper.spatialReference);const L=l();o(L,w);const A=i();n(A,L);const{polygons:z,mapPositions:B,position:G}=h;for(const n of z){const e=n.count;if(this._context.clippingExtent&&(_(u),j(u,n.mapPositions),!x(u,this._context.clippingExtent)))continue;const i=r(n.mapPositions,n.holeIndices,3);if(0===i.length)continue;const o=i.length,a=6*e,l=S(a+o),m=S(o),h=P(3*a),p=P(3*a),f=P(3*a),y=P(a);te(G,B,i,n,h,f,p,y,l,m,this._getExtrusionSize(t),v,C),E(h,h,L);const b=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerUid:this._context.layer.uid}),w=new xe(h,f,J(p),y);g.push(ee(this._materials[je.Main],l,l.length-m.length,w,s,b),ee(this._materials[je.Bottom],m,0,w,s,b)),d.push(w.heights)}if(0===g.length)return null;const T=new K({geometries:g,layerUid:this._context.layer.uid,graphicUid:c,isElevationSource:!0});T.transformation=w;const k=U(this.symbolLayer,{opacity:this._getLayerOpacity()}),N=null!=k?{baseMaterial:this._materials[je.Main],edgeMaterials:[k],properties:{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}}:null,H=new O(this,T,g,null,null,((e,t,s,r,n)=>ge(e,t,s,r,n,d)),a,N);return H.alignedSampledElevation=h.sampledElevation,H.needsElevationUpdates=I(a.mode),H}}function ee(e,t,s,r,n,i){const o=w(t.length),a=[[Q.POSITION,new H(r.positions,3,!0),t],[Q.NORMALCOMPRESSED,new H(r.normals,2,!0),t],[Q.COLOR,new H(n,4,!0),o]];return new q(e,a,r.elevation,W.Mesh,i,s)}function te(e,t,s,r,n,i,o,a,l,c,m,h,p){const g=s.length/3;let d=0,u=2*r.count;se(e,t,r.index,r.count,s,0,g,n,i,o,a,l,c,u,m,h,p);let f=2*r.count;u=0,ie(n,i,a,o,d,r.pathLengths[0],r.count,f,l,u,m),f+=4*r.pathLengths[0],u+=2*r.pathLengths[0],d+=r.pathLengths[0];for(let y=1;y<r.pathLengths.length;++y)ie(n,i,a,o,d,r.pathLengths[y],r.count,f,l,u,m),f+=4*r.pathLengths[y],u+=2*r.pathLengths[y],d+=r.pathLengths[y]}function se(e,t,s,r,n,i,o,a,l,h,p,g,d,u,f,y,b){c(ue,y);const _=f>0?1:-1;let j=3*s,x=0,P=3*x,S=r,w=3*S;for(let c=0;c<r;++c)b&&(ue[0]=e[j],ue[1]=e[j+1],ue[2]=e[j+2],m(ue,ue)),a[P]=e[j],a[P+1]=e[j+1],a[P+2]=e[j+2],l[P]=t[j],l[P+1]=t[j+1],l[P+2]=t[j+2],h[P]=-_*ue[0],h[P+1]=-_*ue[1],h[P+2]=-_*ue[2],p[x]=0,a[w]=e[j]+f*ue[0],a[w+1]=e[j+1]+f*ue[1],a[w+2]=e[j+2]+f*ue[2],l[w]=t[j],l[w+1]=t[j+1],l[w+2]=t[j+2],h[w]=_*ue[0],h[w+1]=_*ue[1],h[w+2]=_*ue[2],p[S]=f,P+=3,w+=3,j+=3,x+=1,S+=1;j=3*i,P=0,w=3*u;const E=f<0?be:ye,v=f<0?ye:be;for(let c=0;c<o;++c)d[P]=n[j+E[0]],d[P+1]=n[j+E[1]],d[P+2]=n[j+E[2]],g[w]=n[j+v[0]]+r,g[w+1]=n[j+v[1]]+r,g[w+2]=n[j+v[2]]+r,P+=3,w+=3,j+=3}function re(e,t,s,r,n,i,o){r[i]=r[o],o*=3,e[i*=3]=e[o],e[i+1]=e[o+1],e[i+2]=e[o+2],t[i]=t[o],t[i+1]=t[o+1],t[i+2]=t[o+2],s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2]}const ne=f();function ie(e,t,s,r,n,i,o,a,l,c,m){let h=n,p=n+1,g=n+o,d=n+o+1,u=a,f=a+1,y=a+2*i,b=a+2*i+1;m<0&&(h=n+o+1,d=n),c*=3;for(let _=0;_<i;++_)_===i-1&&(m>0?(p=n,d=n+o):(p=n,h=n+o)),he(e,h,p,g,ne),re(e,t,r,s,ne,u,h),re(e,t,r,s,ne,f,p),re(e,t,r,s,ne,y,g),re(e,t,r,s,ne,b,d),l[c++]=u,l[c++]=y,l[c++]=b,l[c++]=u,l[c++]=b,l[c++]=f,h++,p++,g++,d++,u+=2,f+=2,y+=2,b+=2}const oe=f(),ae=f(),le=f(),ce=f(),me=f();function he(e,t,s,r,n){t*=3,s*=3,r*=3,h(oe,e[t++],e[t++],e[t++]),h(ae,e[s++],e[s++],e[s++]),h(le,e[r++],e[r++],e[r++]),p(ce,ae,oe),p(me,le,oe),g(n,me,ce),m(n,n)}const pe=f();function ge(e,t,s,r,n,i){const o=e.stageObject,c=o.geometries,m=c.length,p="absolute-height"!==t.mode;let g=0;const u=o.transformation,f=a(l(),u);for(let a=0;a<m;a+=2){const e=c[a];if(!Z(e))continue;const t=e.getMutableAttribute(Q.POSITION).data,l=i[a/2],m=new k(e.mapPositions),y=t.length/3;let b=0,_=!1,j=0;for(let i=0;i<y;i++){pe[0]=t[b],pe[1]=t[b+1],pe[2]=t[b+2],r(m,fe),p&&(j+=fe.sampledElevation),T.TESTS_DISABLE_OPTIMIZATIONS?(h(de,m.array[m.offset],m.array[m.offset+1],fe.z+l[b/3]),null!=s&&n.toRenderCoords(de,s,de),d(de,de,f)):(h(de,t[b],t[b+1],t[b+2]),d(de,de,u),n.setAltitude(de,fe.z+l[b/3]),d(de,de,f)),t[b]=de[0],t[b+1]=de[1],t[b+2]=de[2];const e=_e/n.unitInMeters;(Math.abs(pe[0]-t[b])>=e||Math.abs(pe[1]-t[b+1])>=e||Math.abs(pe[2]-t[b+2])>=e)&&(_=!0),m.offset+=3,b+=3}_&&(e.invalidateBoundingInfo(),o.geometryVertexAttrsUpdated(c[a]),c[a+1].invalidateBoundingInfo(),o.geometryVertexAttrsUpdated(c[a+1])),g+=j/y}return g/m}const de=f(),ue=f(),fe=new A,ye=[0,2,1],be=[0,1,2],_e=.01;var je;!function(e){e[e.Main=0]="Main",e[e.Bottom=1]="Bottom"}(je||(je={}));class xe{constructor(e,t,s,r){this.positions=e,this.elevation=t,this.normals=s,this.heights=r}}export{$ as Graphics3DExtrudeSymbolLayer};
5
+ import"../../../../core/has.js";import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as s}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{n}from"../../../../chunks/mat3.js";import{a as i}from"../../../../chunks/mat3f64.js";import{i as o,p as a}from"../../../../chunks/mat4.js";import{a as l}from"../../../../chunks/mat4f64.js";import{c,n as m,s as h,f as p,b as g,e as d}from"../../../../chunks/vec3.js";import{e as u,c as f}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as y}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,empty as _,expandWithBuffer as j,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as P}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as S,getZeroIndexArray as w}from"../../../../geometry/support/Indices.js";import{t as E}from"../../../../chunks/vec32.js";import{makeVertexCandidate as v,makeEdgeCandidate as C}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as L}from"../../../../renderers/support/renderingInfoUtils.js";import{ViewingMode as M}from"../../../ViewingMode.js";import{needsElevationUpdates3D as I,SampleElevationInfo as A}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as O}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as B,computeCentroid as D}from"./graphicUtils.js";import{ApplyRendererDiffResult as G}from"./interfaces.js";import{geometryAsPolygon as R}from"./polygonUtils.js";import{createMaterial as U}from"../support/edgeUtils.js";import{debugFlags as T}from"../../support/debugFlags.js";import{SamplePosition as k}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as V}from"../../support/renderInfoUtils/polygon.js";import{NormalType as N}from"../../webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{Attribute as H}from"../../webgl-engine/lib/Attribute.js";import{CullFaceOptions as F}from"../../webgl-engine/lib/basicInterfaces.js";import{ContentObjectType as W}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as q}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as Z}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as J}from"../../webgl-engine/lib/Normals.js";import{Object3D as K}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as Q}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as X}from"../../webgl-engine/materials/DefaultMaterial.js";const Y=["polygon","extent"];class $ extends z{constructor(e,t,s,r){super(e,t,s,r),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=B(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const t=this.symbolLayer?.material?.color,s=this._getCombinedOpacityAndColor(t),r=u(s),n=s[3],i=n<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:r,ambient:r,opacity:n,transparent:i,cullFace:i?F.None:F.Back,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0,normalType:N.Compressed};this._materials[je.Main]=new X(o),this._materials[je.Bottom]=new X({...o,cullFace:F.Back}),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,Y,this.symbolLayer.type))return null;const s=this._getVertexOpacityAndColor(e.renderingInfo,255),r=this.setGraphicElevationContext(t);return this._createAs3DShape(t,e.renderingInfo,s,r,t.uid)}layerOpacityChanged(e,t){const s=this.symbolLayer?.material?.color,r=this._getCombinedOpacity(s),n=r<1||this.needsDrivenTransparentPass;this._materials[je.Main]?.setParameters({opacity:r,transparent:n}),this._materials[je.Bottom]?.setParameters({opacity:r,transparent:n});const i=this._getLayerOpacity();e.forEach((e=>{const s=t(e);null!=s&&s.layerOpacityChanged(i,this._context.isAsync)}))}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,I)}slicePlaneEnabledChanged(e,t){return this._materials[je.Main]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[je.Bottom]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e.forEach((e=>{const s=t(e);null!=s&&s.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[je.Main]?.setParameters(e),this._materials[je.Bottom]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?L(e.size,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(e,t){return this._drivenPropertiesChanged(t)?G.RecreateSymbol:G.RecreateGraphics}async queryForSnapping(e,r,n,i){const o=this._getExtrusionSize(n)*this._context.renderCoordsHelper.unitInMeters/s(r),{objectId:a,target:l}=e,c=t(l);switch(c.z=(c.z??0)+o,e.type){case"edge":{const{start:s,end:r}=e,n=t(s),i=t(r);return n.z=(n.z??0)+o,i.z=(i.z??0)+o,[C(a,c,1/0,n,i)]}case"vertex":return[v(a,c,1/0),C(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,s,a,c){const m=R(e.geometry);if(null==m)return null;if(0===m.rings.length||!m.rings.some((e=>e.length>0)))return this._logGeometryValidationWarnings(m.rings,"rings","ExtrudeSymbol3DLayer"),null;const h=V(m,this._context.elevationProvider,this._context.renderCoordsHelper,a);this._logGeometryCreationWarnings(h,m.rings,"rings","ExtrudeSymbol3DLayer");const p=D(m);if(null==p)return null;const g=new Array,d=new Array,u=b(),w=l(),v=f(),C=this._context.renderCoordsHelper.viewingMode===M.Global;C||this._context.renderCoordsHelper.worldUpAtPosition(null,v),y(m.spatialReference,[p.x,p.y,0],w,this._context.renderCoordsHelper.spatialReference);const L=l();o(L,w);const A=i();n(A,L);const{polygons:z,mapPositions:B,position:G}=h;for(const n of z){const e=n.count;if(this._context.clippingExtent&&(_(u),j(u,n.mapPositions),!x(u,this._context.clippingExtent)))continue;const i=r(n.mapPositions,n.holeIndices,3);if(0===i.length)continue;const o=i.length,a=6*e,l=S(a+o),m=S(o),h=P(3*a),p=P(3*a),f=P(3*a),y=P(a);te(G,B,i,n,h,f,p,y,l,m,this._getExtrusionSize(t),v,C),E(h,h,L);const b=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerUid:this._context.layer.uid}),w=new xe(h,f,J(p),y);g.push(ee(this._materials[je.Main],l,l.length-m.length,w,s,b),ee(this._materials[je.Bottom],m,0,w,s,b)),d.push(w.heights)}if(0===g.length)return null;const T=new K({geometries:g,layerUid:this._context.layer.uid,graphicUid:c,isElevationSource:!0});T.transformation=w;const k=U(this.symbolLayer,{opacity:this._getLayerOpacity()}),N=null!=k?{baseMaterial:this._materials[je.Main],edgeMaterials:[k],properties:{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}}:null,H=new O(this,T,g,null,null,((e,t,s,r,n)=>ge(e,t,s,r,n,d)),a,N);return H.alignedSampledElevation=h.sampledElevation,H.needsElevationUpdates=I(a.mode),H}}function ee(e,t,s,r,n,i){const o=w(t.length),a=[[Q.POSITION,new H(r.positions,t,3,!0)],[Q.NORMALCOMPRESSED,new H(r.normals,t,2,!0)],[Q.COLOR,new H(n,o,4,!0)]];return new q(e,a,r.elevation,W.Mesh,i,s)}function te(e,t,s,r,n,i,o,a,l,c,m,h,p){const g=s.length/3;let d=0,u=2*r.count;se(e,t,r.index,r.count,s,0,g,n,i,o,a,l,c,u,m,h,p);let f=2*r.count;u=0,ie(n,i,a,o,d,r.pathLengths[0],r.count,f,l,u,m),f+=4*r.pathLengths[0],u+=2*r.pathLengths[0],d+=r.pathLengths[0];for(let y=1;y<r.pathLengths.length;++y)ie(n,i,a,o,d,r.pathLengths[y],r.count,f,l,u,m),f+=4*r.pathLengths[y],u+=2*r.pathLengths[y],d+=r.pathLengths[y]}function se(e,t,s,r,n,i,o,a,l,h,p,g,d,u,f,y,b){c(ue,y);const _=f>0?1:-1;let j=3*s,x=0,P=3*x,S=r,w=3*S;for(let c=0;c<r;++c)b&&(ue[0]=e[j],ue[1]=e[j+1],ue[2]=e[j+2],m(ue,ue)),a[P]=e[j],a[P+1]=e[j+1],a[P+2]=e[j+2],l[P]=t[j],l[P+1]=t[j+1],l[P+2]=t[j+2],h[P]=-_*ue[0],h[P+1]=-_*ue[1],h[P+2]=-_*ue[2],p[x]=0,a[w]=e[j]+f*ue[0],a[w+1]=e[j+1]+f*ue[1],a[w+2]=e[j+2]+f*ue[2],l[w]=t[j],l[w+1]=t[j+1],l[w+2]=t[j+2],h[w]=_*ue[0],h[w+1]=_*ue[1],h[w+2]=_*ue[2],p[S]=f,P+=3,w+=3,j+=3,x+=1,S+=1;j=3*i,P=0,w=3*u;const E=f<0?be:ye,v=f<0?ye:be;for(let c=0;c<o;++c)d[P]=n[j+E[0]],d[P+1]=n[j+E[1]],d[P+2]=n[j+E[2]],g[w]=n[j+v[0]]+r,g[w+1]=n[j+v[1]]+r,g[w+2]=n[j+v[2]]+r,P+=3,w+=3,j+=3}function re(e,t,s,r,n,i,o){r[i]=r[o],o*=3,e[i*=3]=e[o],e[i+1]=e[o+1],e[i+2]=e[o+2],t[i]=t[o],t[i+1]=t[o+1],t[i+2]=t[o+2],s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2]}const ne=f();function ie(e,t,s,r,n,i,o,a,l,c,m){let h=n,p=n+1,g=n+o,d=n+o+1,u=a,f=a+1,y=a+2*i,b=a+2*i+1;m<0&&(h=n+o+1,d=n),c*=3;for(let _=0;_<i;++_)_===i-1&&(m>0?(p=n,d=n+o):(p=n,h=n+o)),he(e,h,p,g,ne),re(e,t,r,s,ne,u,h),re(e,t,r,s,ne,f,p),re(e,t,r,s,ne,y,g),re(e,t,r,s,ne,b,d),l[c++]=u,l[c++]=y,l[c++]=b,l[c++]=u,l[c++]=b,l[c++]=f,h++,p++,g++,d++,u+=2,f+=2,y+=2,b+=2}const oe=f(),ae=f(),le=f(),ce=f(),me=f();function he(e,t,s,r,n){t*=3,s*=3,r*=3,h(oe,e[t++],e[t++],e[t++]),h(ae,e[s++],e[s++],e[s++]),h(le,e[r++],e[r++],e[r++]),p(ce,ae,oe),p(me,le,oe),g(n,me,ce),m(n,n)}const pe=f();function ge(e,t,s,r,n,i){const o=e.stageObject,c=o.geometries,m=c.length,p="absolute-height"!==t.mode;let g=0;const u=o.transformation,f=a(l(),u);for(let a=0;a<m;a+=2){const e=c[a];if(!Z(e))continue;const t=e.getMutableAttribute(Q.POSITION).data,l=i[a/2],m=new k(e.mapPositions),y=t.length/3;let b=0,_=!1,j=0;for(let i=0;i<y;i++){pe[0]=t[b],pe[1]=t[b+1],pe[2]=t[b+2],r(m,fe),p&&(j+=fe.sampledElevation),T.TESTS_DISABLE_OPTIMIZATIONS?(h(de,m.array[m.offset],m.array[m.offset+1],fe.z+l[b/3]),null!=s&&n.toRenderCoords(de,s,de),d(de,de,f)):(h(de,t[b],t[b+1],t[b+2]),d(de,de,u),n.setAltitude(de,fe.z+l[b/3]),d(de,de,f)),t[b]=de[0],t[b+1]=de[1],t[b+2]=de[2];const e=_e/n.unitInMeters;(Math.abs(pe[0]-t[b])>=e||Math.abs(pe[1]-t[b+1])>=e||Math.abs(pe[2]-t[b+2])>=e)&&(_=!0),m.offset+=3,b+=3}_&&(e.invalidateBoundingInfo(),o.geometryVertexAttrsUpdated(c[a]),c[a+1].invalidateBoundingInfo(),o.geometryVertexAttrsUpdated(c[a+1])),g+=j/y}return g/m}const de=f(),ue=f(),fe=new A,ye=[0,2,1],be=[0,1,2],_e=.01;var je;!function(e){e[e.Main=0]="Main",e[e.Bottom=1]="Bottom"}(je||(je={}));class xe{constructor(e,t,s,r){this.positions=e,this.elevation=t,this.normals=s,this.heights=r}}export{$ as Graphics3DExtrudeSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{c as r}from"../../../../chunks/vec3f64.js";import{c as i}from"../../../../chunks/vec4f64.js";import{textSymbolLayerSupportsVerticalOffset as n}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as a}from"./ElevationAligners.js";import{SymbolUpdateType as s,elevationModeChangeUpdateType as o,needsElevationUpdates2D as l}from"./elevationAlignmentUtils.js";import{ElevationContext as c}from"./ElevationContext.js";import{Graphics3DGraphicCreationContext as m}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as d}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as p}from"./Graphics3DSymbolLayer.js";import{computeCentroid as u}from"./graphicUtils.js";import{createStageObject as f,extendPointGraphicElevationContext as g}from"./pointUtils.js";import{SymbolComplexity as y}from"./SymbolComplexity.js";import{Attribute as v}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as b}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as C}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as _}from"../../webgl-engine/lib/VertexAttribute.js";import{LineCalloutMaterial as x,Parameters as O}from"../../webgl-engine/materials/LineCalloutMaterial.js";class j extends p{constructor(e,t){super(e,null,t,U),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new x(this._materialParameters),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 O,i=this.symbol,n=i.callout;if(r.color=null!=n.color?e.toUnitRGBA(n.color):[0,0,0,0],r.color[3]*=this._getLayerOpacity(),r.size=t(n.size||0),i.verticalOffset){const{screenLength:e,minWorldLength:n,maxWorldLength:a}=i.verticalOffset;r.verticalOffset={screenLength:t(e),minWorldLength:n||0,maxWorldLength:null!=a?a:1/0}}r.borderColor=null!=n.border&&null!=n.border.color?e.toUnitRGBA(n.border.color):null;const a="object"===i.symbolLayers.at(0).type,s="label-3d"===i.type;return r.occlusionTest=!a,r.shaderPolygonOffset=a?0:void 0,r.depthHUDAlignStart=s,r.hasSlicePlane=this._context.slicePlaneEnabled,r.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null,r}_defaultElevationInfoNoZ(){return E}createGraphics3DGraphic(e){const t=e.renderingInfo,r=e.graphic,i=this.setGraphicElevationContext(r,new c,t.elevationOffset||0),a=t.symbol,s="on-the-ground"===this._elevationContext.mode&&("cim"===a.type||!a.symbolLayers.some((e=>"object"===e.type||"text"===e.type)));if("label-3d"!==a.type&&s)return null;if("point-3d"===a.type&&a.symbolLayers.every((e=>"text"===e.type&&!n(e))))return null;const o=u(r.geometry);return null==o?null:this._createAs3DShape(o,i,t,r.uid)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,n=o(j.elevationModeChangeTypes,r,i);return n!==s.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){this.setGraphicElevationContext(e,t.elevationContext,null!=t.metadata?t.metadata.elevationOffset:0),t.needsElevationUpdates=l(t.elevationContext.mode)}computeComplexity(){return new y({verticesPerFeature:6})}_createVertexData(e){const{translation:t,centerOffset:r}=e,i=new v(t?[t[0],t[1],t[2]]:[0,0,0],3,!0),n=new v(r?[r[0],r[1],r[2],r[3]]:[0,0,0,1],4,!0);return[[_.POSITION,i,P],[_.NORMAL,new v([0,0,1],3,!0),P],[_.AUXPOS1,n,P]]}_getOrCreateMaterial(e){const t=this._perInstanceMaterialParameters(e),r=x.uniqueMaterialIdentifier(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 x(t),e.materialCollection.add(r,i)),{material:i,isUnique:!1}}return{material:new x(t),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),c=new C(o.material,this._createVertexData(r),null,b.Point,s),m=f(this._context,e,c,t,i);if(null==m)return null;const p=new h(this,m.object,[c],o.isUnique?[o.material]:null,null,a,t);return p.metadata=new d(r.elevationOffset),p.alignedSampledElevation=m.sampledElevation,p.needsElevationUpdates=l(t.mode),g(p,e,this._context.elevationProvider),p}}j.elevationModeChangeTypes={definedChanged:s.UPDATE,staysOnTheGround:s.UPDATE,onTheGroundChanged:s.RECREATE};const P=[0],E={mode:"relative-to-ground",offset:0},U={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class w{constructor(e,t,n=r(),a=i(),s=0,o="world",l=0,c=null){this.renderer=e,this.symbol=t,this.translation=n,this.centerOffset=a,this.horizontalScreenOffset=s,this.centerOffsetUnits=o,this.elevationOffset=l,this.materialCollection=c}}class G extends m{}export{j as Graphics3DLineCalloutSymbolLayer,G as LineCalloutCreationContext,w as LineCalloutSymbolLayerRenderingInfo};
5
+ import e from"../../../../Color.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{c as r}from"../../../../chunks/vec3f64.js";import{c as i}from"../../../../chunks/vec4f64.js";import{textSymbolLayerSupportsVerticalOffset as n}from"../../../../symbols/callouts/calloutUtils.js";import{perObjectElevationAligner as a}from"./ElevationAligners.js";import{SymbolUpdateType as s,elevationModeChangeUpdateType as o,needsElevationUpdates2D as l}from"./elevationAlignmentUtils.js";import{ElevationContext as c}from"./ElevationContext.js";import{Graphics3DGraphicCreationContext as m}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DObject3DGraphicLayer as h}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DObjectMetadata as d}from"./Graphics3DObjectMetadata.js";import{Graphics3DSymbolLayer as p}from"./Graphics3DSymbolLayer.js";import{computeCentroid as u}from"./graphicUtils.js";import{createStageObject as f,extendPointGraphicElevationContext as g}from"./pointUtils.js";import{SymbolComplexity as y}from"./SymbolComplexity.js";import{Attribute as v}from"../../webgl-engine/lib/Attribute.js";import{ContentObjectType as b}from"../../webgl-engine/lib/ContentObjectType.js";import{Geometry as C}from"../../webgl-engine/lib/Geometry.js";import{VertexAttribute as _}from"../../webgl-engine/lib/VertexAttribute.js";import{LineCalloutMaterial as x,Parameters as O}from"../../webgl-engine/materials/LineCalloutMaterial.js";class j extends p{constructor(e,t){super(e,null,t,U),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){this._materials[0]=new x(this._materialParameters),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 O,i=this.symbol,n=i.callout;if(r.color=null!=n.color?e.toUnitRGBA(n.color):[0,0,0,0],r.color[3]*=this._getLayerOpacity(),r.size=t(n.size||0),i.verticalOffset){const{screenLength:e,minWorldLength:n,maxWorldLength:a}=i.verticalOffset;r.verticalOffset={screenLength:t(e),minWorldLength:n||0,maxWorldLength:null!=a?a:1/0}}r.borderColor=null!=n.border&&null!=n.border.color?e.toUnitRGBA(n.border.color):null;const a="object"===i.symbolLayers.at(0).type,s="label-3d"===i.type;return r.occlusionTest=!a,r.shaderPolygonOffset=a?0:void 0,r.depthHUDAlignStart=s,r.hasSlicePlane=this._context.slicePlaneEnabled,r.screenSizePerspective=this._context.screenSizePerspectiveEnabled?this._context.sharedResources.screenSizePerspectiveSettings:null,r}_defaultElevationInfoNoZ(){return E}createGraphics3DGraphic(e){const t=e.renderingInfo,r=e.graphic,i=this.setGraphicElevationContext(r,new c,t.elevationOffset||0),a=t.symbol,s="on-the-ground"===this._elevationContext.mode&&("cim"===a.type||!a.symbolLayers.some((e=>"object"===e.type||"text"===e.type)));if("label-3d"!==a.type&&s)return null;if("point-3d"===a.type&&a.symbolLayers.every((e=>"text"===e.type&&!n(e))))return null;const o=u(r.geometry);return null==o?null:this._createAs3DShape(o,i,t,r.uid)}layerOpacityChanged(){this._materials[0]?.setParameters(this._materialParameters)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,n=o(j.elevationModeChangeTypes,r,i);return n!==s.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){this.setGraphicElevationContext(e,t.elevationContext,null!=t.metadata?t.metadata.elevationOffset:0),t.needsElevationUpdates=l(t.elevationContext.mode)}computeComplexity(){return new y({verticesPerFeature:6})}_createVertexData(e){const{translation:t,centerOffset:r}=e,i=new v(t?[t[0],t[1],t[2]]:[0,0,0],P,3,!0),n=new v(r?[r[0],r[1],r[2],r[3]]:[0,0,0,1],P,4,!0);return[[_.POSITION,i],[_.NORMAL,new v([0,0,1],P,3,!0)],[_.AUXPOS1,n]]}_getOrCreateMaterial(e){const t=this._perInstanceMaterialParameters(e),r=x.uniqueMaterialIdentifier(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 x(t),e.materialCollection.add(r,i)),{material:i,isUnique:!1}}return{material:new x(t),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),c=new C(o.material,this._createVertexData(r),null,b.Point,s),m=f(this._context,e,c,t,i);if(null==m)return null;const p=new h(this,m.object,[c],o.isUnique?[o.material]:null,null,a,t);return p.metadata=new d(r.elevationOffset),p.alignedSampledElevation=m.sampledElevation,p.needsElevationUpdates=l(t.mode),g(p,e,this._context.elevationProvider),p}}j.elevationModeChangeTypes={definedChanged:s.UPDATE,staysOnTheGround:s.UPDATE,onTheGroundChanged:s.RECREATE};const P=[0],E={mode:"relative-to-ground",offset:0},U={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};class w{constructor(e,t,n=r(),a=i(),s=0,o="world",l=0,c=null){this.renderer=e,this.symbol=t,this.translation=n,this.centerOffset=a,this.horizontalScreenOffset=s,this.centerOffsetUnits=o,this.elevationOffset=l,this.materialCollection=c}}class G extends m{}export{j as Graphics3DLineCalloutSymbolLayer,G as LineCalloutCreationContext,w as LineCalloutSymbolLayerRenderingInfo};