@arcgis/core 4.33.0-next.20250407 → 4.33.0-next.20250408

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 (251) hide show
  1. package/Color.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{69b5d0ef14fb521b0fd7.js → 04008648c59031bca8ea.js} +1 -1
  4. package/assets/esri/core/workers/chunks/07236fe57d76b1134cd4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{6a8cf1f51cc4adc268d3.js → 0747c9542172241b52ab.js} +1 -1
  6. package/assets/esri/core/workers/chunks/083548c5eea5aca6404c.js +1 -0
  7. package/assets/esri/core/workers/chunks/0d37c6aa261c8d5e5b23.js +1 -0
  8. package/assets/esri/core/workers/chunks/0d7c1de47ae006277b76.js +1 -0
  9. package/assets/esri/core/workers/chunks/{9574896c90b39fa7ecb4.js → 10fd52bc5124fced5bcc.js} +1 -1
  10. package/assets/esri/core/workers/chunks/11b725421a823f6183a2.js +1 -0
  11. package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → 14d1a970e927ebfed9c8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 1595f3def0ba0c4f0fe7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{1263391920fbb8926ced.js → 19eb465f91d07862926a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1c8cdae7736b6c907d95.js +1 -0
  15. package/assets/esri/core/workers/chunks/1cc4fc3353d217632a1b.js +1 -0
  16. package/assets/esri/core/workers/chunks/{91439b59260b0fb04be9.js → 238df0aee97315623638.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7ea5bbb52e84be9a608e.js → 23cc33576da66b3c4366.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{358a3a9326615d5e6d3b.js → 2679da0c93f05ae956c6.js} +1 -1
  19. package/assets/esri/core/workers/chunks/26e0a0a13060cd3e4291.js +1 -0
  20. package/assets/esri/core/workers/chunks/{c2d0fc13f4b746318a38.js → 290f63304a2a81303c06.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{e6544e966f14fb410157.js → 2d5cb817e6e905103068.js} +1 -1
  22. package/assets/esri/core/workers/chunks/345f428dfcaa594ee617.js +1 -0
  23. package/assets/esri/core/workers/chunks/35dccd3883d2e466c42e.js +1 -0
  24. package/assets/esri/core/workers/chunks/{fc5ca7b08915177c5e33.js → 364860a42edc0c3b8d5b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/393fbd296817e813936c.js +1 -0
  26. package/assets/esri/core/workers/chunks/{82a58a405332d43a328f.js → 39fbac918ebd1b0e3a18.js} +1 -1
  27. package/assets/esri/core/workers/chunks/3a649aa78e25e3c8aa8c.js +1 -0
  28. package/assets/esri/core/workers/chunks/{4cc77769009901a112ec.js → 3b2bda2e8c08f486de27.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3e1bb914aceb3a9af898.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ee77b601fb0f3567e87.js +1 -0
  31. package/assets/esri/core/workers/chunks/40945669f5be487b340c.js +1 -0
  32. package/assets/esri/core/workers/chunks/43a3b1b78d214aadaaad.js +1 -0
  33. package/assets/esri/core/workers/chunks/49d03bdaa9c4476b69d6.js +1 -0
  34. package/assets/esri/core/workers/chunks/{1b87fa15470cce26feea.js → 49d6b56e21b1bc0d1948.js} +1 -1
  35. package/assets/esri/core/workers/chunks/4cbd5303f5a5a5fff391.js +1 -0
  36. package/assets/esri/core/workers/chunks/{40b33c9bd271cddbd837.js → 50ffb2620cdbcfd75723.js} +1 -1
  37. package/assets/esri/core/workers/chunks/544771f64a86b541d5bb.js +1 -0
  38. package/assets/esri/core/workers/chunks/55cc40d1b1853f779d82.js +1 -0
  39. package/assets/esri/core/workers/chunks/56e9dfd62102c32b9770.js +1 -0
  40. package/assets/esri/core/workers/chunks/576bed289aa7be03f319.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b7a1185ac49480fc1410.js → 5c80452df87024fdaa75.js} +1 -1
  42. package/assets/esri/core/workers/chunks/5ef6acd36629eae225da.js +1 -0
  43. package/assets/esri/core/workers/chunks/{e592731ac12b9bc646ff.js → 60d3b329e69f3cddb7f4.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{43b19c58b2d16ae8e7cc.js → 6275114e8ed9dd31465d.js} +1 -1
  45. package/assets/esri/core/workers/chunks/63ce66da1a52d6d07ccb.js +1 -0
  46. package/assets/esri/core/workers/chunks/6447d373a43ef6cd46cd.js +1 -0
  47. package/assets/esri/core/workers/chunks/64824ee75c643cee2aa9.js +1 -0
  48. package/assets/esri/core/workers/chunks/{48fbf887da6d19838bf0.js → 6a067a6ce0968d893142.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6a70b858e24d98845041.js +1 -0
  50. package/assets/esri/core/workers/chunks/{c589d32f8efcca6bf712.js → 6c65b966f4c952508fc1.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{cda6ae4c5cb67e22b454.js → 6d15d953baabccbbee01.js} +1 -1
  52. package/assets/esri/core/workers/chunks/6ecf2924f9f6aac61101.js +1 -0
  53. package/assets/esri/core/workers/chunks/{25a686f00479ac12a1ca.js → 6f9a17f62786af04b74e.js} +1 -1
  54. package/assets/esri/core/workers/chunks/77334c3fed1e3a06d307.js +1 -0
  55. package/assets/esri/core/workers/chunks/{7ef9bcd58af499a14a08.js → 79036c5d7569c4e94abe.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{2ab7d36409e9af3ac3da.js → 7b47b08f4a58898273b9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{90442f47c9f31f26b453.js → 7f961954e59a232bfa88.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ccb289911e7445b17763.js → 86b4920f5a99576399fb.js} +2 -2
  59. package/assets/esri/core/workers/chunks/877f665c7edb26c147ea.js +1 -0
  60. package/assets/esri/core/workers/chunks/{8aae03e347ab18ae6ee2.js → 89e7cc489156ff0ebdb6.js} +1 -1
  61. package/assets/esri/core/workers/chunks/8c5619fdf125a459281d.js +1 -0
  62. package/assets/esri/core/workers/chunks/8e64687ee76e70deeb29.js +1 -0
  63. package/assets/esri/core/workers/chunks/{400f95295bbfced31076.js → 8ef755e6a7b2b71f46e6.js} +1 -1
  64. package/assets/esri/core/workers/chunks/8fe36b06a7eceeb874e9.js +1 -0
  65. package/assets/esri/core/workers/chunks/{269531e770376ed9e4fd.js → 90874dfe23035d16660c.js} +1 -1
  66. package/assets/esri/core/workers/chunks/91bb715f5ee87e97f162.js +1 -0
  67. package/assets/esri/core/workers/chunks/{5c757e20c0543e6a49b3.js → 948a3c1419ae323cca10.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{7f31dbe0ca8974a10be8.js → 96cddbbeef61a4f33f29.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{27b7ef3442700f6d6123.js → 9a84ff99756c7247dd39.js} +97 -96
  70. package/assets/esri/core/workers/chunks/9fddd759c308d3d5801a.js +1 -0
  71. package/assets/esri/core/workers/chunks/a29e99328d75b6ceb74d.js +1 -0
  72. package/assets/esri/core/workers/chunks/{af9fda47d02c51a2c7da.js → a32e697547f8ac345dd7.js} +1 -1
  73. package/assets/esri/core/workers/chunks/a426152e7eb550b8f15f.js +1 -0
  74. package/assets/esri/core/workers/chunks/a6de903f22f76d875005.js +1 -0
  75. package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → aaf67ec3d580e1fee6c7.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{d2c7067bb6654c0e2793.js → ac91bd1fee9ddadc270b.js} +1 -1
  77. package/assets/esri/core/workers/chunks/ae7c1e34ed1288773ec2.js +1 -0
  78. package/assets/esri/core/workers/chunks/ae9ebc0c0553e57e85ba.js +1 -0
  79. package/assets/esri/core/workers/chunks/{49ed3ab9bd6d7c52e864.js → af41dcc8006cd0f451c2.js} +1 -1
  80. package/assets/esri/core/workers/chunks/b199508eef1eeee72854.js +1 -0
  81. package/assets/esri/core/workers/chunks/b715fa857391931c04b9.js +1 -0
  82. package/assets/esri/core/workers/chunks/c144e00dfe6d63eaa2b1.js +1 -0
  83. package/assets/esri/core/workers/chunks/c150cd2a82260495e9de.js +1 -0
  84. package/assets/esri/core/workers/chunks/{2cbab0c078d0b844934c.js → c3c70dad8c8a93953237.js} +1 -1
  85. package/assets/esri/core/workers/chunks/c4425d5227f7e2379b0f.js +1 -0
  86. package/assets/esri/core/workers/chunks/c837379b36cf716d6215.js +1 -0
  87. package/assets/esri/core/workers/chunks/c849e3e151d78a061bf0.js +1 -0
  88. package/assets/esri/core/workers/chunks/{d2eb3802fa003c2d497e.js → caa5676636b06d743623.js} +1 -1
  89. package/assets/esri/core/workers/chunks/cb83fcfff8731c88c108.js +1 -0
  90. package/assets/esri/core/workers/chunks/cc366e4df91cf516d1b9.js +1 -0
  91. package/assets/esri/core/workers/chunks/ccd3f9b52006cd7dd11e.js +1 -0
  92. package/assets/esri/core/workers/chunks/d59aeb46bf2fb0931a9b.js +1 -0
  93. package/assets/esri/core/workers/chunks/{4ba34124054752b363c0.js → d65c30cd787b287833fb.js} +1 -1
  94. package/assets/esri/core/workers/chunks/d72d44df7e117e26e717.js +1 -0
  95. package/assets/esri/core/workers/chunks/e22cdfce2a0583f3cc50.js +1 -0
  96. package/assets/esri/core/workers/chunks/ee277dd58aa69281163f.js +1 -0
  97. package/assets/esri/core/workers/chunks/f086993f8744209d761f.js +1 -0
  98. package/assets/esri/core/workers/chunks/{8d49c79e549e90371303.js → fa2d836d4a844b26b84e.js} +1 -1
  99. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +1 -0
  100. package/assets/esri/core/workers/chunks/fb65796296b0422cf266.js +1 -0
  101. package/assets/esri/core/workers/chunks/fde544c090cc04581536.js +1 -0
  102. package/assets/esri/core/workers/chunks/fe2c48de24b25c45b3e7.js +1 -0
  103. package/chunks/CheckerBoard.glsl.js +3 -3
  104. package/chunks/ColorMaterial.glsl.js +3 -3
  105. package/chunks/ComponentShader.glsl.js +2 -2
  106. package/chunks/DefaultMaterial.glsl.js +5 -5
  107. package/chunks/ImageMaterial.glsl.js +1 -1
  108. package/chunks/LineMarker.glsl.js +4 -4
  109. package/chunks/Path.glsl.js +2 -2
  110. package/chunks/Pattern.glsl.js +3 -3
  111. package/chunks/Precipitation.glsl.js +1 -1
  112. package/chunks/RealisticTree.glsl.js +6 -6
  113. package/chunks/RibbonLine.glsl.js +1 -1
  114. package/chunks/ShadedColorMaterial.glsl.js +7 -7
  115. package/chunks/WaterSurface.glsl.js +3 -3
  116. package/chunks/vec32.js +1 -1
  117. package/colorUtils.js +1 -1
  118. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  119. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  120. package/core/libs/gl-matrix-2/vec3.js +1 -1
  121. package/geometry/support/float16.js +1 -1
  122. package/geometry/support/meshUtils/merge.js +1 -1
  123. package/identity/IdentityManagerBase.js +1 -1
  124. package/interfaces.d.ts +13 -6
  125. package/layers/effects/parser.js +1 -1
  126. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  127. package/package.json +2 -2
  128. package/support/revision.js +1 -1
  129. package/symbols/support/Symbol3DEmissive.js +5 -0
  130. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  131. package/symbols/support/Symbol3DMaterial.js +1 -1
  132. package/symbols/support/materialUtils.js +1 -1
  133. package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
  134. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  141. package/views/2d/layers/MediaLayerView2D.js +1 -1
  142. package/views/2d/layers/TileLayerView2D.js +1 -1
  143. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  144. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  145. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  146. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  147. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  148. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  149. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  150. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  151. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  152. package/views/3d/layers/I3SMeshView3D.js +1 -1
  153. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  154. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  155. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  160. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  161. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  162. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  163. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  164. package/views/3d/support/cameraUtils.js +1 -1
  165. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  166. package/views/3d/terrain/PatchRenderData.js +1 -1
  167. package/views/3d/terrain/SphericalPatch.js +1 -1
  168. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  169. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +6 -5
  170. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  171. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  172. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  173. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  174. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  175. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  176. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  177. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  178. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  179. package/views/SceneView.js +1 -1
  180. package/views/VideoView.js +1 -1
  181. package/views/interactive/SegmentLabels.js +1 -1
  182. package/views/interactive/coordinateHelper.js +1 -1
  183. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  184. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  185. package/views/interactive/sketch/constraints.js +1 -1
  186. package/views/interactive/snapping/GridSnappingEngine.js +1 -1
  187. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  188. package/views/support/geometry3dUtils.js +1 -1
  189. package/views/webgl/FramebufferObject.js +1 -1
  190. package/views/webgl/RenderbufferDescriptor.js +1 -1
  191. package/views/webgl/RenderingContext.js +1 -1
  192. package/views/webgl/TextureDescriptor.js +1 -1
  193. package/assets/esri/core/workers/chunks/066844a51cd22cbef0e6.js +0 -1
  194. package/assets/esri/core/workers/chunks/067dda58592fbf4fb812.js +0 -1
  195. package/assets/esri/core/workers/chunks/0a0e5d699ddb7052c5c0.js +0 -1
  196. package/assets/esri/core/workers/chunks/1014513c0ec85f9414a4.js +0 -1
  197. package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +0 -1
  198. package/assets/esri/core/workers/chunks/114599ed0752d9a70eef.js +0 -1
  199. package/assets/esri/core/workers/chunks/19e83b184d8b4d0b3007.js +0 -1
  200. package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
  201. package/assets/esri/core/workers/chunks/25ef080163f3f795911a.js +0 -1
  202. package/assets/esri/core/workers/chunks/277b61af8982092a4c81.js +0 -1
  203. package/assets/esri/core/workers/chunks/37e4f588a6896f98bce3.js +0 -1
  204. package/assets/esri/core/workers/chunks/3b7284516a0e34a9e85e.js +0 -1
  205. package/assets/esri/core/workers/chunks/3f6dc811b5d515c2725c.js +0 -1
  206. package/assets/esri/core/workers/chunks/4275dcec730a11173661.js +0 -1
  207. package/assets/esri/core/workers/chunks/4403b3f08907e88d0d91.js +0 -1
  208. package/assets/esri/core/workers/chunks/4523ba4a3c8987abca56.js +0 -1
  209. package/assets/esri/core/workers/chunks/47bbfc10c2a3b9e4bdd6.js +0 -1
  210. package/assets/esri/core/workers/chunks/4baef5262ce401bf81bb.js +0 -1
  211. package/assets/esri/core/workers/chunks/4e3b60156bee3b8b3367.js +0 -1
  212. package/assets/esri/core/workers/chunks/519028f42b817d3e9933.js +0 -1
  213. package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +0 -1
  214. package/assets/esri/core/workers/chunks/705c1ebb327f680f8519.js +0 -1
  215. package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +0 -1
  216. package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +0 -1
  217. package/assets/esri/core/workers/chunks/72f4cea853ce9fcf2cb6.js +0 -1
  218. package/assets/esri/core/workers/chunks/759c12b0715279e3c0f6.js +0 -1
  219. package/assets/esri/core/workers/chunks/7655be1470ce39f0e494.js +0 -1
  220. package/assets/esri/core/workers/chunks/796cf1c2ca9955595836.js +0 -1
  221. package/assets/esri/core/workers/chunks/7ccc02a4ec6d3552ecca.js +0 -1
  222. package/assets/esri/core/workers/chunks/80427cd9f0c2e07f21c3.js +0 -1
  223. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +0 -1
  224. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
  225. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +0 -1
  226. package/assets/esri/core/workers/chunks/8f35416a5036897d6289.js +0 -1
  227. package/assets/esri/core/workers/chunks/8fecd1337d84c26c692b.js +0 -1
  228. package/assets/esri/core/workers/chunks/9050dad7e4f093568026.js +0 -1
  229. package/assets/esri/core/workers/chunks/9643a9516783e8c32180.js +0 -1
  230. package/assets/esri/core/workers/chunks/9e156e135f34f9b06032.js +0 -1
  231. package/assets/esri/core/workers/chunks/a3421383e48379012c9c.js +0 -1
  232. package/assets/esri/core/workers/chunks/a91f2d1deb950f46ad09.js +0 -1
  233. package/assets/esri/core/workers/chunks/b4a1f3f3a036226d6810.js +0 -1
  234. package/assets/esri/core/workers/chunks/bd0dbad694ce5531deab.js +0 -1
  235. package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
  236. package/assets/esri/core/workers/chunks/c68c68e918c72932b247.js +0 -1
  237. package/assets/esri/core/workers/chunks/cc307d34a68e44e3cbc5.js +0 -1
  238. package/assets/esri/core/workers/chunks/d3b0117ad9232e36f785.js +0 -1
  239. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +0 -1
  240. package/assets/esri/core/workers/chunks/d89f105b8a0b13dd8e5f.js +0 -1
  241. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
  242. package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +0 -1
  243. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
  244. package/assets/esri/core/workers/chunks/e5aff9b10877fb04d6de.js +0 -1
  245. package/assets/esri/core/workers/chunks/e792603b7cc3ddd133f3.js +0 -1
  246. package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +0 -1
  247. package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +0 -1
  248. package/assets/esri/core/workers/chunks/f41a9ceb8e49baafe9fa.js +0 -1
  249. package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
  250. package/assets/esri/core/workers/chunks/f7d33d18bf1bd4db9df8.js +0 -1
  251. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{updatePointsFromFeatureReference as t,getFeatureId as o}from"../../../../analysis/featureReferenceUtils.js";import i from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{handlesGroup as a,makeHandle as l}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,d as v,n as f,h as _,g as b,G as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import I from"../../../../geometry/Point.js";import{projectOrLoad as P}from"../../../../geometry/projection.js";import{projectBoundingRect as j}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as S,containsPointObject as w,intersectsSegment as R}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as A,create as H}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as E}from"../../../../support/elevationInfoUtils.js";import L from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as V}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as F}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as x}from"../support/projectionUtils.js";import{StoreResults as D}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as N,TaskPriority as z}from"../../../support/Scheduler.js";let k=class extends(r.EventedMixin(i)){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=N,this._computationHandles=new s,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):N,this._intersector=new F({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:o,computationResult:i}=t,{observerAdjusted:n,targetAdjusted:r}=o,{start:s,end:a}=i;m(s,n),m(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:o}=this,{inputPoints:i}=e,{observer:n,target:r,observerAdjusted:s,targetAdjusted:a}=i;m(s,n),m(a,r),t(o,this._intersector.intersector,i);const{observerSurfaceNormal:l,targetSurfaceNormal:c}=i,u=this._screenPixelSize,d=B;null!=l?m(d,l):v(d,a,s);const p=u;f(d,d),_(d,d,Math.min(p,1)),b(s,s,d),null!=c?m(d,c):v(d,s,a);const g=o.state.camera.computeScreenPixelSizeAt(a);f(d,d),_(d,d,Math.min(g,1)),b(a,a,d)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:o}=this,{sceneIntersectionHelper:i,renderCoordsHelper:n}=o;if(null==i)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:c}=a,{start:u,end:d}=s,p=A(u,d,q);r.options.store=D.MIN,i.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,v=B;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){m(t.originalIntersection,h),m(t.originalObserver,u),m(t.originalTarget,d),n.fromRenderCoords(h,v,o.spatialReference);const e=1-y(d,c)/y(u,c);f=y(l,h)>=e*y(l,c)}const _=new I(v,o.spatialReference);{const{result:t,target:i}=e;null!=t?(t.target=i,t.intersectedGraphic=f?null:G(g,o),t.intersectedLocation=f?null:_,t.visible=f):e.result=new L({target:i,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,o),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,o=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==o)return!1;const{observerAdjusted:i,targetAdjusted:n}=e.inputPoints,r=o.intersectsPoint(i),s=o.intersectsPoint(n);return r&&s}_onObserverPositionChange(e,t,i,n,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return x(this.analysis,e.spatialReference,c.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=U(t,i),{absoluteZ:a,elevation:l}=E(t.x,t.y,t.z,this.view.spatialReference,this.view,s),u=t.clone();u.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=u;const d=T();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=a-l,this._observerFeatureId=o(n),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n){const{inputPoints:r}=e;switch(m(r.observer,t),r.observerFeatureId=n,r.observerSurfaceNormal=null,i){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,o,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,n,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==i)return null!=t&&x(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const l=U(i,n),{absoluteZ:u,elevation:d}=E(i.x,i.y,i.z,this.view.spatialReference,this.view,l),p=i.clone();switch(p.z=u,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=o(r),a.targetSurfaceNormal=null,l.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,u-d,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return a([this._updatingHandles.add((()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:P(e.target.position,this.view.spatialReference)})),(({computation:e,targetPosition:t,targetElevationInfo:o,targetFeatureInfo:i,projectedTargetPosition:n})=>{null==n.pending?this._onTargetPositionChange(e,t,n.geometry,o,i):this._updatingHandles.addPromise(n.pending)}),p)])}_connectComputationToObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver})),(({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}),p)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId})),(({computation:e,observer:t,observerGroundOffset:o,observerElevationMode:i,observerFeatureId:n})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n)}),p)}_connectComputationToCamera(e){return this._updatingHandles.add((()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty})),(({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()}))}_connectComputationToSlicePlane(e){return this._updatingHandles.add((()=>this.view.slicePlane),(()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()}))}_connectComputationToElevation(e){const t=(o,i)=>{const n=this.analysis.observer,r=e.target;let s=null,a=null,l=null,c=null,u=null,d=null;if(null!=n?.position){const e=P(n.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));s=e.geometry,a=n.elevationInfo,l=n.feature}if(null!=r.position){const e=P(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));c=e.geometry,u=r.elevationInfo,d=r.feature}null==s&&null==c||(j(o,i,J,this.view.spatialReference),null!=s&&w(J,s)&&this._onObserverPositionChange(null!=n?n.position:null,s,a,l,!1),null!=c&&w(J,c)&&this._onTargetPositionChange(e,r.position,c,u,d,!1),null!=s&&null!=c&&R(J,s,c)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:o})=>t(e,o)))}_connectComputationToTask(e){let t=null;const o={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return a([this._updatingHandles.add((()=>e.inputPoints),(()=>{t=u(t),t=n((async e=>{await d(this._frameTask.schedule((()=>this._computeResult(o)),e))}))}),{initial:!0,equals:()=>!1}),l((()=>t=u(t)))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const o of t)this._disconnectComputation(o);for(const o of e)this._connectComputation(o)}_onTargetCollectionChange({added:e,removed:t}){for(const o of t)this._removeTarget(o);for(const o of e)this._addTarget(o)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some((t=>t.target===e))||this._computations.add(new V({target:e}))}_removeTarget(e){const t=this._computations.findIndex((t=>t.target===e));this._computations.removeAt(t)}_connectObserver(){return a([this._updatingHandles.add((()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:P(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null})),(({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:o,observerFeatureInfo:i})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,o,i,!0):this._updatingHandles.addPromise(t.pending)}),p)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this._computations),(e=>this._onComputationCollectionChange(e)),{initial:!0,final:!0})}_connectTargets(){return a([this._updatingHandles.addOnCollectionChange((()=>this.analysis.targets),(e=>this._onTargetCollectionChange(e)),{initial:!0,final:!0}),this._updatingHandles.add((()=>this.analysisViewData.cursorTarget),((e,t)=>{this._onCursorTargetChange(e,t)}))])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:o}=t;if(null==e||null==o)return!1;const i=B;o.toRenderCoords(e,i);const n=t.state.camera.computeScreenPixelSizeAt(i);return Math.abs((n-this._screenPixelSize)/this._screenPixelSize)>Z}};function U(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:o,inputPoints:i}=e,{start:n,end:r,intersection:s}=o,{originalIntersection:a,originalObserver:l,originalTarget:c}=t;if(m(s,a),i.isValid){const e=B,t=y(l,a)/y(l,c);C(e,n,l),_(e,e,1-t),b(s,s,e),C(e,r,c),_(e,e,t),b(s,s,e),o.isValid=!0}else e.result=null,o.isValid=!1,o.isTargetVisible=!1}e([g({constructOnly:!0})],k.prototype,"analysis",void 0),e([g({constructOnly:!0})],k.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],k.prototype,"view",void 0),e([g()],k.prototype,"updating",null),e([g()],k.prototype,"priority",null),e([g()],k.prototype,"updateOnCameraChange",void 0),e([g()],k.prototype,"_computations",null),e([g()],k.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],k.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],k.prototype,"_effectiveObserverElevationMode",void 0),e([g()],k.prototype,"_observerFeatureId",void 0),e([g()],k.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],k.prototype,"_updatingHandles",void 0),e([g()],k.prototype,"_frameTask",void 0),e([g()],k.prototype,"_isCameraDirty",null),k=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],k);const Z=.1,B=T(),q=H(),J=S();export{k as LineOfSightController};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{updatePointsFromFeatureReference as t,getFeatureId as o}from"../../../../analysis/featureReferenceUtils.js";import i from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{handlesGroup as a,makeHandle as l}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,d as v,n as f,h as _,g as b,F as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import I from"../../../../geometry/Point.js";import{projectOrLoad as P}from"../../../../geometry/projection.js";import{projectBoundingRect as j}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as S,containsPointObject as w,intersectsSegment as R}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as A,create as H}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as E}from"../../../../support/elevationInfoUtils.js";import L from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as V}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as F}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as x}from"../support/projectionUtils.js";import{StoreResults as D}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as N,TaskPriority as z}from"../../../support/Scheduler.js";let k=class extends(r.EventedMixin(i)){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=N,this._computationHandles=new s,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):N,this._intersector=new F({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:o,computationResult:i}=t,{observerAdjusted:n,targetAdjusted:r}=o,{start:s,end:a}=i;m(s,n),m(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:o}=this,{inputPoints:i}=e,{observer:n,target:r,observerAdjusted:s,targetAdjusted:a}=i;m(s,n),m(a,r),t(o,this._intersector.intersector,i);const{observerSurfaceNormal:l,targetSurfaceNormal:c}=i,u=this._screenPixelSize,d=B;null!=l?m(d,l):v(d,a,s);const p=u;f(d,d),_(d,d,Math.min(p,1)),b(s,s,d),null!=c?m(d,c):v(d,s,a);const g=o.state.camera.computeScreenPixelSizeAt(a);f(d,d),_(d,d,Math.min(g,1)),b(a,a,d)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:o}=this,{sceneIntersectionHelper:i,renderCoordsHelper:n}=o;if(null==i)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:c}=a,{start:u,end:d}=s,p=A(u,d,q);r.options.store=D.MIN,i.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,v=B;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){m(t.originalIntersection,h),m(t.originalObserver,u),m(t.originalTarget,d),n.fromRenderCoords(h,v,o.spatialReference);const e=1-y(d,c)/y(u,c);f=y(l,h)>=e*y(l,c)}const _=new I(v,o.spatialReference);{const{result:t,target:i}=e;null!=t?(t.target=i,t.intersectedGraphic=f?null:G(g,o),t.intersectedLocation=f?null:_,t.visible=f):e.result=new L({target:i,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,o),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,o=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==o)return!1;const{observerAdjusted:i,targetAdjusted:n}=e.inputPoints,r=o.intersectsPoint(i),s=o.intersectsPoint(n);return r&&s}_onObserverPositionChange(e,t,i,n,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return x(this.analysis,e.spatialReference,c.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=U(t,i),{absoluteZ:a,elevation:l}=E(t.x,t.y,t.z,this.view.spatialReference,this.view,s),u=t.clone();u.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=u;const d=T();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=a-l,this._observerFeatureId=o(n),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n){const{inputPoints:r}=e;switch(m(r.observer,t),r.observerFeatureId=n,r.observerSurfaceNormal=null,i){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,o,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,n,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==i)return null!=t&&x(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const l=U(i,n),{absoluteZ:u,elevation:d}=E(i.x,i.y,i.z,this.view.spatialReference,this.view,l),p=i.clone();switch(p.z=u,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=o(r),a.targetSurfaceNormal=null,l.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,u-d,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return a([this._updatingHandles.add((()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:P(e.target.position,this.view.spatialReference)})),(({computation:e,targetPosition:t,targetElevationInfo:o,targetFeatureInfo:i,projectedTargetPosition:n})=>{null==n.pending?this._onTargetPositionChange(e,t,n.geometry,o,i):this._updatingHandles.addPromise(n.pending)}),p)])}_connectComputationToObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver})),(({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}),p)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId})),(({computation:e,observer:t,observerGroundOffset:o,observerElevationMode:i,observerFeatureId:n})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n)}),p)}_connectComputationToCamera(e){return this._updatingHandles.add((()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty})),(({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()}))}_connectComputationToSlicePlane(e){return this._updatingHandles.add((()=>this.view.slicePlane),(()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()}))}_connectComputationToElevation(e){const t=(o,i)=>{const n=this.analysis.observer,r=e.target;let s=null,a=null,l=null,c=null,u=null,d=null;if(null!=n?.position){const e=P(n.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));s=e.geometry,a=n.elevationInfo,l=n.feature}if(null!=r.position){const e=P(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));c=e.geometry,u=r.elevationInfo,d=r.feature}null==s&&null==c||(j(o,i,J,this.view.spatialReference),null!=s&&w(J,s)&&this._onObserverPositionChange(null!=n?n.position:null,s,a,l,!1),null!=c&&w(J,c)&&this._onTargetPositionChange(e,r.position,c,u,d,!1),null!=s&&null!=c&&R(J,s,c)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:o})=>t(e,o)))}_connectComputationToTask(e){let t=null;const o={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return a([this._updatingHandles.add((()=>e.inputPoints),(()=>{t=u(t),t=n((async e=>{await d(this._frameTask.schedule((()=>this._computeResult(o)),e))}))}),{initial:!0,equals:()=>!1}),l((()=>t=u(t)))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const o of t)this._disconnectComputation(o);for(const o of e)this._connectComputation(o)}_onTargetCollectionChange({added:e,removed:t}){for(const o of t)this._removeTarget(o);for(const o of e)this._addTarget(o)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some((t=>t.target===e))||this._computations.add(new V({target:e}))}_removeTarget(e){const t=this._computations.findIndex((t=>t.target===e));this._computations.removeAt(t)}_connectObserver(){return a([this._updatingHandles.add((()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:P(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null})),(({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:o,observerFeatureInfo:i})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,o,i,!0):this._updatingHandles.addPromise(t.pending)}),p)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this._computations),(e=>this._onComputationCollectionChange(e)),{initial:!0,final:!0})}_connectTargets(){return a([this._updatingHandles.addOnCollectionChange((()=>this.analysis.targets),(e=>this._onTargetCollectionChange(e)),{initial:!0,final:!0}),this._updatingHandles.add((()=>this.analysisViewData.cursorTarget),((e,t)=>{this._onCursorTargetChange(e,t)}))])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:o}=t;if(null==e||null==o)return!1;const i=B;o.toRenderCoords(e,i);const n=t.state.camera.computeScreenPixelSizeAt(i);return Math.abs((n-this._screenPixelSize)/this._screenPixelSize)>Z}};function U(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:o,inputPoints:i}=e,{start:n,end:r,intersection:s}=o,{originalIntersection:a,originalObserver:l,originalTarget:c}=t;if(m(s,a),i.isValid){const e=B,t=y(l,a)/y(l,c);C(e,n,l),_(e,e,1-t),b(s,s,e),C(e,r,c),_(e,e,t),b(s,s,e),o.isValid=!0}else e.result=null,o.isValid=!1,o.isTargetVisible=!1}e([g({constructOnly:!0})],k.prototype,"analysis",void 0),e([g({constructOnly:!0})],k.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],k.prototype,"view",void 0),e([g()],k.prototype,"updating",null),e([g()],k.prototype,"priority",null),e([g()],k.prototype,"updateOnCameraChange",void 0),e([g()],k.prototype,"_computations",null),e([g()],k.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],k.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],k.prototype,"_effectiveObserverElevationMode",void 0),e([g()],k.prototype,"_observerFeatureId",void 0),e([g()],k.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],k.prototype,"_updatingHandles",void 0),e([g()],k.prototype,"_frameTask",void 0),e([g()],k.prototype,"_isCameraDirty",null),k=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],k);const Z=.1,B=T(),q=H(),J=S();export{k as LineOfSightController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../../chunks/tslib.es6.js";import o from"../../../../core/Accessor.js";import{equals as t}from"../../../../core/arrayUtils.js";import{clone as s}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{H as n}from"../../../../chunks/vec32.js";import{clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as a}from"../../../../geometry/support/ray.js";var m;let y=m=class extends o{constructor(r){super(r)}clone(){return new m({type:this.type,id:s(this.id),mapPoint:s(this.mapPoint),renderPoint:c(this.renderPoint),normal:s(this.normal),ray:s(this.ray),graphic:this.graphic})}equals(r){return this.type===r.type&&this.id===r.id&&i(this.mapPoint,r.mapPoint)&&n(this.renderPoint,r.renderPoint)&&t(this.normal,r.normal)&&a(this.ray,r.ray)&&this.graphic===r.graphic}};r([e()],y.prototype,"type",void 0),r([e({constructOnly:!0})],y.prototype,"id",void 0),r([e({constructOnly:!0})],y.prototype,"mapPoint",void 0),r([e({constructOnly:!0})],y.prototype,"renderPoint",void 0),r([e({constructOnly:!0})],y.prototype,"normal",void 0),r([e({constructOnly:!0})],y.prototype,"graphic",void 0),r([e({constructOnly:!0})],y.prototype,"ray",void 0),y=m=r([p("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],y);export{y as LineOfSightIntersectionResult};
5
+ import{_ as r}from"../../../../chunks/tslib.es6.js";import o from"../../../../core/Accessor.js";import{equals as t}from"../../../../core/arrayUtils.js";import{clone as s}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{G as n}from"../../../../chunks/vec32.js";import{clone as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as a}from"../../../../geometry/support/ray.js";var m;let y=m=class extends o{constructor(r){super(r)}clone(){return new m({type:this.type,id:s(this.id),mapPoint:s(this.mapPoint),renderPoint:c(this.renderPoint),normal:s(this.normal),ray:s(this.ray),graphic:this.graphic})}equals(r){return this.type===r.type&&this.id===r.id&&i(this.mapPoint,r.mapPoint)&&n(this.renderPoint,r.renderPoint)&&t(this.normal,r.normal)&&a(this.ray,r.ray)&&this.graphic===r.graphic}};r([e()],y.prototype,"type",void 0),r([e({constructOnly:!0})],y.prototype,"id",void 0),r([e({constructOnly:!0})],y.prototype,"mapPoint",void 0),r([e({constructOnly:!0})],y.prototype,"renderPoint",void 0),r([e({constructOnly:!0})],y.prototype,"normal",void 0),r([e({constructOnly:!0})],y.prototype,"graphic",void 0),r([e({constructOnly:!0})],y.prototype,"ray",void 0),y=m=r([p("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],y);export{y as LineOfSightIntersectionResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as e,fromTranslation as a,fromZRotation as r,mul as o,fromYRotation as n,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as m,h as p,a as c,I as u,f as h,b as d,n as f,i as _}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as T}from"../../../../chunks/boundedPlane.js";import{fromValues as v}from"../../../../geometry/support/ray.js";import{displayFocusMultiplier as j}from"../Slice/sliceToolConfig.js";import{ArrowManipulator as w}from"./ArrowManipulator.js";import{viewshedToolManipulatorConfiguration as D}from"./ViewshedConfiguration.js";import{screenToCircleAngle as R,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{screenToRenderRay as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ManipulatorType as x}from"../../interactive/editingTools/ManipulatorType.js";import{discRadiusSmall as H,discRadius as M}from"../../interactive/editingTools/manipulations/config.js";import{InteractiveManipulation as y}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createManipulatorDragEventPipeline as P,dragAtLocation as b}from"../../../interactive/dragEventPipeline.js";class A extends y{constructor(i){super(),this._handles=new t,this._tool=i.tool,this._view=i.view;const e=D.scaleOrientHandleRadius;this._manipulatorHeading=new w(this._view,e),this._manipulatorTilt=new w(this._view,e),this._manipulatorDistance=new w(this._view,e),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._manipulatorHeading=null,this._manipulatorTilt=null,this._manipulatorDistance=null,this._tool=null,this._view=null}createHeadingDragPipeline(t,e){return P(this._manipulatorHeading,((a,r,o,n,s)=>{const l=this._view,{tiltParallelToSurface:h,farDistanceRenderSpace:d,upVector:f,observerRenderSpace:_,targetRenderSpace:g,rightVector:v}=e,j=Math.sin(i(h))*d,w=m(V,_,p(C,f,j)),D=c(C,g,w),S=p(I,v,u(D)),E=T(w,D,S),H=R(r,l,E,e).next((t=>({...t,manipulatorType:x.ROTATE})));t(a,H,o)}))}createTiltDragPipeline(t,i){return P(this._manipulatorTilt,((e,a,r,o,n)=>{const{observerRenderSpace:s,farDistanceRenderSpace:l,upVector:m,targetDirection:c}=i,u=h(c,m),_=d(V,c,m,-u);p(_,f(_,_),l);const g=p(C,m,l),v=T(s,_,g),j=R(a,this._view,v,i).next((t=>({...t,manipulatorType:x.ROTATE})));t(e,j,r)}))}createDistanceDragPipeline(t,i){return P(this._manipulatorDistance,((e,a,r,o,n)=>{const s=v(i.observerRenderSpace,i.targetDirection),l=a.next(b(this._view,e.location)).next(E(this._view,s)).next((t=>({...t,manipulatorType:x.SCALE})));t(e,l,r)}))}updateManipulators(t){const{targetRenderSpace:i}=t;this._manipulatorHeading.renderLocation=i,this._manipulatorTilt.renderLocation=i,this._manipulatorDistance.renderLocation=i;const m=l(),c=t=>{s(m,t,m)},u=D.scaleOrientSize*(H/M);c(e(O,_(V,u,u,u))),c(S(t,O));const h=D.scaleOrientHandleRadius*j*u,d=p(V,t.targetDirection,h);c(a(O,d));const f=r(O,-k);o(f,f,n(L,-k)),this._manipulatorHeading.modelTransform=o(l(),m,f);const g=n(O,k);o(g,g,r(L,Math.PI)),this._manipulatorTilt.modelTransform=s(l(),m,g),this._manipulatorDistance.modelTransform=m}forEachManipulator(t){t(this._manipulatorHeading,x.ROTATE),t(this._manipulatorTilt,x.ROTATE),t(this._manipulatorDistance,x.SCALE)}}const O=l(),L=l(),V=g(),C=g(),I=g(),k=Math.PI/2;export{A as ScaleOrientManipulation};
5
+ import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as e,fromTranslation as a,fromZRotation as r,mul as o,fromYRotation as n,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as m,h as p,a as c,H as u,f as h,b as d,n as f,i as _}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as T}from"../../../../chunks/boundedPlane.js";import{fromValues as v}from"../../../../geometry/support/ray.js";import{displayFocusMultiplier as j}from"../Slice/sliceToolConfig.js";import{ArrowManipulator as w}from"./ArrowManipulator.js";import{viewshedToolManipulatorConfiguration as D}from"./ViewshedConfiguration.js";import{screenToCircleAngle as R,getViewshedRotationMatrix as S}from"./viewshedToolUtils.js";import{screenToRenderRay as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ManipulatorType as H}from"../../interactive/editingTools/ManipulatorType.js";import{discRadiusSmall as x,discRadius as M}from"../../interactive/editingTools/manipulations/config.js";import{InteractiveManipulation as y}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createManipulatorDragEventPipeline as P,dragAtLocation as b}from"../../../interactive/dragEventPipeline.js";class A extends y{constructor(i){super(),this._handles=new t,this._tool=i.tool,this._view=i.view;const e=D.scaleOrientHandleRadius;this._manipulatorHeading=new w(this._view,e),this._manipulatorTilt=new w(this._view,e),this._manipulatorDistance=new w(this._view,e),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._manipulatorHeading=null,this._manipulatorTilt=null,this._manipulatorDistance=null,this._tool=null,this._view=null}createHeadingDragPipeline(t,e){return P(this._manipulatorHeading,((a,r,o,n,s)=>{const l=this._view,{tiltParallelToSurface:h,farDistanceRenderSpace:d,upVector:f,observerRenderSpace:_,targetRenderSpace:g,rightVector:v}=e,j=Math.sin(i(h))*d,w=m(V,_,p(C,f,j)),D=c(C,g,w),S=p(I,v,u(D)),E=T(w,D,S),x=R(r,l,E,e).next((t=>({...t,manipulatorType:H.ROTATE})));t(a,x,o)}))}createTiltDragPipeline(t,i){return P(this._manipulatorTilt,((e,a,r,o,n)=>{const{observerRenderSpace:s,farDistanceRenderSpace:l,upVector:m,targetDirection:c}=i,u=h(c,m),_=d(V,c,m,-u);p(_,f(_,_),l);const g=p(C,m,l),v=T(s,_,g),j=R(a,this._view,v,i).next((t=>({...t,manipulatorType:H.ROTATE})));t(e,j,r)}))}createDistanceDragPipeline(t,i){return P(this._manipulatorDistance,((e,a,r,o,n)=>{const s=v(i.observerRenderSpace,i.targetDirection),l=a.next(b(this._view,e.location)).next(E(this._view,s)).next((t=>({...t,manipulatorType:H.SCALE})));t(e,l,r)}))}updateManipulators(t){const{targetRenderSpace:i}=t;this._manipulatorHeading.renderLocation=i,this._manipulatorTilt.renderLocation=i,this._manipulatorDistance.renderLocation=i;const m=l(),c=t=>{s(m,t,m)},u=D.scaleOrientSize*(x/M);c(e(O,_(V,u,u,u))),c(S(t,O));const h=D.scaleOrientHandleRadius*j*u,d=p(V,t.targetDirection,h);c(a(O,d));const f=r(O,-k);o(f,f,n(L,-k)),this._manipulatorHeading.modelTransform=o(l(),m,f);const g=n(O,k);o(g,g,r(L,Math.PI)),this._manipulatorTilt.modelTransform=s(l(),m,g),this._manipulatorDistance.modelTransform=m}forEachManipulator(t){t(this._manipulatorHeading,H.ROTATE),t(this._manipulatorTilt,H.ROTATE),t(this._manipulatorDistance,H.SCALE)}}const O=l(),L=l(),V=g(),C=g(),I=g(),k=Math.PI/2;export{A as ScaleOrientManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,I as M,f as _}from"../../../../chunks/vec32.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projection.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let I=class extends e{constructor(i){super(i),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c((()=>this.viewshedComputedData?.observerRenderSpace),(i=>{null!=i&&(this._moveManipulation.renderLocation=i,this._observerManipulator.renderLocation=i)}),d),c((()=>this.viewshedComputedData?.heading),(i=>{i&&(this._moveManipulation.angle=r(90-i))}),v),c((()=>{const{viewshedComputedData:i}=this;return{viewshedComputedData:i,observer:i?.observer}}),(({viewshedComputedData:i,observer:e},a)=>{this._grabbing&&e!==a?.observer||(this.removeHandles(E),i?.isValid()&&this.addHandles([this._buildObserverDragPipeline(i),this._buildFOVDragPipeline(i),this._buildScaleOrientDragPipeline(i)].filter(t),E))}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,target:i.targetRenderSpace,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorsTransform(i.viewshedCompData)}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView,tilt:i.tilt}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorVisuals(i.viewshedCompData)}),v),c((()=>{const i=this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1),e=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:i&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:i&&(!this.parentTool.creating||e)}}),(({fovManipulationAvailable:i,nonFOVManipulationAvailable:e})=>{this._moveManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e,this._fieldOfViewManipulation.available=i}),v),c((()=>{const i=this.viewshedComputedData;if(!i?.isValid())return null;const{observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=i;return{viewshedCompData:i,observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}}),(i=>{null!=i&&this._scaleOrientManipulation.updateManipulators(i.viewshedCompData)}),v)]);const i=i=>{const e=this.analysisViewData;this.addHandles([i.events.on("focus-changed",(()=>{const i=this._someManipulatorHovering();i&&this.parentTool.subToolHandles.forEach((({subTool:i})=>{i._resetHoveringTask()})),this._someManipulatorSelected()||i||(this._forceHoveringTask=a((async i=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,i)),u(i),this._forceHoveringTask=null,this._updateManipulatorVisibility()})))})),i.events.on("grab-changed",(t=>{this._grabbing="start"===t.action,"end"===t.action&&e.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach((({subTool:i})=>{i!==this&&i._setInteractive(!this._grabbing)})),this._setInteractive((e=>e.hasManipulator(i)||!this._grabbing))})),i.events.on("drag",(i=>{"start"===i.action&&e.tool?.updateInteractionVisualsVisibility()}))])};this._forEachManipulator(i)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(i){const e=this.viewshed;null!=e&&(e.observer=i)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:i,grabbing:e}=this._moveManipulation;return{dragging:i,grabbing:e}}get scaleOrientInteractionState(){const{dragging:i,grabbing:e}=this._scaleOrientManipulation;return{dragging:i,grabbing:e}}_setInteractive(i){const e="boolean"==typeof i;this._forEachManipulation((t=>t.interactive=e?i:i(t)))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(i){let e=!1;return this._forEachManipulator((t=>{e=e||t===i})),e}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(i){const e={mode:"absolute-height",offset:0},t=i.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline(((i,e,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next((i=>(this.observer=l.data.geometry,i))),cancel:n}}),e,a,void 0)}_buildFOVDragPipeline(i){let e=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((a,n,s)=>{if(null==i)return{steps:n,cancel:s};const r=i.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((a=>{"start"===a.action&&(l=null,e=i.horizontalFieldOfView,t=i.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const i="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===e&&i||360===e&&!i:0===t&&i}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=e/2-n;break;case"right":p=e/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a})),cancel:s}}),i)}_buildScaleOrientDragPipeline(i){let e=0,t=0;const a=(e,t)=>(a,o,n)=>{if(null==i)return{steps:o,cancel:n};const s=i.viewshed;return n=n.next(S(s,[e])),{steps:o=o.next(t(s,i)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",((e,a)=>a=>("start"===a.action&&(t=i.heading),e.heading=o.normalize(t+a.deltaAngle),a))),i),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",((t,a)=>a=>{"start"===a.action&&(e=i.tilt);let o=e+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a})),i),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",((i,e)=>t=>{const a=g(U,t.renderEnd,e.observerRenderSpace),o=M(a)*e.metersPerUnit,n=_(a,e.targetDirection)<0?H.scaleOrientMinDistance:o;return i.farDistance=n,t})),i)])}_updateManipulatorVisibility(){const i=this._someManipulatorSelected(),e=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=i=>{o.push(i.disableDisplay())};i||!a&&e?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),i||!a&&e||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),i||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(i){this._forEachManipulation((e=>{e.forEachManipulator(i)})),i(this._observerManipulator)}_forEachManipulation(i){i(this._moveManipulation),i(this._fieldOfViewManipulation),i(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:i=>{this._forceHoveringTestPromise=i}}}};i([m({constructOnly:!0})],I.prototype,"analysis",void 0),i([m({constructOnly:!0})],I.prototype,"analysisViewData",void 0),i([m({constructOnly:!0})],I.prototype,"parentTool",void 0),i([m({constructOnly:!0,nonNullable:!0})],I.prototype,"view",void 0),i([m()],I.prototype,"viewshed",null),i([m()],I.prototype,"_grabbing",void 0),i([m()],I.prototype,"grabbing",null),i([m()],I.prototype,"viewshedComputedData",void 0),i([m()],I.prototype,"observer",null),I=i([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],I);const U=b(),R=new n(0,180);export{I as ViewshedSubTool};
5
+ import{_ as i}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,H as M,f as _}from"../../../../chunks/vec32.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projection.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends e{constructor(i){super(i),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c((()=>this.viewshedComputedData?.observerRenderSpace),(i=>{null!=i&&(this._moveManipulation.renderLocation=i,this._observerManipulator.renderLocation=i)}),d),c((()=>this.viewshedComputedData?.heading),(i=>{i&&(this._moveManipulation.angle=r(90-i))}),v),c((()=>{const{viewshedComputedData:i}=this;return{viewshedComputedData:i,observer:i?.observer}}),(({viewshedComputedData:i,observer:e},a)=>{this._grabbing&&e!==a?.observer||(this.removeHandles(E),i?.isValid()&&this.addHandles([this._buildObserverDragPipeline(i),this._buildFOVDragPipeline(i),this._buildScaleOrientDragPipeline(i)].filter(t),E))}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,target:i.targetRenderSpace,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorsTransform(i.viewshedCompData)}),v),c((()=>{const i=this.viewshedComputedData;return i?.isValid()?{viewshedCompData:i,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView,tilt:i.tilt}:null}),(i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorVisuals(i.viewshedCompData)}),v),c((()=>{const i=this.analysisViewData.visible&&(this.viewshedComputedData?.isValid()??!1),e=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:i&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:i&&(!this.parentTool.creating||e)}}),(({fovManipulationAvailable:i,nonFOVManipulationAvailable:e})=>{this._moveManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e,this._fieldOfViewManipulation.available=i}),v),c((()=>{const i=this.viewshedComputedData;if(!i?.isValid())return null;const{observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=i;return{viewshedCompData:i,observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}}),(i=>{null!=i&&this._scaleOrientManipulation.updateManipulators(i.viewshedCompData)}),v)]);const i=i=>{const e=this.analysisViewData;this.addHandles([i.events.on("focus-changed",(()=>{const i=this._someManipulatorHovering();i&&this.parentTool.subToolHandles.forEach((({subTool:i})=>{i._resetHoveringTask()})),this._someManipulatorSelected()||i||(this._forceHoveringTask=a((async i=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,i)),u(i),this._forceHoveringTask=null,this._updateManipulatorVisibility()})))})),i.events.on("grab-changed",(t=>{this._grabbing="start"===t.action,"end"===t.action&&e.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach((({subTool:i})=>{i!==this&&i._setInteractive(!this._grabbing)})),this._setInteractive((e=>e.hasManipulator(i)||!this._grabbing))})),i.events.on("drag",(i=>{"start"===i.action&&e.tool?.updateInteractionVisualsVisibility()}))])};this._forEachManipulator(i)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(i){const e=this.viewshed;null!=e&&(e.observer=i)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:i,grabbing:e}=this._moveManipulation;return{dragging:i,grabbing:e}}get scaleOrientInteractionState(){const{dragging:i,grabbing:e}=this._scaleOrientManipulation;return{dragging:i,grabbing:e}}_setInteractive(i){const e="boolean"==typeof i;this._forEachManipulation((t=>t.interactive=e?i:i(t)))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(i){let e=!1;return this._forEachManipulator((t=>{e=e||t===i})),e}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(i){const e={mode:"absolute-height",offset:0},t=i.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline(((i,e,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next((i=>(this.observer=l.data.geometry,i))),cancel:n}}),e,a,void 0)}_buildFOVDragPipeline(i){let e=0,t=0;return this._fieldOfViewManipulation.createDragPipeline(((a,n,s)=>{if(null==i)return{steps:n,cancel:s};const r=i.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next((a=>{"start"===a.action&&(l=null,e=i.horizontalFieldOfView,t=i.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const i="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===e&&i||360===e&&!i:0===t&&i}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=e/2-n;break;case"right":p=e/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a})),cancel:s}}),i)}_buildScaleOrientDragPipeline(i){let e=0,t=0;const a=(e,t)=>(a,o,n)=>{if(null==i)return{steps:o,cancel:n};const s=i.viewshed;return n=n.next(S(s,[e])),{steps:o=o.next(t(s,i)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",((e,a)=>a=>("start"===a.action&&(t=i.heading),e.heading=o.normalize(t+a.deltaAngle),a))),i),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",((t,a)=>a=>{"start"===a.action&&(e=i.tilt);let o=e+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a})),i),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",((i,e)=>t=>{const a=g(I,t.renderEnd,e.observerRenderSpace),o=M(a)*e.metersPerUnit,n=_(a,e.targetDirection)<0?H.scaleOrientMinDistance:o;return i.farDistance=n,t})),i)])}_updateManipulatorVisibility(){const i=this._someManipulatorSelected(),e=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=i=>{o.push(i.disableDisplay())};i||!a&&e?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),i||!a&&e||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),i||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(i){this._forEachManipulation((e=>{e.forEachManipulator(i)})),i(this._observerManipulator)}_forEachManipulation(i){i(this._moveManipulation),i(this._fieldOfViewManipulation),i(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:i=>{this._forceHoveringTestPromise=i}}}};i([m({constructOnly:!0})],U.prototype,"analysis",void 0),i([m({constructOnly:!0})],U.prototype,"analysisViewData",void 0),i([m({constructOnly:!0})],U.prototype,"parentTool",void 0),i([m({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),i([m()],U.prototype,"viewshed",null),i([m()],U.prototype,"_grabbing",void 0),i([m()],U.prototype,"grabbing",null),i([m()],U.prototype,"viewshedComputedData",void 0),i([m()],U.prototype,"observer",null),U=i([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=b(),R=new n(0,180);export{U as ViewshedSubTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,sync as l,when as c,initial as d}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,I as g,i as w,r as v,f as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../../geometry/Point.js";import{create as f,fromPositionAndNormal as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as j}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as M}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as P}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let x=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._creationState=!1,this._interactionVisualElements=null,this._settings=new j({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>e?.some((e=>e.viewshedComputedData.isValid()))),(e=>{e&&this.finishToolCreation()}),r),o((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),o((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),l),o((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),c((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),d),o((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),o((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),d)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}createViewsheds(){this.selectedViewshed=null,this._creationState="placing-observer"}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._creationState="placing-observer",this._stagedViewshed=null,this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){if(this.creating){if(this.removeStaged())return this._creationState="placing-observer",this.selectedViewshed=null,void e.stopPropagation();this._creationState=!1}else if(!this.grabbing)return this.selectedViewshed=null,void e.stopPropagation()}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=U(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=P(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new M({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([o((()=>e.zVerticalLine),(e=>e.apply(s)),r),o((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,r=e?o.grabbing:o.dragging,l=s.scaleOrientInteractionState,c=e?l.grabbing:l.dragging,d=i&&(r||c);if(n(d,r),d){const e=r?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,r)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function U(e,t,i){const s=t.observerRenderSpace,n=m(W,i,s),o=g(n)*t.metersPerUnit,r=e.renderCoordsHelper.basisMatrixAtPosition(s,F),l=w(A,r[8],r[9],r[10]),c=y(s,l,G),d=S(c,i,z),h=m(d,d,s),u=(g(h)<1e-4?90:a(v(n,h)))*(_(l,n)<0?-1:1)+90,p=w(K,r[4],r[5],r[6]),V=a(v(p,h)),b=w(K,r[0],r[1],r[2]);return{heading:_(h,b)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],x.prototype,"view",void 0),e([h()],x.prototype,"analysisViewData",void 0),e([h()],x.prototype,"removeIncompleteOnCancel",void 0),e([h()],x.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],x.prototype,"analysis",void 0),e([h()],x.prototype,"subToolHandles",void 0),e([h()],x.prototype,"_stagedViewshed",void 0),e([h()],x.prototype,"_stagedViewshedComputedData",void 0),e([h()],x.prototype,"_creationState",void 0),e([h({readOnly:!0})],x.prototype,"cursor",null),e([h()],x.prototype,"_selectedManipulator",void 0),e([h()],x.prototype,"_selectedSubTool",null),e([h()],x.prototype,"selectedViewshed",null),e([h()],x.prototype,"selectedViewshedComputedData",null),e([h()],x.prototype,"stagedViewshed",null),e([h()],x.prototype,"grabbing",null),e([h()],x.prototype,"creating",null),e([h()],x.prototype,"isPlacingTarget",null),x=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],x);const W=V(),A=V(),z=V(),K=V(),F=p(),G=f(),B={mapPoint:new b,scenePoint:V(),feature:null},q=x;export{q as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as r,sync as l,when as c,initial as d}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,H as g,i as w,r as v,f as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import b from"../../../../geometry/Point.js";import{create as f,fromPositionAndNormal as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as j}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as M}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as P}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as I}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let x=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._creationState=!1,this._interactionVisualElements=null,this._settings=new j({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>e?.some((e=>e.viewshedComputedData.isValid()))),(e=>{e&&this.finishToolCreation()}),r),o((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),o((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),l),o((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),c((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),d),o((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),o((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),d)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}createViewsheds(){this.selectedViewshed=null,this._creationState="placing-observer"}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._creationState="placing-observer",this._stagedViewshed=null,this.selectedViewshed=e}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){if(this.creating){if(this.removeStaged())return this._creationState="placing-observer",this.selectedViewshed=null,void e.stopPropagation();this._creationState=!1}else if(!this.grabbing)return this.selectedViewshed=null,void e.stopPropagation()}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=U(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=P(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new M({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:I.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([o((()=>e.zVerticalLine),(e=>e.apply(s)),r),o((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,r=e?o.grabbing:o.dragging,l=s.scaleOrientInteractionState,c=e?l.grabbing:l.dragging,d=i&&(r||c);if(n(d,r),d){const e=r?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,r)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function U(e,t,i){const s=t.observerRenderSpace,n=m(W,i,s),o=g(n)*t.metersPerUnit,r=e.renderCoordsHelper.basisMatrixAtPosition(s,F),l=w(A,r[8],r[9],r[10]),c=y(s,l,G),d=S(c,i,z),h=m(d,d,s),u=(g(h)<1e-4?90:a(v(n,h)))*(_(l,n)<0?-1:1)+90,p=w(K,r[4],r[5],r[6]),V=a(v(p,h)),b=w(K,r[0],r[1],r[2]);return{heading:_(h,b)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],x.prototype,"view",void 0),e([h()],x.prototype,"analysisViewData",void 0),e([h()],x.prototype,"removeIncompleteOnCancel",void 0),e([h()],x.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],x.prototype,"analysis",void 0),e([h()],x.prototype,"subToolHandles",void 0),e([h()],x.prototype,"_stagedViewshed",void 0),e([h()],x.prototype,"_stagedViewshedComputedData",void 0),e([h()],x.prototype,"_creationState",void 0),e([h({readOnly:!0})],x.prototype,"cursor",null),e([h()],x.prototype,"_selectedManipulator",void 0),e([h()],x.prototype,"_selectedSubTool",null),e([h()],x.prototype,"selectedViewshed",null),e([h()],x.prototype,"selectedViewshedComputedData",null),e([h()],x.prototype,"stagedViewshed",null),e([h()],x.prototype,"grabbing",null),e([h()],x.prototype,"creating",null),e([h()],x.prototype,"isPlacingTarget",null),x=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],x);const W=V(),A=V(),z=V(),K=V(),F=p(),G=f(),B={mapPoint:new b,scenePoint:V(),feature:null},q=x;export{q 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,I as _,n as V,h as f,r as v,v as w,c as E,g as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import j from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as D}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:R.OccludeAndTransparent},i={...t,stipplePattern:O(2)};this._observerVisualElement=new D({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F(e),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a((()=>{const e=this.viewshedComputedData;if(!e?.isValid())return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}}),(e=>{const t=null!=e;this._forEachVisualElement((e=>e.attached=t)),t&&this._updateVisualElements(e)}),{initial:!0,equals:s}),a((()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}}),(({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()}),l),a((()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}}),(({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement((e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?R.OccludeAndTransparent:R.Occlude})),[this._centralLatitude,this._centralLongitude].forEach((i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t}))}),l),a((()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=this.view.activeTool,o=!t?.active&&r instanceof j&&r.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||o),color:this._color}}),(({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement((e=>e.color=t))}),l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const r=s.tool?.active||s.interactive,o=e.viewshed===s.tool?.stagedViewshed,a=r&&(i||o)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=o(this._observerVisualElement),this._shapeVisualElement=o(this._shapeVisualElement),this._frameLinesVisualElement=o(this._frameLinesVisualElement),this._leftArcVisualElement=o(this._leftArcVisualElement),this._rightArcVisualElement=o(this._rightArcVisualElement),this._topArcVisualElement=o(this._topArcVisualElement),this._bottomArcVisualElement=o(this._bottomArcVisualElement),this._centralLongitude=o(this._centralLongitude),this._centralLatitude=o(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(o,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=r(a),c=g(),p=m();h(p,n/2,l),d(c,o,p),P(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,o,p),P(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),V(c,c),f(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const j=[],y=Math.ceil(Math.abs(u)/a),D=m();h(D,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,D),b(R,t,F);const i=g();E(i,R),j.push([e,i])}e.geometry=j}e([n()],S.prototype,"view",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);const z=S;export{z as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,H as _,n as V,h as f,r as v,v as w,c as E,g as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import j from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as D}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as R}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as O}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:R.OccludeAndTransparent},i={...t,stipplePattern:O(2)};this._observerVisualElement=new D({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F(e),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a((()=>{const e=this.viewshedComputedData;if(!e?.isValid())return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}}),(e=>{const t=null!=e;this._forEachVisualElement((e=>e.attached=t)),t&&this._updateVisualElements(e)}),{initial:!0,equals:s}),a((()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}}),(({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()}),l),a((()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}}),(({visible:e,selected:t,staged:i,horFovNot360:s})=>{const r=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const o=e&&(t||s);this._leftArcVisualElement.visible=o,this._rightArcVisualElement.visible=o,this._forEachLineVisualElement((e=>{e.width=r?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?R.OccludeAndTransparent:R.Occlude})),[this._centralLatitude,this._centralLongitude].forEach((i=>{i.width=2*(r?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t}))}),l),a((()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,r=this.view.activeTool,o=!t?.active&&r instanceof j&&r.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||o),color:this._color}}),(({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement((e=>e.color=t))}),l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const r=s.tool?.active||s.interactive,o=e.viewshed===s.tool?.stagedViewshed,a=r&&(i||o)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=o(this._observerVisualElement),this._shapeVisualElement=o(this._shapeVisualElement),this._frameLinesVisualElement=o(this._frameLinesVisualElement),this._leftArcVisualElement=o(this._leftArcVisualElement),this._rightArcVisualElement=o(this._rightArcVisualElement),this._topArcVisualElement=o(this._topArcVisualElement),this._bottomArcVisualElement=o(this._bottomArcVisualElement),this._centralLongitude=o(this._centralLongitude),this._centralLatitude=o(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:r}=e,o=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(o,i),this._updateFrameArcs(t,i,r),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:o,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=r(a),c=g(),p=m();h(p,n/2,l),d(c,o,p),P(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,o,p),P(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";P(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),P(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";P(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),P(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function P(e,t,i,s,r,o,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),V(c,c),f(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const j=[],y=Math.ceil(Math.abs(u)/a),D=m();h(D,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,D),b(R,t,F);const i=g();E(i,R),j.push([e,i])}e.geometry=j}e([n()],S.prototype,"view",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);const z=S;export{z 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.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import i from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{G as m,d,n as u,f as p,e as h,h as f}from"../../../../../chunks/vec32.js";import{create as _,fromValues as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{ManipulatorType as U}from"../ManipulatorType.js";import{Settings as O}from"../settings.js";import{discRadius as b}from"./config.js";import{Manipulation as y}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as T,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as F}from"../../../webgl-engine/lib/Material.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as A}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as E}from"../../../../interactive/interfaces.js";class R extends y{constructor(t){super(),this._radius=b,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(C(r,1,.25),F.Occlude),materialFocused:v(C(r,1,0),F.Occlude),materialOccludedUnfocused:v(C(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(C(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s((()=>this._view.effectiveTheme.accentColor),(t=>{const e=C(t,1,.25),i=C(t,1,0),r=C(t,.7,0),a=C(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})})),this._createManipulator(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=L,this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()}))}forEachManipulator(t){t(this._manipulator,U.TRANSLATE_Z)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,(e=>this.createDragPipeline(((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a))),a)))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,((r,a,o,s,n)=>{const l=a.next((t=>({...t,manipulatorType:U.TRANSLATE_Z}))).next(M(i,r.renderLocation,e)).next(A());t(r,l,o,s,n)}))}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/b,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[j(0,0,0),j(0,0,i)],m=[j(0,0,0),j(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,_=T(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,E.Unfocused),new g(_,E.Unfocused),new g(w.instantiate({material:p}),E.Focused),new g(_.instantiate({material:p}),E.Focused),new g(w.instantiate({material:h}),E.Unfocused),new g(_.instantiate({material:h}),E.Unfocused),new g(w.instantiate({material:f}),E.Focused),new g(_.instantiate({material:f}),E.Focused)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=D;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(H,r,i.eye);u(n,n);const l=S;t.renderCoordsHelper.worldUpAtPosition(D,l);const c=Math.abs(p(n,l)),_=h(H,n,l),j=h(H,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/b,U=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*U),e[12]-=H[0],e[13]-=H[1],e[14]-=H[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function C(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const D=_(),H=_(),S=_(),L=()=>{};export{R as MoveZManipulation};
5
+ import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import i from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX as l}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{F as m,d,n as u,f as p,e as h,h as f}from"../../../../../chunks/vec32.js";import{create as _,fromValues as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{ManipulatorType as U}from"../ManipulatorType.js";import{Settings as O}from"../settings.js";import{discRadius as b}from"./config.js";import{Manipulation as y}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as T,createConeGeometry as F}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as z}from"../../../webgl-engine/lib/Material.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as A}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as E}from"../../../../interactive/interfaces.js";class R extends y{constructor(t){super(),this._radius=b,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(C(r,1,.25),z.Occlude),materialFocused:v(C(r,1,0),z.Occlude),materialOccludedUnfocused:v(C(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(C(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s((()=>this._view.effectiveTheme.accentColor),(t=>{const e=C(t,1,.25),i=C(t,1,0),r=C(t,.7,0),a=C(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})})),this._createManipulator(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=L,this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()}))}forEachManipulator(t){t(this._manipulator,U.TRANSLATE_Z)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,(e=>this.createDragPipeline(((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a))),a)))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,((r,a,o,s,n)=>{const l=a.next((t=>({...t,manipulatorType:U.TRANSLATE_Z}))).next(M(i,r.renderLocation,e)).next(A());t(r,l,o,s,n)}))}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/b,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[j(0,0,0),j(0,0,i)],m=[j(0,0,0),j(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,_=T(u,s,o/2,16,!1),w=F(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,E.Unfocused),new g(_,E.Unfocused),new g(w.instantiate({material:p}),E.Focused),new g(_.instantiate({material:p}),E.Focused),new g(w.instantiate({material:h}),E.Unfocused),new g(_.instantiate({material:h}),E.Unfocused),new g(w.instantiate({material:f}),E.Focused),new g(_.instantiate({material:f}),E.Focused)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=D;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(H,r,i.eye);u(n,n);const l=S;t.renderCoordsHelper.worldUpAtPosition(D,l);const c=Math.abs(p(n,l)),_=h(H,n,l),j=h(H,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/b,U=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*U),e[12]-=H[0],e[13]-=H[1],e[14]-=H[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function C(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const D=_(),H=_(),S=_(),L=()=>{};export{R as MoveZManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{colorVectorEquals as e}from"../../../../core/colorUtils.js";import t from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as i,a,e as n,I as l,d as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as f}from"../../webgl-engine/lib/Material.js";import{MeasurementArrowMaterial as C}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class y extends p{constructor(e){super(e),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=f.OccludeAndTransparent,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=m(),this._contrastColor=m(),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial?.setParameters({renderOccluded:e}))}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(e){this._stripeLength=e,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(e){if(this._stripesEnabled=e,this.attached){const e=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:e})}}get color(){return this._color}set color(t){e(t,this._color)||(d(this._color,t),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(t){e(t,this._color)||(d(this._contrastColor,t),this._updateArrowColor())}createExternalResources(){const e=this._color,r=this._contrastColor,o=this._stripesEnabled?r:e;this._arrowMaterial=new C({outlineColor:e,stripeEvenColor:o,stripeOddColor:e,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new t,this._handles.add(s((()=>this.view.state.camera),(()=>{this._viewChanged()})))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachExternalMaterial(e){e(this._arrowMaterial)}createGeometries(e){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const t=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);t.transformation=this._originTransform,e.addGeometry(t),this._viewChanged()}_createArrowGeometry(e,t,r,s){const o=this.view,a=o.renderCoordsHelper,n=[],l=[],c=(e,t)=>{const s=_.get();h(s,e,r),n.push(s),l.push(t)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=_.get();if(a.worldUpAtPosition(this._arrowCenter,r),v(e,t,r)){const{heading:t,tilt:s}=o.camera,{direction:a}=g(o,e,t,s,j);i(r,a)}c(e,r),c(t,r)}else{s.eval(.5,this._arrowCenter);const e=this._arrowSubdivisions+1&-2;for(let t=0;t<e;++t){const r=t/(e-1),o=_.get(),i=_.get();s.eval(r,o),a.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,n,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const e=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*e})}}_updateArrowColor(){if(!this.attached)return;const e=this._color,t=this._contrastColor,r=this._stripesEnabled?t:e,s=e,o=e;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function v(e,t,r){const s=a(b,t,e),o=n(b,s,r);return 0===l(o)}const b=c(),j=u();export{y as MeasurementArrowVisualElement};
5
+ import{colorVectorEquals as e}from"../../../../core/colorUtils.js";import t from"../../../../core/Handles.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as i,a,e as n,H as l,d as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{headingTiltToDirectionUp as g}from"../../support/cameraUtils.js";import{createDirectionUp as u}from"../../support/cameraUtilsInternal.js";import{createPolylineGeometry as w}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as f}from"../../webgl-engine/lib/Material.js";import{MeasurementArrowMaterial as C}from"../../webgl-engine/materials/MeasurementArrowMaterial.js";class y extends p{constructor(e){super(e),this._arrowWidth=16,this._arrowSubdivisions=128,this._origin=c(),this._originTransform=o(),this._arrowCenter=c(),this._renderOccluded=f.OccludeAndTransparent,this._geometry=null,this._stripeLength=1,this._stripesEnabled=!0,this._color=m(),this._contrastColor=m(),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._arrowMaterial?.setParameters({renderOccluded:e}))}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this._geometryChanged()}get stripeLength(){return this._stripeLength}set stripeLength(e){this._stripeLength=e,this.attached&&this._arrowMaterial.setParameters({stripeLength:this._stripeLength})}get stripesEnabled(){return this._stripesEnabled}set stripesEnabled(e){if(this._stripesEnabled=e,this.attached){const e=this._stripesEnabled?this._contrastColor:this._color;this._arrowMaterial.setParameters({stripeEvenColor:e})}}get color(){return this._color}set color(t){e(t,this._color)||(d(this._color,t),this._updateArrowColor())}get contrastColor(){return this._contrastColor}set contrastColor(t){e(t,this._color)||(d(this._contrastColor,t),this._updateArrowColor())}createExternalResources(){const e=this._color,r=this._contrastColor,o=this._stripesEnabled?r:e;this._arrowMaterial=new C({outlineColor:e,stripeEvenColor:o,stripeOddColor:e,renderOccluded:this.renderOccluded,polygonOffset:!0,isDecoration:this.isDecoration}),this._handles=new t,this._handles.add(s((()=>this.view.state.camera),(()=>{this._viewChanged()})))}destroyExternalResources(){this._arrowMaterial=null,this._handles=r(this._handles)}forEachExternalMaterial(e){e(this._arrowMaterial)}createGeometries(e){if(null==this._geometry?.startRenderSpace||null==this._geometry.endRenderSpace)return;const t=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);t.transformation=this._originTransform,e.addGeometry(t),this._viewChanged()}_createArrowGeometry(e,t,r,s){const o=this.view,a=o.renderCoordsHelper,n=[],l=[],c=(e,t)=>{const s=_.get();h(s,e,r),n.push(s),l.push(t)};if("euclidean"===s.type){s.eval(.5,this._arrowCenter);const r=_.get();if(a.worldUpAtPosition(this._arrowCenter,r),v(e,t,r)){const{heading:t,tilt:s}=o.camera,{direction:a}=g(o,e,t,s,j);i(r,a)}c(e,r),c(t,r)}else{s.eval(.5,this._arrowCenter);const e=this._arrowSubdivisions+1&-2;for(let t=0;t<e;++t){const r=t/(e-1),o=_.get(),i=_.get();s.eval(r,o),a.worldUpAtPosition(o,i),c(o,i)}}return w(this._arrowMaterial,n,l)}_geometryChanged(){this.recreateGeometry()}_viewChanged(){if(this.view.ready&&this.attached&&null!=this._geometry){const e=this.view.state.camera.computeScreenPixelSizeAt(this._arrowCenter);this._arrowMaterial.setParameters({width:this._arrowWidth*e})}}_updateArrowColor(){if(!this.attached)return;const e=this._color,t=this._contrastColor,r=this._stripesEnabled?t:e,s=e,o=e;this._arrowMaterial.setParameters({stripeEvenColor:r,outlineColor:s,stripeOddColor:o})}}function v(e,t,r){const s=a(b,t,e),o=n(b,s,r);return 0===l(o)}const b=c(),j=u();export{y as MeasurementArrowVisualElement};