@arcgis/core 4.33.0-next.20250508 → 4.33.0-next.20250509

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 (380) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.d.ts +2 -0
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  4. package/arcade/functions/aiServices.js +1 -1
  5. package/arcade.js +1 -1
  6. package/assets/components/assets/input-time-picker/t9n/messages.ar.json +1 -1
  7. package/assets/components/assets/input-time-picker/t9n/messages.bg.json +1 -1
  8. package/assets/components/assets/input-time-picker/t9n/messages.bs.json +1 -1
  9. package/assets/components/assets/input-time-picker/t9n/messages.ca.json +1 -1
  10. package/assets/components/assets/input-time-picker/t9n/messages.cs.json +1 -1
  11. package/assets/components/assets/input-time-picker/t9n/messages.da.json +1 -1
  12. package/assets/components/assets/input-time-picker/t9n/messages.de.json +1 -1
  13. package/assets/components/assets/input-time-picker/t9n/messages.el.json +1 -1
  14. package/assets/components/assets/input-time-picker/t9n/messages.en.json +1 -1
  15. package/assets/components/assets/input-time-picker/t9n/messages.es.json +1 -1
  16. package/assets/components/assets/input-time-picker/t9n/messages.et.json +1 -1
  17. package/assets/components/assets/input-time-picker/t9n/messages.fi.json +1 -1
  18. package/assets/components/assets/input-time-picker/t9n/messages.fr.json +1 -1
  19. package/assets/components/assets/input-time-picker/t9n/messages.he.json +1 -1
  20. package/assets/components/assets/input-time-picker/t9n/messages.hr.json +1 -1
  21. package/assets/components/assets/input-time-picker/t9n/messages.hu.json +1 -1
  22. package/assets/components/assets/input-time-picker/t9n/messages.id.json +1 -1
  23. package/assets/components/assets/input-time-picker/t9n/messages.it.json +1 -1
  24. package/assets/components/assets/input-time-picker/t9n/messages.ja.json +1 -1
  25. package/assets/components/assets/input-time-picker/t9n/messages.json +1 -1
  26. package/assets/components/assets/input-time-picker/t9n/messages.ko.json +1 -1
  27. package/assets/components/assets/input-time-picker/t9n/messages.lt.json +1 -1
  28. package/assets/components/assets/input-time-picker/t9n/messages.lv.json +1 -1
  29. package/assets/components/assets/input-time-picker/t9n/messages.nl.json +1 -1
  30. package/assets/components/assets/input-time-picker/t9n/messages.no.json +1 -1
  31. package/assets/components/assets/input-time-picker/t9n/messages.pl.json +1 -1
  32. package/assets/components/assets/input-time-picker/t9n/messages.pt-BR.json +1 -1
  33. package/assets/components/assets/input-time-picker/t9n/messages.pt-PT.json +1 -1
  34. package/assets/components/assets/input-time-picker/t9n/messages.ro.json +1 -1
  35. package/assets/components/assets/input-time-picker/t9n/messages.ru.json +1 -1
  36. package/assets/components/assets/input-time-picker/t9n/messages.sk.json +1 -1
  37. package/assets/components/assets/input-time-picker/t9n/messages.sl.json +1 -1
  38. package/assets/components/assets/input-time-picker/t9n/messages.sr.json +1 -1
  39. package/assets/components/assets/input-time-picker/t9n/messages.sv.json +1 -1
  40. package/assets/components/assets/input-time-picker/t9n/messages.th.json +1 -1
  41. package/assets/components/assets/input-time-picker/t9n/messages.tr.json +1 -1
  42. package/assets/components/assets/input-time-picker/t9n/messages.uk.json +1 -1
  43. package/assets/components/assets/input-time-picker/t9n/messages.vi.json +1 -1
  44. package/assets/components/assets/input-time-picker/t9n/messages.zh-CN.json +1 -1
  45. package/assets/components/assets/input-time-picker/t9n/messages.zh-HK.json +1 -1
  46. package/assets/components/assets/input-time-picker/t9n/messages.zh-TW.json +1 -1
  47. package/assets/esri/core/workers/RemoteClient.js +1 -1
  48. package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js +2 -0
  49. package/assets/esri/core/workers/chunks/{543eb46b55cacd6e1dbc.js.LICENSE.txt → 0766ecb677d667e5fb83.js.LICENSE.txt} +1 -1
  50. package/assets/esri/core/workers/chunks/{c607d618b64d3accecc4.js → 0aca29f7156b2b412f2e.js} +1 -1
  51. package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +1 -0
  52. package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js +2 -0
  53. package/assets/esri/core/workers/chunks/{d8dc922f7466300b668f.js.LICENSE.txt → 218a66d53f7cf4f285aa.js.LICENSE.txt} +2 -2
  54. package/assets/esri/core/workers/chunks/{037af6379f3e9278633b.js → 243dc74ec62891ba1ef7.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{f74b5659b6496a5c4c0c.js → 2e0af748eba93f3ea6cb.js} +1 -1
  56. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +2 -0
  57. package/assets/esri/core/workers/chunks/{7b4523ab392966624d97.js.LICENSE.txt → 3596540ef49e5330ceb2.js.LICENSE.txt} +1 -7
  58. package/assets/esri/core/workers/chunks/{a22c88b0a525e602dce0.js → 3d0e09ef78dc2fd6957a.js} +1 -1
  59. package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +1 -0
  60. package/assets/esri/core/workers/chunks/{ee1d104e2bcc5d808fa4.js → 5228fc7fcdf57f44781e.js} +1 -1
  61. package/assets/esri/core/workers/chunks/5371df31553626528c69.js +1 -0
  62. package/assets/esri/core/workers/chunks/54f4a1131f99468db076.js +1 -0
  63. package/assets/esri/core/workers/chunks/{49c968e91c3c48aaa110.js → 5583d18032ed8bc17c74.js} +1 -1
  64. package/assets/esri/core/workers/chunks/5e7f35bf1aab93cb1c52.js +1 -0
  65. package/assets/esri/core/workers/chunks/61c74a733718d667b071.js +1 -0
  66. package/assets/esri/core/workers/chunks/{69f7fe6c58e4931597f6.js → 631205dc4d73d49ec9ed.js} +1 -1
  67. package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +1 -0
  68. package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +1 -0
  69. package/assets/esri/core/workers/chunks/7ed9a9c33a08ebba5570.js +346 -0
  70. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  71. package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js +2 -0
  72. package/assets/esri/core/workers/chunks/{ac9c6779771ec855da79.js.LICENSE.txt → 90ae15ce22a49bd84876.js.LICENSE.txt} +3 -3
  73. package/assets/esri/core/workers/chunks/{9aedd7874da7c63865d6.js → 93cc26e5636040fdc0b8.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{77c7b7c4426c2b1a5b42.js → 9fc35ec8185beba96715.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{4f627eb62caee760215a.js → a1f27c4f4b5ef3e359f7.js} +1 -1
  76. package/assets/esri/core/workers/chunks/a31658f544ac6e1801d6.js +1 -0
  77. package/assets/esri/core/workers/chunks/{3a205f87f100832ef9f5.js → a5e746e10239a3bfe237.js} +1 -1
  78. package/assets/esri/core/workers/chunks/a6bcae413e62cd879b46.js +1 -0
  79. package/assets/esri/core/workers/chunks/{59d4c41172e921922cac.js → a8b42d8c0b76c234c09f.js} +100 -62
  80. package/assets/esri/core/workers/chunks/{3a517393619af3639b83.js → ad9bcd9dae45cdf90cbb.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{e46c05ef7272c7f1f70c.js → b1035bf4a016b1199236.js} +1 -1
  82. package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js +2 -0
  83. package/assets/esri/core/workers/chunks/{ce9de24cb96b56d20562.js.LICENSE.txt → b4f38fe9cc948a39ad87.js.LICENSE.txt} +1 -1
  84. package/assets/esri/core/workers/chunks/{752ef63d910852b7be44.js → c16e0da7a19310c71e8b.js} +1 -1
  85. package/assets/esri/core/workers/chunks/c28d4717ed588c0d8bf1.js +1 -0
  86. package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +1 -0
  87. package/assets/esri/core/workers/chunks/d7b640f7a181bd26c7c7.js +1 -0
  88. package/assets/esri/core/workers/chunks/{2bdbf678d4f013543dbb.js → d971571a957de70d5a8d.js} +1 -1
  89. package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +1 -0
  90. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +2 -0
  91. package/assets/esri/core/workers/chunks/{670a66617249f2d15a62.js.LICENSE.txt → e0dc8794343c2a949ffb.js.LICENSE.txt} +1 -1
  92. package/assets/esri/core/workers/chunks/e3c1aea34ece8336dae1.js +1 -0
  93. package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +1 -0
  94. package/assets/esri/core/workers/chunks/{a50cb1fc8c4c585c0e11.js → ec8e8048b3df2c92008d.js} +1 -1
  95. package/assets/esri/core/workers/chunks/f7ab3511f6627f467796.js +1 -0
  96. package/assets/esri/core/workers/chunks/{1eef9cf19634c038b59b.js → f98689562017583f73ee.js} +1 -1
  97. package/assets/esri/core/workers/chunks/fb2e28e6a87956267d1c.js +66 -0
  98. package/assets/esri/core/workers/chunks/fbcd94f60f92257a7303.js +2 -0
  99. package/assets/esri/core/workers/chunks/{c2594024d72133d3ed7b.js.LICENSE.txt → fbcd94f60f92257a7303.js.LICENSE.txt} +1 -1
  100. package/assets/esri/core/workers/chunks/fda48126f67e80034404.js +1 -0
  101. package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
  102. package/assets/esri/themes/dark/main.css +1 -1
  103. package/assets/esri/themes/light/main.css +1 -1
  104. package/assets/esri/themes/light/view.css +1 -1
  105. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
  106. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
  107. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
  108. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
  109. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
  110. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
  111. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
  112. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
  113. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
  114. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
  115. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
  116. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
  117. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
  118. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
  119. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
  120. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
  121. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
  122. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
  123. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
  124. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
  125. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
  126. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
  127. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
  128. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
  129. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
  130. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
  131. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
  132. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
  133. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
  134. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
  135. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
  136. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
  137. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
  138. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
  139. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
  140. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
  141. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
  142. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
  143. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
  144. package/chunks/HUDMaterial.glsl.js +1 -1
  145. package/chunks/Laserlines.glsl.js +2 -2
  146. package/chunks/aiServices.js +1 -1
  147. package/chunks/boundedPlane.js +1 -1
  148. package/chunks/cameraUtilsSpherical.js +1 -1
  149. package/chunks/vec32.js +1 -1
  150. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  151. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  152. package/core/mapCollectionUtils.js +1 -1
  153. package/core/perspectiveUtils.js +1 -1
  154. package/geometry/support/axisAngleDegrees.js +1 -1
  155. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  156. package/geometry/support/curves/circleUtils.js +1 -1
  157. package/geometry/support/curves/curveExtent.js +5 -0
  158. package/geometry/support/curves/curveLength.js +5 -0
  159. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  160. package/geometry/support/curves/ellipticArc4Utils.js +1 -1
  161. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  162. package/geometry/support/curves/mathUtils.js +1 -1
  163. package/geometry/support/curves/splitCurveAtPoint.js +1 -1
  164. package/geometry/support/frustum.js +1 -1
  165. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  166. package/geometry/support/meshUtils/primitives.js +1 -1
  167. package/geometry/support/meshUtils/projection.js +1 -1
  168. package/geometry/support/meshUtils/rotate.js +1 -1
  169. package/geometry/support/meshUtils/scale.js +1 -1
  170. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  171. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  172. package/geometry/support/plane.js +1 -1
  173. package/interfaces.d.ts +61 -3
  174. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  175. package/layers/LinkChartLayer.js +1 -1
  176. package/layers/VoxelWasmPerSceneView.js +1 -1
  177. package/layers/graphics/sources/MemorySource.js +1 -1
  178. package/layers/video/VideoCameraSensorModel.js +1 -1
  179. package/layers/voxel/VoxelVolume.js +1 -1
  180. package/layers/voxel/voxelPlaneUtils.js +1 -1
  181. package/package.json +1 -1
  182. package/support/revision.js +1 -1
  183. package/symbols/cim/cimAnalyzer.js +1 -1
  184. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  186. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  187. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  190. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  191. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  192. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  193. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  194. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  195. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  196. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  197. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  198. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  199. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  200. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  201. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  202. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  203. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  204. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  205. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  206. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  207. package/views/3d/camera/constraintUtils/distance.js +1 -1
  208. package/views/3d/camera/intersectionUtils.js +1 -1
  209. package/views/3d/interactive/Manipulator3D.js +1 -1
  210. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  211. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  212. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  213. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  214. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  215. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  216. package/views/3d/layers/I3SMeshView3D.js +1 -1
  217. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  218. package/views/3d/layers/PointCloudWorker.js +1 -1
  219. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  220. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  221. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  222. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  223. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  224. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  225. package/views/3d/layers/graphics/Labeler.js +1 -1
  226. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  227. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  228. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  229. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  230. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  231. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  232. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  233. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  234. package/views/3d/layers/i3s/Intersector.js +1 -1
  235. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  236. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  237. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  238. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  239. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  240. package/views/3d/state/Frustum.js +1 -1
  241. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  242. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  243. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  244. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  245. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  246. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  247. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  248. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  249. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  250. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  251. package/views/3d/support/hitTest.js +1 -1
  252. package/views/3d/support/orientedBoundingBox.js +1 -1
  253. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  254. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  255. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  256. package/views/3d/support/viewpointUtils.js +1 -1
  257. package/views/3d/terrain/Intersector.js +1 -1
  258. package/views/3d/terrain/OverlayManager.js +1 -1
  259. package/views/3d/terrain/TerrainRenderer.js +1 -1
  260. package/views/3d/terrain/TerrainSurface.js +1 -1
  261. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  262. package/views/3d/webgl/RenderCamera.js +1 -1
  263. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  264. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  265. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  266. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  267. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  268. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  269. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  270. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  271. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  272. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  273. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  274. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  275. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  276. package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +5 -0
  277. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  278. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  279. package/views/3d/webgl-engine/lib/IntersectorResult.js +5 -0
  280. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  281. package/views/3d/webgl-engine/lib/IntersectorType.js +5 -0
  282. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  283. package/views/3d/webgl-engine/lib/Material.js +1 -1
  284. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  285. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  286. package/views/3d/webgl-engine/lib/ObjectIntersectorResult.js +5 -0
  287. package/views/3d/webgl-engine/lib/ObjectTarget.js +5 -0
  288. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  289. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  290. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  291. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  292. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  293. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  294. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  295. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  296. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  297. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  298. package/views/3d/webgl-engine/lib/lodRendering/Intersector.js +1 -1
  299. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  300. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  301. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  302. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  303. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  309. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  311. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  312. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  313. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  314. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  315. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  316. package/views/FocusArea.js +1 -1
  317. package/views/FocusAreaOutline.js +5 -0
  318. package/views/FocusAreaOutlineItem.js +5 -0
  319. package/views/FocusAreas.js +1 -1
  320. package/views/FocusAreasUtils.js +5 -0
  321. package/views/FocusAreasView.js +5 -0
  322. package/views/SceneView.js +1 -1
  323. package/views/analysis/DimensionAnalysisView.js +1 -1
  324. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  325. package/views/interactive/ToolIntersector.js +1 -1
  326. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  327. package/views/interactive/sketch/constraints.js +1 -1
  328. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  329. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  330. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  331. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  332. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  333. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  334. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  335. package/views/layers/DimensionLayerView.js +1 -1
  336. package/views/support/angularMeasurementUtils.js +1 -1
  337. package/views/support/geometry3dUtils.js +1 -1
  338. package/widgets/BasemapLayerList.js +1 -1
  339. package/widgets/BatchAttributeForm.js +1 -1
  340. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  341. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  342. package/widgets/FeatureForm.js +1 -1
  343. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  344. package/widgets/FeatureTable.js +1 -1
  345. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  346. package/widgets/UtilityNetworkTrace.js +1 -1
  347. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  348. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  349. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  350. package/widgets/support/FilterBuilder.js +1 -1
  351. package/widgets/support/SketchTooltipControls.js +1 -1
  352. package/widgets/support/SnappingControls.js +1 -1
  353. package/assets/esri/core/workers/chunks/094300acbd24085cb063.js +0 -1
  354. package/assets/esri/core/workers/chunks/0c338364cb55afdbd580.js +0 -1
  355. package/assets/esri/core/workers/chunks/2da01fe20200b6d74851.js +0 -1
  356. package/assets/esri/core/workers/chunks/35c996f6fbff165b03f4.js +0 -1
  357. package/assets/esri/core/workers/chunks/45d64b72b7e93e9c64d7.js +0 -1
  358. package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js +0 -2
  359. package/assets/esri/core/workers/chunks/5e0118a030cf741f78c6.js +0 -319
  360. package/assets/esri/core/workers/chunks/670a66617249f2d15a62.js +0 -2
  361. package/assets/esri/core/workers/chunks/6b5274d46a155d65dff1.js +0 -39
  362. package/assets/esri/core/workers/chunks/74187c771ee7083d1db7.js +0 -1
  363. package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +0 -2
  364. package/assets/esri/core/workers/chunks/7c2ec96749972e0b8a13.js +0 -1
  365. package/assets/esri/core/workers/chunks/7ffc1db10b00754398e8.js +0 -1
  366. package/assets/esri/core/workers/chunks/81546c6141d564ed59c9.js +0 -1
  367. package/assets/esri/core/workers/chunks/852dd5af8e704613310a.js +0 -1
  368. package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js +0 -2
  369. package/assets/esri/core/workers/chunks/bbff052a991a2dc36960.js +0 -1
  370. package/assets/esri/core/workers/chunks/bcab8b9ce2f9d2ebaae7.js +0 -1
  371. package/assets/esri/core/workers/chunks/bf190d672dcbaedc1a41.js +0 -1
  372. package/assets/esri/core/workers/chunks/c255c9279815359fdce5.js +0 -1
  373. package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +0 -2
  374. package/assets/esri/core/workers/chunks/ce9de24cb96b56d20562.js +0 -2
  375. package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js +0 -2
  376. package/assets/esri/core/workers/chunks/d9948763423784b68c09.js +0 -1
  377. package/assets/esri/core/workers/chunks/dbf6011dd7933f02d41d.js +0 -66
  378. package/assets/esri/core/workers/chunks/e4e9dd635bdef18d0bd5.js +0 -1
  379. package/assets/esri/core/workers/chunks/e69f2e3c2d5e71fbb42f.js +0 -1
  380. package/assets/esri/core/workers/chunks/f61632c06c05b72e7017.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{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,when as r,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import u from"../../../../geometry/Point.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as p}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as h}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";var g;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(g||(g={}));let S=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new h({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o((()=>this._clearPointerMoveTimeout())),n((()=>this.state),(e=>{e===g.Created&&this.finishToolCreation()}),a),r((()=>this.firstGrabbedManipulator),(e=>{this.selectedDimension=e.metadata}),a),n((()=>this.selectedDimension),(()=>this._resetPointerMoveTimeout()),a)])}get state(){return this.analysis.dimensions.some((e=>"length"===e.type))?null!=this._activeSubTool?g.Creating:g.Created:g.Ready}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":if(_.cancel===e.key){if(null!=this._activeSubTool&&this._activeSubTool.removeStaged())return void e.stopPropagation();this.active||(this.selectedDimension=null)}else _.delete.includes(e.key)&&this._deleteKeyHandler()}}onActivate(){this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){null!=this._activeSubTool&&(this._activeSubTool.onDeactivate(),this._activeSubTool=null)}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_deleteKeyHandler(){null!=this._activeSubTool&&this._activeSubTool.removeStaged(),this._removeSelected()}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=m.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new u({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach((e=>e.manipulator.state|=p)),this._prevPointerMoveTimeout=t.setTimeout((()=>{this.manipulators.forEach((e=>e.manipulator.state&=~p))}),this._pointerMoveTimerMs)}get test(){}};e([l({constructOnly:!0})],S.prototype,"view",void 0),e([l({constructOnly:!0})],S.prototype,"analysis",void 0),e([l({readOnly:!0})],S.prototype,"state",null),e([l({readOnly:!0})],S.prototype,"updating",null),e([l({readOnly:!0})],S.prototype,"cursor",null),e([l({constructOnly:!0})],S.prototype,"analysisViewData",void 0),e([l()],S.prototype,"selectedDimension",null),e([l()],S.prototype,"automaticManipulatorSelection",void 0),e([l()],S.prototype,"_activeSubTool",void 0),e([l()],S.prototype,"_lengthDimensionSubTool",void 0),S=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],S);export{S as DimensionTool};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{clock as t}from"../../../../core/clock.js";import{destroyHandle as i,makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{removeMaybe as s}from"../../../../core/maybe.js";import{when as n,watch as r,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import p from"../../../../geometry/Point.js";import{sv3d as m}from"../../../../geometry/support/vectorStacks.js";import{DidPointerMoveRecentlyFlag as u}from"./lengthDimensionManipulatorUtils.js";import{LengthDimensionSubTool as h}from"./LengthDimensionSubTool.js";import{pointerMoveTimeoutMs as d}from"./settings.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{newToolIntersector as y}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as T}from"../../../support/screenUtils.js";var g;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(g||(g={}));let D=class extends v{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._placementMode=S,this._pointerMoveTimerMs=d,this._prevPointerMoveTimeout=null}initialize(){this._intersector=y(this.view.state.viewingMode),this._lengthDimensionSubTool=new h({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([i(this._lengthDimensionSubTool),o((()=>this._clearPointerMoveTimeout())),n((()=>this.state===g.Created),(()=>this.finishToolCreation()),a),n((()=>this.firstGrabbedManipulator),(e=>{this.selectedDimension=e.metadata}),a),r((()=>this.selectedDimension),(()=>this._resetPointerMoveTimeout()),a)])}get state(){return this.analysis.dimensions.some((e=>"length"===e.type))?null!=this._activeSubTool?g.Creating:g.Created:g.Ready}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}place(e){this.selectedDimension=null,this._placementMode=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":this._keyDownHandler(e)}}onActivate(){this._placementMode=S,this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool?.onDeactivate(),this._activeSubTool=null}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(null==this._activeSubTool)return;const t=this._intersectScreen(e);null!=t&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),this.selectedDimension&&"single"===this._placementMode&&(this.view.activeTool=null),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),null==this._activeSubTool)return;if(this.hasFocusedManipulators)return;const t=this._intersectScreen(e);null!=t&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_keyDownHandler(e){_.cancel===e.key?(this._activeSubTool?.removeStaged()&&"multiple"===this._placementMode&&e.stopPropagation(),this.active||(this.selectedDimension=null)):_.delete.includes(e.key)&&(this._activeSubTool?.removeStaged(),this._removeSelected())}_intersectScreen(e){const t=T(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,o=m.get();return i.getIntersectionPoint(o)?this.view.renderCoordsHelper.fromRenderCoords(o,new p({spatialReference:this.view.spatialReference})):null}_removeSelected(){null!=this.selectedDimension&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach((e=>e.manipulator.state|=u)),this._prevPointerMoveTimeout=t.setTimeout((()=>{this.manipulators.forEach((e=>e.manipulator.state&=~u))}),this._pointerMoveTimerMs)}get test(){}};e([l({constructOnly:!0})],D.prototype,"view",void 0),e([l({constructOnly:!0})],D.prototype,"analysis",void 0),e([l({readOnly:!0})],D.prototype,"state",null),e([l({readOnly:!0})],D.prototype,"updating",null),e([l({readOnly:!0})],D.prototype,"cursor",null),e([l({constructOnly:!0})],D.prototype,"analysisViewData",void 0),e([l()],D.prototype,"selectedDimension",null),e([l()],D.prototype,"automaticManipulatorSelection",void 0),e([l()],D.prototype,"_activeSubTool",void 0),e([l()],D.prototype,"_lengthDimensionSubTool",void 0),e([l()],D.prototype,"_placementMode",void 0),D=e([c("esri.views.3d.analysis.Dimension.DimensionTool")],D);const S="multiple";export{D as DimensionTool};
@@ -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{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import"../../../../core/has.js";import{p as t,g as n,e as i,d as o,k as r}from"../../../../chunks/vec32.js";import a from"../../../../geometry/Point.js";import{sv3d as s}from"../../../../geometry/support/vectorStacks.js";import{automaticHeadingFromCamera as l}from"./lengthDimensionManipulatorUtils.js";import{isGeodesicDimension as c,directUp as d,directStartToEnd as u}from"./lengthDimensionUtils.js";import{constraintThresholdPx as m}from"./settings.js";var P;function p(e,t){return{enabled:t.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function f(e,a){if(c(e))return P.Direct;if(!e.enabled)return null;const{geometry:l}=e;if(null==l||t(l.directSegment.startRenderSpace,l.directSegment.endRenderSpace))return null;const{camera:p}=a.state,f=d(s.get(),l,a.renderCoordsHelper),g=u(s.get(),l),S=n(s.get(),f,i(g,f)),v=o(s.get(),g,S),y=r(v),A=r(S),{startRenderSpace:R,endRenderSpace:z}=l.directSegment,j=Math.max(p.computeScreenPixelSizeAt(R)*m,p.computeScreenPixelSizeAt(z)*m)**2;return y<j?P.Vertical:A<j?P.Horizontal:null}function g(e,t,{constraint:n,view:i}){const{unconstrainedGeometry:o}=e;if(null==o)return;const{renderCoordsHelper:r,spatialReference:s}=i,{startRenderSpace:l,endRenderSpace:c}=o.directSegment,d=r.fromRenderCoords(l,new a({spatialReference:s})),u=r.fromRenderCoords(c,new a({spatialReference:s}));let m;m="start"===t?{startPoint:d}:{endPoint:u},S(e,m,{constraint:n,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,unconstrainedGeometry:o,view:i})}function S(t,n,i){const{constraint:o,elevationAlignedStartPoint:r,elevationAlignedEndPoint:a,unconstrainedGeometry:s,view:c}=i,{dimension:d,previousConstraint:u,preConstraintProperties:m}=t;if(null==r||null==a)return;const p=()=>{"startPoint"in n?d.startPoint=n.startPoint:"endPoint"in n&&(d.endPoint=n.endPoint)};if(null==o)p(),null!=u&&null!=m&&(d.measureType=m.measureType,d.orientation=m.orientation);else switch(d.measureType=e.Direct,o){case P.Horizontal:if(o!==u&&(d.orientation=0),"startPoint"in n){const e=n.startPoint;null!=e&&(e.z=a.z),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.z=r.z),d.endPoint=e}break;case P.Vertical:if(o!==u&&(d.orientation=l(s,c)),"startPoint"in n){const e=n.startPoint;null!=e&&(e.x=a.x,e.y=a.y),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.x=r.x,e.y=r.y),d.endPoint=e}break;case P.Direct:o!==u&&null!=m&&(d.orientation=m.orientation),p()}t.previousConstraint=o,t.unconstrainedGeometry=s}!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.Direct=2]="Direct"}(P||(P={}));export{P as LengthDimensionConstraint,S as applyConstraint,f as computeConstraint,p as constraintDependencies,g as reapplyConstraint};
5
+ import{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import"../../../../core/has.js";import{q as t,g as n,e as i,d as o,k as r}from"../../../../chunks/vec32.js";import a from"../../../../geometry/Point.js";import{sv3d as s}from"../../../../geometry/support/vectorStacks.js";import{automaticHeadingFromCamera as l}from"./lengthDimensionManipulatorUtils.js";import{isGeodesicDimension as c,directUp as d,directStartToEnd as u}from"./lengthDimensionUtils.js";import{constraintThresholdPx as m}from"./settings.js";var P;function p(e,t){return{enabled:t.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function f(e,a){if(c(e))return P.Direct;if(!e.enabled)return null;const{geometry:l}=e;if(null==l||t(l.directSegment.startRenderSpace,l.directSegment.endRenderSpace))return null;const{camera:p}=a.state,f=d(s.get(),l,a.renderCoordsHelper),g=u(s.get(),l),S=n(s.get(),f,i(g,f)),v=o(s.get(),g,S),y=r(v),A=r(S),{startRenderSpace:R,endRenderSpace:z}=l.directSegment,j=Math.max(p.computeScreenPixelSizeAt(R)*m,p.computeScreenPixelSizeAt(z)*m)**2;return y<j?P.Vertical:A<j?P.Horizontal:null}function g(e,t,{constraint:n,view:i}){const{unconstrainedGeometry:o}=e;if(null==o)return;const{renderCoordsHelper:r,spatialReference:s}=i,{startRenderSpace:l,endRenderSpace:c}=o.directSegment,d=r.fromRenderCoords(l,new a({spatialReference:s})),u=r.fromRenderCoords(c,new a({spatialReference:s}));let m;m="start"===t?{startPoint:d}:{endPoint:u},S(e,m,{constraint:n,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,unconstrainedGeometry:o,view:i})}function S(t,n,i){const{constraint:o,elevationAlignedStartPoint:r,elevationAlignedEndPoint:a,unconstrainedGeometry:s,view:c}=i,{dimension:d,previousConstraint:u,preConstraintProperties:m}=t;if(null==r||null==a)return;const p=()=>{"startPoint"in n?d.startPoint=n.startPoint:"endPoint"in n&&(d.endPoint=n.endPoint)};if(null==o)p(),null!=u&&null!=m&&(d.measureType=m.measureType,d.orientation=m.orientation);else switch(d.measureType=e.Direct,o){case P.Horizontal:if(o!==u&&(d.orientation=0),"startPoint"in n){const e=n.startPoint;null!=e&&(e.z=a.z),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.z=r.z),d.endPoint=e}break;case P.Vertical:if(o!==u&&(d.orientation=l(s,c)),"startPoint"in n){const e=n.startPoint;null!=e&&(e.x=a.x,e.y=a.y),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.x=r.x,e.y=r.y),d.endPoint=e}break;case P.Direct:o!==u&&null!=m&&(d.orientation=m.orientation),p()}t.previousConstraint=o,t.unconstrainedGeometry=s}!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.Direct=2]="Direct"}(P||(P={}));export{P as LengthDimensionConstraint,S as applyConstraint,f as computeConstraint,p as constraintDependencies,g as reapplyConstraint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{lengthDimensionMeasureType as t,LengthDimensionMeasureType as r}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as n}from"../../../../core/Cyclical.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{identity as c,scale as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as d,c as u,p,l as f,i as g,a as h,d as v,h as y,e as w}from"../../../../chunks/vec32.js";import{fromValues as S,create as j,ZEROS as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import H from"../../../../geometry/Point.js";import{fromPositionAndNormal as M,create as P,signedDistance as C,getNormal as T}from"../../../../geometry/support/plane.js";import{sv3d as O}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as U}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as R,computeOffsetForPoint as z,computeSegmentForMeasureType as A,computeOffsetAxis as _,dimensionStartToEnd as D,headingFromGeometry as F,computeGeometryFromDimension as L,computationToGeometryDependencies as k,directUp as E,directStartToEnd as G}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as I,pointRadius as B,lengthFraction as N,minLengthMeters as V,linePaddingPx as W,focusedLinePaddingPx as q,orientationFocusMultiplier as J,orientationDiscScale as K,orientationCalloutWidth as Q,markerLineSizeFraction as X,orientationCalloutOffsetPx as Y,orientationSnapThresholdDegrees as Z}from"./settings.js";import{Manipulator3D as $}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as ee,worldScaledManipulatorSettings as te,calculateTranslateRotateFromBases as re,rotateManipulatorDefaults as ne,calculateInputRotationTransform as ie}from"../../interactive/manipulatorUtils.js";import{RenderObject as oe}from"../../interactive/RenderObject.js";import{hideManipulatorWhileDragging as ae,screenToMap3D as se,screenToRenderPlane as ce}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as le}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as me}from"../../support/engineContent/marker.js";import{Attribute as de}from"../../webgl-engine/lib/Attribute.js";import{Geometry as ue}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as pe,createPolylineGeometry as fe}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ge}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as he}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as ve}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as ye,resetProperties as we,EventPipeline as Se}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as je,ManipulatorStateFlags as be}from"../../../interactive/interfaces.js";class xe{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find((t=>this.hasOwnProperty(t)&&e===this[t]))}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(e){for(const r of t)e(this.manipulatorForMeasureType(r),r)}manipulatorForMeasureType(e){switch(e){case r.Direct:return this.direct;case r.Horizontal:return this.horizontal;case r.Vertical:return this.vertical}}}class He extends ${constructor(t,r){const n=ee(e.toUnitRGBA(I(t.effectiveTheme))),i=[new oe(pe(n,1,32,32),et)];super({view:t,renderObjects:i,metadata:r.metadata,available:!1,grabCursor:"crosshair",radius:B,collisionPriority:1}),this._themeHandle=o((()=>({color:e.toUnitRGBA(I(t.effectiveTheme))})),(e=>n.setParameters(e)))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){const r=[S(-.5,0,0),S(.5,0,0)],n=fe(t.unfocusedMaterial,r.map((e=>d(j(),e,N)))),i=n.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(n,be.Unfocused|be.Selected|et),new oe(i,be.Focused|et)],collisionType:{type:"line",paths:[r]},radius:Ze(t.lineSizePt)/2,metadata:t.metadata,available:!1,...te})}class Pe extends ${constructor(t,{lineSizePt:r,material:n,metadata:i}){super({view:t,autoScaleRenderObjects:!1,collisionPriority:1,metadata:i}),this._options={calloutColor:x(),lineSizePt:r,material:n},this._themeHandle=o((()=>e.toUnitRGBA(I(t.effectiveTheme))),(e=>{this._options.calloutColor=e,$e(this,Ce({...this._options,metadata:this.metadata}))}),a)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,$e(this,Ce({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function Ce({calloutColor:e,lineSizePt:t,material:r,metadata:n}){return{calloutLength:.25*me*X*s(t)+Y,calloutColor:e,calloutWidth:Q,customStateMask:et,discScale:K,focusMultiplier:J,material:r,metadata:n}}function Te(e,t){const r=[S(-.5,0,0),S(.5,0,0)],n=fe(t.thinOffsetManipulatorMaterial,r),i=fe(t.unfocusedMaterial,r.map((e=>d(j(),e,N)))),o=i.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(i,be.Unfocused|et),new oe(o,be.Focused|et),new oe(n,et)],collisionType:{type:"line",paths:[r]},radius:Ze(t.lineSizePt)/2,available:!1,metadata:t.metadata,...te})}function Oe(e,{isStart:t,createSnappingPipelineStep:r,dimension:n,onUpdate:i,view:o}){const a=t?"startPoint":"endPoint",s=ye(e,((e,t,s,c)=>{const l=ae(e),{snappingStep:m,cancelSnapping:d}=r(c);s=s.next(l).next(we(n,[a,"measureType","orientation"])).next(d),t.next(l).next(se(o)).next(...m).next((e=>{const t=U(e.mapEnd,new H);i("startPoint"===a?{startPoint:t}:{endPoint:t})}))}));return[s]}function Ue(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{if(!R(t)||!e.selected)return;const{geometry:o,dimension:a}=t,s=ae(e);n.next(s).next(Le(r,a,o.dimensionSegment,o.primaryOffsetAxis)),i.next(s).next(we(a,["offset"]))}))]}function Re(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!0,steps:n,view:r})}))]}function ze(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!1,steps:n,view:r})})),e.events.on("immediate-click",(e=>{Ae(e,t,r)}))]}function Ae(e,t,r){const{dimension:i,geometry:o}=t;if(90===i.orientation||270===i.orientation)return i.orientation=0,void e.stopPropagation();if(null==o)return;const{renderCoordsHelper:a}=r,s=L({...k(t),orientation:90},a),c=L({...k(t),orientation:270},a);if(null==s||null==c)return;const l=F(s,a),m=F(c,a),d=ke(o,r),u=n.shortestSignedDiff(d,l),p=n.shortestSignedDiff(d,m);i.orientation=Math.abs(u)<Math.abs(p)?90:270,e.stopPropagation()}function _e(e){const{cancel:t,computation:r,settingHeading:n,steps:o,view:a}=e;if(!R(r))return;const{renderCoordsHelper:s}=a,{dimension:c,geometry:l}=r,m=j(),d=qe(j(),l,l.directSegment,s),p=Je(O.get(),{forHeading:n,geometry:l,renderCoordsHelper:s}),f=M(d,p,P()),g=n?c.orientation??F(l,a.renderCoordsHelper):c.orientation??0;o.next(ce(a,f)).next((e=>{"start"===e.action&&u(m,e.renderStart);const t=T(f),r=ie(m,e.renderEnd,d,t);let o=g-i(r);n||(o=De(o)),c.orientation=o})),t.next(we(c,["orientation"]))}function De(e){const t=n.normalize(e)%90;return t<Z?e-t:90-t<Z?e+(90-t):e}function Fe(e,{computation:t,manipulatorMeasureType:n,view:i}){let o=r.Direct,a=0,s=0;return[e.events.on("grab-changed",(r=>{if("start"!==r.action||!R(t))return;const{dimension:c,geometry:l}=t;o=c.measureType,a=c.offset,s=c.orientation;const m=u(O.get(),e.renderLocation);c.measureType=n,c.offset=z(m,n,l,i.renderCoordsHelper),c.orientation=0})),ye(e,((e,r,c)=>{if(!R(t))return;const{geometry:l,dimension:m}=t,{renderCoordsHelper:d}=i,u=A(it,n,t,d),p=_(O.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),f=ae(e);r.next(f).next(Le(i,m,u,p)),c.next(f).next((e=>(m.measureType=o,m.offset=a,m.orientation=s,e)))}))]}function Le(e,t,r,n){const i=v(O.get(),r.endRenderSpace,r.startRenderSpace);y(i,i,n);const o=M(r.startRenderSpace,i,P()),a=M(r.startRenderSpace,n,P()),s=t.offset;let c,l=0;const m=new Se;return m.next(ce(e,o)).next((r=>{"start"===r.action&&(l=C(a,r.renderStart));const n=(C(a,r.renderEnd)-l)*e.renderCoordsHelper.unitInMeters;t.offset=s+n,c=r})),e=>(m.execute(e),c)}function ke(e,t){const{directSegment:r}=e,{renderCoordsHelper:n}=t,i=E(O.get(),e,n),o=G(O.get(),e),a=y(O.get(),o,i),{viewForward:s}=t.state.camera;w(a,s)>0&&d(a,a,-1);const c=r.eval(.5,O.get());return n.headingAtPosition(c,a)}function Ee(e,t,r){const{dimensionSegment:n,primaryOffsetAxis:i}=t,o=D(tt,t),a=p(o,b)?c(nt):re(o,i,b,nt),s=Math.max(f(o),V/r.unitInMeters);l(a,a,g(tt,s,s,s)),e.modelTransform=a,e.renderLocation=n.eval(.5,tt)}function Ge(e,t,r){Be(e,t,r,{forHeading:!0})}function Ie(e,t,r){Be(e,t,r,{forHeading:!1})}function Be(e,t,r,{forHeading:n}){const{dimension:i,geometry:o}=t,{primaryOffsetAxis:a}=o,s=d(Ne,a,i.offset>=0?1:-1),c=Je(Ve,{forHeading:n,geometry:o,renderCoordsHelper:r});y(c,c,s);const l=re(s,c,b,nt);e.modelTransform=l,e.renderLocation=qe(tt,o,o.dimensionSegment,r)}const Ne=j(),Ve=j();function We(e,t,r,n){const{geometry:i}=t,o=A(it,r,t,n),a=_(tt,{measureType:r,directSegment:i.directSegment,renderCoordsHelper:n}),s=h(rt,o.endRenderSpace,o.startRenderSpace),c=re(s,a,b,nt),m=f(s);l(c,c,g(rt,m,m,m)),e.modelTransform=c,e.renderLocation=o.eval(.5,rt)}function qe(e,t,r,n){const{startRenderSpace:i,endRenderSpace:o}=r,a=Ke(t,n)?i:o;return u(e,a)}function Je(e,{forHeading:t,geometry:r,renderCoordsHelper:n}){return t?E(e,r,n):D(e,r,{invert:!0})}function Ke(e,t){const r=G(Qe,e),n=E(Xe,e,t);return w(r,n)>0}const Qe=j(),Xe=j();function Ye(e){return s(e)+W}function Ze(e){return s(e)+q}function $e(e,t){const r=t.material,n=t.focusMultiplier??ne.focusMultiplier,i=t.calloutLength??ne.calloutLength,o=ne.discRadius*(t.discScale??1),a=o*n,s=(e,t)=>{const r=[0,1,2,2,3,0];return new ue(t,[[he.POSITION,new de([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],[he.UV0,new de([0,0,1,0,1,1,0,1],r,2,!0)]])},c=t.calloutWidth??ne.calloutWidth,l=new ve({width:c,color:t.calloutColor,renderOccluded:ge.OccludeAndTransparent,isDecoration:!0}),m=fe(l,[[0,0,0],[i-o,0,0]]),d=fe(l,[[0,0,0],[i-a,0,0]]),u=t.customStateMask??je.None;e.collisionType={type:"disc",direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=n,e.metadata=t.metadata,e.radius=o,e.renderObjects=[new oe(s(o,r),be.Unfocused|u),new oe(m,be.Unfocused|u),new oe(s(a,r),be.Focused|u),new oe(d,be.Focused|u)]}const et=je.Custom1,tt=j(),rt=j(),nt=m(),it=new le;export{et as DidPointerMoveRecentlyFlag,xe as LengthDimensionManipulators,He as LengthDimensionPointManipulator,Pe as LineOfSightOrientationManipulator,ke as automaticHeadingFromCamera,Te as createMeasureTypeManipulator,Me as createOffsetManipulator,Ze as focusedOffsetWidth,Re as headingManipulatorHandles,Fe as measureTypeManipulatorHandles,Ue as offsetManipulatorHandles,Oe as pointManipulatorHandles,ze as rotationManipulatorHandles,De as snapOrientationToNearestRightAngle,Ye as unfocusedOffsetWidth,Ge as updateHeadingManipulatorTransform,We as updateMeasureTypeManipulatorTransform,Ee as updateOffsetManipulatorTransform,Ie as updateRotationManipulatorTransform};
5
+ import e from"../../../../Color.js";import{lengthDimensionMeasureType as t,LengthDimensionMeasureType as r}from"../../../../analysis/dimensionUtils.js";import{cyclicalDegrees as n}from"../../../../core/Cyclical.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{watch as o,initial as a}from"../../../../core/reactiveUtils.js";import{pt2px as s}from"../../../../core/screenUtils.js";import{identity as c,scale as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as d,c as u,q as p,l as f,i as g,a as h,d as v,h as y,e as w}from"../../../../chunks/vec32.js";import{fromValues as S,create as j,ZEROS as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import H from"../../../../geometry/Point.js";import{fromPositionAndNormal as M,create as P,signedDistance as C,getNormal as T}from"../../../../geometry/support/plane.js";import{sv3d as O}from"../../../../geometry/support/vectorStacks.js";import{clonePoint as U}from"../../../../layers/graphics/hydratedFeatures.js";import{isValidComputation as R,computeOffsetForPoint as z,computeSegmentForMeasureType as A,computeOffsetAxis as _,dimensionStartToEnd as D,headingFromGeometry as F,computeGeometryFromDimension as L,computationToGeometryDependencies as k,directUp as E,directStartToEnd as G}from"./lengthDimensionUtils.js";import{getTransparentAccentColor as I,pointRadius as B,lengthFraction as N,minLengthMeters as V,linePaddingPx as W,focusedLinePaddingPx as q,orientationFocusMultiplier as J,orientationDiscScale as K,orientationCalloutWidth as Q,markerLineSizeFraction as X,orientationCalloutOffsetPx as Y,orientationSnapThresholdDegrees as Z}from"./settings.js";import{Manipulator3D as $}from"../../interactive/Manipulator3D.js";import{createManipulatorMaterial as ee,worldScaledManipulatorSettings as te,calculateTranslateRotateFromBases as re,rotateManipulatorDefaults as ne,calculateInputRotationTransform as ie}from"../../interactive/manipulatorUtils.js";import{RenderObject as oe}from"../../interactive/RenderObject.js";import{hideManipulatorWhileDragging as ae,screenToMap3D as se,screenToRenderPlane as ce}from"../../interactive/editingTools/dragEventPipeline3D.js";import{EuclideanSegment as le}from"../../interactive/visualElements/support/Segment.js";import{markerSizePerLineWidth as me}from"../../support/engineContent/marker.js";import{Attribute as de}from"../../webgl-engine/lib/Attribute.js";import{Geometry as ue}from"../../webgl-engine/lib/Geometry.js";import{createSphereGeometry as pe,createPolylineGeometry as fe}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as ge}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as he}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as ve}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as ye,resetProperties as we,EventPipeline as Se}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as je,ManipulatorStateFlags as be}from"../../../interactive/interfaces.js";class xe{constructor(e){this.start=e.start,this.end=e.end,this.offset=e.offset,this.heading=e.heading,this.rotation=e.rotation,this.direct=e.direct,this.horizontal=e.horizontal,this.vertical=e.vertical}manipulatorName(e){return Object.keys(this).find((t=>this.hasOwnProperty(t)&&e===this[t]))}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(e){for(const r of t)e(this.manipulatorForMeasureType(r),r)}manipulatorForMeasureType(e){switch(e){case r.Direct:return this.direct;case r.Horizontal:return this.horizontal;case r.Vertical:return this.vertical}}}class He extends ${constructor(t,r){const n=ee(e.toUnitRGBA(I(t.effectiveTheme))),i=[new oe(pe(n,1,32,32),et)];super({view:t,renderObjects:i,metadata:r.metadata,available:!1,grabCursor:"crosshair",radius:B,collisionPriority:1}),this._themeHandle=o((()=>({color:e.toUnitRGBA(I(t.effectiveTheme))})),(e=>n.setParameters(e)))}destroy(){this._themeHandle.remove(),super.destroy()}}function Me(e,t){const r=[S(-.5,0,0),S(.5,0,0)],n=fe(t.unfocusedMaterial,r.map((e=>d(j(),e,N)))),i=n.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(n,be.Unfocused|be.Selected|et),new oe(i,be.Focused|et)],collisionType:{type:"line",paths:[r]},radius:Ze(t.lineSizePt)/2,metadata:t.metadata,available:!1,...te})}class Pe extends ${constructor(t,{lineSizePt:r,material:n,metadata:i}){super({view:t,autoScaleRenderObjects:!1,collisionPriority:1,metadata:i}),this._options={calloutColor:x(),lineSizePt:r,material:n},this._themeHandle=o((()=>e.toUnitRGBA(I(t.effectiveTheme))),(e=>{this._options.calloutColor=e,$e(this,Ce({...this._options,metadata:this.metadata}))}),a)}update({lineSizePt:e,material:t}){this._options.lineSizePt=e,this._options.material=t,$e(this,Ce({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function Ce({calloutColor:e,lineSizePt:t,material:r,metadata:n}){return{calloutLength:.25*me*X*s(t)+Y,calloutColor:e,calloutWidth:Q,customStateMask:et,discScale:K,focusMultiplier:J,material:r,metadata:n}}function Te(e,t){const r=[S(-.5,0,0),S(.5,0,0)],n=fe(t.thinOffsetManipulatorMaterial,r),i=fe(t.unfocusedMaterial,r.map((e=>d(j(),e,N)))),o=i.instantiate({material:t.focusedMaterial});return new $({view:e,renderObjects:[new oe(i,be.Unfocused|et),new oe(o,be.Focused|et),new oe(n,et)],collisionType:{type:"line",paths:[r]},radius:Ze(t.lineSizePt)/2,available:!1,metadata:t.metadata,...te})}function Oe(e,{isStart:t,createSnappingPipelineStep:r,dimension:n,onUpdate:i,view:o}){const a=t?"startPoint":"endPoint",s=ye(e,((e,t,s,c)=>{const l=ae(e),{snappingStep:m,cancelSnapping:d}=r(c);s=s.next(l).next(we(n,[a,"measureType","orientation"])).next(d),t.next(l).next(se(o)).next(...m).next((e=>{const t=U(e.mapEnd,new H);i("startPoint"===a?{startPoint:t}:{endPoint:t})}))}));return[s]}function Ue(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{if(!R(t)||!e.selected)return;const{geometry:o,dimension:a}=t,s=ae(e);n.next(s).next(Le(r,a,o.dimensionSegment,o.primaryOffsetAxis)),i.next(s).next(we(a,["offset"]))}))]}function Re(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!0,steps:n,view:r})}))]}function ze(e,{computation:t,view:r}){return[ye(e,((e,n,i)=>{_e({cancel:i,computation:t,settingHeading:!1,steps:n,view:r})})),e.events.on("immediate-click",(e=>{Ae(e,t,r)}))]}function Ae(e,t,r){const{dimension:i,geometry:o}=t;if(90===i.orientation||270===i.orientation)return i.orientation=0,void e.stopPropagation();if(null==o)return;const{renderCoordsHelper:a}=r,s=L({...k(t),orientation:90},a),c=L({...k(t),orientation:270},a);if(null==s||null==c)return;const l=F(s,a),m=F(c,a),d=ke(o,r),u=n.shortestSignedDiff(d,l),p=n.shortestSignedDiff(d,m);i.orientation=Math.abs(u)<Math.abs(p)?90:270,e.stopPropagation()}function _e(e){const{cancel:t,computation:r,settingHeading:n,steps:o,view:a}=e;if(!R(r))return;const{renderCoordsHelper:s}=a,{dimension:c,geometry:l}=r,m=j(),d=qe(j(),l,l.directSegment,s),p=Je(O.get(),{forHeading:n,geometry:l,renderCoordsHelper:s}),f=M(d,p,P()),g=n?c.orientation??F(l,a.renderCoordsHelper):c.orientation??0;o.next(ce(a,f)).next((e=>{"start"===e.action&&u(m,e.renderStart);const t=T(f),r=ie(m,e.renderEnd,d,t);let o=g-i(r);n||(o=De(o)),c.orientation=o})),t.next(we(c,["orientation"]))}function De(e){const t=n.normalize(e)%90;return t<Z?e-t:90-t<Z?e+(90-t):e}function Fe(e,{computation:t,manipulatorMeasureType:n,view:i}){let o=r.Direct,a=0,s=0;return[e.events.on("grab-changed",(r=>{if("start"!==r.action||!R(t))return;const{dimension:c,geometry:l}=t;o=c.measureType,a=c.offset,s=c.orientation;const m=u(O.get(),e.renderLocation);c.measureType=n,c.offset=z(m,n,l,i.renderCoordsHelper),c.orientation=0})),ye(e,((e,r,c)=>{if(!R(t))return;const{geometry:l,dimension:m}=t,{renderCoordsHelper:d}=i,u=A(it,n,t,d),p=_(O.get(),{measureType:n,directSegment:l.directSegment,renderCoordsHelper:d}),f=ae(e);r.next(f).next(Le(i,m,u,p)),c.next(f).next((e=>(m.measureType=o,m.offset=a,m.orientation=s,e)))}))]}function Le(e,t,r,n){const i=v(O.get(),r.endRenderSpace,r.startRenderSpace);y(i,i,n);const o=M(r.startRenderSpace,i,P()),a=M(r.startRenderSpace,n,P()),s=t.offset;let c,l=0;const m=new Se;return m.next(ce(e,o)).next((r=>{"start"===r.action&&(l=C(a,r.renderStart));const n=(C(a,r.renderEnd)-l)*e.renderCoordsHelper.unitInMeters;t.offset=s+n,c=r})),e=>(m.execute(e),c)}function ke(e,t){const{directSegment:r}=e,{renderCoordsHelper:n}=t,i=E(O.get(),e,n),o=G(O.get(),e),a=y(O.get(),o,i),{viewForward:s}=t.state.camera;w(a,s)>0&&d(a,a,-1);const c=r.eval(.5,O.get());return n.headingAtPosition(c,a)}function Ee(e,t,r){const{dimensionSegment:n,primaryOffsetAxis:i}=t,o=D(tt,t),a=p(o,b)?c(nt):re(o,i,b,nt),s=Math.max(f(o),V/r.unitInMeters);l(a,a,g(tt,s,s,s)),e.modelTransform=a,e.renderLocation=n.eval(.5,tt)}function Ge(e,t,r){Be(e,t,r,{forHeading:!0})}function Ie(e,t,r){Be(e,t,r,{forHeading:!1})}function Be(e,t,r,{forHeading:n}){const{dimension:i,geometry:o}=t,{primaryOffsetAxis:a}=o,s=d(Ne,a,i.offset>=0?1:-1),c=Je(Ve,{forHeading:n,geometry:o,renderCoordsHelper:r});y(c,c,s);const l=re(s,c,b,nt);e.modelTransform=l,e.renderLocation=qe(tt,o,o.dimensionSegment,r)}const Ne=j(),Ve=j();function We(e,t,r,n){const{geometry:i}=t,o=A(it,r,t,n),a=_(tt,{measureType:r,directSegment:i.directSegment,renderCoordsHelper:n}),s=h(rt,o.endRenderSpace,o.startRenderSpace),c=re(s,a,b,nt),m=f(s);l(c,c,g(rt,m,m,m)),e.modelTransform=c,e.renderLocation=o.eval(.5,rt)}function qe(e,t,r,n){const{startRenderSpace:i,endRenderSpace:o}=r,a=Ke(t,n)?i:o;return u(e,a)}function Je(e,{forHeading:t,geometry:r,renderCoordsHelper:n}){return t?E(e,r,n):D(e,r,{invert:!0})}function Ke(e,t){const r=G(Qe,e),n=E(Xe,e,t);return w(r,n)>0}const Qe=j(),Xe=j();function Ye(e){return s(e)+W}function Ze(e){return s(e)+q}function $e(e,t){const r=t.material,n=t.focusMultiplier??ne.focusMultiplier,i=t.calloutLength??ne.calloutLength,o=ne.discRadius*(t.discScale??1),a=o*n,s=(e,t)=>{const r=[0,1,2,2,3,0];return new ue(t,[[he.POSITION,new de([i-e,-e,0,i+e,-e,0,i+e,e,0,i-e,e,0],r,3,!0)],[he.UV0,new de([0,0,1,0,1,1,0,1],r,2,!0)]])},c=t.calloutWidth??ne.calloutWidth,l=new ve({width:c,color:t.calloutColor,renderOccluded:ge.OccludeAndTransparent,isDecoration:!0}),m=fe(l,[[0,0,0],[i-o,0,0]]),d=fe(l,[[0,0,0],[i-a,0,0]]),u=t.customStateMask??je.None;e.collisionType={type:"disc",direction:[0,0,1],offset:[i,0,0]},e.focusMultiplier=n,e.metadata=t.metadata,e.radius=o,e.renderObjects=[new oe(s(o,r),be.Unfocused|u),new oe(m,be.Unfocused|u),new oe(s(a,r),be.Focused|u),new oe(d,be.Focused|u)]}const et=je.Custom1,tt=j(),rt=j(),nt=m(),it=new le;export{et as DidPointerMoveRecentlyFlag,xe as LengthDimensionManipulators,He as LengthDimensionPointManipulator,Pe as LineOfSightOrientationManipulator,ke as automaticHeadingFromCamera,Te as createMeasureTypeManipulator,Me as createOffsetManipulator,Ze as focusedOffsetWidth,Re as headingManipulatorHandles,Fe as measureTypeManipulatorHandles,Ue as offsetManipulatorHandles,Oe as pointManipulatorHandles,ze as rotationManipulatorHandles,De as snapOrientationToNearestRightAngle,Ye as unfocusedOffsetWidth,Ge as updateHeadingManipulatorTransform,We as updateMeasureTypeManipulatorTransform,Ee as updateOffsetManipulatorTransform,Ie as updateRotationManipulatorTransform};
@@ -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{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{toUnit as n}from"../../../../core/quantityUtils.js";import{adaptiveVerticalLengthUnit as r,adaptiveLengthUnit as i}from"../../../../core/unitUtils.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as s,k as d,b as c,t as l,a as u,h as p,e as m,G as S,n as g,y as f}from"../../../../chunks/vec32.js";import{create as v,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Axis as A}from"../../../../geometry/support/Axis.js";import{sv3d as P}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{clonePoint as h}from"../../../../layers/graphics/hydratedFeatures.js";import{EuclideanSegment as E}from"../../interactive/visualElements/support/Segment.js";import{autoDistanceBetweenPoints2D as j}from"../../../support/automaticLengthMeasurementUtils.js";import{euclideanDirectDistanceBetweenPoints as x,euclideanDirectDistance as w}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceThreshold as U}from"../../../support/geodesicMeasurementUtils.js";class z{constructor(e,t,n,r,i,o){this.elevationAlignedStartPoint=e,this.elevationAlignedEndPoint=t,this.directSegment=n,this.dimensionSegment=r,this.primaryOffsetAxis=i,this.spatialReference=o}}function b(t,o,a){if(null==t)return null;let s;if(o===e.Horizontal)s=j(t.elevationAlignedStartPoint,t.elevationAlignedEndPoint);else{const{startRenderSpace:e,endRenderSpace:n}=t.dimensionSegment;s=w(e,n,t.spatialReference)}if(null==s)return null;const d=o===e.Vertical?r(s.value,s.unit,a):i(s.value,s.unit,a);return n(s,d)}function H(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,dimension:{offset:r,measureType:i,orientation:o}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o}}function C({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o},a,d=null){if(null==t||null==n)return null;const c=D(d?.directSegment??new E,{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n},a),l=d?.primaryOffsetAxis??v();F(l,{measureType:i,elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,directSegment:c,orientation:o,renderCoordsHelper:a});const u=d?.dimensionSegment??new E;return Y({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n})&&i===e.Vertical?(s(u.startRenderSpace,c.startRenderSpace),s(u.endRenderSpace,c.endRenderSpace)):J(u,l,r,c,a),new z(t,n,c,u,l,a.spatialReference)}function T(e,t,n,r){return t===k.Start?(s(e.startRenderSpace,n.startRenderSpace),s(e.endRenderSpace,r.startRenderSpace)):(s(e.startRenderSpace,n.endRenderSpace),s(e.endRenderSpace,r.endRenderSpace)),e}var k;function M(e,t,n,r){c(e.startRenderSpace,t.startRenderSpace,n,r),c(e.endRenderSpace,t.endRenderSpace,n,r)}function V(t,n,r,i){switch(n){case e.Direct:return D(t,r,i);case e.Horizontal:case e.Vertical:{const{elevationAlignedStartPoint:o,elevationAlignedEndPoint:a,dimension:s,geometry:d}=r;let c;if(s.measureType===e.Direct){c=O(d,i)===o.z>a.z,n===e.Horizontal&&(c=!c)}else c=!I(d);const[l,u]=c?[o,a]:[a,o],p=h(u,L);return n===e.Horizontal?p.z=l.z:(p.x=l.x,p.y=l.y),i.toRenderCoords(l,t.startRenderSpace),i.toRenderCoords(p,t.endRenderSpace),t}}}function D(e,t,n){return n.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),n.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function O(e,t){const n=e.directSegment.eval(.5,P.get()),r=t.worldUpAtPosition(n,P.get()),i=e.dimensionSegment.eval(.5,P.get()),o=u(P.get(),i,n);return!S(o,R)&&m(o,r)>0}function I(e){const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment,{startRenderSpace:r,endRenderSpace:i}=e.directSegment;return f(r,t)<f(i,n)}!function(e){e[e.Start=0]="Start",e[e.End=1]="End"}(k||(k={}));const L=y(0,0,0,null);function q(e,t,n,r){const{directSegment:i}=n,o=F(P.get(),{measureType:t,directSegment:i,renderCoordsHelper:r}),a=J(B,o,0,i,r).eval(.5,P.get()),s=u(P.get(),e,a);return m(s,o)*r.unitInMeters}const B=new E;function F(n,r){const{measureType:i,elevationAlignedStartPoint:a,elevationAlignedEndPoint:d,directSegment:{startRenderSpace:c,endRenderSpace:f},directSegment:v,renderCoordsHelper:y}=r,h=v.eval(.5,P.get()),E=y.worldUpAtPosition(h,P.get()),j=y.worldBasisAtPosition(h,A.Y,P.get());switch(i){case e.Horizontal:s(n,E);break;case e.Vertical:m(c,E)<m(f,E)?u(n,f,c):u(n,c,f),p(n,n,E),p(n,n,E);break;case e.Direct:{const e=r.orientation??0;if(Y({elevationAlignedStartPoint:a,elevationAlignedEndPoint:d}))o(G,-t(e),E),l(n,j,G);else{const r=u(P.get(),f,c),i=p(P.get(),r,E);p(i,i,r),o(G,t(e),r),l(n,i,G)}break}}return S(n,R)?s(n,j):g(n,n)}const G=a();function Y({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}){return null!=e&&null!=t&&e.x===t.x&&e.y===t.y}function J(e,t,n,r,i){const{startRenderSpace:o,endRenderSpace:a}=r,s=n/i.unitInMeters,[d,l]=K(o,a,t,s);return c(e.startRenderSpace,r.startRenderSpace,t,d),c(e.endRenderSpace,r.endRenderSpace,t,l),e}function K(e,t,n,r=0){const i=m(t,n),o=m(e,n),a=Math.abs(i-o)+r;return i>o?[a,r]:[r,a]}function N(e,t,n){const r=t.directSegment.eval(.5,P.get());return n.worldUpAtPosition(r,e)}function Q(e,t){const{startRenderSpace:n,endRenderSpace:r}=t.directSegment;return u(e,r,n)}function W(e,t,n={invert:!1}){const{startRenderSpace:r,endRenderSpace:i}=t.dimensionSegment;return n.invert?u(e,r,i):u(e,i,r)}function X(e,t){const n=e.directSegment.eval(.5,P.get());return t.headingAtPosition(n,e.primaryOffsetAxis)}function Z(e,t){return d(W($,e))/t**2}const $=v();function _(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:r}=e;if(null==t||null==r)return!1;const i=x(t,r);return null!=i&&n(i,"meters").value>U}function ee(e){return null!=e.geometry}export{z as LengthDimensionGeometry,k as OffsetSegmentLocation,Y as arePointsVerticallyAligned,H as computationToGeometryDependencies,C as computeGeometryFromDimension,b as computeLength,F as computeOffsetAxis,q as computeOffsetForPoint,V as computeSegmentForMeasureType,T as computeSpanningSegment,W as dimensionStartToEnd,Q as directStartToEnd,N as directUp,X as headingFromGeometry,_ as isGeodesicDimension,ee as isValidComputation,Z as maxScreenLengthSquaredFromGeometry,M as offsetSegment};
5
+ import{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{toUnit as n}from"../../../../core/quantityUtils.js";import{adaptiveVerticalLengthUnit as r,adaptiveLengthUnit as i}from"../../../../core/unitUtils.js";import{fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as s,k as d,b as c,t as l,a as u,h as p,e as m,G as S,n as g,x as f}from"../../../../chunks/vec32.js";import{create as v,ZEROS as R}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Axis as A}from"../../../../geometry/support/Axis.js";import{sv3d as P}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{clonePoint as h}from"../../../../layers/graphics/hydratedFeatures.js";import{EuclideanSegment as E}from"../../interactive/visualElements/support/Segment.js";import{autoDistanceBetweenPoints2D as j}from"../../../support/automaticLengthMeasurementUtils.js";import{euclideanDirectDistanceBetweenPoints as x,euclideanDirectDistance as w}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceThreshold as U}from"../../../support/geodesicMeasurementUtils.js";class z{constructor(e,t,n,r,i,o){this.elevationAlignedStartPoint=e,this.elevationAlignedEndPoint=t,this.directSegment=n,this.dimensionSegment=r,this.primaryOffsetAxis=i,this.spatialReference=o}}function b(t,o,a){if(null==t)return null;let s;if(o===e.Horizontal)s=j(t.elevationAlignedStartPoint,t.elevationAlignedEndPoint);else{const{startRenderSpace:e,endRenderSpace:n}=t.dimensionSegment;s=w(e,n,t.spatialReference)}if(null==s)return null;const d=o===e.Vertical?r(s.value,s.unit,a):i(s.value,s.unit,a);return n(s,d)}function H(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,dimension:{offset:r,measureType:i,orientation:o}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o}}function C({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,offset:r,measureType:i,orientation:o},a,d=null){if(null==t||null==n)return null;const c=D(d?.directSegment??new E,{elevationAlignedStartPoint:t,elevationAlignedEndPoint:n},a),l=d?.primaryOffsetAxis??v();F(l,{measureType:i,elevationAlignedStartPoint:t,elevationAlignedEndPoint:n,directSegment:c,orientation:o,renderCoordsHelper:a});const u=d?.dimensionSegment??new E;return Y({elevationAlignedStartPoint:t,elevationAlignedEndPoint:n})&&i===e.Vertical?(s(u.startRenderSpace,c.startRenderSpace),s(u.endRenderSpace,c.endRenderSpace)):J(u,l,r,c,a),new z(t,n,c,u,l,a.spatialReference)}function T(e,t,n,r){return t===k.Start?(s(e.startRenderSpace,n.startRenderSpace),s(e.endRenderSpace,r.startRenderSpace)):(s(e.startRenderSpace,n.endRenderSpace),s(e.endRenderSpace,r.endRenderSpace)),e}var k;function M(e,t,n,r){c(e.startRenderSpace,t.startRenderSpace,n,r),c(e.endRenderSpace,t.endRenderSpace,n,r)}function V(t,n,r,i){switch(n){case e.Direct:return D(t,r,i);case e.Horizontal:case e.Vertical:{const{elevationAlignedStartPoint:o,elevationAlignedEndPoint:a,dimension:s,geometry:d}=r;let c;if(s.measureType===e.Direct){c=O(d,i)===o.z>a.z,n===e.Horizontal&&(c=!c)}else c=!I(d);const[l,u]=c?[o,a]:[a,o],p=h(u,L);return n===e.Horizontal?p.z=l.z:(p.x=l.x,p.y=l.y),i.toRenderCoords(l,t.startRenderSpace),i.toRenderCoords(p,t.endRenderSpace),t}}}function D(e,t,n){return n.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),n.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function O(e,t){const n=e.directSegment.eval(.5,P.get()),r=t.worldUpAtPosition(n,P.get()),i=e.dimensionSegment.eval(.5,P.get()),o=u(P.get(),i,n);return!S(o,R)&&m(o,r)>0}function I(e){const{startRenderSpace:t,endRenderSpace:n}=e.dimensionSegment,{startRenderSpace:r,endRenderSpace:i}=e.directSegment;return f(r,t)<f(i,n)}!function(e){e[e.Start=0]="Start",e[e.End=1]="End"}(k||(k={}));const L=y(0,0,0,null);function q(e,t,n,r){const{directSegment:i}=n,o=F(P.get(),{measureType:t,directSegment:i,renderCoordsHelper:r}),a=J(B,o,0,i,r).eval(.5,P.get()),s=u(P.get(),e,a);return m(s,o)*r.unitInMeters}const B=new E;function F(n,r){const{measureType:i,elevationAlignedStartPoint:a,elevationAlignedEndPoint:d,directSegment:{startRenderSpace:c,endRenderSpace:f},directSegment:v,renderCoordsHelper:y}=r,h=v.eval(.5,P.get()),E=y.worldUpAtPosition(h,P.get()),j=y.worldBasisAtPosition(h,A.Y,P.get());switch(i){case e.Horizontal:s(n,E);break;case e.Vertical:m(c,E)<m(f,E)?u(n,f,c):u(n,c,f),p(n,n,E),p(n,n,E);break;case e.Direct:{const e=r.orientation??0;if(Y({elevationAlignedStartPoint:a,elevationAlignedEndPoint:d}))o(G,-t(e),E),l(n,j,G);else{const r=u(P.get(),f,c),i=p(P.get(),r,E);p(i,i,r),o(G,t(e),r),l(n,i,G)}break}}return S(n,R)?s(n,j):g(n,n)}const G=a();function Y({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t}){return null!=e&&null!=t&&e.x===t.x&&e.y===t.y}function J(e,t,n,r,i){const{startRenderSpace:o,endRenderSpace:a}=r,s=n/i.unitInMeters,[d,l]=K(o,a,t,s);return c(e.startRenderSpace,r.startRenderSpace,t,d),c(e.endRenderSpace,r.endRenderSpace,t,l),e}function K(e,t,n,r=0){const i=m(t,n),o=m(e,n),a=Math.abs(i-o)+r;return i>o?[a,r]:[r,a]}function N(e,t,n){const r=t.directSegment.eval(.5,P.get());return n.worldUpAtPosition(r,e)}function Q(e,t){const{startRenderSpace:n,endRenderSpace:r}=t.directSegment;return u(e,r,n)}function W(e,t,n={invert:!1}){const{startRenderSpace:r,endRenderSpace:i}=t.dimensionSegment;return n.invert?u(e,r,i):u(e,i,r)}function X(e,t){const n=e.directSegment.eval(.5,P.get());return t.headingAtPosition(n,e.primaryOffsetAxis)}function Z(e,t){return d(W($,e))/t**2}const $=v();function _(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:r}=e;if(null==t||null==r)return!1;const i=x(t,r);return null!=i&&n(i,"meters").value>U}function ee(e){return null!=e.geometry}export{z as LengthDimensionGeometry,k as OffsetSegmentLocation,Y as arePointsVerticallyAligned,H as computationToGeometryDependencies,C as computeGeometryFromDimension,b as computeLength,F as computeOffsetAxis,q as computeOffsetForPoint,V as computeSegmentForMeasureType,T as computeSpanningSegment,W as dimensionStartToEnd,Q as directStartToEnd,N as directUp,X as headingFromGeometry,_ as isGeodesicDimension,ee as isValidComputation,Z as maxScreenLengthSquaredFromGeometry,M as offsetSegment};
@@ -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 s from"../../../core/Accessor.js";import{destroyHandle as t}from"../../../core/handleUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{mapCollection as e}from"../../../core/mapCollectionUtils.js";import{abortMaybe as n,destroyMaybe as a}from"../../../core/maybe.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as m}from"./AnalysisView3D.js";import{DimensionController as p}from"./Dimension/DimensionController.js";import{DimensionTool as c}from"./Dimension/DimensionTool.js";import{DimensionVisualization as u}from"./Dimension/DimensionVisualization.js";import{LengthDimensionComputation as d}from"./Dimension/LengthDimensionComputation.js";import{applyProjectionAndElevationAlignment as h,logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{connectAnalysisViewToTool as _,removeAnalysisViewTool as j,activateAnalysisViewTool as D}from"../../analysis/analysisViewUtils.js";import f from"../../analysis/DimensionAnalysisView.js";let g=class extends(f(m(s))){constructor(i){super(i),this.type="dimension-view-3d",this.tool=null,this.selectedDimension=null,this._dimensionsToComputations=new Map,this._placementTask=null,this._projectAndAlignPoint=null}initialize(){this._projectAndAlignPoint=i=>{if(null==i)return null;const{spatialReference:s,elevationProvider:t}=this.view,e=h(i,s,t);return null==e&&y(this.analysis,i.spatialReference,o.getLogger(this)),e};const i=e((()=>this.analysis.dimensions),(i=>this._createComputation(i)));this.computations=i,this.addHandles([_(this,c),t(i)]),this._analysisVisualization=new u({analysisViewData:this,view:this.view,isDecoration:!this.parent}),this._analysisController=new p({analysisViewData:this,view:this.view})}destroy(){this._placementTask=n(this._placementTask),this._analysisVisualization=a(this._analysisVisualization),j(this)}get updating(){return this._analysisVisualization?.loadingMessages??!1}get results(){return this.analysis.dimensions.map((i=>this._dimensionsToComputations.get(i).result))}get selectedComputation(){const{selectedDimension:i}=this;return null==i?null:this._dimensionsToComputations.get(i)}get testInfo(){}async createLengthDimensions(i){return this.selectedDimension=null,this._placementTask=n(this._placementTask),this._placementTask=D(this,i),this._placementTask.promise}_createComputation(i){const{_dimensionsToComputations:s}=this,t=new d({dimension:i,projectAndAlignPoint:this._projectAndAlignPoint});return s.set(i,t),{computation:t,remove:()=>this._removeComputation(t)}}_removeComputation(i){const{dimension:s}=i;s===this.selectedDimension&&(this.selectedDimension=null),this._dimensionsToComputations.delete(s),i.destroy()}};i([r({readOnly:!0})],g.prototype,"type",void 0),i([r()],g.prototype,"tool",void 0),i([r()],g.prototype,"updating",null),i([r({readOnly:!0})],g.prototype,"results",null),i([r()],g.prototype,"computations",void 0),i([r()],g.prototype,"selectedDimension",void 0),i([r()],g.prototype,"selectedComputation",null),i([r()],g.prototype,"_analysisVisualization",void 0),i([r()],g.prototype,"_analysisController",void 0),i([r()],g.prototype,"_dimensionsToComputations",void 0),i([r()],g.prototype,"_placementTask",void 0),g=i([l("esri.views.3d.analysis.DimensionAnalysisView3D")],g);const v=g;export{v as default};
5
+ import{_ as i}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{destroyHandle as s}from"../../../core/handleUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{mapCollection as e}from"../../../core/mapCollectionUtils.js";import{abortMaybe as n,destroyMaybe as r}from"../../../core/maybe.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as p}from"./AnalysisView3D.js";import{DimensionController as m}from"./Dimension/DimensionController.js";import{DimensionTool as u}from"./Dimension/DimensionTool.js";import{DimensionVisualization as c}from"./Dimension/DimensionVisualization.js";import{LengthDimensionComputation as d}from"./Dimension/LengthDimensionComputation.js";import{applyProjectionAndElevationAlignment as h,logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{connectAnalysisViewToTool as j,removeAnalysisViewTool as D,startExclusiveInteractiveOperation as g}from"../../analysis/analysisViewUtils.js";import v from"../../analysis/DimensionAnalysisView.js";let f=class extends(v(p(t))){constructor(i){super(i),this.type="dimension-view-3d",this.tool=null,this.selectedDimension=null,this.userOperation=null,this._dimensionsToComputations=new Map,this._projectAndAlignPoint=null}initialize(){this._projectAndAlignPoint=i=>{if(null==i)return null;const{spatialReference:t,elevationProvider:s}=this.view,e=h(i,t,s);return null==e&&y(this.analysis,i.spatialReference,o.getLogger(this)),e};const i=e((()=>this.analysis.dimensions),(i=>this._createComputation(i)));this.computations=i,this.addHandles([j(this,u),s(i)]),this._analysisVisualization=new c({analysisViewData:this,view:this.view,isDecoration:!this.parent}),this._analysisController=new m({analysisViewData:this,view:this.view})}destroy(){this.userOperation=n(this.userOperation),D(this),this._analysisVisualization=r(this._analysisVisualization)}get updating(){return this._analysisVisualization?.loadingMessages??!1}get results(){return this.analysis.dimensions.map((i=>this._dimensionsToComputations.get(i).result))}get selectedComputation(){const{selectedDimension:i}=this;return null==i?null:this._dimensionsToComputations.get(i)}get testInfo(){}async createLengthDimensions(i){return this.selectedDimension=null,g(this,{abortOptions:i,onToolActivated:i=>i.place("multiple")})}async place(i){return this.selectedDimension=null,g(this,{abortOptions:i,onToolActivated:i=>i.place("single")})}_createComputation(i){const{_dimensionsToComputations:t}=this,s=new d({dimension:i,projectAndAlignPoint:this._projectAndAlignPoint});return t.set(i,s),{computation:s,remove:()=>this._removeComputation(s)}}_removeComputation(i){const{dimension:t}=i;t===this.selectedDimension&&(this.selectedDimension=null),this._dimensionsToComputations.delete(t),i.destroy()}};i([a({readOnly:!0})],f.prototype,"type",void 0),i([a()],f.prototype,"tool",void 0),i([a()],f.prototype,"updating",null),i([a({readOnly:!0})],f.prototype,"results",null),i([a()],f.prototype,"computations",void 0),i([a()],f.prototype,"selectedDimension",void 0),i([a()],f.prototype,"selectedComputation",null),i([a()],f.prototype,"userOperation",void 0),i([a()],f.prototype,"_analysisVisualization",void 0),i([a()],f.prototype,"_analysisController",void 0),i([a()],f.prototype,"_dimensionsToComputations",void 0),f=i([l("esri.views.3d.analysis.DimensionAnalysisView3D")],f);const _=f;export{_ 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 r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as n,n as i,g as c,f as a}from"../../../../chunks/vec32.js";import{create as l,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{copy as u,fromPoints as d,create as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as h}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as y}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as I}from"../../terrain/Intersector.js";import{newIntersector as w}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as v,IntersectorType as b}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";let P=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=w(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=v.MIN}getScreenPointIntersection(e){const r=t(e,g.get()),o=j(this.view.state.camera,r,O);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=v.MIN,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const n=l();if(!s.getIntersectionPoint(n))return null;if(null!=r?.maxDistance&&!s.withinDistance(r.maxDistance))return null;const i=t.renderCoordsHelper.fromRenderCoords(n,new m({spatialReference:t.spatialReference})),c=p(s.normal);if(I(s))return new y({type:b.TERRAIN,id:s.target.lij.slice(),mapPoint:i,renderPoint:n,normal:c,ray:u(e),graphic:null});const a=R(s,t);if(null==a)return null;const{layer:d,sourceLayer:f}=a,g="scene"===f?.type?h(a,f.objectIdField):a.uid;return new y({type:b.OBJECT,id:`${d?.uid}/${g}`,mapPoint:i,renderPoint:n,normal:c,ray:u(e),graphic:a})}updateFromGroundIntersection(e,r,t){const o=L,s=S,l=x,m=C;n(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,l),i(l,l);const u=this.view.basemapTerrain.visibleElevationBounds,f=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));c(m,l,f),a(o,s,m),d(o,s,O);const g=this._getRayIntersection(O,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:f});if(null!=g){const e=C;return c(e,l,r),a(t,g.renderPoint,e),p(g.normal)}return n(t,e),null}};e([o()],P.prototype,"view",void 0),e([o()],P.prototype,"intersector",void 0),P=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],P);const L=l(),S=l(),x=l(),C=l(),O=f();export{P as LineOfSightRayIntersector};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as n,n as i,g as c,f as a}from"../../../../chunks/vec32.js";import{create as l,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{copy as u,fromPoints as f,create as d}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as I}from"../../terrain/Intersector.js";import{Intersector as w}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as b}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{IntersectorType as v}from"../../webgl-engine/lib/IntersectorType.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";let P=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=new w(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=b.MIN}getScreenPointIntersection(e){const r=t(e,g.get()),o=j(this.view.state.camera,r,O);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=b.MIN,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const n=l();if(!s.getIntersectionPoint(n))return null;if(null!=r?.maxDistance&&!s.withinDistance(r.maxDistance))return null;const i=t.renderCoordsHelper.fromRenderCoords(n,new m({spatialReference:t.spatialReference})),c=p(s.normal);if(I(s))return new h({type:v.TERRAIN,id:s.target.lij.slice(),mapPoint:i,renderPoint:n,normal:c,ray:u(e),graphic:null});const a=R(s,t);if(null==a)return null;const{layer:f,sourceLayer:d}=a,g="scene"===d?.type?y(a,d.objectIdField):a.uid;return new h({type:v.OBJECT,id:`${f?.uid}/${g}`,mapPoint:i,renderPoint:n,normal:c,ray:u(e),graphic:a})}updateFromGroundIntersection(e,r,t){const o=L,s=S,l=x,m=C;n(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,l),i(l,l);const u=this.view.basemapTerrain.visibleElevationBounds,d=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));c(m,l,d),a(o,s,m),f(o,s,O);const g=this._getRayIntersection(O,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=g){const e=C;return c(e,l,r),a(t,g.renderPoint,e),p(g.normal)}return n(t,e),null}};e([o()],P.prototype,"view",void 0),e([o()],P.prototype,"intersector",void 0),P=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],P);const L=l(),S=l(),x=l(),C=l(),O=d();export{P as LineOfSightRayIntersector};
@@ -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"../../../../analysis/LineOfSightAnalysisObserver.js";import a from"../../../../analysis/LineOfSightAnalysisTarget.js";import n from"../../../../core/Handles.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{when as o,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{create as p,fromPoints as g}from"../../../../geometry/support/lineSegment.js";import{getGraphicEffectiveElevationInfo as _,getConvertedElevation as m}from"../../../../support/elevationInfoUtils.js";import v from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as b,laserLineConfiguration as y}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as f,LineOfSightObserverManipulator as T}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{LaserlineVisualElement as w}from"../../interactive/visualElements/LaserlineVisualElement.js";import{IntersectorType as M}from"../../webgl-engine/lib/IntersectorInterfaces.js";import"../../../input/ViewEvents.js";import{AnalysisToolBase as C}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as V}from"../../../interactive/interfaces.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import{MouseButton as I}from"../../../input/IViewEvents.js";var O;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(O||(O={}));let P=class extends C{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._analysisHandles=new n,this._updatingHandles=new d,this._manipulatorHandles=new n,this._targetTrackerManipulator=null}initialize(){this._intersector=new L({view:this.view}),this.addHandles(o((()=>this.state===O.Created),(()=>this.finishToolCreation()),l)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add((()=>this.analysisViewData?.elevationAlignedObserver),(e=>this._onObserverLocationChange(e)),u),this._updatingHandles.add((()=>b(this.view.effectiveTheme)),(({glowColor:e,innerColor:t,globalAlpha:i})=>this._updateLaserLineStyle(e,t,i)),u),this._updatingHandles.add((()=>this._laserLineRendererDependencies()),(e=>this._updateLaserLineRenderer(e))),this._connectComputations(),this._updatingHandles.addWhen((()=>!this._shouldRenderTracker),(()=>this._clearCursorTracker()),u),this._updatingHandles.add((()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators})),(({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)}),u)])}destroy(){this._updatingHandles=s(this._updatingHandles),this._manipulatorHandles=s(this._manipulatorHandles),this._analysisHandles=s(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?O.Creating:O.Created:null!=this.analysis.observer?.position?O.Created:O.Ready}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return null!=this.analysisViewData&&this.analysisViewData.updating||this._updatingHandles.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this.analysisViewData.computations),(e=>this._onComputationsCollectionChange(e)),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_connectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const i=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&i.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=i,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add((()=>j(e)),(()=>D(i,e)),u),this._updatingHandles.add((()=>e.elevationAlignedTargetLocation),(e=>this._onTargetLocationChange(e,i)),u)],e)}_disconnectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this.analysisViewData.cursorTarget=s(this.analysisViewData.cursorTarget)}_createTargetManipulator(e){const t={target:e,type:"target"},i=new f(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(i),i.events.on("grab-changed",(e=>this._manipulatorGrabChanged(i,e))),i.events.on("immediate-click",(e=>this._manipulatorClick(i,e)))],i),this.manipulators.add(i),null!=e.position?i.elevationAlignedLocation=e.position:i.available=!1,i}_getTargetManipulator(e){let t=null;return this.manipulators.forEach((i=>{const a=i.manipulator;null==t&&"target"===a.metadata.type&&a.metadata.target===e&&(t=a)})),t}_createObserverManipulator(){const e=new T(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",(t=>this._manipulatorGrabChanged(e,t))),e.events.on("immediate-click",(t=>this._manipulatorClick(e,t)))],e),this.manipulators.add(e),e}_screenToIntersection(){return e=>{const t=this._intersector.getScreenPointIntersection(e.screenEnd);return null==t?null:{...e,intersection:t}}}_createTargetManipulatorDragPipeline(e){return k(e,((t,i,a)=>{i.next(this._screenToIntersection()).next(this._updateTargetDragStep(e)).next((()=>this._updateLaserLineRenderer())),a.next(R(e.metadata.target)).next((()=>this._updateLaserLineRenderer()))}))}_createObserverManipulatorDragPipeline(e){return k(e,((e,t,i)=>{t.next(this._screenToIntersection()).next(this._updateObserverDragStep()).next((()=>this._updateLaserLineRenderer())),i.next(this._cancelObserverDragStep()).next((()=>this._updateLaserLineRenderer()))}))}_updateObserverDragStep(){return e=>(null!=e.intersection.mapPoint?(null==this.analysis.observer&&(this.analysis.observer=new i),this._updateFromIntersection(this.analysis.observer,e.intersection)):this.analysis.observer=null,e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>{this._updateFromIntersection(e.metadata.target,t.intersection);const i=t.intersection.mapPoint;return null!=i&&(e.elevationAlignedLocation=i),t}}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:i,shouldRenderTracker:a,observerPosition:n,visible:r}=e;if(null==t)return;const s=null!=i?i:a&&null!=n?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,S):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=y;this._laserlineVisualElement=new w({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,i,a){const n=this._laserlineVisualElement;if(null==n)return;const r=n.style;n.style={...r,glowColor:t.toUnitRGB(e),innerColor:t.toUnitRGB(i),globalAlpha:a}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e){const t=this._intersector.getScreenPointIntersection(e);if(null!=t?.mapPoint)if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new a;this._updateFromIntersection(e,t),this.analysis.targets.add(e)}else{const e=new i;this._updateFromIntersection(e,t),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==I.Right&&(this._addPointFromClickEvent(H(e)),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==I.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker||null==this.analysis.observer?.position)return;const t=H(e),i=this._intersector.getScreenPointIntersection(t);null!=i?.mapPoint&&(null==this.analysisViewData.cursorTarget&&(this.analysisViewData.cursorTarget=new a),this._updateFromIntersection(this.analysisViewData.cursorTarget,i),this._updateLaserLineRenderer())}_updateFromIntersection(e,t){if(null==t.mapPoint)return e.position=null,e.elevationInfo=null,void(e.feature=null);switch(t.type){case M.OBJECT:if(null!=t.graphic){const i=t.graphic,a=_(i);"on-the-ground"===a.mode&&(a.mode="relative-to-ground",a.offset=0),e.elevationInfo=new v(a),e.feature=i}else e.elevationInfo=null,e.feature=null;break;case M.TERRAIN:e.elevationInfo=new v({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}const i=t.mapPoint.clone();i.z=m(this.view,i,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=i}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==I.Right||this.analysis.targets.length<=1)return;const{target:i}=e.metadata;this.analysis.targets.remove(i),t.stopPropagation()}get testInfo(){}};function R(e){const t=e.position?.clone();return i=>(e.position=t,i)}function D(e,t){const{isValid:i,isTargetVisible:a}=t.computationResult;e.state=i?a?V.Custom1:V.Custom2:V.Custom3}function j(e){const{isValid:t,isTargetVisible:i}=e.computationResult;return{isValid:t,isTargetVisible:i}}e([c({constructOnly:!0})],P.prototype,"view",void 0),e([c({constructOnly:!0})],P.prototype,"analysis",void 0),e([c()],P.prototype,"_creationMode",void 0),e([c({readOnly:!0})],P.prototype,"state",null),e([c({readOnly:!0})],P.prototype,"cursor",null),e([c()],P.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],P.prototype,"updating",null),e([c({constructOnly:!0})],P.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],P.prototype,"_showTracker",null),e([c()],P.prototype,"_latestPointerMovePointerType",void 0),e([c()],P.prototype,"_shouldRenderTracker",null),e([c()],P.prototype,"_laserlineVisualElement",void 0),e([c()],P.prototype,"_grabbedManipulator",void 0),P=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],P);const S=p();export{P as LineOfSightTool};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Color.js";import i from"../../../../analysis/LineOfSightAnalysisObserver.js";import a from"../../../../analysis/LineOfSightAnalysisTarget.js";import n from"../../../../core/Handles.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{when as o,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{create as p,fromPoints as g}from"../../../../geometry/support/lineSegment.js";import{getGraphicEffectiveElevationInfo as _,getConvertedElevation as m}from"../../../../support/elevationInfoUtils.js";import v from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as b,laserLineConfiguration as y}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as f,LineOfSightObserverManipulator as T}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{LaserlineVisualElement as w}from"../../interactive/visualElements/LaserlineVisualElement.js";import{IntersectorType as M}from"../../webgl-engine/lib/IntersectorType.js";import"../../../input/ViewEvents.js";import{AnalysisToolBase as C}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as k}from"../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as V}from"../../../interactive/interfaces.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import{MouseButton as O}from"../../../input/IViewEvents.js";var P;!function(e){e.Ready="ready",e.Creating="creating",e.Created="created"}(P||(P={}));let I=class extends C{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._analysisHandles=new n,this._updatingHandles=new d,this._manipulatorHandles=new n,this._targetTrackerManipulator=null}initialize(){this._intersector=new L({view:this.view}),this.addHandles(o((()=>this.state===P.Created),(()=>this.finishToolCreation()),l)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add((()=>this.analysisViewData?.elevationAlignedObserver),(e=>this._onObserverLocationChange(e)),u),this._updatingHandles.add((()=>b(this.view.effectiveTheme)),(({glowColor:e,innerColor:t,globalAlpha:i})=>this._updateLaserLineStyle(e,t,i)),u),this._updatingHandles.add((()=>this._laserLineRendererDependencies()),(e=>this._updateLaserLineRenderer(e))),this._connectComputations(),this._updatingHandles.addWhen((()=>!this._shouldRenderTracker),(()=>this._clearCursorTracker()),u),this._updatingHandles.add((()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators})),(({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)}),u)])}destroy(){this._updatingHandles=s(this._updatingHandles),this._manipulatorHandles=s(this._manipulatorHandles),this._analysisHandles=s(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?P.Creating:P.Created:null!=this.analysis.observer?.position?P.Created:P.Ready}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return null!=this.analysisViewData&&this.analysisViewData.updating||this._updatingHandles.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this.analysisViewData.computations),(e=>this._onComputationsCollectionChange(e)),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const i of t)this._disconnectComputation(i);for(const i of e)this._connectComputation(i)}_connectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const i=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&i.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=i,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add((()=>j(e)),(()=>D(i,e)),u),this._updatingHandles.add((()=>e.elevationAlignedTargetLocation),(e=>this._onTargetLocationChange(e,i)),u)],e)}_disconnectComputation(e){if(this.destroyed)return void r.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this.analysisViewData.cursorTarget=s(this.analysisViewData.cursorTarget)}_createTargetManipulator(e){const t={target:e,type:"target"},i=new f(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(i),i.events.on("grab-changed",(e=>this._manipulatorGrabChanged(i,e))),i.events.on("immediate-click",(e=>this._manipulatorClick(i,e)))],i),this.manipulators.add(i),null!=e.position?i.elevationAlignedLocation=e.position:i.available=!1,i}_getTargetManipulator(e){let t=null;return this.manipulators.forEach((i=>{const a=i.manipulator;null==t&&"target"===a.metadata.type&&a.metadata.target===e&&(t=a)})),t}_createObserverManipulator(){const e=new T(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",(t=>this._manipulatorGrabChanged(e,t))),e.events.on("immediate-click",(t=>this._manipulatorClick(e,t)))],e),this.manipulators.add(e),e}_screenToIntersection(){return e=>{const t=this._intersector.getScreenPointIntersection(e.screenEnd);return null==t?null:{...e,intersection:t}}}_createTargetManipulatorDragPipeline(e){return k(e,((t,i,a)=>{i.next(this._screenToIntersection()).next(this._updateTargetDragStep(e)).next((()=>this._updateLaserLineRenderer())),a.next(R(e.metadata.target)).next((()=>this._updateLaserLineRenderer()))}))}_createObserverManipulatorDragPipeline(e){return k(e,((e,t,i)=>{t.next(this._screenToIntersection()).next(this._updateObserverDragStep()).next((()=>this._updateLaserLineRenderer())),i.next(this._cancelObserverDragStep()).next((()=>this._updateLaserLineRenderer()))}))}_updateObserverDragStep(){return e=>(null!=e.intersection.mapPoint?(null==this.analysis.observer&&(this.analysis.observer=new i),this._updateFromIntersection(this.analysis.observer,e.intersection)):this.analysis.observer=null,e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>{this._updateFromIntersection(e.metadata.target,t.intersection);const i=t.intersection.mapPoint;return null!=i&&(e.elevationAlignedLocation=i),t}}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:i,shouldRenderTracker:a,observerPosition:n,visible:r}=e;if(null==t)return;const s=null!=i?i:a&&null!=n?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,S):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=y;this._laserlineVisualElement=new w({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,i,a){const n=this._laserlineVisualElement;if(null==n)return;const r=n.style;n.style={...r,glowColor:t.toUnitRGB(e),innerColor:t.toUnitRGB(i),globalAlpha:a}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e){const t=this._intersector.getScreenPointIntersection(e);if(null!=t?.mapPoint)if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new a;this._updateFromIntersection(e,t),this.analysis.targets.add(e)}else{const e=new i;this._updateFromIntersection(e,t),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==O.Right&&(this._addPointFromClickEvent(H(e)),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==O.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker||null==this.analysis.observer?.position)return;const t=H(e),i=this._intersector.getScreenPointIntersection(t);null!=i?.mapPoint&&(null==this.analysisViewData.cursorTarget&&(this.analysisViewData.cursorTarget=new a),this._updateFromIntersection(this.analysisViewData.cursorTarget,i),this._updateLaserLineRenderer())}_updateFromIntersection(e,t){if(null==t.mapPoint)return e.position=null,e.elevationInfo=null,void(e.feature=null);switch(t.type){case M.OBJECT:if(null!=t.graphic){const i=t.graphic,a=_(i);"on-the-ground"===a.mode&&(a.mode="relative-to-ground",a.offset=0),e.elevationInfo=new v(a),e.feature=i}else e.elevationInfo=null,e.feature=null;break;case M.TERRAIN:e.elevationInfo=new v({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}const i=t.mapPoint.clone();i.z=m(this.view,i,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=i}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==O.Right||this.analysis.targets.length<=1)return;const{target:i}=e.metadata;this.analysis.targets.remove(i),t.stopPropagation()}get testInfo(){}};function R(e){const t=e.position?.clone();return i=>(e.position=t,i)}function D(e,t){const{isValid:i,isTargetVisible:a}=t.computationResult;e.state=i?a?V.Custom1:V.Custom2:V.Custom3}function j(e){const{isValid:t,isTargetVisible:i}=e.computationResult;return{isValid:t,isTargetVisible:i}}e([c({constructOnly:!0})],I.prototype,"view",void 0),e([c({constructOnly:!0})],I.prototype,"analysis",void 0),e([c()],I.prototype,"_creationMode",void 0),e([c({readOnly:!0})],I.prototype,"state",null),e([c({readOnly:!0})],I.prototype,"cursor",null),e([c()],I.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],I.prototype,"updating",null),e([c({constructOnly:!0})],I.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],I.prototype,"_showTracker",null),e([c()],I.prototype,"_latestPointerMovePointerType",void 0),e([c()],I.prototype,"_shouldRenderTracker",null),e([c()],I.prototype,"_laserlineVisualElement",void 0),e([c()],I.prototype,"_grabbedManipulator",void 0),I=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],I);const S=p();export{I as LineOfSightTool};
@@ -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"../../../../core/Accessor.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,n as p,h as a,v as c,f as l,g as h}from"../../../../chunks/vec32.js";import{create as d,fromValues as u,fromArray as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{rotateBy as g}from"./viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null,this.needUpdateByFeature=!1}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}get valid(){return this.viewshed.valid}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"needUpdateByFeature",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"valid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("esri.views.3d.analysis.Viewshed.ViewshedComputedData")],m);const R=d();export{m as ViewshedComputedData};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,n as p,h as a,u as c,f as l,g as h}from"../../../../chunks/vec32.js";import{create as d,fromValues as u,fromArray as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../../../geometry/Point.js";import{rotateBy as g}from"./viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null,this.needUpdateByFeature=!1}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}get valid(){return this.viewshed.valid}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"needUpdateByFeature",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"valid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("esri.views.3d.analysis.Viewshed.ViewshedComputedData")],m);const R=d();export{m as ViewshedComputedData};
@@ -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{when as o,watch as l,syncAndInitial as r,sync as d,initial as c}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 v,r as w,e as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create 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 M}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as j}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as P}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 W=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode="single",this._creationState=!1,this._interactionVisualElements=null,this._settings=new M({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((()=>this._valid),(()=>this.finishToolCreation()),r),l((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),l((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),d),l((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),o((()=>{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)}),c),l((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),l((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),c)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some((e=>e.viewshedComputedData.valid))??!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}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}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._stagedViewshed=null,"multiple"===this._placementMode?(this._creationState="placing-observer",this.selectedViewshed=e):(this._creationState=!1,this._stagedViewshed=null,this.selectedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null)}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){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=x(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=I(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 j({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:P.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l((()=>e.zVerticalLine),(e=>e.apply(s)),r),l((()=>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,l=e?o.grabbing:o.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(n(c,l),c){const e=l?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_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 x(e,t,i){const s=t.observerRenderSpace,n=m(U,i,s),o=g(n)*t.metersPerUnit,l=e.renderCoordsHelper.basisMatrixAtPosition(s,F),r=v(A,l[8],l[9],l[10]),d=b(s,r,G),c=S(d,i,z),h=m(c,c,s),u=(g(h)<1e-4?90:a(w(n,h)))*(_(r,n)<0?-1:1)+90,p=v(K,l[4],l[5],l[6]),V=a(w(p,h)),f=v(K,l[0],l[1],l[2]);return{heading:_(h,f)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],W.prototype,"view",void 0),e([h()],W.prototype,"analysisViewData",void 0),e([h()],W.prototype,"removeIncompleteOnCancel",void 0),e([h()],W.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],W.prototype,"analysis",void 0),e([h()],W.prototype,"subToolHandles",void 0),e([h()],W.prototype,"_stagedViewshed",void 0),e([h()],W.prototype,"_stagedViewshedComputedData",void 0),e([h()],W.prototype,"_placementMode",void 0),e([h()],W.prototype,"_creationState",void 0),e([h()],W.prototype,"_valid",null),e([h({readOnly:!0})],W.prototype,"cursor",null),e([h()],W.prototype,"_selectedManipulator",void 0),e([h()],W.prototype,"_selectedSubTool",null),e([h()],W.prototype,"selectedViewshed",null),e([h()],W.prototype,"selectedViewshedComputedData",null),e([h()],W.prototype,"stagedViewshed",null),e([h()],W.prototype,"grabbing",null),e([h()],W.prototype,"creating",null),e([h()],W.prototype,"isPlacingTarget",null),W=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],W);const U=V(),A=V(),z=V(),K=V(),F=p(),G=y(),B={mapPoint:new f,scenePoint:V(),feature:null};export{W 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 o}from"../../../../core/maybe.js";import{when as n,watch as l,syncAndInitial as r,sync as d,initial as c}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 v,p as w,e as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create 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 M}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as j}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as P}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 W=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=q,this._creationState=!1,this._interactionVisualElements=null,this._settings=new M({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([n((()=>this._valid),(()=>this.finishToolCreation()),r),l((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),l((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),d),l((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),n((()=>{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)}),c),l((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),l((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),c)])}destroy(){this.subToolHandles=o(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some((e=>e.viewshedComputedData.valid))??!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}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}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)}onActivate(){this._placementMode=q}_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._stagedViewshed=null,"multiple"===this._placementMode?(this._creationState="placing-observer",this.selectedViewshed=e):(this._creationState=!1,this._stagedViewshed=null,this.selectedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null)}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){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:o}=x(this.view,i,e);t.farDistance=o,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 o=t.mapPoint;return o.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,o),null==o?null:(t.feature=I(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 j({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:P.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l((()=>e.zVerticalLine),(e=>e.apply(s)),r),l((()=>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,o=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void o(i,!1);if(null==s||null==a)return void o(!1,!1);const n=s.moveInteractionState,l=e?n.grabbing:n.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(o(c,l),c){const e=l?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_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 x(e,t,i){const s=t.observerRenderSpace,o=m(U,i,s),n=g(o)*t.metersPerUnit,l=e.renderCoordsHelper.basisMatrixAtPosition(s,F),r=v(A,l[8],l[9],l[10]),d=b(s,r,G),c=S(d,i,z),h=m(c,c,s),u=(g(h)<1e-4?90:a(w(o,h)))*(_(r,o)<0?-1:1)+90,p=v(K,l[4],l[5],l[6]),V=a(w(p,h)),f=v(K,l[0],l[1],l[2]);return{heading:_(h,f)<0?360-V:V,tilt:u,farDistance:n}}e([h({constructOnly:!0})],W.prototype,"view",void 0),e([h()],W.prototype,"analysisViewData",void 0),e([h()],W.prototype,"removeIncompleteOnCancel",void 0),e([h()],W.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],W.prototype,"analysis",void 0),e([h()],W.prototype,"subToolHandles",void 0),e([h()],W.prototype,"_stagedViewshed",void 0),e([h()],W.prototype,"_stagedViewshedComputedData",void 0),e([h()],W.prototype,"_placementMode",void 0),e([h()],W.prototype,"_creationState",void 0),e([h()],W.prototype,"_valid",null),e([h({readOnly:!0})],W.prototype,"cursor",null),e([h()],W.prototype,"_selectedManipulator",void 0),e([h()],W.prototype,"_selectedSubTool",null),e([h()],W.prototype,"selectedViewshed",null),e([h()],W.prototype,"selectedViewshedComputedData",null),e([h()],W.prototype,"stagedViewshed",null),e([h()],W.prototype,"grabbing",null),e([h()],W.prototype,"creating",null),e([h()],W.prototype,"isPlacingTarget",null),W=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],W);const U=V(),A=V(),z=V(),K=V(),F=p(),G=y(),B={mapPoint:new f,scenePoint:V(),feature:null},q="multiple";export{W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.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,H as _,n as f,g as V,r as v,v as w,c as E,f 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 D from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as O}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as R}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:O.OccludeAndTransparent},i={...t,stipplePattern:R(2)};this._observerVisualElement=new j({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F({...e,isDecoration:this.isDecoration}),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?.valid)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?O.OccludeAndTransparent:O.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 D&&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),f(c,c),V(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const D=[],y=Math.ceil(Math.abs(u)/a),j=m();h(j,u/y,L);const F=g();E(F,l);const O=g();E(O,i);for(let h=0;h<y;h++){const e=g();E(e,O),d(F,F,j),b(O,t,F);const i=g();E(i,O),D.push([e,i])}e.geometry=D}e([n()],S.prototype,"view",void 0),e([n({constructOnly:!0})],S.prototype,"isDecoration",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);export{S 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 f,g as V,p as v,u as w,c as E,f 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 D from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{RenderOccludedFlag as O}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as R}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:O.OccludeAndTransparent},i={...t,stipplePattern:R(2)};this._observerVisualElement=new j({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F({...e,isDecoration:this.isDecoration}),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?.valid)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?O.OccludeAndTransparent:O.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 D&&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),f(c,c),V(c,c,n);let u=v(l,c);const L=C(o);"backward"===r&&(w(L,L),u=-(2*Math.PI-u));const D=[],y=Math.ceil(Math.abs(u)/a),j=m();h(j,u/y,L);const F=g();E(F,l);const O=g();E(O,i);for(let h=0;h<y;h++){const e=g();E(e,O),d(F,F,j),b(O,t,F);const i=g();E(i,O),D.push([e,i])}e.geometry=D}e([n()],S.prototype,"view",void 0),e([n({constructOnly:!0})],S.prototype,"isDecoration",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);export{S 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{rad2deg as r,clamp as e}from"../../../../core/mathUtils.js";import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as o,n as a,c as s,r as i,e as c,a as m,f as p,g as l}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getNormal as f,fromPositionAndNormal as u,create as g}from"../../../../geometry/support/plane.js";import{viewshedToolManipulatorConfiguration as h}from"./ViewshedConfiguration.js";import{calculateTranslateRotateFromBases as j,calculateInputRotationTransform as b}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as x}from"../../interactive/editingTools/dragEventPipeline3D.js";import{headingTiltToDirectionUp as v}from"../../support/cameraUtils.js";import{createDirectionUp as S}from"../../support/cameraUtilsInternal.js";function R({tiltedUpVector:r,rightVector:e,observerRenderSpace:t},n){const o=j(r,e,t,n);return o[12]=0,o[13]=0,o[14]=0,o}function U(t,n,o,i){const j=d(),v=f(o.plane),S=E(n,v);let R;if(Math.abs(S)>h.viewAngleThreshold)R=t.next(x(n,o.plane));else{const r=u(i.targetRenderSpace,o.basis1,g()),s=a(D,o.basis1),f=a(M,o.basis2);R=t.next(x(n,r)).next((r=>{const t=r=>{const t=c(m(V,r,o.origin),f),n=Math.acos(e(t/i.farDistanceRenderSpace,-1,1)),a=Math.sin(n)*i.farDistanceRenderSpace;return p(d(),o.origin,p(d(),l(V,s,a),l(w,f,t)))},n=t(r.renderStart),a=t(r.renderEnd);return{...r,renderStart:n,renderEnd:a}}))}return R.next((e=>{"start"===e.action&&s(j,e.renderStart);const t=r(b(j,e.renderEnd,o.origin,v));return{...e,deltaAngle:t}}))}function E(e,t){const n=D;e.renderCoordsHelper.toRenderCoords(e.camera.position,n);const o=v(e,n,e.camera.heading,e.camera.tilt,S()).direction;return r(i(o,t))-90}function C(r,e,n,a){return t(A,n,a),o(r,e,A)}const D=d(),M=d(),V=d(),w=d(),A=n();export{R as getViewshedRotationMatrix,C as rotateBy,U as screenToCircleAngle};
5
+ import{rad2deg as r,clamp as e}from"../../../../core/mathUtils.js";import{fromRotation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as o,n as a,c as s,p as i,e as c,a as m,f as p,g as l}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getNormal as f,fromPositionAndNormal as u,create as g}from"../../../../geometry/support/plane.js";import{viewshedToolManipulatorConfiguration as h}from"./ViewshedConfiguration.js";import{calculateTranslateRotateFromBases as j,calculateInputRotationTransform as b}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as x}from"../../interactive/editingTools/dragEventPipeline3D.js";import{headingTiltToDirectionUp as v}from"../../support/cameraUtils.js";import{createDirectionUp as S}from"../../support/cameraUtilsInternal.js";function R({tiltedUpVector:r,rightVector:e,observerRenderSpace:t},n){const o=j(r,e,t,n);return o[12]=0,o[13]=0,o[14]=0,o}function U(t,n,o,i){const j=d(),v=f(o.plane),S=E(n,v);let R;if(Math.abs(S)>h.viewAngleThreshold)R=t.next(x(n,o.plane));else{const r=u(i.targetRenderSpace,o.basis1,g()),s=a(D,o.basis1),f=a(M,o.basis2);R=t.next(x(n,r)).next((r=>{const t=r=>{const t=c(m(V,r,o.origin),f),n=Math.acos(e(t/i.farDistanceRenderSpace,-1,1)),a=Math.sin(n)*i.farDistanceRenderSpace;return p(d(),o.origin,p(d(),l(V,s,a),l(w,f,t)))},n=t(r.renderStart),a=t(r.renderEnd);return{...r,renderStart:n,renderEnd:a}}))}return R.next((e=>{"start"===e.action&&s(j,e.renderStart);const t=r(b(j,e.renderEnd,o.origin,v));return{...e,deltaAngle:t}}))}function E(e,t){const n=D;e.renderCoordsHelper.toRenderCoords(e.camera.position,n);const o=v(e,n,e.camera.heading,e.camera.tilt,S()).direction;return r(i(o,t))-90}function C(r,e,n,a){return t(A,n,a),o(r,e,A)}const D=d(),M=d(),V=d(),w=d(),A=n();export{R as getViewshedRotationMatrix,C as rotateBy,U as screenToCircleAngle};
@@ -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{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as n}from"../../../core/maybe.js";import{watch as d,initial as l,when as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{c as m,p as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as f,isLoaded as V,projectOrLoad as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{containsPoint as g,empty as j}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as D}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as C}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{newIntersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as O}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as A}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as S,removeAnalysisViewTool as U,startExclusiveInteractiveOperation as z}from"../../analysis/analysisViewUtils.js";let I=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderer=new A({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=O.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(t=>{const s=new C({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([d((()=>({valid:s.valid,canProject:f(s.observer?.spatialReference,this.view.spatialReference)||V()})),(({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))}),l),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}})),this._analysisVisualization=new D({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([d((()=>this.visible),(e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map((e=>e.viewshedComputedData)).filter((e=>e.valid)).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)})),d((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:t})=>t.renderCoordsHelper=e))})),S(this,F),h((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),c)])}destroy(){this.userOperation=a(this.userOperation),U(this),this._analysisVisualization=n(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[d((()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature]),(()=>{this._updateObserverFromFeature(t,e)}),l),this._createElevationUpdateHandle(e),h((()=>e.needUpdateByFeature),(()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1}))]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=y(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally((()=>t(s,i)));const n=a.geometry;null!=n&&(_(s,i,x,r.spatialReference),g(x,[n.x,n.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:s})=>t(e,s)))}async createViewsheds(e){return z(this,{abortOptions:e,onToolActivated:e=>e.place("multiple")})}async place(e){return z(this,{abortOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderer.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderer.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=m(v(),r),n={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:m(v(),o),targetFeatureId:null};s(e,this._intersector,n,(e=>Math.min(e,.05*i.farDistanceRenderSpace))),i.observerRenderSpaceOverride=w(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof F&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],I.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],I.prototype,"analysis",void 0),e([p()],I.prototype,"tool",void 0),e([p()],I.prototype,"_selectedViewshed",void 0),e([p()],I.prototype,"selectedViewshed",null),e([p()],I.prototype,"selectedViewshedComputedData",null),e([p()],I.prototype,"viewshedComputedDataHandles",void 0),e([p()],I.prototype,"userOperation",void 0),e([p()],I.prototype,"_analysisVisualization",void 0),e([p()],I.prototype,"_viewshedRenderer",void 0),I=e([u("esri.views.3d.analysis.ViewshedAnalysisView3D")],I);const T=I,x=j();export{T as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as n}from"../../../core/maybe.js";import{watch as d,initial as l,when as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{c as m,q as w}from"../../../chunks/vec32.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as f,isLoaded as V,projectOrLoad as y}from"../../../geometry/projection.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{containsPoint as g,empty as j}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as D}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as C}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{Intersector as H}from"../webgl-engine/lib/Intersector.js";import{StoreResults as O}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Viewshed as A}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as S,removeAnalysisViewTool as U,startExclusiveInteractiveOperation as z}from"../../analysis/analysisViewUtils.js";let I=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderer=null,this._intersector=null}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderer=new A({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=O.MIN,this.viewshedComputedDataHandles=o((()=>this.analysis.viewsheds),(t=>{const s=new C({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([d((()=>({valid:s.valid,canProject:f(s.observer?.spatialReference,this.view.spatialReference)||V()})),(({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))}),l),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}})),this._analysisVisualization=new D({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([d((()=>this.visible),(e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map((e=>e.viewshedComputedData)).filter((e=>e.valid)).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)})),d((()=>e.renderCoordsHelper),(e=>{this.viewshedComputedDataHandles?.forEach((({viewshedComputedData:t})=>t.renderCoordsHelper=e))})),S(this,F),h((()=>this.interactive),(()=>{this._unselectOtherViewsheds(this.selectedViewshed)}),c)])}destroy(){this.userOperation=a(this.userOperation),U(this),this._analysisVisualization=n(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map((e=>e.viewshedComputedData)).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[d((()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature]),(()=>{this._updateObserverFromFeature(t,e)}),l),this._createElevationUpdateHandle(e),h((()=>e.needUpdateByFeature),(()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1}))]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=y(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally((()=>t(s,i)));const n=a.geometry;null!=n&&(_(s,i,x,r.spatialReference),g(x,[n.x,n.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:s})=>t(e,s)))}async createViewsheds(e){return z(this,{abortOptions:e,onToolActivated:e=>e.place("multiple")})}async place(e){return z(this,{abortOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderer.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderer.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=m(v(),r),n={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:m(v(),o),targetFeatureId:null};s(e,this._intersector,n,(e=>Math.min(e,.05*i.farDistanceRenderSpace))),i.observerRenderSpaceOverride=w(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof F&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],I.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],I.prototype,"analysis",void 0),e([p()],I.prototype,"tool",void 0),e([p()],I.prototype,"_selectedViewshed",void 0),e([p()],I.prototype,"selectedViewshed",null),e([p()],I.prototype,"selectedViewshedComputedData",null),e([p()],I.prototype,"viewshedComputedDataHandles",void 0),e([p()],I.prototype,"userOperation",void 0),e([p()],I.prototype,"_analysisVisualization",void 0),e([p()],I.prototype,"_viewshedRenderer",void 0),I=e([u("esri.views.3d.analysis.ViewshedAnalysisView3D")],I);const T=I,x=j();export{T 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{lerp as t}from"../../../../core/mathUtils.js";import{transpose as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{l as s,j as a,m as o,c as h,d as n,q as r,g as c,h as _,e as m,f as p,n as f}from"../../../../chunks/vec32.js";import{create as l,clone as d,UNIT_Y as M,UNIT_X as v,UNIT_Z as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as u}from"../../../ViewingMode.js";import{angle as w,slerp as y}from"../../support/mathUtils.js";class P{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(t){this.viewingMode=t,this.center=l(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=d(O),this._fov=55,this._size=1}pixelsPerPanAtZoom(t){return this._size/2/(this._zoomToPanScale*t)}zoomAtPixelsPerPan(t){return this._size/2/(this._zoomToPanScale*t)}pixelsPerRotate(){const t=Math.max(Math.cos(Math.abs(this._pitch)),.5);return this._size/2/t}compareTo(t,i){if(this.viewingMode===u.Global){const e=(s(this.center)+s(t.center))/2;i.pan=w(this.center,t.center)*e}else i.pan=a(this.center,t.center);let e=Math.abs(t._yaw-this._yaw);e>=Math.PI&&(e=2*Math.PI-e);const o=Math.abs(t._pitch-this._pitch);i.rotate=Math.max(e,o),i.fov=t.fov-this.fov,i.sourceZoom=this._distance,i.targetZoom=t._distance}interpolate(i,e,s){this.viewingMode===u.Global?y(i.center,e.center,s.pan,this.center):o(this.center,i.center,e.center,s.pan),this._distance=isFinite(e.distance)?t(i.distance,e.distance+s.zoomOffset,s.zoom):i.distance,this._pitch=t(i.pitch,e.pitch,s.rotate);let a=i._yaw;const h=e._yaw;Math.abs(h-a)>=Math.PI&&(a+=2*(a<h?1:-1)*Math.PI),this._yaw=t(a,h,s.rotate),this._fov=t(i.fov,e.fov,s.fov)}copyFrom(t){h(this.center,t.center),this._pitch=t.pitch,this._yaw=t.yaw,this._distance=t.distance,h(this.direction,t.direction),this._size=t.size,this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov),this.viewingMode=t.viewingMode}copyFromRenderCamera(t){const i=this._lookAtOrientation(t.center,F);h(this.center,t.center),n(I,t.center,t.eye),r(I,I,i),r(k,t.up,i),this._distance=s(I),0!==this._distance&&(I[0]/=this._distance,I[1]/=this._distance,I[2]/=this._distance),this._pitch=z(I),this._yaw=x(I,k),this._size=Math.sqrt(t.width*t.width+t.height*t.height),this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(t){const e=this._lookAtOrientation(this.center,F);i(e,e),this._axisAngleVec3(S,this._pitch-Math.PI/2,O,I),this._axisAngleVec3(V,this._yaw,I,I),this._axisAngleVec3(S,this._pitch-Math.PI/2,V,k),this._axisAngleVec3(V,this._yaw,k,k),c(I,I,this._distance),r(I,I,e),r(k,k,e),t.center=this.center,t.eye=n(I,this.center,I),t.up=k,t.fov=this._fov}_axisAngleVec3(t,i,e,s){const a=Math.cos(i),o=Math.sin(i);return c(A,e,a),_(b,t,e),c(b,b,o),c(j,t,(1-a)*m(t,e)),p(s,p(s,A,b),j)}_lookAtOrientation(t,i=e()){return this._upAtLookAt(t,j),_(A,this.direction,j),f(A,A),0===A[0]&&0===A[1]&&0===A[2]&&h(A,S),_(b,j,A),f(b,b),i[0]=A[0],i[1]=b[0],i[2]=j[0],i[3]=A[1],i[4]=b[1],i[5]=j[1],i[6]=A[2],i[7]=b[2],i[8]=j[2],i}_upAtLookAt(t,i){return this.viewingMode===u.Local?h(i,V):f(i,t)}}function z(t){return Math.PI-w(V,t)}function x(t,i){const e=T;return Math.abs(i[2])<.5?(h(e,i),t[2]>0&&c(e,e,-1)):h(e,t),_(b,e,V),f(b,b),w(S,b,V)}const A=l(),b=l(),j=l(),I=l(),k=l(),T=l(),V=g,O=M,S=v,F=e();export{P as Camera};
5
+ import{lerp as t}from"../../../../core/mathUtils.js";import{transpose as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{l as s,j as a,m as o,c as h,d as n,o as r,g as c,h as _,e as m,f as p,n as f}from"../../../../chunks/vec32.js";import{create as l,clone as d,UNIT_Y as M,UNIT_X as v,UNIT_Z as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as u}from"../../../ViewingMode.js";import{angle as w,slerp as y}from"../../support/mathUtils.js";class P{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(t){this.viewingMode=t,this.center=l(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=d(O),this._fov=55,this._size=1}pixelsPerPanAtZoom(t){return this._size/2/(this._zoomToPanScale*t)}zoomAtPixelsPerPan(t){return this._size/2/(this._zoomToPanScale*t)}pixelsPerRotate(){const t=Math.max(Math.cos(Math.abs(this._pitch)),.5);return this._size/2/t}compareTo(t,i){if(this.viewingMode===u.Global){const e=(s(this.center)+s(t.center))/2;i.pan=w(this.center,t.center)*e}else i.pan=a(this.center,t.center);let e=Math.abs(t._yaw-this._yaw);e>=Math.PI&&(e=2*Math.PI-e);const o=Math.abs(t._pitch-this._pitch);i.rotate=Math.max(e,o),i.fov=t.fov-this.fov,i.sourceZoom=this._distance,i.targetZoom=t._distance}interpolate(i,e,s){this.viewingMode===u.Global?y(i.center,e.center,s.pan,this.center):o(this.center,i.center,e.center,s.pan),this._distance=isFinite(e.distance)?t(i.distance,e.distance+s.zoomOffset,s.zoom):i.distance,this._pitch=t(i.pitch,e.pitch,s.rotate);let a=i._yaw;const h=e._yaw;Math.abs(h-a)>=Math.PI&&(a+=2*(a<h?1:-1)*Math.PI),this._yaw=t(a,h,s.rotate),this._fov=t(i.fov,e.fov,s.fov)}copyFrom(t){h(this.center,t.center),this._pitch=t.pitch,this._yaw=t.yaw,this._distance=t.distance,h(this.direction,t.direction),this._size=t.size,this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov),this.viewingMode=t.viewingMode}copyFromRenderCamera(t){const i=this._lookAtOrientation(t.center,F);h(this.center,t.center),n(I,t.center,t.eye),r(I,I,i),r(k,t.up,i),this._distance=s(I),0!==this._distance&&(I[0]/=this._distance,I[1]/=this._distance,I[2]/=this._distance),this._pitch=z(I),this._yaw=x(I,k),this._size=Math.sqrt(t.width*t.width+t.height*t.height),this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(t){const e=this._lookAtOrientation(this.center,F);i(e,e),this._axisAngleVec3(S,this._pitch-Math.PI/2,O,I),this._axisAngleVec3(V,this._yaw,I,I),this._axisAngleVec3(S,this._pitch-Math.PI/2,V,k),this._axisAngleVec3(V,this._yaw,k,k),c(I,I,this._distance),r(I,I,e),r(k,k,e),t.center=this.center,t.eye=n(I,this.center,I),t.up=k,t.fov=this._fov}_axisAngleVec3(t,i,e,s){const a=Math.cos(i),o=Math.sin(i);return c(A,e,a),_(b,t,e),c(b,b,o),c(j,t,(1-a)*m(t,e)),p(s,p(s,A,b),j)}_lookAtOrientation(t,i=e()){return this._upAtLookAt(t,j),_(A,this.direction,j),f(A,A),0===A[0]&&0===A[1]&&0===A[2]&&h(A,S),_(b,j,A),f(b,b),i[0]=A[0],i[1]=b[0],i[2]=j[0],i[3]=A[1],i[4]=b[1],i[5]=j[1],i[6]=A[2],i[7]=b[2],i[8]=j[2],i}_upAtLookAt(t,i){return this.viewingMode===u.Local?h(i,V):f(i,t)}}function z(t){return Math.PI-w(V,t)}function x(t,i){const e=T;return Math.abs(i[2])<.5?(h(e,i),t[2]>0&&c(e,e,-1)):h(e,t),_(b,e,V),f(b,b),w(S,b,V)}const A=l(),b=l(),j=l(),I=l(),k=l(),T=l(),V=g,O=M,S=v,F=e();export{P as Camera};
@@ -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{c as e,d as r,f as n,j as t,o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{h as s,l as a}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as f,interactionDirectionTowardsConstraintMinimization as m,adjustRangeForInteraction as u}from"./common.js";import{InteractionType as p}from"./InteractionType.js";function d(e,r,n=f){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;x.min=0,x.max=t,l(e,n,x);const o=O(e,r),i=x.max-o;return i>=-1e-6?0:i}function y(t,o,i=f){const u=d(t,o,i);if(0===u)return!1;const p=t.pointsOfInterest.surfaceOrigin;if(!p.renderLocation)return!1;const y=O(t,o)+u,l=e(L,o.eye),x=m(o,i.interactionDirection,j(o,p.renderLocation,h),I);if(!s(a(p.renderLocation,y),c(o.eye,x),C))return!1;o.eye=C;const N=r(g,o.eye,l);o.center=n(C,o.center,N);const k=t.renderCoordsHelper.getAltitude(o.center),v=t.renderCoordsHelper.intersectInfiniteManifold(o.ray,k,C);return null!=v&&(o.center=v),!0}function l(e,r,n){const t=r.interactionType;if(t===p.NONE)return;const{min:o,max:i}=n,{interactionStartCamera:c,interactionFactor:s}=r;if(!c)return;const a=t===p.ZOOM||t===p.PAN,f=d(e,c),m=0===f?0:O(e,c);n.min=o,n.max=i;u(f,m,a,s,.05*m,n)}function O(e,r){const n=e.pointsOfInterest.surfaceOrigin;return n.renderLocation?t(r.eye,n.renderLocation):0}function j(e,r,n){return o(n,e.eye,r)}const x={min:0,max:0},L=i(),g=i(),I=i(),h=i(),C=i();export{y as applyDistanceConstraint,d as getDistanceConstraintError};
5
+ import{c as e,d as r,f as n,j as t,E as o}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{h as s,l as a}from"../../../../chunks/sphere.js";import{defaultConstraintOptions as f,interactionDirectionTowardsConstraintMinimization as m,adjustRangeForInteraction as u}from"./common.js";import{InteractionType as p}from"./InteractionType.js";function d(e,r,n=f){if(!e.state.isLocal)return 0;const t=e.state.constraints.distance;if(!e.pointsOfInterest.surfaceOrigin.renderLocation||t===1/0)return 0;x.min=0,x.max=t,l(e,n,x);const o=O(e,r),i=x.max-o;return i>=-1e-6?0:i}function y(t,o,i=f){const u=d(t,o,i);if(0===u)return!1;const p=t.pointsOfInterest.surfaceOrigin;if(!p.renderLocation)return!1;const y=O(t,o)+u,l=e(L,o.eye),x=m(o,i.interactionDirection,j(o,p.renderLocation,h),I);if(!s(a(p.renderLocation,y),c(o.eye,x),C))return!1;o.eye=C;const N=r(g,o.eye,l);o.center=n(C,o.center,N);const k=t.renderCoordsHelper.getAltitude(o.center),v=t.renderCoordsHelper.intersectInfiniteManifold(o.ray,k,C);return null!=v&&(o.center=v),!0}function l(e,r,n){const t=r.interactionType;if(t===p.NONE)return;const{min:o,max:i}=n,{interactionStartCamera:c,interactionFactor:s}=r;if(!c)return;const a=t===p.ZOOM||t===p.PAN,f=d(e,c),m=0===f?0:O(e,c);n.min=o,n.max=i;u(f,m,a,s,.05*m,n)}function O(e,r){const n=e.pointsOfInterest.surfaceOrigin;return n.renderLocation?t(r.eye,n.renderLocation):0}function j(e,r,n){return o(n,e.eye,r)}const x={min:0,max:0},L=i(),g=i(),I=i(),h=i(),C=i();export{y as applyDistanceConstraint,d as getDistanceConstraintError};
@@ -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{c as e,s as r,g as n,d as t,f as i,e as o,l as s}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as l}from"../../../geometry/support/aaBoundingRect.js";import d from"../webgl/RenderCamera.js";import{DepthRange as g}from"../webgl-engine/lib/DepthRange.js";import{newIntersector as f}from"../webgl-engine/lib/Intersector.js";function u(e,r,n,t){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,w,t)&&l(n,w)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c){const l=o.state.camera.clone();s&&a&&c&&(l.eye=s,l.center=a,l.up=c),v(o,l.ray,j)||e(j,l.center);const d=o.state.constraints,g=d.minimumPoiDistance;if(r(l.eye,j)<g){const r=d.collision.enabled;e(R,l.viewForward),n(R,R,g),r?l.eye=t(w,j,R):i(j,l.eye,R);const s=o.renderCoordsHelper,a=s.getAltitude(l.eye),c=d.collision.elevationMargin;r&&a<c&&(t(R,j,l.eye),l.eye=s.setAltitude(w,c,l.eye),i(j,l.eye,R))}return l.center=j,l}function y(e,n,t){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,n),o=e.stateManager.constraintsManager.nearFarHeuristic;C.eye=n,C.center=t;const{far:s}=o.compute(C,e.renderDataExtent,g.infinite,i),a=s*s;return r(n,t)>a}function v(e,r,n){let t=M[e.viewingMode];t||(t=f(e.state.viewingMode),t.options.backfacesTerrain=!e.state.isGlobal,t.options.invisibleTerrain=!0,M[e.viewingMode]=t);const{isGlobal:i}=e.state;return!(!e.sceneIntersectionHelper.intersectRay(r,t,n)||y(e,r.origin,n))||(!(!e.renderCoordsHelper.intersectManifold(r,0,n)||y(e,r.origin,n))||!!i&&b(r,n,c(e.spatialReference).radius))}function b(e,r,t){const a=o(e.origin,e.origin)-t*t,c=a>0?Math.sqrt(a)/3:1;return n(r,e.direction,c/s(e.direction)),i(r,r,e.origin),!0}const M={},w=a(),j=a(),R=a(),C=new d;export{p as cameraOnContentAlongViewDirection,u as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
5
+ import{c as e,s as r,g as n,d as t,f as i,e as o,l as s}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as l}from"../../../geometry/support/aaBoundingRect.js";import d from"../webgl/RenderCamera.js";import{DepthRange as g}from"../webgl-engine/lib/DepthRange.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function u(e,r,n,t){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,M,t)&&l(n,M)}function m(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function p(o,s,a,c){const l=o.state.camera.clone();s&&a&&c&&(l.eye=s,l.center=a,l.up=c),v(o,l.ray,j)||e(j,l.center);const d=o.state.constraints,g=d.minimumPoiDistance;if(r(l.eye,j)<g){const r=d.collision.enabled;e(R,l.viewForward),n(R,R,g),r?l.eye=t(M,j,R):i(j,l.eye,R);const s=o.renderCoordsHelper,a=s.getAltitude(l.eye),c=d.collision.elevationMargin;r&&a<c&&(t(R,j,l.eye),l.eye=s.setAltitude(M,c,l.eye),i(j,l.eye,R))}return l.center=j,l}function y(e,n,t){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=m(e,n),o=e.stateManager.constraintsManager.nearFarHeuristic;C.eye=n,C.center=t;const{far:s}=o.compute(C,e.renderDataExtent,g.infinite,i),a=s*s;return r(n,t)>a}function v(e,r,n){let t=w[e.viewingMode];t||(t=new f(e.state.viewingMode),t.options.backfacesTerrain=!e.state.isGlobal,t.options.invisibleTerrain=!0,w[e.viewingMode]=t);const{isGlobal:i}=e.state;return!(!e.sceneIntersectionHelper.intersectRay(r,t,n)||y(e,r.origin,n))||(!(!e.renderCoordsHelper.intersectManifold(r,0,n)||y(e,r.origin,n))||!!i&&b(r,n,c(e.spatialReference).radius))}function b(e,r,t){const a=o(e.origin,e.origin)-t*t,c=a>0?Math.sqrt(a)/3:1;return n(r,e.direction,c/s(e.direction)),i(r,r,e.origin),!0}const w={},M=a(),j=a(),R=a(),C=new d;export{p as cameraOnContentAlongViewDirection,u as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};