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

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 (431) 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/06eb4832b6c86744e52e.js +1 -0
  49. package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js +2 -0
  50. package/assets/esri/core/workers/chunks/{543eb46b55cacd6e1dbc.js.LICENSE.txt → 0766ecb677d667e5fb83.js.LICENSE.txt} +1 -1
  51. package/assets/esri/core/workers/chunks/{c607d618b64d3accecc4.js → 0aca29f7156b2b412f2e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/170c346cf5a18adb25b0.js +1 -0
  53. package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +1 -0
  54. package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js +2 -0
  55. package/assets/esri/core/workers/chunks/{d8dc922f7466300b668f.js.LICENSE.txt → 218a66d53f7cf4f285aa.js.LICENSE.txt} +2 -2
  56. package/assets/esri/core/workers/chunks/{037af6379f3e9278633b.js → 243dc74ec62891ba1ef7.js} +1 -1
  57. package/assets/esri/core/workers/chunks/253bcc3cc7bc4c2dc6ea.js +1 -0
  58. package/assets/esri/core/workers/chunks/{d874d24568b1acedebc4.js → 297d2c0a9d3f1e978318.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{f74b5659b6496a5c4c0c.js → 2e0af748eba93f3ea6cb.js} +1 -1
  60. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +2 -0
  61. package/assets/esri/core/workers/chunks/{7b4523ab392966624d97.js.LICENSE.txt → 3596540ef49e5330ceb2.js.LICENSE.txt} +1 -7
  62. package/assets/esri/core/workers/chunks/{a22c88b0a525e602dce0.js → 3d0e09ef78dc2fd6957a.js} +1 -1
  63. package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +1 -0
  64. package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +1 -0
  65. package/assets/esri/core/workers/chunks/{ee1d104e2bcc5d808fa4.js → 5228fc7fcdf57f44781e.js} +1 -1
  66. package/assets/esri/core/workers/chunks/54f4a1131f99468db076.js +1 -0
  67. package/assets/esri/core/workers/chunks/{49c968e91c3c48aaa110.js → 5583d18032ed8bc17c74.js} +1 -1
  68. package/assets/esri/core/workers/chunks/5e7f35bf1aab93cb1c52.js +1 -0
  69. package/assets/esri/core/workers/chunks/{69f7fe6c58e4931597f6.js → 631205dc4d73d49ec9ed.js} +1 -1
  70. package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +1 -0
  71. package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +1 -0
  72. package/assets/esri/core/workers/chunks/{e46c05ef7272c7f1f70c.js → 83d6a1b3db7d364d156b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  74. package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js +2 -0
  75. package/assets/esri/core/workers/chunks/{ac9c6779771ec855da79.js.LICENSE.txt → 90ae15ce22a49bd84876.js.LICENSE.txt} +3 -3
  76. package/assets/esri/core/workers/chunks/92cbe9af8a6c061bfb57.js +346 -0
  77. package/assets/esri/core/workers/chunks/{9aedd7874da7c63865d6.js → 93cc26e5636040fdc0b8.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{77c7b7c4426c2b1a5b42.js → 9fc35ec8185beba96715.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +1 -0
  80. package/assets/esri/core/workers/chunks/{4f627eb62caee760215a.js → a1f27c4f4b5ef3e359f7.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a31658f544ac6e1801d6.js +1 -0
  82. package/assets/esri/core/workers/chunks/{3a205f87f100832ef9f5.js → a5e746e10239a3bfe237.js} +1 -1
  83. package/assets/esri/core/workers/chunks/a6bcae413e62cd879b46.js +1 -0
  84. package/assets/esri/core/workers/chunks/{59d4c41172e921922cac.js → a8b42d8c0b76c234c09f.js} +100 -62
  85. package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js +2 -0
  86. package/assets/esri/core/workers/chunks/{ce9de24cb96b56d20562.js.LICENSE.txt → b4f38fe9cc948a39ad87.js.LICENSE.txt} +1 -1
  87. package/assets/esri/core/workers/chunks/{752ef63d910852b7be44.js → c16e0da7a19310c71e8b.js} +1 -1
  88. package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +1 -0
  89. package/assets/esri/core/workers/chunks/d551f70560a2b1ef5696.js +1 -0
  90. package/assets/esri/core/workers/chunks/d7b640f7a181bd26c7c7.js +1 -0
  91. package/assets/esri/core/workers/chunks/{2bdbf678d4f013543dbb.js → d971571a957de70d5a8d.js} +1 -1
  92. package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +1 -0
  93. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +2 -0
  94. package/assets/esri/core/workers/chunks/{670a66617249f2d15a62.js.LICENSE.txt → e0dc8794343c2a949ffb.js.LICENSE.txt} +1 -1
  95. package/assets/esri/core/workers/chunks/e3c1aea34ece8336dae1.js +1 -0
  96. package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +1 -0
  97. package/assets/esri/core/workers/chunks/{a50cb1fc8c4c585c0e11.js → ec8e8048b3df2c92008d.js} +1 -1
  98. package/assets/esri/core/workers/chunks/f6a1fec33b0d81acce61.js +1 -0
  99. package/assets/esri/core/workers/chunks/f7ab3511f6627f467796.js +1 -0
  100. package/assets/esri/core/workers/chunks/{1eef9cf19634c038b59b.js → f98689562017583f73ee.js} +1 -1
  101. package/assets/esri/core/workers/chunks/fb2e28e6a87956267d1c.js +66 -0
  102. package/assets/esri/core/workers/chunks/fbcd94f60f92257a7303.js +2 -0
  103. package/assets/esri/core/workers/chunks/{c2594024d72133d3ed7b.js.LICENSE.txt → fbcd94f60f92257a7303.js.LICENSE.txt} +1 -1
  104. package/assets/esri/core/workers/chunks/fda48126f67e80034404.js +1 -0
  105. package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
  106. package/assets/esri/themes/dark/main.css +1 -1
  107. package/assets/esri/themes/light/main.css +1 -1
  108. package/assets/esri/themes/light/view.css +1 -1
  109. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
  110. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
  111. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
  112. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
  113. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
  114. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
  115. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
  116. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
  117. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
  118. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
  119. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
  120. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
  121. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
  122. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
  123. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
  124. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
  125. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
  126. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
  127. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
  128. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
  129. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
  130. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
  131. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
  132. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
  133. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
  134. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
  135. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
  136. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
  137. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
  138. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
  139. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
  140. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
  141. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
  142. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
  143. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
  144. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
  145. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
  146. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
  147. package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
  148. package/chunks/HUDMaterial.glsl.js +1 -1
  149. package/chunks/Laserlines.glsl.js +2 -2
  150. package/chunks/aiServices.js +1 -1
  151. package/chunks/boundedPlane.js +1 -1
  152. package/chunks/cameraUtilsSpherical.js +1 -1
  153. package/chunks/vec32.js +1 -1
  154. package/core/has.js +1 -1
  155. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  156. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  157. package/core/mapCollectionUtils.js +1 -1
  158. package/core/perspectiveUtils.js +1 -1
  159. package/core/sql/StandardizedFunctions.js +1 -1
  160. package/core/sql/WhereGrammar.js +1 -1
  161. package/geometry/support/axisAngleDegrees.js +1 -1
  162. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  163. package/geometry/support/curves/circleUtils.js +1 -1
  164. package/geometry/support/curves/curveExtent.js +5 -0
  165. package/geometry/support/curves/curveLength.js +5 -0
  166. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  167. package/geometry/support/curves/ellipticArc4Utils.js +1 -1
  168. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  169. package/geometry/support/curves/mathUtils.js +1 -1
  170. package/geometry/support/curves/splitCurveAtPoint.js +1 -1
  171. package/geometry/support/frustum.js +1 -1
  172. package/geometry/support/meshUtils/External.js +1 -1
  173. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  174. package/geometry/support/meshUtils/loadExternal.js +1 -1
  175. package/geometry/support/meshUtils/primitives.js +1 -1
  176. package/geometry/support/meshUtils/projection.js +1 -1
  177. package/geometry/support/meshUtils/rotate.js +1 -1
  178. package/geometry/support/meshUtils/scale.js +1 -1
  179. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  180. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  181. package/geometry/support/plane.js +1 -1
  182. package/interfaces.d.ts +401 -17
  183. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  184. package/layers/LinkChartLayer.js +1 -1
  185. package/layers/SceneLayer.js +1 -1
  186. package/layers/VideoLayer.js +1 -1
  187. package/layers/VoxelWasmPerSceneView.js +1 -1
  188. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  189. package/layers/graphics/sources/MemorySource.js +1 -1
  190. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  191. package/layers/video/VideoCameraSensorModel.js +1 -1
  192. package/layers/video/VideoController.js +1 -1
  193. package/layers/voxel/VoxelVolume.js +1 -1
  194. package/layers/voxel/voxelPlaneUtils.js +1 -1
  195. package/package.json +1 -1
  196. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  197. package/rest/support/meshFeatureSet.js +1 -1
  198. package/smartMapping/renderers/size.js +1 -1
  199. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  200. package/support/revision.js +1 -1
  201. package/symbols/cim/cimAnalyzer.js +1 -1
  202. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  209. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  210. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  211. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  212. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  213. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  214. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  215. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  216. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  217. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  218. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  219. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  220. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  221. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  222. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  223. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  224. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  225. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  226. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  227. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  228. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  229. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  230. package/views/3d/camera/constraintUtils/distance.js +1 -1
  231. package/views/3d/camera/intersectionUtils.js +1 -1
  232. package/views/3d/interactive/Manipulator3D.js +1 -1
  233. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  234. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  235. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  236. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  237. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  238. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  239. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  240. package/views/3d/layers/I3SMeshView3D.js +1 -1
  241. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  242. package/views/3d/layers/PointCloudWorker.js +1 -1
  243. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  244. package/views/3d/layers/SceneLayerView3D.js +1 -1
  245. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  246. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  247. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  248. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  249. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  250. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  251. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  252. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  253. package/views/3d/layers/graphics/Labeler.js +1 -1
  254. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  255. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  256. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  257. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  258. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  259. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  260. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  261. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  262. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  263. package/views/3d/layers/i3s/I3SQueryResultGeometry.js +5 -0
  264. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  265. package/views/3d/layers/i3s/Intersector.js +1 -1
  266. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  267. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  268. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  269. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  270. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  271. package/views/3d/state/Frustum.js +1 -1
  272. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  273. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  274. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  275. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  276. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  277. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  278. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  279. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  280. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  281. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  282. package/views/3d/support/hitTest.js +1 -1
  283. package/views/3d/support/orientedBoundingBox.js +1 -1
  284. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  285. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  286. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  287. package/views/3d/support/viewpointUtils.js +1 -1
  288. package/views/3d/terrain/Intersector.js +1 -1
  289. package/views/3d/terrain/OverlayManager.js +1 -1
  290. package/views/3d/terrain/TerrainRenderer.js +1 -1
  291. package/views/3d/terrain/TerrainSurface.js +1 -1
  292. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  293. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  294. package/views/3d/webgl/RenderCamera.js +1 -1
  295. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  296. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  297. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  298. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  299. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  300. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  301. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  302. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  303. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  304. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  305. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  306. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  307. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  308. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  309. package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +5 -0
  310. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  311. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  312. package/views/3d/webgl-engine/lib/IntersectorResult.js +5 -0
  313. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  314. package/views/3d/webgl-engine/lib/IntersectorType.js +5 -0
  315. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  316. package/views/3d/webgl-engine/lib/Material.js +1 -1
  317. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  318. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  319. package/views/3d/webgl-engine/lib/ObjectIntersectorResult.js +5 -0
  320. package/views/3d/webgl-engine/lib/ObjectTarget.js +5 -0
  321. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  322. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  323. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  324. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  325. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  326. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  327. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  328. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  329. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  330. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  331. package/views/3d/webgl-engine/lib/lodRendering/Intersector.js +1 -1
  332. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  333. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  334. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  335. package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
  336. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  337. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  338. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  339. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  340. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  341. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  342. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  343. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  344. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  345. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  346. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  347. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  348. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  349. package/views/FocusArea.js +1 -1
  350. package/views/FocusAreaOutline.js +5 -0
  351. package/views/FocusAreaOutlineItem.js +5 -0
  352. package/views/FocusAreas.js +1 -1
  353. package/views/FocusAreasUtils.js +5 -0
  354. package/views/FocusAreasView.js +5 -0
  355. package/views/SceneView.js +1 -1
  356. package/views/analysis/DimensionAnalysisView.js +1 -1
  357. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  358. package/views/interactive/ToolIntersector.js +1 -1
  359. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  360. package/views/interactive/keybindings.js +1 -1
  361. package/views/interactive/sketch/constraints.js +1 -1
  362. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  363. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  364. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  365. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  366. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  367. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  368. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  369. package/views/layers/DimensionLayerView.js +1 -1
  370. package/views/support/angularMeasurementUtils.js +1 -1
  371. package/views/support/geometry3dUtils.js +1 -1
  372. package/webdoc/IPSInfo.js +1 -1
  373. package/webdoc/ips/AppleIPSProperties.d.ts +4 -0
  374. package/webdoc/ips/AppleIPSProperties.js +5 -0
  375. package/webdoc/ips/Configuration.d.ts +4 -0
  376. package/webdoc/ips/Configuration.js +5 -0
  377. package/webdoc/ips/GNSSProperties.d.ts +4 -0
  378. package/webdoc/ips/GNSSProperties.js +5 -0
  379. package/webdoc/ips/PathSnappingProperties.d.ts +4 -0
  380. package/webdoc/ips/PathSnappingProperties.js +5 -0
  381. package/webdoc/ips/SmoothingProperties.d.ts +4 -0
  382. package/webdoc/ips/SmoothingProperties.js +5 -0
  383. package/widgets/BasemapLayerList.js +1 -1
  384. package/widgets/BatchAttributeForm.js +1 -1
  385. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  386. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  387. package/widgets/FeatureForm.js +1 -1
  388. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  389. package/widgets/FeatureTable.js +1 -1
  390. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  391. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  392. package/widgets/UtilityNetworkTrace.js +1 -1
  393. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  394. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  395. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  396. package/widgets/support/FilterBuilder.js +1 -1
  397. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  398. package/widgets/support/SketchTooltipControls.js +1 -1
  399. package/widgets/support/SnappingControls.js +1 -1
  400. package/assets/esri/core/workers/chunks/094300acbd24085cb063.js +0 -1
  401. package/assets/esri/core/workers/chunks/0c338364cb55afdbd580.js +0 -1
  402. package/assets/esri/core/workers/chunks/2da01fe20200b6d74851.js +0 -1
  403. package/assets/esri/core/workers/chunks/35c996f6fbff165b03f4.js +0 -1
  404. package/assets/esri/core/workers/chunks/3a517393619af3639b83.js +0 -1
  405. package/assets/esri/core/workers/chunks/45d64b72b7e93e9c64d7.js +0 -1
  406. package/assets/esri/core/workers/chunks/46104db7f77952bb6c12.js +0 -1
  407. package/assets/esri/core/workers/chunks/47bbfc10c2a3b9e4bdd6.js +0 -1
  408. package/assets/esri/core/workers/chunks/49f0e53b3c9ba8451442.js +0 -1
  409. package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js +0 -2
  410. package/assets/esri/core/workers/chunks/5e0118a030cf741f78c6.js +0 -319
  411. package/assets/esri/core/workers/chunks/670a66617249f2d15a62.js +0 -2
  412. package/assets/esri/core/workers/chunks/6b5274d46a155d65dff1.js +0 -39
  413. package/assets/esri/core/workers/chunks/74187c771ee7083d1db7.js +0 -1
  414. package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +0 -2
  415. package/assets/esri/core/workers/chunks/7c2ec96749972e0b8a13.js +0 -1
  416. package/assets/esri/core/workers/chunks/7ffc1db10b00754398e8.js +0 -1
  417. package/assets/esri/core/workers/chunks/81546c6141d564ed59c9.js +0 -1
  418. package/assets/esri/core/workers/chunks/852dd5af8e704613310a.js +0 -1
  419. package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js +0 -2
  420. package/assets/esri/core/workers/chunks/bbff052a991a2dc36960.js +0 -1
  421. package/assets/esri/core/workers/chunks/bcab8b9ce2f9d2ebaae7.js +0 -1
  422. package/assets/esri/core/workers/chunks/bf190d672dcbaedc1a41.js +0 -1
  423. package/assets/esri/core/workers/chunks/c255c9279815359fdce5.js +0 -1
  424. package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +0 -2
  425. package/assets/esri/core/workers/chunks/ce9de24cb96b56d20562.js +0 -2
  426. package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js +0 -2
  427. package/assets/esri/core/workers/chunks/d9948763423784b68c09.js +0 -1
  428. package/assets/esri/core/workers/chunks/dbf6011dd7933f02d41d.js +0 -66
  429. package/assets/esri/core/workers/chunks/e4e9dd635bdef18d0bd5.js +0 -1
  430. package/assets/esri/core/workers/chunks/e69f2e3c2d5e71fbb42f.js +0 -1
  431. 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 t}from"../../../../chunks/tslib.es6.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import o from"../../../ViewAnimation.js";import{Animation as s}from"../../animation/pointToPoint/Animation.js";import{AnimationController as r}from"./AnimationController.js";import a from"../../webgl/RenderCamera.js";import{newIntersector as m}from"../../webgl-engine/lib/Intersector.js";import{EasingFunctions as c}from"../../../animation/easing.js";let p=class extends r{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.type="point-to-point",this.mode="interaction",this._hasTarget=!1}initialize(){this.animation=new s(this.view.state.viewingMode),this.viewAnimation="interaction"===this.mode?null:new o}get isInteractive(){return"interaction"===this.mode}begin(t,i){this._hasTarget=!0;const e=this.animationSettings(i);h.copyFrom(this.view.state.camera);const n=m(this.view.state.viewingMode);this._intersectionHelper.intersectRay(h.ray,n,l)&&(h.center=l),this.animation.update(h,t,e),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(t,i){this._hasTarget&&this.animation.step(t,i)}onControllerEnd(t){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,t),this.animation.currentTime=this.animation.time),super.onControllerEnd(t)}animationSettings(t={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...t,easing:"string"==typeof t.easing?c[t.easing]:t.easing}}};t([i({constructOnly:!0})],p.prototype,"mode",void 0),t([i({readOnly:!0})],p.prototype,"isInteractive",null),p=t([e("esri.views.3d.state.controllers.PointToPointAnimationController")],p);const h=new a,l=n();function g(t){return null!=t&&"type"in t&&"point-to-point"===t.type}export{p as PointToPointAnimationController,g as isPointToPointAnimationController};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import o from"../../../ViewAnimation.js";import{Animation as s}from"../../animation/pointToPoint/Animation.js";import{AnimationController as r}from"./AnimationController.js";import a from"../../webgl/RenderCamera.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{EasingFunctions as c}from"../../../animation/easing.js";let p=class extends r{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.type="point-to-point",this.mode="interaction",this._hasTarget=!1}initialize(){this.animation=new s(this.view.state.viewingMode),this.viewAnimation="interaction"===this.mode?null:new o}get isInteractive(){return"interaction"===this.mode}begin(t,i){this._hasTarget=!0;const e=this.animationSettings(i);h.copyFrom(this.view.state.camera);const n=new m(this.view.state.viewingMode);this._intersectionHelper.intersectRay(h.ray,n,l)&&(h.center=l),this.animation.update(h,t,e),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(t,i){this._hasTarget&&this.animation.step(t,i)}onControllerEnd(t){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,t),this.animation.currentTime=this.animation.time),super.onControllerEnd(t)}animationSettings(t={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...t,easing:"string"==typeof t.easing?c[t.easing]:t.easing}}};t([i({constructOnly:!0})],p.prototype,"mode",void 0),t([i({readOnly:!0})],p.prototype,"isInteractive",null),p=t([e("esri.views.3d.state.controllers.PointToPointAnimationController")],p);const h=new a,l=n();function g(t){return null!=t&&"type"in t&&"point-to-point"===t.type}export{p as PointToPointAnimationController,g as isPointToPointAnimationController};
@@ -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 t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as o,l as m,n as h,e as c,g as p,f as _,v as l,c as u,m as f}from"../../../../chunks/vec32.js";import{create as g,fromValues as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as P,fromPositionAndNormal as D}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as j,applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as d}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as v}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as b}from"../../layers/VoxelWasm.js";import{InteractiveController as M}from"./InteractiveController.js";import{normalizeCoordinate as O,contentIntersectorOptions as N,distanceClampValues as R,pivotDistanceModifier as x,screenPixelArea as U,intersectPlaneFromScreenPoint as A}from"../utils/navigationUtils.js";let z=class extends M{constructor(){super(...arguments),this._tmpP=g(),this._tmpDir=g(),this._tmpN=g(),this._tmpP0=n(),this._tmpPoi=g(),this._tmpRayDir=g(),this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new d(v.ALL,w.ZOOM,0,this.startCamera,g()),this._plane=P()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),O(this.startCamera,t,this._normalizedAnchorPoint);const r=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,0===this.view.map.ground.opacity?N:{});o(this._tmpDir,this._tmpP,this.startCamera.eye);const s=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z);let n=i(Math.min(x,1/Math.abs(c(B,this._tmpDir)))*a,R[0],R[1]);const u=this.view.stage.renderView.getMinimalDepthForArea(b(this.view),t[0],t[1],this.view.state.camera,U);n=null!=u?u:n,n=r?Math.min(n,s):n,p(this._tmpDir,this._tmpDir,n),_(this._tmpP,this.startCamera.eye,this._tmpDir),o(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&l(this._tmpN,this._tmpN),D(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.running)return;A(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||u(this._tmpPoi,this.currentCamera.center),O(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),o(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const r=m(this._tmpRayDir);let s=r*(1-i);this._constraintOptions.interactionDirection&&(u(this._constraintOptions.interactionDirection,this._tmpRayDir),p(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/r));const n=this.view.state.constraints.minimumPoiDistance;i>=0&&s<n&&(s=n,i=-(s-r)/r),Math.abs(r-s)<1e-6||(p(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=_(L,this.currentCamera.eye,this._tmpRayDir),f(L,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?L[2]=Math.max(this.startCamera.center[2],L[2]):L[2]=Math.min(this.startCamera.center[2],L[2]),this.currentCamera.center=L,this._constraintOptions.interactionFactor=j(a(this.dragBeginPoint,t)),y(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}finish(){this.running&&this.finishController()}};z=t([s("esri.views.3d.state.controllers.ZoomControllerLocal")],z);const L=g(),B=C(0,0,1);export{z as ZoomControllerLocal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{copy as e,distance as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{d as o,l as m,n as h,e as c,g as p,f as _,u as l,c as u,m as f}from"../../../../chunks/vec32.js";import{create as g,fromValues as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as P,fromPositionAndNormal as D}from"../../../../geometry/support/plane.js";import{pixelDistanceToInteractionFactor as j,applyAll as y}from"../../camera/constraintUtils.js";import{ConstraintOptions as d}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as v}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as w}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as b}from"../../layers/VoxelWasm.js";import{InteractiveController as M}from"./InteractiveController.js";import{normalizeCoordinate as O,contentIntersectorOptions as N,distanceClampValues as R,pivotDistanceModifier as x,screenPixelArea as U,intersectPlaneFromScreenPoint as A}from"../utils/navigationUtils.js";let z=class extends M{constructor(){super(...arguments),this._tmpP=g(),this._tmpDir=g(),this._tmpN=g(),this._tmpP0=n(),this._tmpPoi=g(),this._tmpRayDir=g(),this.dragBeginPoint=r(),this._normalizedAnchorPoint=n(),this._constraintOptions=new d(v.ALL,w.ZOOM,0,this.startCamera,g()),this._plane=P()}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;e(this.dragBeginPoint,t),O(this.startCamera,t,this._normalizedAnchorPoint);const r=this._intersectionHelper.intersectScreenFreePointFallback(t,this._tmpP,0===this.view.map.ground.opacity?N:{});o(this._tmpDir,this._tmpP,this.startCamera.eye);const s=m(this._tmpDir);h(this._tmpDir,this._tmpDir);const a=Math.abs(this.view.camera.position.z);let n=i(Math.min(x,1/Math.abs(c(B,this._tmpDir)))*a,R[0],R[1]);const u=this.view.stage.renderView.getMinimalDepthForArea(b(this.view),t[0],t[1],this.view.state.camera,U);n=null!=u?u:n,n=r?Math.min(n,s):n,p(this._tmpDir,this._tmpDir,n),_(this._tmpP,this.startCamera.eye,this._tmpDir),o(this._tmpN,this.startCamera.eye,this.startCamera.center),h(this._tmpN,this._tmpN),this._tmpN[1]<0&&l(this._tmpN,this._tmpN),D(this._tmpP,this._tmpN,this._plane)}update(t){if(!this.running)return;A(this._plane,this.currentCamera,this.dragBeginPoint,this._tmpPoi)||u(this._tmpPoi,this.currentCamera.center),O(this.currentCamera,t,this._tmpP0);let i=4*(this._tmpP0[1]-this._normalizedAnchorPoint[1]);e(this._normalizedAnchorPoint,this._tmpP0),o(this._tmpRayDir,this._tmpPoi,this.currentCamera.eye);const r=m(this._tmpRayDir);let s=r*(1-i);this._constraintOptions.interactionDirection&&(u(this._constraintOptions.interactionDirection,this._tmpRayDir),p(this._constraintOptions.interactionDirection,this._constraintOptions.interactionDirection,Math.sign(i)/r));const n=this.view.state.constraints.minimumPoiDistance;i>=0&&s<n&&(s=n,i=-(s-r)/r),Math.abs(r-s)<1e-6||(p(this._tmpRayDir,this._tmpRayDir,i),this.currentCamera.eye=_(L,this.currentCamera.eye,this._tmpRayDir),f(L,this.currentCamera.center,this._tmpPoi,i),this._tmpPoi[2]>this.startCamera.center[2]?L[2]=Math.max(this.startCamera.center[2],L[2]):L[2]=Math.min(this.startCamera.center[2],L[2]),this.currentCamera.center=L,this._constraintOptions.interactionFactor=j(a(this.dragBeginPoint,t)),y(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}finish(){this.running&&this.finishController()}};z=t([s("esri.views.3d.state.controllers.ZoomControllerLocal")],z);const L=g(),B=C(0,0,1);export{z as ZoomControllerLocal};
@@ -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 t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as s,n as o,g as a,e as n,l as m,d as h,f as c,s as p}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as l}from"../../../../geometry/support/ray.js";import{c as y}from"../../../../chunks/sphere.js";import{applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as g}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as w}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as C}from"../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as d}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as j}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as u,navigationMode as D,zoomMaxDistanceModifier as v,zoomMinDistanceModifier as b,zoomDistanceModifier as R,NavigationMode as M,panToPosition as L}from"../utils/navigationUtils.js";import{fromScreenAtEye as O}from"../../support/geometryUtils/ray.js";import{intersectScreen as z}from"../../support/geometryUtils/sphere.js";import U from"../../webgl/RenderCamera.js";import{newIntersector as V}from"../../webgl-engine/lib/Intersector.js";import{outExpo as S}from"../../../animation/easing.js";const H=.6,x=4,A=60;let F=class extends j{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new U,this._tmpViewDir=_(),this._tmpRayDir=l(),this._targetOnSphere=_(),this._tmpCenter=_(),this._beginCamera=new U,this._constraintOptions=new g(w.ALL_EXCEPT_COLLISION,C.ZOOM,null,this._beginCamera),this._sphere=y()}initialize(){this._intersector=V(this.view.state.viewingMode)}step(t,i){if(!this.running)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this._intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?u:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:S}}_updateCamera(t,e,r,s){const _=D(t,r,this.view.renderCoordsHelper,this.view.viewingMode),l=Math.abs(this.view.camera.position.z),y=this._zoomLocation;o(T,t.eye),a(T,T,-1),O(t,r,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const g=i(Math.min(R,1/Math.abs(n(T,this._tmpRayDir.direction)))*l,b,v);if(_===M.Horizontal){let i=H**e;this._sphere[3]=m(y),h(this._tmpViewDir,t.center,t.eye);const s=Math.min(m(this._tmpViewDir),g);let o=s*i;if(i<=1&&o<x&&(o=x,i=o/s),Math.abs(s-o)<1e-6)return;const n=m(t.center);if(this._sphere[3]!==n){const e=this._sphere[3]+i*(n-this._sphere[3]);t.center=a(I,t.center,e/n)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=c(I,t.center,this._tmpViewDir),f(this.view,t,this._constraintOptions),p(y,t.center)>1e-12&&z(this._sphere,t,r,this._targetOnSphere)&&L(this._sphere,t,y,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=H**Math.abs(e);const o=e>0?1:-1;h(this._tmpViewDir,y,t.eye);const n=m(this._tmpViewDir),p=this.view.stage.renderView.getMinimalDepthForArea(null,r[0],r[1],this.view.state.camera,A);let _=null!=p?p:g;_=s&&e>0?Math.min(_,n):_,a(this._tmpRayDir.direction,this._tmpRayDir.direction,_),c(y,this._tmpRayDir.origin,this._tmpRayDir.direction);let l=_*i;const f=Math.max(x,1.01*t.nearFar[0]);if(e>0&&l<f&&(l=f,i=l/_),Math.abs(_-l)<1e-6)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,o*(1-i)),t.eye=c(I,t.eye,this._tmpRayDir.direction),t.center=c(I,t.center,this._tmpRayDir.direction)}d(this.view,t)}};F=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],F);const I=_(),T=_();export{F as ZoomStepControllerGlobal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as s,n as o,g as a,e as n,l as m,d as h,f as c,s as p}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as l}from"../../../../geometry/support/ray.js";import{c as y}from"../../../../chunks/sphere.js";import{applyAll as f}from"../../camera/constraintUtils.js";import{ConstraintOptions as g}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as w}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as C}from"../../camera/constraintUtils/InteractionType.js";import{applySurfaceCollisionConstraint as d}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as j}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as u,navigationMode as D,zoomMaxDistanceModifier as v,zoomMinDistanceModifier as b,zoomDistanceModifier as R,NavigationMode as M,panToPosition as L}from"../utils/navigationUtils.js";import{fromScreenAtEye as O}from"../../support/geometryUtils/ray.js";import{intersectScreen as z}from"../../support/geometryUtils/sphere.js";import U from"../../webgl/RenderCamera.js";import{Intersector as V}from"../../webgl-engine/lib/Intersector.js";import{outExpo as S}from"../../../animation/easing.js";const H=.6,x=4,A=60;let F=class extends j{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new U,this._tmpViewDir=_(),this._tmpRayDir=l(),this._targetOnSphere=_(),this._tmpCenter=_(),this._beginCamera=new U,this._constraintOptions=new g(w.ALL_EXCEPT_COLLISION,C.ZOOM,null,this._beginCamera),this._sphere=y()}initialize(){this._intersector=new V(this.view.state.viewingMode)}step(t,i){if(!this.running)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this._intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?u:{})&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:S}}_updateCamera(t,e,r,s){const _=D(t,r,this.view.renderCoordsHelper,this.view.viewingMode),l=Math.abs(this.view.camera.position.z),y=this._zoomLocation;o(T,t.eye),a(T,T,-1),O(t,r,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const g=i(Math.min(R,1/Math.abs(n(T,this._tmpRayDir.direction)))*l,b,v);if(_===M.Horizontal){let i=H**e;this._sphere[3]=m(y),h(this._tmpViewDir,t.center,t.eye);const s=Math.min(m(this._tmpViewDir),g);let o=s*i;if(i<=1&&o<x&&(o=x,i=o/s),Math.abs(s-o)<1e-6)return;const n=m(t.center);if(this._sphere[3]!==n){const e=this._sphere[3]+i*(n-this._sphere[3]);t.center=a(I,t.center,e/n)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=c(I,t.center,this._tmpViewDir),f(this.view,t,this._constraintOptions),p(y,t.center)>1e-12&&z(this._sphere,t,r,this._targetOnSphere)&&L(this._sphere,t,y,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=H**Math.abs(e);const o=e>0?1:-1;h(this._tmpViewDir,y,t.eye);const n=m(this._tmpViewDir),p=this.view.stage.renderView.getMinimalDepthForArea(null,r[0],r[1],this.view.state.camera,A);let _=null!=p?p:g;_=s&&e>0?Math.min(_,n):_,a(this._tmpRayDir.direction,this._tmpRayDir.direction,_),c(y,this._tmpRayDir.origin,this._tmpRayDir.direction);let l=_*i;const f=Math.max(x,1.01*t.nearFar[0]);if(e>0&&l<f&&(l=f,i=l/_),Math.abs(_-l)<1e-6)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,o*(1-i)),t.eye=c(I,t.eye,this._tmpRayDir.direction),t.center=c(I,t.center,this._tmpRayDir.direction)}d(this.view,t)}};F=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],F);const I=_(),T=_();export{F as ZoomStepControllerGlobal};
@@ -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 t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as r,d as o,n as a,e as m,l as n,f as c,g as h,m as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as g}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as y}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as j}from"../../layers/VoxelWasm.js";import{PointToPointAnimationController as u}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as w,zoomMaxDistanceModifier as b,zoomMinDistanceModifier as L,zoomDistanceModifier as d}from"../utils/navigationUtils.js";import v from"../../webgl/RenderCamera.js";import{newIntersector as z}from"../../webgl-engine/lib/Intersector.js";import{outExpo as R}from"../../../animation/easing.js";const M=.6,D=4,F=60;let U=class extends u{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new v,this._tmpRayDir=_(),this._tmpCenter=_(),this._beginCamera=new v,this._constraintOptions=new f(g.ALL,y.ZOOM,null,this._beginCamera)}step(t,e){if(!this.running)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const p=z(this.view.state.viewingMode);let l=!1;t>0?(l=this._intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,0===this.view.map.ground.opacity?w:{}),this._intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this._intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:r(this._zoomLocation,this._tmpCamera.center);const C=M**t;let f=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),e[0],e[1],this.view.state.camera,F);o(A,this._tmpCamera.eye,this._zoomLocation),a(A,A);const g=i(Math.min(d,1/Math.abs(m(O,A)))*Math.abs(this.view.camera.position.z),L,b);if(f=null!=f?f:g,f){const t=_();o(t,this._zoomLocation,this._tmpCamera.eye),(f<n(t)||!l)&&(a(t,t),c(this._zoomLocation,this._tmpCamera.eye,h(t,t,f)))}this._updateCamera(this._tmpCamera,C,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:R}}_updateCamera(t,i,e){o(this._tmpRayDir,e,t.eye);const s=n(this._tmpRayDir);let r=s*i;const a=i<=1,m=Math.max(D,1.01*t.nearFar[0]);0!==r&&(a&&r<m&&(r=m,i=r/s),Math.abs(s-r)<1e-6||(h(this._tmpRayDir,this._tmpRayDir,i),t.eye=o(x,e,this._tmpRayDir),t.center=p(x,t.center,e,1-i),C(this.view,t,this._constraintOptions)))}};U=t([s("esri.views.3d.state.controllers.ZoomStepControllerLocal")],U);const x=_(),O=l(0,0,1),A=_();export{U as ZoomStepControllerLocal};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as r,d as o,n as a,e as n,l as m,f as c,g as h,m as p}from"../../../../chunks/vec32.js";import{create as _,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as f}from"../../camera/constraintUtils/ConstraintOptions.js";import{ConstraintTypes as g}from"../../camera/constraintUtils/ConstraintTypes.js";import{InteractionType as y}from"../../camera/constraintUtils/InteractionType.js";import{getVoxelWasm as j}from"../../layers/VoxelWasm.js";import{PointToPointAnimationController as w}from"./PointToPointAnimationController.js";import{contentIntersectorOptions as u,zoomMaxDistanceModifier as b,zoomMinDistanceModifier as L,zoomDistanceModifier as d}from"../utils/navigationUtils.js";import v from"../../webgl/RenderCamera.js";import{Intersector as z}from"../../webgl-engine/lib/Intersector.js";import{outExpo as R}from"../../../animation/easing.js";const M=.6,D=4,F=60;let U=class extends w{constructor(){super(...arguments),this._zoomLocation=_(),this._tmpCamera=new v,this._tmpRayDir=_(),this._tmpCenter=_(),this._beginCamera=new v,this._constraintOptions=new f(g.ALL,y.ZOOM,null,this._beginCamera)}step(t,e){if(!this.running)return;const s=this.view.state;this.animation.finished?this._beginCamera.copyFrom(s.camera):this.animation.cameraAt(1,this._beginCamera),this._tmpCamera.copyFrom(s.camera);const p=new z(this.view.state.viewingMode);let l=!1;t>0?(l=this._intersectionHelper.intersectScreenFreePointFallback(e,this._zoomLocation,0===this.view.map.ground.opacity?u:{}),this._intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this._intersectionHelper.intersectRay(this._tmpCamera.ray,p,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:r(this._zoomLocation,this._tmpCamera.center);const C=M**t;let f=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),e[0],e[1],this.view.state.camera,F);o(A,this._tmpCamera.eye,this._zoomLocation),a(A,A);const g=i(Math.min(d,1/Math.abs(n(O,A)))*Math.abs(this.view.camera.position.z),L,b);if(f=null!=f?f:g,f){const t=_();o(t,this._zoomLocation,this._tmpCamera.eye),(f<m(t)||!l)&&(a(t,t),c(this._zoomLocation,this._tmpCamera.eye,h(t,t,f)))}this._updateCamera(this._tmpCamera,C,this._zoomLocation),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:R}}_updateCamera(t,i,e){o(this._tmpRayDir,e,t.eye);const s=m(this._tmpRayDir);let r=s*i;const a=i<=1,n=Math.max(D,1.01*t.nearFar[0]);0!==r&&(a&&r<n&&(r=n,i=r/s),Math.abs(s-r)<1e-6||(h(this._tmpRayDir,this._tmpRayDir,i),t.eye=o(x,e,this._tmpRayDir),t.center=p(x,t.center,e,1-i),C(this.view,t,this._constraintOptions)))}};U=t([s("esri.views.3d.state.controllers.ZoomStepControllerLocal")],U);const x=_(),O=l(0,0,1),A=_();export{U as ZoomStepControllerLocal};
@@ -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 t}from"../../../../../chunks/tslib.es6.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 r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as e,o as s}from"../../../../../chunks/vec32.js";import{clone as i,create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InteractionType as m}from"../../../camera/constraintUtils/InteractionType.js";import{MomentumController as c}from"./MomentumController.js";import{applyZoomToPoint as a}from"../../utils/navigationUtils.js";let p=class extends c{set zoomCenter(t){this._set("zoomCenter",i(t))}constructor(t){super(t),this.interactionType=m.ZOOM,this.constraintOptions.interactionDirection=n()}momentumStep(t,o){const{interactionDirection:r}=this.constraintOptions;if(!r)return;e(r,o.eye);const i=this.momentum.valueDelta(0,t);a(o,this.zoomCenter,i,this.view.state.constraints.minimumPoiDistance),s(r,o.eye,r)}};t([o({constructOnly:!0})],p.prototype,"momentum",void 0),t([o({constructOnly:!0})],p.prototype,"zoomCenter",null),p=t([r("esri.views.3d.state.controllers.momentum.ZoomPlanarMomentumController")],p);export{p as ZoomPlanarMomentumController};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.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 r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{c as e,E as s}from"../../../../../chunks/vec32.js";import{clone as i,create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InteractionType as m}from"../../../camera/constraintUtils/InteractionType.js";import{MomentumController as c}from"./MomentumController.js";import{applyZoomToPoint as a}from"../../utils/navigationUtils.js";let p=class extends c{set zoomCenter(t){this._set("zoomCenter",i(t))}constructor(t){super(t),this.interactionType=m.ZOOM,this.constraintOptions.interactionDirection=n()}momentumStep(t,o){const{interactionDirection:r}=this.constraintOptions;if(!r)return;e(r,o.eye);const i=this.momentum.valueDelta(0,t);a(o,this.zoomCenter,i,this.view.state.constraints.minimumPoiDistance),s(r,o.eye,r)}};t([o({constructOnly:!0})],p.prototype,"momentum",void 0),t([o({constructOnly:!0})],p.prototype,"zoomCenter",null),p=t([r("esri.views.3d.state.controllers.momentum.ZoomPlanarMomentumController")],p);export{p as ZoomPlanarMomentumController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/PooledArray.js";import{createRenderScreenPointArray3 as t,castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/unitUtils.js";import{f as n,n as s,e as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u,width as h,height as d,expandPointInPlace as p}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as f}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as w}from"../../support/geometryUtils/ray.js";import{defaultTolerance as v,newIntersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as b,IntersectorType as P}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j,sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";class x{constructor(t,r,i){this.viewingMode=t,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new e,this._tolerance=v,this._tmpRay=m(),this._tmpRegion=a(),this._validateHUDIntersector=I(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),A(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,A(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,i){return t.options.selectionMode=!1,t.options.store=b.MIN,this.computeIntersection(e,t,i),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,i=.5){return e.getRenderCenter(D,r,i),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,r)}intersectToolIntersectorScreen(e,t,r){const i=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(i,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,r);const i=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(i)&&i.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,r))}setTolerance(e=v){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return w(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==g.Local||null==e||n(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,i=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,i)}_intersectElevation(e,t,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,h=i(c.spatialReference),d=null!=t?t.mode:"absolute-height",p=f(t)/h,m=("on-the-ground"!==d?p+l:0)*h/u.unitInMeters,{camera:g}=c.state;if("absolute-height"===d){const t=u?.getAltitude(g.eye),r=o(s(F,e.direction),u.worldUpAtPosition(g.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(c,F);return e.z??=0,e.z-=p,e}return null}const _=r(y.get());g.projectToRenderScreen(e.origin,_);const w=new k(null,this._forEachLayer),{slice:{plane:v}}=c,j=null!=v?M(v):null,U=I(this.viewingMode);U.options.store=b.MIN,U.options.verticalOffset=m,U.options.normalRequired=!1;const x=e.origin,T=n(y.get(),x,e.direction);U.reset(x,T,g),U.point=_;let E=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find((e=>e.layer===a))?.uid;E=e?t=>t.layerViewUid===e:null}else a&&(E=e=>e.graphicUid!==a.uid);switch(d){case"relative-to-scene":{const e=e=>(!E||E(e))&&!!e.lastValidElevationBB;U.intersect(w.layers,_,this._tolerance,null,e),this._externalIntersectionHandlers.forAll((e=>{if(e.type===P.I3S||e.type===P.TERRAIN||e.type===P.TILES3D){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}));break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll((e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_)}}))}if(U.results.min.getIntersectionPoint(F)){const e=R(c,F);return e.z=l,e}return null}computeIntersection(e,t,i,s){if(null==e)return;const o=this._view.state.camera,l=r(y.get());o.projectToRenderScreen(e.origin,l);const a=new k(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!("include"in i||"exclude"in i);const c=e.origin,u=n(y.get(),e.origin,e.direction);t.reset(c,u,o),t.intersect(a.layers,l,this._tolerance);const h=this._view.slice.plane,d=null!=h?M(h):null;t.intersect(a.sliceableLayers,l,this._tolerance,d);const p=i&&(i.requiresGroundFeedback||i.enableDraped);this._externalIntersectionHandlers.forAll((e=>{const r=e.layerViewUid,i=Array.isArray(r),n=i?r:[r];i&&(t.options.filteredLayerViewUids=[]);let o=!1;for(const s of n){!a.filterLayerViewUid(s)?i&&t.options.filteredLayerViewUids.push(s):o=!0}if(t.options.isFiltered=!o,e.isGround&&p||!t.options.isFiltered){const r=e.slicePlaneEnabled?d:null;e.intersect(t,r,c,u,l,s)}}));const m=y.get(),f=this._view.basemapTerrain;if(i&&i.enableDraped&&null!=f.spatialReference&&t.results.ground.getIntersectionPoint(m)){const e=f.overlayManager.renderer,r=this._view.renderCoordsHelper.spatialReference,i=y.get();this._view.renderCoordsHelper.fromRenderCoords(m,i,f.spatialReference),i[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],r,"ground")??0,e.intersect(t,i,t.results.ground,(e=>a.filterRenderGeometry(e)))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=this._view.state.camera,i=[],n=this._tmpRegion,s=e=>{const t=new H(e),s=t.result.target.object.geometries.every((e=>e.material instanceof U&&e.material.parameters.occlusionTest));i.push({item:t,occlusionTest:s}),s&&(r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),p(n,t.screenPoint))};e.sortResults(t.all),null!=t.min.dist&&s(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&s(c);if(null!=t.max.dist&&t.max.target.object!==t.min.target.object&&s(t.max),!i.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);const o=r.fullWidth,l=r.fullHeight,a=Math.max(0,n[0]-T),m=Math.max(0,n[1]-T),y=Math.min(h(n)+2*T,o-a),f=Math.min(d(n)+2*T,l-m),g=y>0&&f>0?new Uint8Array(y*f*4):null;g&&this._view.stage.renderer.readHUDVisibility(a,m,y,f,g);let R=!0;const _=null==e.results.max.dist;let w=0;for(const{item:c,occlusionTest:u}of i){let t=!u;if(u&&g)for(const e of E){const r=4*(Math.min(c.screenPoint[0]+e[0],o)-n[0]+(Math.min(c.screenPoint[1]+e[1],l)-n[1])*y);if(r>=0&&r<g.length&&g[r]){t=!0;break}}t&&(R&&(e.results.min.copy(c.result),R=!1),_&&e.results.max.copy(c.result),e.options.store===b.ALL&&e.results.all.splice(w++,0,c.result))}}}const T=1,E=(()=>{const e=[],t=T;for(let r=-1;r<=t;r++)for(let i=-1;i<=t;i++)e.push([i+t,r+t]);return e})();class H{constructor(e){this.result=e,this.screenPoint=t()}}let L;function A(e){return L&&L.viewingMode===e||(L=I(e)),L}class k{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t((e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)}))}filterLayerViewUid(e){const{include:t,exclude:r}=this;return null==e?null==t&&null==r:(null==t||t.has(e))&&(null==r||!r.has(e))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function V(e){return"object"==typeof e&&"intersect"in e}const F=l(),S=l(),D=t();export{x as SceneIntersectionHelper,V as isIntersectionHandler};
5
+ import"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{createRenderScreenPointArray3 as t,castRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/unitUtils.js";import{f as n,n as s,e as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u,width as h,height as p,expandPointInPlace as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as m}from"../../../../geometry/support/ray.js";import{sv3d as f}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as g}from"../../../../support/elevationInfoUtils.js";import{ViewingMode as y}from"../../../ViewingMode.js";import{computeMapPointFromVec3d as R}from"../../support/hitTest.js";import{fromRenderAtEye as _,fromScreen as w}from"../../support/geometryUtils/ray.js";import{defaultTolerance as b,Intersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as v}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as j}from"../../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as P}from"../../webgl-engine/lib/IntersectorType.js";import{sliceFilterPredicate as M}from"../../webgl-engine/lib/intersectorUtils.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";class x{constructor(t,r,i){this.viewingMode=t,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new e,this._tolerance=b,this._tmpRay=m(),this._tmpRegion=a(),this._validateHUDIntersector=new I(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),A(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,A(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,i){return t.options.selectionMode=!1,t.options.store=v.MIN,this.computeIntersection(e,t,!1,i),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,i=.5){return e.getRenderCenter(D,r,i),D[0]+=.0466,D[1]-=.0123,_(e,D,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}intersectToolIntersectorScreen(e,t,r){const i=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(i,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const i=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||j(i)&&i.intersector!==P.TERRAIN||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=b){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort(((e,t)=>e.type===P.TERRAIN?1:t.type===P.TERRAIN?-1:0))}_getPickRay(e,t){const r=this._view.state.camera;return w(r,e,t)}_intersectRayFreePointLocal(e,t){return this.viewingMode!==y.Local||null==e||n(t,e.origin,s(f.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,i=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,i)}_intersectElevation(e,t,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,h=i(c.spatialReference),p=null!=t?t.mode:"absolute-height",d=g(t)/h,m=("on-the-ground"!==p?d+l:0)*h/u.unitInMeters,{camera:y}=c.state;if("absolute-height"===p){const t=u?.getAltitude(y.eye),r=o(s(F,e.direction),u.worldUpAtPosition(y.eye,S));if(t<m&&r<0||t>=m&&r>0)return null;if(u.intersectInfiniteManifold(e,m,F)){const e=R(c,F);return e.z??=0,e.z-=d,e}return null}const _=r(f.get());y.projectToRenderScreen(e.origin,_);const w=new k(null,this._forEachLayer),{slice:{plane:b}}=c,j=null!=b?M(b):null,U=new I(this.viewingMode);U.options.store=v.MIN,U.options.verticalOffset=m,U.options.normalRequired=!1;const x=e.origin,T=n(f.get(),x,e.direction);U.reset(x,T,y),U.point=_;let E=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find((e=>e.layer===a))?.uid;E=e?t=>t.layerViewUid===e:null}else a&&(E=e=>e.graphicUid!==a.uid);switch(p){case"relative-to-scene":{const e=e=>(!E||E(e))&&!!e.lastValidElevationBB;U.intersect(w.layers,_,this._tolerance,null,e),this._externalIntersectionHandlers.forAll((e=>{if(e.type===P.I3S||e.type===P.TERRAIN||e.type===P.TILES3D){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_,!1)}}));break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll((e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(U,t,U.rayBegin,U.rayEnd,_,!1)}}))}if(U.results.min.getIntersectionPoint(F)){const e=R(c,F);return e.z=l,e}return null}computeIntersection(e,t,i,s){if(null==e)return;const o=this._view.state.camera,l=r(f.get());o.projectToRenderScreen(e.origin,l);const a=new k(s,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!s||!("include"in s||"exclude"in s);const c=e.origin,u=n(f.get(),e.origin,e.direction);t.reset(c,u,o),t.intersect(a.layers,l,this._tolerance);const h=this._view.slice.plane,p=null!=h?M(h):null;t.intersect(a.sliceableLayers,l,this._tolerance,p);const d=s&&(s.requiresGroundFeedback||s.enableDraped);this._externalIntersectionHandlers.forAll((e=>{const r=e.layerViewUid,n=Array.isArray(r),s=n?r:[r];n&&(t.options.filteredLayerViewUids=[]);let o=!1;for(const i of s){!a.filterLayerViewUid(i)?n&&t.options.filteredLayerViewUids.push(i):o=!0}if(t.options.isFiltered=!o,e.isGround&&d||!t.options.isFiltered){const r=e.slicePlaneEnabled?p:null;e.intersect(t,r,c,u,l,i)}}));const m=f.get(),g=this._view.basemapTerrain;if(s&&s.enableDraped&&null!=g.spatialReference&&t.results.ground.getIntersectionPoint(m)){const e=g.overlayManager.renderer,r=this._view.renderCoordsHelper.spatialReference,i=f.get();this._view.renderCoordsHelper.fromRenderCoords(m,i,g.spatialReference),i[2]=this._view.elevationProvider?.getElevation(m[0],m[1],m[2],r,"ground")??0,e.intersect(t,i,t.results.ground,(e=>a.filterRenderGeometry(e)))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=this._view.state.camera,i=[],n=this._tmpRegion,s=e=>{const t=new H(e),s=t.result.target.object.geometries.every((e=>e.material instanceof U&&e.material.parameters.occlusionTest));i.push({item:t,occlusionTest:s}),s&&(r.projectToRenderScreen(e.target.center,t.screenPoint),t.screenPoint[0]=Math.floor(t.screenPoint[0]),t.screenPoint[1]=Math.floor(t.screenPoint[1]),d(n,t.screenPoint))};e.sortResults(t.all),null!=t.min.distance&&s(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&s(c);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&s(t.max),!i.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);const o=r.fullWidth,l=r.fullHeight,a=Math.max(0,n[0]-T),m=Math.max(0,n[1]-T),f=Math.min(h(n)+2*T,o-a),g=Math.min(p(n)+2*T,l-m),y=f>0&&g>0?new Uint8Array(f*g*4):null;y&&this._view.stage.renderer.readHUDVisibility(a,m,f,g,y);let R=!0;const _=null==e.results.max.distance;let w=0;for(const{item:c,occlusionTest:u}of i){let t=!u;if(u&&y)for(const e of E){const r=4*(Math.min(c.screenPoint[0]+e[0],o)-n[0]+(Math.min(c.screenPoint[1]+e[1],l)-n[1])*f);if(r>=0&&r<y.length&&y[r]){t=!0;break}}t&&(R&&(e.results.min.copy(c.result),R=!1),_&&e.results.max.copy(c.result),e.options.store===v.ALL&&e.results.all.splice(w++,0,c.result))}}}const T=1,E=(()=>{const e=[],t=T;for(let r=-1;r<=t;r++)for(let i=-1;i<=t;i++)e.push([i+t,r+t]);return e})();class H{constructor(e){this.result=e,this.screenPoint=t()}}let L;function A(e){return L&&L.viewingMode===e||(L=new I(e)),L}class k{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t((e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)}))}filterLayerViewUid(e){const{include:t,exclude:r}=this;return null==e?null==t&&null==r:(null==t||t.has(e))&&(null==r||!r.has(e))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function V(e){return"object"==typeof e&&"intersect"in e}const F=l(),S=l(),D=t();export{x as SceneIntersectionHelper,V as isIntersectionHandler};
@@ -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{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{invert as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as n,g as o,o as s,t as a,i as c,e as l}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as m}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as _}from"../../../geometry/projection/projectVectorToVector.js";import{empty as g,create as f,expandWithVec3 as u}from"../../../geometry/support/aaBoundingBox.js";import{center as x,create as R}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as y}from"../../../geometry/support/frustum.js";import{fromPoints as j,create as b}from"../../../geometry/support/lineSegment.js";import{create as A,fromVectorsAndPoint as E,copy as S,negate as B,signedDistance as C}from"../../../geometry/support/plane.js";import{wrap as H}from"../../../geometry/support/ray.js";import{ViewingMode as w}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class N{constructor(t){this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:p(),direction:p()},this._renderCoordsHelper=t.renderCoordsHelper;for(let e=0;e<4;e++)this._extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this._planes[e]=A();this._planes[y.NEAR]=A(),this._planes[y.FAR]=A(),this._planesWithoutFar=this._planes.slice(0,5)}update(t,e,i,r=!0){const a=this._extent;this._toRenderBoundingExtent(t,e,i),n(this._center.origin,a[0].origin,a[2].origin),o(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),r||o(this._center.direction,this._center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),E(t.direction,t.cap.direction,t.origin,this._planes[n]),r||o(t.direction,t.direction,-1)}E(a[0].cap.direction,a[1].cap.direction,a[0].origin,this._planes[y.NEAR]),r?B(this._planes[y.NEAR],this._planes[y.FAR]):(S(this._planes[y.FAR],this._planes[y.NEAR]),B(this._planes[y.NEAR],this._planes[y.NEAR])),this._maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this._maxSpanSpatialReference=e,this._minGlobalAltitude=.9*h(this._maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this._renderCoordsHelper.viewingMode===w.Global){const i=this._maxSpanSpatialReference.isGeographic?F:M*e;if(this._maxSpan>i)return!0;if(null!=t.altitude&&t.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this._maxSpan){const e=this._extent[0];return!(i||!t.intersectsRay(H(e.origin,e.direction)))}for(let n=0;n<this._extent.length;n++){const e=this._extent[n];if(!i&&t.intersectsRay(H(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(j(e.origin,e.cap.next,k),e.cap.direction))return!0}const r=i?this._planes:this._planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;x(t,V),V[2]=n,d(r,V,v,this._renderCoordsHelper.spatialReference),i(I,v),g(L);for(const{x0:i,x1:s,y0:c,y1:l}of U)for(let p=0;p<o;p++){const h=p/(o-1);V[0]=e(t[i],t[s],h),V[1]=e(t[c],t[l],h),V[2]=n,_(V,r,V,this._renderCoordsHelper.spatialReference),a(V,V,I),u(L,V)}c(this._extent[0].origin,L[0],L[1],L[2]),c(this._extent[1].origin,L[3],L[1],L[2]),c(this._extent[2].origin,L[3],L[4],L[2]),c(this._extent[3].origin,L[0],L[4],L[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,P,this._renderCoordsHelper.spatialReference),c(this._extent[0].origin,P[0],P[1],i),c(this._extent[1].origin,P[2],P[1],i),c(this._extent[2].origin,P[2],P[3],i),c(this._extent[3].origin,P[0],P[3],i)}_toRenderBoundingExtent(e,i,r){switch(this._renderCoordsHelper.viewingMode){case w.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case w.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(C(t.planes[y.NEAR],this._center.origin)<0&&l(this._center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this._extent[e];if(C(t.planes[y.NEAR],i.origin)<0&&l(i.direction,t.direction)<0)return!0}return!1}}const U=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],V=p(),v=r(),I=r(),L=f(),P=R(),k=b();export{N as FrustumExtentIntersection};
5
+ import{neverReached as t}from"../../../core/compilerUtils.js";import{lerp as e}from"../../../core/mathUtils.js";import{invert as i}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as n,g as o,E as s,t as a,i as c,e as l}from"../../../chunks/vec32.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as d}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as m}from"../../../geometry/projection/projectBoundingRect.js";import{projectVectorToVector as _}from"../../../geometry/projection/projectVectorToVector.js";import{empty as g,create as f,expandWithVec3 as u}from"../../../geometry/support/aaBoundingBox.js";import{center as x,create as R}from"../../../geometry/support/aaBoundingRect.js";import{PlaneIndex as y}from"../../../geometry/support/frustum.js";import{fromPoints as j,create as b}from"../../../geometry/support/lineSegment.js";import{create as A,fromVectorsAndPoint as E,copy as S,negate as B,signedDistance as C}from"../../../geometry/support/plane.js";import{wrap as H}from"../../../geometry/support/ray.js";import{ViewingMode as w}from"../../ViewingMode.js";import{frustumLineSegment as G}from"./intersectionUtils.js";const M=.5*Math.PI,F=M/Math.PI*180;class N{constructor(t){this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:p(),direction:p()},this._renderCoordsHelper=t.renderCoordsHelper;for(let e=0;e<4;e++)this._extent[e]={origin:p(),direction:p(),cap:{next:null,direction:p()}},this._planes[e]=A();this._planes[y.NEAR]=A(),this._planes[y.FAR]=A(),this._planesWithoutFar=this._planes.slice(0,5)}update(t,e,i,r=!0){const a=this._extent;this._toRenderBoundingExtent(t,e,i),n(this._center.origin,a[0].origin,a[2].origin),o(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),r||o(this._center.direction,this._center.direction,-1);for(let n=0;n<4;n++){const t=a[n];this._renderCoordsHelper.worldUpAtPosition(t.origin,t.direction);const e=a[3===n?0:n+1];t.cap.next=e.origin,s(t.cap.direction,t.origin,e.origin),E(t.direction,t.cap.direction,t.origin,this._planes[n]),r||o(t.direction,t.direction,-1)}E(a[0].cap.direction,a[1].cap.direction,a[0].origin,this._planes[y.NEAR]),r?B(this._planes[y.NEAR],this._planes[y.FAR]):(S(this._planes[y.FAR],this._planes[y.NEAR]),B(this._planes[y.NEAR],this._planes[y.NEAR])),this._maxSpan=Math.max(Math.abs(t[0]-t[2]),Math.abs(t[1]-t[3])),this._maxSpanSpatialReference=e,this._minGlobalAltitude=.9*h(this._maxSpanSpatialReference).radius}isVisibleInFrustum(t,e,i=!1){if(null==t)return!1;if(this._renderCoordsHelper.viewingMode===w.Global){const i=this._maxSpanSpatialReference.isGeographic?F:M*e;if(this._maxSpan>i)return!0;if(null!=t.altitude&&t.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(t)}if(0===this._maxSpan){const e=this._extent[0];return!(i||!t.intersectsRay(H(e.origin,e.direction)))}for(let n=0;n<this._extent.length;n++){const e=this._extent[n];if(!i&&t.intersectsRay(H(e.origin,e.direction)))return!0;if(t.intersectsLineSegment(j(e.origin,e.cap.next,k),e.cap.direction))return!0}const r=i?this._planes:this._planesWithoutFar;for(let n=0;n<t.lines.length;n++){const e=t.lines[n];if(G(r,e.origin,e.endpoint,e.direction))return!0}return!1}_toRenderBoundingExtentGlobal(t,r,n){const o=5;x(t,V),V[2]=n,d(r,V,v,this._renderCoordsHelper.spatialReference),i(I,v),g(L);for(const{x0:i,x1:s,y0:c,y1:l}of U)for(let p=0;p<o;p++){const h=p/(o-1);V[0]=e(t[i],t[s],h),V[1]=e(t[c],t[l],h),V[2]=n,_(V,r,V,this._renderCoordsHelper.spatialReference),a(V,V,I),u(L,V)}c(this._extent[0].origin,L[0],L[1],L[2]),c(this._extent[1].origin,L[3],L[1],L[2]),c(this._extent[2].origin,L[3],L[4],L[2]),c(this._extent[3].origin,L[0],L[4],L[2]);for(let e=0;e<4;++e)a(this._extent[e].origin,this._extent[e].origin,v)}_toRenderBoundingExtentLocal(t,e,i){m(t,e,P,this._renderCoordsHelper.spatialReference),c(this._extent[0].origin,P[0],P[1],i),c(this._extent[1].origin,P[2],P[1],i),c(this._extent[2].origin,P[2],P[3],i),c(this._extent[3].origin,P[0],P[3],i)}_toRenderBoundingExtent(e,i,r){switch(this._renderCoordsHelper.viewingMode){case w.Global:this._toRenderBoundingExtentGlobal(e,i,r);break;case w.Local:this._toRenderBoundingExtentLocal(e,i,r);break;default:t(this._renderCoordsHelper.viewingMode)}}_isVisibleInFrustumGlobal(t){if(C(t.planes[y.NEAR],this._center.origin)<0&&l(this._center.direction,t.direction)<0)return!0;for(let e=0;e<4;e++){const i=this._extent[e];if(C(t.planes[y.NEAR],i.origin)<0&&l(i.direction,t.direction)<0)return!0}return!1}}const U=[{x0:0,y0:1,x1:2,y1:1},{x0:0,y0:3,x1:2,y1:3},{x0:0,y0:1,x1:0,y1:3},{x0:2,y0:1,x1:2,y1:3}],V=p(),v=r(),I=r(),L=f(),P=R(),k=b();export{N as FrustumExtentIntersection};
@@ -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"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import{projectVectorToVector as l}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{newIntersector as p}from"../webgl-engine/lib/Intersector.js";import{StoreResults as m,IntersectorType as f}from"../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as g}from"../webgl-engine/lib/intersectorUtils.js";import{toHit as h,toOwner as y,toHitAsync as E}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as w}from"../webgl-engine/lib/verticalOffsetUtils.js";async function U(e,n,i,r){const s=i?C(e,i):r,o=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const l=p(e.state.viewingMode);l.options.selectionMode=!0,l.options.store=m.ALL,e.sceneIntersectionHelper.intersectIntersectorScreen(o,l,s);let c=[];c=has("feature-pipeline-3d-test")?await j(e,l.results.all,s.graphics):I(e,l.results.all,s.graphics);const d=l.results.ground,f=y(d,e),h=null!=f&&"type"in f&&a(f.type)?f:null,E={screenPoint:n,results:c,ground:{mapPoint:S(e,d),distance:g(d)?d.distanceInRenderSpace:0,layer:h}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(E.intersector=l),E}function b(e,n,t,r){const s=t?C(e,t):r,o=!(!s.graphics?.include&&!s.graphics?.exclude),l=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(w)||s.exclude?.has(w);const a=e.sceneIntersectionHelper,u=p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||l?m.ALL:m.MIN,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),o||l){for(const n of u.results.all){const i=h(n,e);if(null==i)return S(e,n);if(o&&("graphic"!==i.type||x(s.graphics,i.graphic)))return S(e,n);if(l&&("media"!==i.type||R(s.mediaElements,i.element)))return S(e,n)}return null}return S(e,u.results.min)}function I(e,n,i){const t=new Array;let r=null;for(let s=0;s<n.length;s++){const o=n[s],l=y(o,e);if(null!=l&&(l===e.map.ground||"type"in l&&a(l.type)))break;const c=h(o,e);if(null==c)continue;if("graphic"===c.type){if(null==r&&s!==n.length-1&&(r=new Set),null!=r){const e=L(c.graphic);if(r.has(e))continue;r.add(e)}if(!x(i,c.graphic))continue}const u=S(e,o),d=o.distanceInRenderSpace;if("media"===c.type){const e=c.element.toSource(u);t.push({...c,mapPoint:u,distance:d,sourcePoint:e})}else t.push({...c,mapPoint:u,distance:d})}return t}async function j(e,n,i){const t=new Array;let r=null;for(let s=0;s<n.length;s++){const o=n[s],l=y(o,e);if(null!=l&&(l===e.map.ground||"type"in l&&a(l.type)))break;const c=await E(o,e);if(null==c)continue;if("graphic"===c.type){if(null==r&&s!==n.length-1&&(r=new Set),null!=r){const e=L(c.graphic);if(r.has(e))continue;r.add(e)}if(!x(i,c.graphic))continue}const u=S(e,o),d=o.distanceInRenderSpace;if("media"===c.type){const e=c.element.toSource(u);t.push({...c,mapPoint:u,distance:d,sourcePoint:e})}else t.push({...c,mapPoint:u,distance:d})}return t}function S(e,n,i){return n.getIntersectionPoint(A)?(i=V(e,A,i),n.intersector===f.TERRAIN&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function L(e){const n=e.sourceLayer,i=e.layer,t=n&&"objectIdField"in n?n:i&&"objectIdField"in i?i:n;if(t){const n=t.objectIdField??c,i=e.attributes?.[n];if(i)return`o-${t.id}-${i}`}return`u-${e.uid}`}function x(e,n){return R(e,L(n))}function R(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||o.WGS84;return l(n,e.renderSpatialReference,A,t)?n=A:(t=o.WGS84,l(n,e.renderSpatialReference,A,t)&&(n=A)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function C(e,n){const i=v(e,n.include,F.INCLUDE),t=v(e,n.exclude,F.EXCLUDE);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function v(i,t,r,s={layerViewUids:void 0,graphicUids:void 0,mediaElements:void 0}){if(!t)return s;if(t instanceof e)N(s,L(t)),r===F.INCLUDE&&(null!=i.graphicsView&&t.layer===i?D(s,i.graphicsView.uid):t.layer&&P(s,i,t.layer.uid));else if("layer"in t&&"element"in t)T(s,t.element),r===F.INCLUDE&&P(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?D(s,i.graphicsView.uid):e===i.map.ground?D(s,w):v(i,e,r,s);else"uid"in t&&P(s,i,t.uid);return s}function P(e,n,i){const t=n.allLayerViews.find((e=>e.layer.uid===i));t&&D(e,t.uid)}function D(e,n){e.layerViewUids||(e.layerViewUids=new Set),e.layerViewUids.add(n)}function N(e,n){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(n)}function T(e,n){e.mediaElements||(e.mediaElements=new Set),e.mediaElements.add(n)}const A=r();var F;!function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(F||(F={}));export{V as computeMapPointFromVec3d,C as externalToInternalIntersectOptions,L as getGraphicFilterUid,U as hitTest,S as intersectResultToMapPoint,b as toMap};
5
+ import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as i,createScreenPointArray as t}from"../../../core/screenUtils.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import{projectVectorToVector as l}from"../../../geometry/projection/projectVectorToVector.js";import{fallbackObjectIDAttribute as c}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as a}from"../../../layers/support/layerUtils.js";import{debugFlags as u}from"./debugFlags.js";import{getElevationAtPoint as d}from"./ElevationProvider.js";import{Intersector as p}from"../webgl-engine/lib/Intersector.js";import{StoreResults as m}from"../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as f}from"../webgl-engine/lib/IntersectorResult.js";import{IntersectorType as g}from"../webgl-engine/lib/IntersectorType.js";import{toHit as y,toOwner as h,toHitAsync as w}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as E}from"../webgl-engine/lib/verticalOffsetUtils.js";async function b(e,n,i,r){const s=i?C(e,i):r,o=t(n.x,n.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;const l=new p(e.state.viewingMode);l.options.selectionMode=!0,l.options.store=m.ALL,e.sceneIntersectionHelper.intersectIntersectorScreen(o,l,s);let c=[];c=has("feature-pipeline-3d-test")?await j(e,l.results.all,s.graphics):U(e,l.results.all,s.graphics);const d=l.results.ground,g=h(d,e),y=null!=g&&"type"in g&&a(g.type)?g:null,w={screenPoint:n,results:c,ground:{mapPoint:S(e,d),distance:f(d)?d.distanceInRenderSpace:0,layer:y}};return u.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(w.intersector=l),w}function I(e,n,t,r){const s=t?C(e,t):r,o=!(!s.graphics?.include&&!s.graphics?.exclude),l=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),c=i(n);s.enableDraped=s.include&&!s.include.has(E)||s.exclude?.has(E);const a=e.sceneIntersectionHelper,u=new p(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||l?m.ALL:m.MIN,u.options.excludeLabels=t?.excludeLabels??!1,a.intersectIntersectorScreen(c,u,s),o||l){for(const n of u.results.all){const i=y(n,e);if(null==i)return S(e,n);if(o&&("graphic"!==i.type||x(s.graphics,i.graphic)))return S(e,n);if(l&&("media"!==i.type||R(s.mediaElements,i.element)))return S(e,n)}return null}return S(e,u.results.min)}function U(e,n,i){const t=new Array;let r=null;for(let s=0;s<n.length;s++){const o=n[s],l=h(o,e);if(null!=l&&(l===e.map.ground||"type"in l&&a(l.type)))break;const c=y(o,e);if(null==c)continue;if("graphic"===c.type){if(null==r&&s!==n.length-1&&(r=new Set),null!=r){const e=L(c.graphic);if(r.has(e))continue;r.add(e)}if(!x(i,c.graphic))continue}const u=S(e,o),d=o.distanceInRenderSpace;if("media"===c.type){const e=c.element.toSource(u);t.push({...c,mapPoint:u,distance:d,sourcePoint:e})}else t.push({...c,mapPoint:u,distance:d})}return t}async function j(e,n,i){const t=new Array;let r=null;for(let s=0;s<n.length;s++){const o=n[s],l=h(o,e);if(null!=l&&(l===e.map.ground||"type"in l&&a(l.type)))break;const c=await w(o,e);if(null==c)continue;if("graphic"===c.type){if(null==r&&s!==n.length-1&&(r=new Set),null!=r){const e=L(c.graphic);if(r.has(e))continue;r.add(e)}if(!x(i,c.graphic))continue}const u=S(e,o),d=o.distanceInRenderSpace;if("media"===c.type){const e=c.element.toSource(u);t.push({...c,mapPoint:u,distance:d,sourcePoint:e})}else t.push({...c,mapPoint:u,distance:d})}return t}function S(e,n,i){return n.getIntersectionPoint(A)?(i=V(e,A,i),n.intersector===g.TERRAIN&&e.basemapTerrain&&(i.z=d(e.basemapTerrain,i)??0),i):null}function L(e){const n=e.sourceLayer,i=e.layer,t=n&&"objectIdField"in n?n:i&&"objectIdField"in i?i:n;if(t){const n=t.objectIdField??c,i=e.attributes?.[n];if(i)return`o-${t.id}-${i}`}return`u-${e.uid}`}function x(e,n){return R(e,L(n))}function R(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function V(e,n,i){let t=e.spatialReference||o.WGS84;return l(n,e.renderSpatialReference,A,t)?n=A:(t=o.WGS84,l(n,e.renderSpatialReference,A,t)&&(n=A)),i?(i.x=n[0],i.y=n[1],i.z=n[2],i.spatialReference=t):i=new s(n,t),i}function C(e,n){const i=v(e,n.include,F.INCLUDE),t=v(e,n.exclude,F.EXCLUDE);return{include:i.layerViewUids,exclude:t.layerViewUids,graphics:{include:i.graphicUids,exclude:t.graphicUids},mediaElements:{include:i.mediaElements,exclude:t.mediaElements}}}function v(i,t,r,s={layerViewUids:void 0,graphicUids:void 0,mediaElements:void 0}){if(!t)return s;if(t instanceof e)D(s,L(t)),r===F.INCLUDE&&(null!=i.graphicsView&&t.layer===i?T(s,i.graphicsView.uid):t.layer&&P(s,i,t.layer.uid));else if("layer"in t&&"element"in t)N(s,t.element),r===F.INCLUDE&&P(s,i,t.layer.uid);else if(n(t))for(const e of t)e===i.graphics&&null!=i.graphicsView?T(s,i.graphicsView.uid):e===i.map.ground?T(s,E):v(i,e,r,s);else"uid"in t&&P(s,i,t.uid);return s}function P(e,n,i){const t=n.allLayerViews.find((e=>e.layer.uid===i));t&&T(e,t.uid)}function T(e,n){e.layerViewUids||(e.layerViewUids=new Set),e.layerViewUids.add(n)}function D(e,n){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(n)}function N(e,n){e.mediaElements||(e.mediaElements=new Set),e.mediaElements.add(n)}const A=r();var F;!function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(F||(F={}));export{V as computeMapPointFromVec3d,C as externalToInternalIntersectOptions,L as getGraphicFilterUid,b as hitTest,S as intersectResultToMapPoint,I as toMap};
@@ -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{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as c,w as d,x as _,y as l,z as m,q as f,f as u,g,a as p,A as M,B as b,l as j,b as S,C as z,D as x}from"../../../chunks/vec32.js";import{ZEROS as C,freeze as y,create as q,UNIT_Z as Q}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as w}from"../../../chunks/vec42.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as P}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as A}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as B}from"../../../geometry/projection/projectors.js";import{getNormal as D}from"../../../geometry/support/plane.js";import{isPlateCarree as W}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as k,sq4d as G}from"../../../geometry/support/vectorStacks.js";import{ViewingMode as U}from"../../ViewingMode.js";import{computeOBB as Z}from"./dito.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";class I{constructor(t=C,a=gt,e=o){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],e[0],e[1],e[2],e[3]]}clone(){const t=new I;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new I;return a._data=t.slice(),a}static fromJSON(t){return new I(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return c(k.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,e){this._data[0]=t,this._data[1]=a,this._data[2]=e}get halfSize(){return c(k.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return i(G.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=O,e=this._data;a[0]=e[6],a[1]=e[7],a[2]=e[8],a[3]=e[9];for(let s=0;s<8;++s){const i=t[s];i[0]=(1&s?-1:1)*e[3],i[1]=(2&s?-1:1)*e[4],i[2]=(4&s?-1:1)*e[5],d(i,i,a),i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],e=this._data[5];return Math.sqrt(t*t+a*a+e*e)}intersectSphere(t){X[0]=this._data[0]-t[0],X[1]=this._data[1]-t[1],X[2]=this._data[2]-t[2];const a=this.getQuaternion(T);return r(O,a),d(X,X,O),_(X,X),Y[0]=Math.min(X[0],this._data[3]),Y[1]=Math.min(X[1],this._data[4]),Y[2]=Math.min(X[2],this._data[5]),l(Y,X)<t[3]*t[3]}intersectSphereWithMBS(t,a=this.radius){const e=this._data;X[0]=e[0]-t[0],X[1]=e[1]-t[1],X[2]=e[2]-t[2];const s=t[3],i=s+a;return!(m(X)>i*i)&&(O[0]=-e[6],O[1]=-e[7],O[2]=-e[8],O[3]=e[9],d(X,X,O),_(X,X),Y[0]=Math.min(X[0],e[3]),Y[1]=Math.min(X[1],e[4]),Y[2]=Math.min(X[2],e[5]),l(Y,X)<s*s)}intersectPlane(t){const a=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],e=this.projectedRadius(D(t));return a>e?1:a<-e?-1:0}intersectRay(t,a,e=0){const s=this._data,i=O;i[0]=-s[6],i[1]=-s[7],i[2]=-s[8],i[3]=s[9],X[0]=t[0]-s[0],X[1]=t[1]-s[1],X[2]=t[2]-s[2];const r=d(X,X,O),n=d(Y,a,O);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=r[d],a=n[d],s=c[d]+e;if(Math.abs(a)>1e-6){const e=(s-t)/a,i=(-s-t)/a;o=Math.max(o,Math.min(e,i)),h=Math.min(h,Math.max(e,i))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(e,s,i,n){const o=this.getQuaternion(T);r(O,o),X[0]=e[0]-this._data[0],X[1]=e[1]-this._data[1],X[2]=e[2]-this._data[2],d(X,X,O);const h=this.getHalfSize(ct),_=X[0]<-h[0]?-1:X[0]>h[0]?1:0,l=X[1]<-h[1]?-1:X[1]>h[1]?1:0,m=X[2]<-h[2]?-1:X[2]>h[2]?1:0,g=Math.abs(_)+Math.abs(l)+Math.abs(m);if(0===g)return 1/0;const p=1===g?4:6,M=6*(_+3*l+9*m+13);t(dt,o),a(dt,dt,h);const b=this.getCenter(ot);for(let t=0;t<p;t++){const a=K[M+t];c(X,((1&a)<<1)-1,(2&a)-1,((4&a)>>1)-1),f(X,X,dt),u(E,b,X),E[3]=1,w(E,E,s);const e=1/Math.max(1e-6,E[3]);N[2*t]=E[0]*e,N[2*t+1]=E[1]*e}const j=2*p-2;let S=N[0]*(N[3]-N[j+1])+N[j]*(N[1]-N[j-1]);for(let t=2;t<j;t+=2)S+=N[t]*(N[t+3]-N[t-1]);return Math.abs(S)*i*n*.125}projectedRadius(t){const a=this.getQuaternion(T);return r(O,a),d(X,t,O),Math.abs(X[0]*this._data[3])+Math.abs(X[1]*this._data[4])+Math.abs(X[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(D(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(D(t))}toAaBoundingBox(a){const e=this.getQuaternion(T),s=t(dt,e),i=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),r=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);a[0]=this._data[0]-i,a[1]=this._data[1]-r,a[2]=this._data[2]-n,a[3]=this._data[0]+i,a[4]=this._data[1]+r,a[5]=this._data[2]+n}transform(t,a,e,s=0,i=A(e),r=A(a),n=B(a,r)){if(e===i)a.isGeographic?st(this,t,a,s,r):et(this,t,a,s,r,n);else if(a.isWGS84&&(e.isWebMercator||W(e)))$(a,this,e,t,s);else if(a.isWebMercator&&W(e))tt(a,this,e,t,s);else{const i=this.getCenter(ot);i[2]+=s,H(i,a,0,i,e,0),t.center=i,this!==t&&(t.quaternion=this.getQuaternion(T),t.halfSize=this.getHalfSize(ct))}}}const O=h(),T=h(),V=h(),X=q(),Y=q(),E=v();function J(t,a=new I){return Z(t,a),a}const N=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let a=0;const e=e=>{for(let s=0;s<e.length;s++)t[a+s]=e[s];a+=6};return e([6,2,3,1,5,4]),e([0,2,3,1,5,4]),e([0,2,3,7,5,4]),e([0,1,3,2,6,4]),e([0,1,3,2,0,0]),e([0,1,5,7,3,2]),e([0,1,3,7,6,4]),e([0,1,3,7,6,2]),e([0,1,5,7,6,2]),e([0,1,5,4,6,2]),e([0,1,5,4,0,0]),e([0,1,3,7,5,4]),e([0,2,6,4,0,0]),e([0,0,0,0,0,0]),e([1,3,7,5,0,0]),e([2,3,7,6,4,0]),e([2,3,7,6,0,0]),e([2,3,1,5,7,6]),e([0,1,5,7,6,2]),e([0,1,5,7,6,4]),e([0,1,3,7,6,4]),e([4,5,7,6,2,0]),e([4,5,7,6,0,0]),e([4,5,1,3,7,6]),e([0,2,3,7,5,4]),e([6,2,3,7,5,4]),e([6,2,3,1,5,4]),t})();function L(t,a,e,s,i){const n=t.getQuaternion(T);i.quaternion=n,r(O,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(s===U.Global){d(mt,o,O),_(ft,mt),b(ut,ft,h),p(ut,ft,ut);const s=j(ut);u(ut,ft,h);const r=j(ut);if(s<e)i.center=o,c(mt,e,e,e),i.halfSize=u(mt,h,mt);else{const n=r>0?1+a/r:1,o=s>0?1+e/s:1,c=(o+n)/2,_=(o-n)/2;g(ut,ft,_),i.halfSize=S(ut,ut,h,c),g(ut,ft,c),S(ut,ut,h,_),z(mt,mt),x(mt,ut,mt);const l=t.getQuaternion(V);i.center=d(mt,mt,l)}}else{i.center=S(mt,o,Q,(e+a)/2);const t=d(mt,Q,O);_(t,t),i.halfSize=S(ft,h,t,(e-a)/2)}return i}function $(t,a,e,s,i){a.getCenter(ot),ot[2]+=i;const r=A(e);H(ot,t,0,ot,r,0),at(r,a,ot,e,s)}function tt(t,a,e,s,i){a.getCenter(ot),ot[2]+=i,at(t,a,ot,e,s)}function at(a,e,s,i,r){const n=e.getQuaternion(T),o=t(dt,n),h=e.getHalfSize(ct);for(let t=0;t<8;++t){for(let a=0;a<3;++a)nt[a]=h[a]*(t&1<<a?-1:1);for(let a=0;a<3;++a){let e=s[a];for(let t=0;t<3;++t)e+=nt[t]*o[3*t+a];it[3*t+a]=e}}H(it,a,0,it,i,0,8),J(rt,r)}function et(t,a,e,s,i=A(e),o=B(e,i)){t.getCorners(lt),t.getCenter(nt),nt[2]+=s,R(e,nt,_t,i),a.setCenter(_t[12],_t[13],_t[14]);const h=2*Math.sqrt(1+_t[0]+_t[5]+_t[10]);O[0]=(_t[6]-_t[9])/h,O[1]=(_t[8]-_t[2])/h,O[2]=(_t[1]-_t[4])/h,O[3]=.25*h;const l=t.getQuaternion(T);a.quaternion=n(O,O,l),r(O,O),c(ft,0,0,0);const m=a.getCenter(ht);for(const r of lt)r[2]+=s,o(r,0,r,0),p(mt,r,m),d(mt,mt,O),_(mt,mt),M(ft,ft,mt);a.halfSize=ft}function st(t,a,e,s,i=A(e)){const n=P(e),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,e,0,nt,i,0),a.center=nt;const h=t.getQuaternion(T);a.quaternion=h,r(O,h),c(mt,0,0,1),d(mt,mt,O);const _=t.getHalfSize(ct);c(mt,_[0]*Math.abs(mt[0]),_[1]*Math.abs(mt[1]),_[2]*Math.abs(mt[2])),g(mt,mt,n.inverseFlattening),u(mt,_,mt),a.halfSize=g(mt,mt,o)}const it=new Array(24),rt=new F(it,3),nt=q(),ot=q(),ht=q(),ct=q(),dt=e(),_t=s(),lt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],mt=q(),ft=q(),ut=q(),gt=y(-1,-1,-1);export{I as Obb,J as compute,L as computeOffsetObb};
5
+ import{fromQuat as t,scale as a}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as i,conjugate as r,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as c,v as d,w as _,x as l,y as m,o as f,f as u,g,a as p,z as M,A as b,l as j,b as S,B as z,C as x}from"../../../chunks/vec32.js";import{ZEROS as C,freeze as y,create as q,UNIT_Z as Q}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as v}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as P}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as A}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as B}from"../../../geometry/projection/projectors.js";import{getNormal as W}from"../../../geometry/support/plane.js";import{isPlateCarree as k}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as D,sq4d as G}from"../../../geometry/support/vectorStacks.js";import{ViewingMode as U}from"../../ViewingMode.js";import{computeOBB as Z}from"./dito.js";import{Vertices as F}from"../webgl-engine/lib/Attribute.js";class I{constructor(t=C,a=gt,e=o){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],e[0],e[1],e[2],e[3]]}clone(){const t=new I;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new I;return a._data=t.slice(),a}static fromJSON(t){return new I(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return c(D.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,e){this._data[0]=t,this._data[1]=a,this._data[2]=e}get halfSize(){return c(D.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return i(G.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=O,e=this._data;a[0]=e[6],a[1]=e[7],a[2]=e[8],a[3]=e[9];for(let s=0;s<8;++s){const i=t[s];i[0]=(1&s?-1:1)*e[3],i[1]=(2&s?-1:1)*e[4],i[2]=(4&s?-1:1)*e[5],d(i,i,a),i[0]+=e[0],i[1]+=e[1],i[2]+=e[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],e=this._data[5];return Math.sqrt(t*t+a*a+e*e)}intersectSphere(t){X[0]=this._data[0]-t[0],X[1]=this._data[1]-t[1],X[2]=this._data[2]-t[2];const a=this.getQuaternion(T);return r(O,a),d(X,X,O),_(X,X),Y[0]=Math.min(X[0],this._data[3]),Y[1]=Math.min(X[1],this._data[4]),Y[2]=Math.min(X[2],this._data[5]),l(Y,X)<t[3]*t[3]}intersectSphereWithMBS(t,a=this.radius){const e=this._data;X[0]=e[0]-t[0],X[1]=e[1]-t[1],X[2]=e[2]-t[2];const s=t[3],i=s+a;return!(m(X)>i*i)&&(O[0]=-e[6],O[1]=-e[7],O[2]=-e[8],O[3]=e[9],d(X,X,O),_(X,X),Y[0]=Math.min(X[0],e[3]),Y[1]=Math.min(X[1],e[4]),Y[2]=Math.min(X[2],e[5]),l(Y,X)<s*s)}intersectPlane(t){const a=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],e=this.projectedRadius(W(t));return a>e?1:a<-e?-1:0}intersectRay(t,a,e=0){const s=this._data,i=O;i[0]=-s[6],i[1]=-s[7],i[2]=-s[8],i[3]=s[9],X[0]=t[0]-s[0],X[1]=t[1]-s[1],X[2]=t[2]-s[2];const r=d(X,X,O),n=d(Y,a,O);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=r[d],a=n[d],s=c[d]+e;if(Math.abs(a)>1e-6){const e=(s-t)/a,i=(-s-t)/a;o=Math.max(o,Math.min(e,i)),h=Math.min(h,Math.max(e,i))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(e,s,i,n){const o=this.getQuaternion(T);r(O,o),X[0]=e[0]-this._data[0],X[1]=e[1]-this._data[1],X[2]=e[2]-this._data[2],d(X,X,O);const h=this.getHalfSize(ct),_=X[0]<-h[0]?-1:X[0]>h[0]?1:0,l=X[1]<-h[1]?-1:X[1]>h[1]?1:0,m=X[2]<-h[2]?-1:X[2]>h[2]?1:0,g=Math.abs(_)+Math.abs(l)+Math.abs(m);if(0===g)return 1/0;const p=1===g?4:6,M=6*(_+3*l+9*m+13);t(dt,o),a(dt,dt,h);const b=this.getCenter(ot);for(let t=0;t<p;t++){const a=K[M+t];c(X,((1&a)<<1)-1,(2&a)-1,((4&a)>>1)-1),f(X,X,dt),u(E,b,X),E[3]=1,v(E,E,s);const e=1/Math.max(1e-6,E[3]);N[2*t]=E[0]*e,N[2*t+1]=E[1]*e}const j=2*p-2;let S=N[0]*(N[3]-N[j+1])+N[j]*(N[1]-N[j-1]);for(let t=2;t<j;t+=2)S+=N[t]*(N[t+3]-N[t-1]);return Math.abs(S)*i*n*.125}projectedRadius(t){const a=this.getQuaternion(T);return r(O,a),d(X,t,O),Math.abs(X[0]*this._data[3])+Math.abs(X[1]*this._data[4])+Math.abs(X[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(W(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(W(t))}toAaBoundingBox(a){const e=this.getQuaternion(T),s=t(dt,e),i=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),r=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);a[0]=this._data[0]-i,a[1]=this._data[1]-r,a[2]=this._data[2]-n,a[3]=this._data[0]+i,a[4]=this._data[1]+r,a[5]=this._data[2]+n}transform(t,a,e,s=0,i=A(e),r=A(a),n=B(a,r)){if(e===i)a.isGeographic?st(this,t,a,s,r):et(this,t,a,s,r,n);else if(a.isWGS84&&(e.isWebMercator||k(e)))$(a,this,e,t,s);else if(a.isWebMercator&&k(e))tt(a,this,e,t,s);else{const i=this.getCenter(ot);i[2]+=s,H(i,a,0,i,e,0),t.center=i,this!==t&&(t.quaternion=this.getQuaternion(T),t.halfSize=this.getHalfSize(ct))}}}const O=h(),T=h(),V=h(),X=q(),Y=q(),E=w();function J(t,a=new I){return Z(t,a),a}const N=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let a=0;const e=e=>{for(let s=0;s<e.length;s++)t[a+s]=e[s];a+=6};return e([6,2,3,1,5,4]),e([0,2,3,1,5,4]),e([0,2,3,7,5,4]),e([0,1,3,2,6,4]),e([0,1,3,2,0,0]),e([0,1,5,7,3,2]),e([0,1,3,7,6,4]),e([0,1,3,7,6,2]),e([0,1,5,7,6,2]),e([0,1,5,4,6,2]),e([0,1,5,4,0,0]),e([0,1,3,7,5,4]),e([0,2,6,4,0,0]),e([0,0,0,0,0,0]),e([1,3,7,5,0,0]),e([2,3,7,6,4,0]),e([2,3,7,6,0,0]),e([2,3,1,5,7,6]),e([0,1,5,7,6,2]),e([0,1,5,7,6,4]),e([0,1,3,7,6,4]),e([4,5,7,6,2,0]),e([4,5,7,6,0,0]),e([4,5,1,3,7,6]),e([0,2,3,7,5,4]),e([6,2,3,7,5,4]),e([6,2,3,1,5,4]),t})();function L(t,a,e,s,i){const n=t.getQuaternion(T);i.quaternion=n,r(O,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(s===U.Global){d(mt,o,O),_(ft,mt),b(ut,ft,h),p(ut,ft,ut);const s=j(ut);u(ut,ft,h);const r=j(ut);if(s<e)i.center=o,c(mt,e,e,e),i.halfSize=u(mt,h,mt);else{const n=r>0?1+a/r:1,o=s>0?1+e/s:1,c=(o+n)/2,_=(o-n)/2;g(ut,ft,_),i.halfSize=S(ut,ut,h,c),g(ut,ft,c),S(ut,ut,h,_),z(mt,mt),x(mt,ut,mt);const l=t.getQuaternion(V);i.center=d(mt,mt,l)}}else{i.center=S(mt,o,Q,(e+a)/2);const t=d(mt,Q,O);_(t,t),i.halfSize=S(ft,h,t,(e-a)/2)}return i}function $(t,a,e,s,i){a.getCenter(ot),ot[2]+=i;const r=A(e);H(ot,t,0,ot,r,0),at(r,a,ot,e,s)}function tt(t,a,e,s,i){a.getCenter(ot),ot[2]+=i,at(t,a,ot,e,s)}function at(a,e,s,i,r){const n=e.getQuaternion(T),o=t(dt,n),h=e.getHalfSize(ct);for(let t=0;t<8;++t){for(let a=0;a<3;++a)nt[a]=h[a]*(t&1<<a?-1:1);for(let a=0;a<3;++a){let e=s[a];for(let t=0;t<3;++t)e+=nt[t]*o[3*t+a];it[3*t+a]=e}}H(it,a,0,it,i,0,8),J(rt,r)}function et(t,a,e,s,i=A(e),o=B(e,i)){t.getCorners(lt),t.getCenter(nt),nt[2]+=s,R(e,nt,_t,i),a.setCenter(_t[12],_t[13],_t[14]);const h=2*Math.sqrt(1+_t[0]+_t[5]+_t[10]);O[0]=(_t[6]-_t[9])/h,O[1]=(_t[8]-_t[2])/h,O[2]=(_t[1]-_t[4])/h,O[3]=.25*h;const l=t.getQuaternion(T);a.quaternion=n(O,O,l),r(O,O),c(ft,0,0,0);const m=a.getCenter(ht);for(const r of lt)r[2]+=s,o(r,0,r,0),p(mt,r,m),d(mt,mt,O),_(mt,mt),M(ft,ft,mt);a.halfSize=ft}function st(t,a,e,s,i=A(e)){const n=P(e),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,e,0,nt,i,0),a.center=nt;const h=t.getQuaternion(T);a.quaternion=h,r(O,h),c(mt,0,0,1),d(mt,mt,O);const _=t.getHalfSize(ct);c(mt,_[0]*Math.abs(mt[0]),_[1]*Math.abs(mt[1]),_[2]*Math.abs(mt[2])),g(mt,mt,n.inverseFlattening),u(mt,_,mt),a.halfSize=g(mt,mt,o)}const it=new Array(24),rt=new F(it,3),nt=q(),ot=q(),ht=q(),ct=q(),dt=e(),_t=s(),lt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],mt=q(),ft=q(),ut=q(),gt=y(-1,-1,-1);export{I as Obb,J as compute,L as computeOffsetObb};
@@ -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 t}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}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{j as n,p as a,c as l}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{ViewingMode as d}from"../../../ViewingMode.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as u}from"./PointOfInterest.js";import{PropertiesPool as m}from"../../../support/PropertiesPool.js";import{Yield as _}from"../../../support/Yield.js";const g=Array;let y=class extends u{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new m({location:c,renderLocation:g},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=p(),this._tmpPoint=new c}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o((()=>this.map?.ground?.layers),"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._pendingElevationQueryController;t&&(this._pendingElevationQueryController=null,t.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),_;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>C&&this.renderCoordsHelper.viewingMode===d.Global&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?v:0}).then((t=>this._updateSurfaceAltitude(t.geometry.z??0))).catch((t=>{r(t)||this._updateSurfaceAltitude(0)})).catch((()=>{})).then((()=>{this._pendingElevationQueryController===o&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),o=null})),this._pendingElevationQueryController=o,_}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(f,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),f)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),f)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],y.prototype,"scheduler",void 0),t([i({constructOnly:!0})],y.prototype,"cache",void 0),t([i({constructOnly:!0})],y.prototype,"task",void 0),t([i()],y.prototype,"location",null),t([i({constructOnly:!0})],y.prototype,"map",void 0),t([i()],y.prototype,"renderLocation",void 0),t([i()],y.prototype,"scale",null),t([i()],y.prototype,"updating",null),y=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],y);const f=p(),C=1e5,v=1e6;export{y as CameraOnSurface};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i}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{j as n,q as a,c as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{ViewingMode as p}from"../../../ViewingMode.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as u}from"./PointOfInterest.js";import{PropertiesPool as m}from"../../../support/PropertiesPool.js";import{Yield as _}from"../../../support/Yield.js";const g=Array;let y=class extends u{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new m({location:d,renderLocation:g},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=c(),this._tmpPoint=new d}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o((()=>this.map?.ground?.layers),"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._pendingElevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._pendingElevationQueryController;t&&(this._pendingElevationQueryController=null,t.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),_;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>C&&this.renderCoordsHelper.viewingMode===p.Global&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?v:0}).then((t=>this._updateSurfaceAltitude(t.geometry.z??0))).catch((t=>{r(t)||this._updateSurfaceAltitude(0)})).catch((()=>{})).then((()=>{this._pendingElevationQueryController===o&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),o=null})),this._pendingElevationQueryController=o,_}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(f,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),f)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),f)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],y.prototype,"scheduler",void 0),t([i({constructOnly:!0})],y.prototype,"cache",void 0),t([i({constructOnly:!0})],y.prototype,"task",void 0),t([i()],y.prototype,"location",null),t([i({constructOnly:!0})],y.prototype,"map",void 0),t([i()],y.prototype,"renderLocation",void 0),t([i()],y.prototype,"scale",null),t([i()],y.prototype,"updating",null),y=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],y);const f=c(),C=1e5,v=1e6;export{y as CameraOnSurface};
@@ -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 t}from"../../../../chunks/tslib.es6.js";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as s}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,j as n,g as c,f as u,p as l,k as p}from"../../../../chunks/vec32.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as S}from"../debugFlags.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PropertiesPool as y}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";const j=Array;let L=class extends g{constructor(t){super(t),this._propertiesPool=new y({location:f,renderLocation:j},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=d(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=s(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=C;let e=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,t);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!e&&r&&(e=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t),e&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const s=k;e&&this._latestSurfaceAltitudeChangesDistanceSignificantly(t,s)&&(a(t,s),this._currentSurfaceAltitude=this._latestSurfaceAltitude),e?this.distance=n(this._camera.eye,t):(c(t,this._camera.viewForward,this._get("distance")),u(t,t,this._camera.eye)),l(this._get("renderLocation"),t)||this._set("renderLocation",a(this._propertiesPool.get("renderLocation"),t))}_calculateSurfaceIntersection(t,r){const s=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(s.ray,t,r))return!1;if(this.state.isGlobal){const e=h(this.renderCoordsHelper.spatialReference).radius,i=e+t,o=p(s.eye),a=o<i*i,l=n(s.eye,r);if(a&&l>e/4){const t=i-Math.sqrt(o);return c(r,s.viewForward,t),u(r,r,s.eye),!0}}else{const t=this.surface?.ready?this.surface.extent:null;null!=t&&m(t,this.surface?.spatialReference,v,this.renderCoordsHelper.spatialReference)&&(r[0]=e(r[0],v[0],v[2]),r[1]=e(r[1],v[1],v[3]))}return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(t,e){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==t)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e)){if(S.TESTS_DISABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye,s=n(r,t),i=n(r,e);if(Math.abs(i-s)/s>R)return!0}return!1}};t([i({constructOnly:!0})],L.prototype,"scheduler",void 0),t([i({constructOnly:!0})],L.prototype,"task",void 0),t([i()],L.prototype,"distance",void 0),t([i({constructOnly:!0})],L.prototype,"estimateSurfaceAltitudeAtCenter",void 0),t([i({readOnly:!0})],L.prototype,"location",null),t([i({readOnly:!0})],L.prototype,"renderLocation",void 0),t([i()],L.prototype,"updating",void 0),L=t([o("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],L);const R=.05,C=d(),k=d(),v=_();export{L as CenterOnSurface};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{clamp as e}from"../../../../core/mathUtils.js";import{removeMaybe as r,destroyMaybe as s}from"../../../../core/maybe.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,j as n,g as c,f as u,q as l,k as d}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import f from"../../../../geometry/Point.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{create as _}from"../../../../geometry/support/aaBoundingRect.js";import{debugFlags as S}from"../debugFlags.js";import{PointOfInterest as g}from"./PointOfInterest.js";import{PropertiesPool as y}from"../../../support/PropertiesPool.js";import{Yield as A}from"../../../support/Yield.js";const j=Array;let L=class extends g{constructor(t){super(t),this._propertiesPool=new y({location:f,renderLocation:j},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=p(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=r(this._frameWorker),this._propertiesPool=s(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,A}_updateRenderLocation(){const t=C;let e=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,t);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!e&&r&&(e=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,t),e&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const s=k;e&&this._latestSurfaceAltitudeChangesDistanceSignificantly(t,s)&&(a(t,s),this._currentSurfaceAltitude=this._latestSurfaceAltitude),e?this.distance=n(this._camera.eye,t):(c(t,this._camera.viewForward,this._get("distance")),u(t,t,this._camera.eye)),l(this._get("renderLocation"),t)||this._set("renderLocation",a(this._propertiesPool.get("renderLocation"),t))}_calculateSurfaceIntersection(t,r){const s=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(s.ray,t,r))return!1;if(this.state.isGlobal){const e=h(this.renderCoordsHelper.spatialReference).radius,i=e+t,o=d(s.eye),a=o<i*i,l=n(s.eye,r);if(a&&l>e/4){const t=i-Math.sqrt(o);return c(r,s.viewForward,t),u(r,r,s.eye),!0}}else{const t=this.surface?.ready?this.surface.extent:null;null!=t&&m(t,this.surface?.spatialReference,v,this.renderCoordsHelper.spatialReference)&&(r[0]=e(r[0],v[0],v[2]),r[1]=e(r[1],v[1],v[3]))}return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(t,e){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||null==t)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e)){if(S.TESTS_DISABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye,s=n(r,t),i=n(r,e);if(Math.abs(i-s)/s>R)return!0}return!1}};t([i({constructOnly:!0})],L.prototype,"scheduler",void 0),t([i({constructOnly:!0})],L.prototype,"task",void 0),t([i()],L.prototype,"distance",void 0),t([i({constructOnly:!0})],L.prototype,"estimateSurfaceAltitudeAtCenter",void 0),t([i({readOnly:!0})],L.prototype,"location",null),t([i({readOnly:!0})],L.prototype,"renderLocation",void 0),t([i()],L.prototype,"updating",void 0),L=t([o("esri.views.3d.support.pointsOfInterest.CenterOnSurface")],L);const R=.05,C=p(),k=p(),v=_();export{L as CenterOnSurface};
@@ -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"../../../../core/has.js";import{watch as r,when as s,on as n,sync as i,initial as o}from"../../../../core/reactiveUtils.js";import{property as a}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{f as u,p as d,c as h}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{create as _}from"../../../../geometry/support/ray.js";import{debugFlags as l}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as A}from"./ContentGeometryUpdates.js";import{Focus as O}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as I}from"./SurfaceGeometryUpdates.js";import{newIntersector as v}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as S}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as R}from"../../../support/PropertiesPool.js";import{TaskPriority as P}from"../../../support/Scheduler.js";let j=class extends t{constructor(e){super(e),this.renderPointOfView=p(),this._pois=new Array,this._updatingHandles=new f,this._debugCenters=null,this._tmpRay=_(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._propertiesPool=new R({renderPointOfView:T},this)}initialize(){const{state:e,basemapTerrain:t,renderCoordsHelper:a,map:c}=this.view;this._surfaceIntersector=v(e.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=S.MIN,this._contentIntersector=v(e.viewingMode);const u=()=>this._estimateSurfaceAltitudeAtCenter(),d=this.view.resourceController.scheduler,h=this.view.basemapTerrain?.elevationQueryCache,p={state:e,scheduler:d,surface:t,renderCoordsHelper:a};this._set("centerOnSurfaceInfrequent",new y({...p,task:P.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnSurfaceFrequent",new y({...p,task:P.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnContent",new y({...p,task:P.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({...p,cache:h,task:P.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new I({...p,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new A({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:a})),this._set("surfaceOrigin",new w({cache:h,view:this.view})),this._set("focus",new O({state:e,scheduler:d,surface:t,renderCoordsHelper:a,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this.addHandles([r((()=>e.contentCamera),(e=>this._cameraChanged(e)),i),this._updatingHandles.add((()=>t.extent),(()=>this._updateCenterPointsOfInterest())),this._updatingHandles.add((()=>this.view.map?.ground?.navigationConstraint?.type),(e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e}),o),s((()=>!t.updating),(()=>this._updateCenterPointsOfInterest()),i),n((()=>this.surfaceGeometryUpdates.events),"request-update",(()=>this._updateCenterPointsOfInterest())),n((()=>this.contentGeometryUpdates.events),"request-update",(()=>this._updateCenterOnContent())),this._updatingHandles.add((()=>l.SHOW_POI),(e=>this._setDebug(e)),o)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this.surfaceOrigin.destroy(),this._updatingHandles.destroy()}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some((e=>e.updating)))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,H,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(null==e)return this._surfaceAltitudeAtCenter;const t=e.origin,r=u(H,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,t,r),this._surfaceIntersector.results.min.getIntersectionPoint(H)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const s=C(t,e,U);if(null==s)return null;const n=s.origin,i=u(H,s.origin,s.direction);return this._surfaceIntersector.resetWithRay(s,t),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,n,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach((e=>e.hide())),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add((()=>t.renderLocation),(e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference)),o),"debug")}get test(){}};e([a()],j.prototype,"centerOnContent",void 0),e([a()],j.prototype,"centerOnSurfaceFrequent",void 0),e([a()],j.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],j.prototype,"cameraOnSurface",void 0),e([a()],j.prototype,"focus",void 0),e([a()],j.prototype,"renderPointOfView",void 0),e([a()],j.prototype,"surfaceOrigin",void 0),e([a()],j.prototype,"contentGeometryUpdates",void 0),e([a()],j.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],j.prototype,"view",void 0),e([a()],j.prototype,"updating",null),j=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],j);const T=Array,H=p(),U=_(),E={exclude:new Set([b])};export{j as PointsOfInterest};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,when as s,on as n,sync as i,initial as o}from"../../../../core/reactiveUtils.js";import{property as a}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{f as u,q as d,c as h}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{create as _}from"../../../../geometry/support/ray.js";import{debugFlags as l}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as A}from"./ContentGeometryUpdates.js";import{Focus as O}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as I}from"./SurfaceGeometryUpdates.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as S}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{terrainId as b}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as R}from"../../../support/PropertiesPool.js";import{TaskPriority as P}from"../../../support/Scheduler.js";let j=class extends t{constructor(e){super(e),this.renderPointOfView=p(),this._pois=new Array,this._updatingHandles=new f,this._debugCenters=null,this._tmpRay=_(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._propertiesPool=new R({renderPointOfView:T},this),this._contentIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=S.MIN}initialize(){const{state:e,basemapTerrain:t,renderCoordsHelper:a,map:c}=this.view,u=()=>this._estimateSurfaceAltitudeAtCenter(),d=this.view.resourceController.scheduler,h=t?.elevationQueryCache,p={state:e,scheduler:d,surface:t,renderCoordsHelper:a};this._set("centerOnSurfaceInfrequent",new y({...p,task:P.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnSurfaceFrequent",new y({...p,task:P.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnContent",new y({...p,task:P.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({...p,cache:h,task:P.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new I({...p,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new A({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:a})),this._set("surfaceOrigin",new w({cache:h,view:this.view})),this._set("focus",new O({state:e,scheduler:d,surface:t,renderCoordsHelper:a,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this.addHandles([r((()=>e.contentCamera),(e=>this._cameraChanged(e)),i),this._updatingHandles.add((()=>t.extent),(()=>this._updateCenterPointsOfInterest())),this._updatingHandles.add((()=>this.view.map?.ground?.navigationConstraint?.type),(e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e}),o),s((()=>!t.updating),(()=>this._updateCenterPointsOfInterest()),i),n((()=>this.surfaceGeometryUpdates.events),"request-update",(()=>this._updateCenterPointsOfInterest())),n((()=>this.contentGeometryUpdates.events),"request-update",(()=>this._updateCenterOnContent())),this._updatingHandles.add((()=>l.SHOW_POI),(e=>this._setDebug(e)),o)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this.surfaceOrigin.destroy(),this._updatingHandles.destroy()}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some((e=>e.updating)))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,H,E)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(null==e)return this._surfaceAltitudeAtCenter;const t=e.origin,r=u(H,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,t,r),this._surfaceIntersector.results.min.getIntersectionPoint(H)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(H)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const s=C(t,e,U);if(null==s)return null;const n=s.origin,i=u(H,s.origin,s.direction);return this._surfaceIntersector.resetWithRay(s,t),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,n,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach((e=>e.hide())),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add((()=>t.renderLocation),(e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference)),o),"debug")}get test(){}};e([a()],j.prototype,"centerOnContent",void 0),e([a()],j.prototype,"centerOnSurfaceFrequent",void 0),e([a()],j.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],j.prototype,"cameraOnSurface",void 0),e([a()],j.prototype,"focus",void 0),e([a()],j.prototype,"renderPointOfView",void 0),e([a()],j.prototype,"surfaceOrigin",void 0),e([a()],j.prototype,"contentGeometryUpdates",void 0),e([a()],j.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],j.prototype,"view",void 0),e([a()],j.prototype,"updating",null),j=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],j);const T=Array,H=p(),U=_(),E={exclude:new Set([b])};export{j as PointsOfInterest};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as r}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,q as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projection.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as T}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as M}from"../../../geometry/projection/projectVectorToVector.js";import{create as Z,center as A,toRect as E,isPoint as F,empty as O,expandWithVec3 as P,expandWithAABB as D,width as U,height as V,depth as C}from"../../../geometry/support/aaBoundingBox.js";import{create as k,isPoint as I}from"../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as J}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as K}from"../../../geometry/support/scaleUtils.js";import{cameraOnContentAlongViewDirection as L}from"../camera/intersectionUtils.js";import{getViewSR as N,fromExtentAsync as q,internalToExternal as W,OrientationMode as Y,scaleToDistance as X,fromCenterDistanceAsync as _,fromExtentSync as H,externalToInternal as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,directionToHeadingTilt as nt,zoomToScale as at}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";const ot=.66;function it(t){return 360-r.normalize(t)}function st(t){return r.normalize(360-t)}function ct(t,e,n){const a=e.camera;if(null!=a)return mt(a,N(t));const{targetGeometry:r}=e;if(null==r)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===r.type)return pt(t,e,r,o,i);const s=r.extent;return null==s?null:H(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,a){const r=e.camera;if(null!=r)return ut(r,N(t),a);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,a);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return q(t,c,i.heading,i.tilt,s,a)}function mt(t,e){const n=t.position;let a;try{a=z(n,e)}catch(o){return null}if(!a)return null;const r=t.clone();return r.position=a.clone(),r}async function ut(t,e,n){const a=t.position,r=await R(a,e,{signal:n});i(n);const o=t.clone();return o.position=r.clone(),o}function ft(t,e,n){const a=W(t,t.state.camera);let r=Y.ADJUST;return null!=e&&(a.heading=it(e),r=Y.LOCKED),null!=n&&(a.tilt=n),{camera:a,mode:r}}function pt(t,e,n,a,r){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?X(t,e.scale):t.state.camera.distance;return tt(t,i,s,a,r)}async function gt(t,e,n,a,r,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?X(t,e.scale):t.state.camera.distance;return _(t,c,l,a,r,o)}function yt(t,e,a=null){return null==a&&(a=new n),jt(t,null,e.clone(),a)}async function ht(e,a,r){const i=Ft(e,a);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Ot(await zt(e,i.target,i,r,c))}if(i.target instanceof t)return Ot(await Gt(e,i.target,r,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Ot(l||t?await Bt(e,i,i.target.center,s,r,c):await Zt(e,i,i.target,s,r,c))}const m=new Dt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,r),isFinite(m.boundingBox[0])){let t;if(A(m.boundingBox,Ut),qt.x=Ut[0],qt.y=Ut[1],qt.z=Ut[2],qt.spatialReference=e.spatialReference,isFinite(qt.z)&&m.hasZ?t=F(m.boundingBox):(qt.z=void 0,t=I(E(m.boundingBox,It))),l||t)return Ot(await Bt(e,i,qt,s,r,c));const n=Pt(e,m.screenSpaceObjects);return Ot(await Et(e,i,qt,m.boundingBox,n,s,r,c))}return i.position?Ot(await Tt(e,i,s,c,r)):Ot(await Mt(e,i,s,r,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?at(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?K(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,a){const r=t.spatialReference||G.WGS84;if(e??=Q(t,n),null==e)return a;const o=new b({spatialReference:r});return T(e.center,t.renderSpatialReference,o)?(a.targetGeometry=o,a.scale=$(t,e.distance),a.rotation=st(n.heading),a.camera=n,a):a}async function vt(t,e,n,a){const r=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw r();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":n=e.centroid}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:a}),Ut[2]=rt(t.elevationProvider,n)??0):Ut[2]=0}const s=Wt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw r();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:a});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ut[0]=o,Ut[1]=f,Ut[2]=p,P(n.boundingBox,Ut);else for(const[o,f]of u.points)Ut[0]=o,Ut[1]=f,P(n.boundingBox,Ut)}async function bt(t,e,n,r,o){const i=await a(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,r,o);const s=i.value,c=await a(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,r,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;D(r.boundingBox,m),l&&l.forEach((t=>{r.screenSpaceObjects.push(t)})),isFinite(m[2])&&(r.hasZ=!0)}async function Rt(t,n,a,r,o){if(Array.isArray(n)&&2===n.length){const e=n[0],a=n[1];if("number"==typeof e&&"number"==typeof a)return qt.x=e,qt.y=a,qt.z=void 0,qt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,qt,r,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map((e=>Rt(t,e,a,r,o)))):n instanceof j?await vt(t,n,r,o):n instanceof e&&await bt(t,n,a,r,o)}async function zt(t,e,n,a,r){if(e.camera)return Gt(t,e.camera,a,r);r.scale=e.scale,r.rotation=e.rotation,r.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,r.camera=null,null!=n.heading?r.rotation=st(n.heading):null!=n.rotation&&(r.rotation=n.rotation);const o=dt(t,n);return null!=o&&(r.scale=o),r.camera=await lt(t,r,n.tilt,a),r}async function Gt(t,e,n,a){const r=t.spatialReference,o=await R(e.position,r,{signal:n}),i=e.clone();return i.position=o,jt(t,null,i,a)}async function St(t,e,n,a,r,o,i){const s=t.renderSpatialReference;return await B(e,Lt,s,0,{signal:i}),await B(n,Kt,s,0,{signal:i}),o.targetGeometry=new b(e),r.position=new b(n),y(Jt,Lt,Kt),nt(t,Kt,Jt,a.up,r),o.scale=$(t,p(Kt,Lt)),o.rotation=st(r.heading),o.camera=r,o}async function Bt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);if(e.position)return St(t,o.targetGeometry,e.position,i,a,o,r);if(e.zoomFactor){const n=i.distance/e.zoomFactor,a=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,a),o.scale=$(t,n)}W(t,i,a);const s=xt(a,e)?Y.LOCKED:Y.ADJUST;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(o.targetGeometry,Ut,t.renderSpatialReference,0,{signal:r});const e=J(i.frustum,Ut)?p(i.eye,Ut):i.distance;o.camera=await _(t,o.targetGeometry,e,a,s),o.scale=$(t,e)}else o.scale=n,o.camera=await et(t,o.targetGeometry,o.scale,a,s,r)}return o}async function Tt(t,e,n,a,r){const o=L(t);g(Jt,o.viewForward),nt(t,o.eye,Jt,o.up,Nt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:r});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Nt.heading,n.tilt=null!=e.tilt?e.tilt:Nt.tilt,jt(t,null,n,a)}async function Mt(t,e,n,a,r){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=L(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return T(o.center,s,c)?Bt(t,e,c,n,a,r):r}return r.scale=t.scale,r.camera=t.camera.clone(),xt(r.camera,e),r}async function Zt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);W(t,i,a);const s=xt(a,e)?Y.LOCKED:Y.ADJUST;return o.camera=await q(t,n,a.heading,a.tilt,s,r),o}function At(t,e,n,a,r){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ut,n.x,n.y,o),S(t.spatialReference,Ut,Vt,t.renderSpatialReference),s(Ct,Vt),c(Ct,Ct),O(kt);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=a[e[2]];isFinite(n)||(n=o),h(Ut,a[e[0]],a[e[1]],n),M(Ut,t.spatialReference,Ut,t.renderSpatialReference),P(kt,d(Ut,Ut,Ct))}const l=U(kt),m=V(kt),u=C(kt),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/r}async function Et(t,e,n,a,r,o,i,s){s.targetGeometry=n.clone();const c=L(t),l=At(t,c,n,a,r);W(t,c,o);const m=xt(o,e)?Y.LOCKED:Y.ADJUST;return s.camera=await _(t,s.targetGeometry,l,o,m,i),s.scale=$(t,l),s}function Ft(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Ot(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Pt(t,e){const n=ot;if(!e.length)return n;let a=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const t=e[r].screenSpaceBoundingRect;a=Math.max(a,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-a/Math.min(t.width,t.height)*2}class Dt{constructor(){this.hasZ=!1,this.boundingBox=O(),this.screenSpaceObjects=new Array}}const Ut=w(),Vt=m(),Ct=l(),kt=Z(),It=k(),Jt=w(),Kt=w(),Lt=w(),Nt={heading:0,tilt:0},qt=new b,Wt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const a=t.hasZ;for(let r=0;r<t.rings.length;r++){const o=t.rings[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const a=t.hasZ;for(let r=0;r<t.paths.length;r++){const o=t.paths[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const a=t.points,r=t.hasZ;for(let o=0;o<a.length;o++)n[0]=a[o][0],n[1]=a[o][1],r&&(n[2]=a[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
5
+ import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{cyclicalDegrees as r}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{g as u,f,j as p,c as g,d as y,i as h,o as d}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectWithZConversion as R,tryProjectWithZConversion as z}from"../../../geometry/projection.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as T}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as M}from"../../../geometry/projection/projectVectorToVector.js";import{create as Z,center as A,toRect as E,isPoint as F,empty as O,expandWithVec3 as P,expandWithAABB as D,width as U,height as V,depth as C}from"../../../geometry/support/aaBoundingBox.js";import{create as k,isPoint as I}from"../../../geometry/support/aaBoundingRect.js";import{intersectsPoint as J}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as K}from"../../../geometry/support/scaleUtils.js";import{cameraOnContentAlongViewDirection as L}from"../camera/intersectionUtils.js";import{getViewSR as N,fromExtentAsync as W,internalToExternal as Y,OrientationMode as q,scaleToDistance as X,fromCenterDistanceAsync as _,fromExtentSync as H,externalToInternal as Q,distanceToScale as $,fromCenterDistanceSync as tt,fromCenterScale as et,directionToHeadingTilt as nt,zoomToScale as at}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";const ot=.66;function it(t){return 360-r.normalize(t)}function st(t){return r.normalize(360-t)}function ct(t,e,n){const a=e.camera;if(null!=a)return mt(a,N(t));const{targetGeometry:r}=e;if(null==r)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===r.type)return pt(t,e,r,o,i);const s=r.extent;return null==s?null:H(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,a){const r=e.camera;if(null!=r)return ut(r,N(t),a);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,a);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return W(t,c,i.heading,i.tilt,s,a)}function mt(t,e){const n=t.position;let a;try{a=z(n,e)}catch(o){return null}if(!a)return null;const r=t.clone();return r.position=a.clone(),r}async function ut(t,e,n){const a=t.position,r=await R(a,e,{signal:n});i(n);const o=t.clone();return o.position=r.clone(),o}function ft(t,e,n){const a=Y(t,t.state.camera);let r=q.ADJUST;return null!=e&&(a.heading=it(e),r=q.LOCKED),null!=n&&(a.tilt=n),{camera:a,mode:r}}function pt(t,e,n,a,r){const o=t.spatialReference;let i;try{i=z(n.clone(),o)}catch(c){return null}if(!i)return null;const s=null!=e.scale?X(t,e.scale):t.state.camera.distance;return tt(t,i,s,a,r)}async function gt(t,e,n,a,r,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?X(t,e.scale):t.state.camera.distance;return _(t,c,l,a,r,o)}function yt(t,e,a=null){return null==a&&(a=new n),jt(t,null,e.clone(),a)}async function ht(e,a,r){const i=Ft(e,a);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Ot(await zt(e,i.target,i,r,c))}if(i.target instanceof t)return Ot(await Gt(e,i.target,r,c));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Ot(l||t?await Bt(e,i,i.target.center,s,r,c):await Zt(e,i,i.target,s,r,c))}const m=new Dt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,r),isFinite(m.boundingBox[0])){let t;if(A(m.boundingBox,Ut),Wt.x=Ut[0],Wt.y=Ut[1],Wt.z=Ut[2],Wt.spatialReference=e.spatialReference,isFinite(Wt.z)&&m.hasZ?t=F(m.boundingBox):(Wt.z=void 0,t=I(E(m.boundingBox,It))),l||t)return Ot(await Bt(e,i,Wt,s,r,c));const n=Pt(e,m.screenSpaceObjects);return Ot(await Et(e,i,Wt,m.boundingBox,n,s,r,c))}return i.position?Ot(await Tt(e,i,s,c,r)):Ot(await Mt(e,i,s,r,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?at(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?K(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,a){const r=t.spatialReference||G.WGS84;if(e??=Q(t,n),null==e)return a;const o=new b({spatialReference:r});return T(e.center,t.renderSpatialReference,o)?(a.targetGeometry=o,a.scale=$(t,e.distance),a.rotation=st(n.heading),a.camera=n,a):a}async function vt(t,e,n,a){const r=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw r();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":n=e.centroid}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:a}),Ut[2]=rt(t.elevationProvider,n)??0):Ut[2]=0}const s=Yt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ut),0===c.length)throw r();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:a});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ut[0]=o,Ut[1]=f,Ut[2]=p,P(n.boundingBox,Ut);else for(const[o,f]of u.points)Ut[0]=o,Ut[1]=f,P(n.boundingBox,Ut)}async function bt(t,e,n,r,o){const i=await a(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,r,o);const s=i.value,c=await a(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,r,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;D(r.boundingBox,m),l&&l.forEach((t=>{r.screenSpaceObjects.push(t)})),isFinite(m[2])&&(r.hasZ=!0)}async function Rt(t,n,a,r,o){if(Array.isArray(n)&&2===n.length){const e=n[0],a=n[1];if("number"==typeof e&&"number"==typeof a)return Wt.x=e,Wt.y=a,Wt.z=void 0,Wt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Wt,r,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map((e=>Rt(t,e,a,r,o)))):n instanceof j?await vt(t,n,r,o):n instanceof e&&await bt(t,n,a,r,o)}async function zt(t,e,n,a,r){if(e.camera)return Gt(t,e.camera,a,r);r.scale=e.scale,r.rotation=e.rotation,r.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,r.camera=null,null!=n.heading?r.rotation=st(n.heading):null!=n.rotation&&(r.rotation=n.rotation);const o=dt(t,n);return null!=o&&(r.scale=o),r.camera=await lt(t,r,n.tilt,a),r}async function Gt(t,e,n,a){const r=t.spatialReference,o=await R(e.position,r,{signal:n}),i=e.clone();return i.position=o,jt(t,null,i,a)}async function St(t,e,n,a,r,o,i){const s=t.renderSpatialReference;return await B(e,Lt,s,0,{signal:i}),await B(n,Kt,s,0,{signal:i}),o.targetGeometry=new b(e),r.position=new b(n),y(Jt,Lt,Kt),nt(t,Kt,Jt,a.up,r),o.scale=$(t,p(Kt,Lt)),o.rotation=st(r.heading),o.camera=r,o}async function Bt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);if(e.position)return St(t,o.targetGeometry,e.position,i,a,o,r);if(e.zoomFactor){const n=i.distance/e.zoomFactor,a=u(Ut,i.viewForward,-n);i.eye=f(Ut,i.center,a),o.scale=$(t,n)}Y(t,i,a);const s=xt(a,e)?q.LOCKED:q.ADJUST;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(o.targetGeometry,Ut,t.renderSpatialReference,0,{signal:r});const e=J(i.frustum,Ut)?p(i.eye,Ut):i.distance;o.camera=await _(t,o.targetGeometry,e,a,s),o.scale=$(t,e)}else o.scale=n,o.camera=await et(t,o.targetGeometry,o.scale,a,s,r)}return o}async function Tt(t,e,n,a,r){const o=L(t);g(Jt,o.viewForward),nt(t,o.eye,Jt,o.up,Nt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:r});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Nt.heading,n.tilt=null!=e.tilt?e.tilt:Nt.tilt,jt(t,null,n,a)}async function Mt(t,e,n,a,r){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=L(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return T(o.center,s,c)?Bt(t,e,c,n,a,r):r}return r.scale=t.scale,r.camera=t.camera.clone(),xt(r.camera,e),r}async function Zt(t,e,n,a,r,o){o.targetGeometry=n.clone();const i=L(t);Y(t,i,a);const s=xt(a,e)?q.LOCKED:q.ADJUST;return o.camera=await W(t,n,a.heading,a.tilt,s,r),o}function At(t,e,n,a,r){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ut,n.x,n.y,o),S(t.spatialReference,Ut,Vt,t.renderSpatialReference),s(Ct,Vt),c(Ct,Ct),O(kt);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=a[e[2]];isFinite(n)||(n=o),h(Ut,a[e[0]],a[e[1]],n),M(Ut,t.spatialReference,Ut,t.renderSpatialReference),P(kt,d(Ut,Ut,Ct))}const l=U(kt),m=V(kt),u=C(kt),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/r}async function Et(t,e,n,a,r,o,i,s){s.targetGeometry=n.clone();const c=L(t),l=At(t,c,n,a,r);Y(t,c,o);const m=xt(o,e)?q.LOCKED:q.ADJUST;return s.camera=await _(t,s.targetGeometry,l,o,m,i),s.scale=$(t,l),s}function Ft(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Ot(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Pt(t,e){const n=ot;if(!e.length)return n;let a=Number.NEGATIVE_INFINITY;for(let r=0;r<e.length;r++){const t=e[r].screenSpaceBoundingRect;a=Math.max(a,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-a/Math.min(t.width,t.height)*2}class Dt{constructor(){this.hasZ=!1,this.boundingBox=O(),this.screenSpaceObjects=new Array}}const Ut=w(),Vt=m(),Ct=l(),kt=Z(),It=k(),Jt=w(),Kt=w(),Lt=w(),Nt={heading:0,tilt:0},Wt=new b,Yt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const a=t.hasZ;for(let r=0;r<t.rings.length;r++){const o=t.rings[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const a=t.hasZ;for(let r=0;r<t.paths.length;r++){const o=t.paths[r];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],a&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const a=t.points,r=t.hasZ;for(let o=0;o<a.length;o++)n[0]=a[o][0],n[1]=a[o][1],r&&(n[2]=a[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
@@ -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{IntersectorType as e}from"../webgl-engine/lib/IntersectorInterfaces.js";import{Graphic3DTarget as r}from"../webgl-engine/lib/IntersectorTarget.js";import{isValidIntersectorResult as t}from"../webgl-engine/lib/intersectorUtils.js";function n(r){return t(r)&&r.intersector===e.TERRAIN&&!!r.target}class i extends r{constructor(e,r,t){super(e,r),this.triangleNr=t}}function o(r){return t(r)&&r.intersector===e.OVERLAY&&!!r.target}export{i as OverlayTarget,o as isOverlayIntersectorResult,n as isTerrainIntersectorResult};
5
+ import{isValidIntersectorResult as e}from"../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as r}from"../webgl-engine/lib/IntersectorTarget.js";import{IntersectorType as t}from"../webgl-engine/lib/IntersectorType.js";function n(r){return e(r)&&r.intersector===t.TERRAIN&&!!r.target}class o extends r{constructor(e,r,t){super(e,r),this.triangleNr=t}}function i(r){return e(r)&&r.intersector===t.OVERLAY&&!!r.target}export{o as OverlayTarget,i as isOverlayIntersectorResult,n as isTerrainIntersectorResult};
@@ -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{Cyclical as r,cyclicalPI as s}from"../../../core/Cyclical.js";import has from"../../../core/has.js";import{clamp as i,deg2rad as n}from"../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{watch as o,sync as l}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 c}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as u,d as p,c as m,j as _}from"../../../chunks/vec32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as y,b as f,g as v}from"../../../chunks/vec42.js";import{fromValues as R,create as O}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as w}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as x}from"../../../geometry/projection/projectVectorToVector.js";import{create as S,width as D,copy as T,center as E,height as P,intersection as M,contains as b,intersects as j,offset as I}from"../../../geometry/support/aaBoundingRect.js";import{create as U,wrap as C}from"../../../geometry/support/ray.js";import{k as N,b as A,t as q}from"../../../chunks/sphere.js";import{angleAroundAxis as G}from"../../../geometry/support/vector.js";import{y2lat as V}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as F}from"../state/utils/viewUtils.js";import{debugFlags as L}from"../support/debugFlags.js";import{DebugPoint as B}from"../support/debugUtils.js";import{OverlayIndex as H}from"./interfaces.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{RenderRequestType as Y}from"../webgl-engine/lib/basicInterfaces.js";import{newIntersector as z}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as X}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as K}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as Q}from"../../support/Scheduler.js";import{Yield as $}from"../../support/Yield.js";const ee=1.3,te=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let re,se=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this._maxResolution=has("esri-mobile")?2048:4096}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=z(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([o((()=>this.renderer.hasHighlights),t),this.renderer.events.on("has-water",(()=>e.stage?.renderer.updateHasFlags())),this.renderer.events.on("content-changed",t),o((()=>e.state.camera.pixelRatio),t),o((()=>e.state.alignPixelEnabled),t),this.renderer.events.on("textures-disposed",(()=>this.surface.requestRender())),o((()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location]),(()=>this.setPlacementDirty())),o((()=>[e.state?.pixelRatio,e.state?.contentPixelRatio]),(()=>this.setPlacementDirty()),l),this.surface.on("elevation-change",(()=>this.setPlacementDirty())),e.on("resize",(()=>this.setPlacementDirty())),e.resourceController.scheduler.registerTask(J.OVERLAY,this),e.stage.renderView.events.on("force-camera-for-screenshot",(e=>{this._updateOverlays(Q,e.camera,Y.BACKGROUND),this.renderer.hasOverlays&&this._drawOverlays(Y.BACKGROUND,e)}))]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null),re&&(re.hide(),re=null),this.renderer=a(this.renderer)}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=e.isWebMercator?new r(-20037508.342787,20037508.342787):new r(-180,180))):this.renderer.disposeOverlays()}get running(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||L.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?w(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return ee/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get rendersOccludedDraped(){return this.renderer.rendersOccludedDraped}render(){if(this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.hasOverlays)return this._precompileShaders()?this._drawOverlays(Y.UPDATE):null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("running")}registerGeometryDrapeSource(e){const t=new X({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("running"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this._updateOverlays(e,this.view.state.contentCamera,Y.UPDATE)}_updateOverlays(e,t,r){if(!this._spatialReference)return $;const s=this._computeOverlayResolution(t);this._computeOverlayExtents(t,s,le),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,le.stretch);const i=this._updateOverlay(H.INNER,le.inner,s,1*le.pixelRatioAdjustment,le.mapUnitsPerPixel),n=D(le.inner)/D(le.outer),a=this._updateOverlay(H.OUTER,le.outer,s,n*le.pixelRatioAdjustment,le.mapUnitsPerPixel);i!==ue.EXTENT&&a!==ue.EXTENT||(this._drapeSources.forEach((e=>this._updateDrapeSourceExtent(e))),this.updateOverlayParameters(r)),i===ue.NONE&&a===ue.NONE||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayResolution(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s));return K(i,this._maxResolution)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return ue.NONE;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=i,n.pixelRatio=s,ie(t,n.extent)&&r===n.resolution)return a===i?ue.NONE:ue.RERENDER_ONLY;T(n.extent,t),n.resolution=r;const o=E(n.extent);return n.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),ue.EXTENT}updateOverlayParameters(e){this.surface.allTiles.forAll((e=>this.updateTileOverlayParameters(e))),this.surface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,H.INNER,t),this._setTileOverlayData(i,H.OUTER,t)):(this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[H.INNER],s=this.renderer.overlays[H.OUTER],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=D(s),n=P(s);let a=e[0];if(this._longitudeCyclical){a=this._longitudeCyclical.minimalMonotonic(s[0],a);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);a>t&&(a=t-(e[2]-e[0]))}r.setScale(t,D(e)/i,P(e)/n),r.setOffset(t,(a-s[0])/i,(e[1]-s[1])/n)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(Q)}requestRender(e=Y.UPDATE){this.renderer.hasOverlays?(e===Y.UPDATE?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,de,t,r);if(null==n)return!1;const a=n.origin,o=u(oe,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let r=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=oe;N(A(q,w(this.view.spatialReference).radius+h),C(e.eye,e.viewForward),t),p(t,t,e.eye);const i=s.normalize(G(e.viewForward,t,e.viewRight))/e.fovY+.5,a=i<=0||i>=1?.5:n;r=c?a*i:i+a*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),s=Math.tan(t),a=R(0,s,1,0),o=y(a,a,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);r=1===l||0===l?.5:c?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,r,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,i=g();this._findHorizonBasedPointOfInterest(e,i)||m(i,s),L.OVERLAY_SHOW_CENTER?(null==re&&(re=new B(this.view.graphics,"red")),re.show(i,this._renderSR)):null!=re&&re.hide();const a=Math.max(.1,_(e.eye,i)),o=F(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||x(i,this._renderSR,i,this._spatialReference);const l=this.surface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,c=h&&this._spatialReference?1/w(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,p=e.perScreenPixelRatio/u*a*c;r.mapUnitsPerPixel=p/this.worldToPCSRatio,r.stretch=this._overlayStretch;let y=t*p/2*r.stretch,R=!1,O=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(y/=Math.cos(V(i[1])),O=l[3]):(R=!0,y/=w(this._spatialReference).metersPerDegree,O=90),y>=O&&(y=O,i[1]=0,this._spatialReference.isWebMercator&&(i[0]=0)));let S=1;R&&(S=1/Math.max(.2,Math.cos(Math.abs(n(i[1])))),y*S>180&&(S=180/y),r.mapUnitsPerPixel*=S);const E=Math.log(2)/12;y=Math.exp(Math.round(Math.log(y)/E)*E);const P=y*S,j=32,I=.5*t/(j*P),U=.5*t/(j*y);i[0]=Math.round(i[0]*I)/I,i[1]=Math.round(i[1]*U)/U;const C=r.inner;C[0]=i[0]-P,C[1]=i[1]-y,C[2]=i[0]+P,C[3]=i[1]+y,this._isSpherical&&this._shiftExtentToFitBounds(C,1/0,O);const N=r.outer;if(6*P>D(l))T(N,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)N[0]=C[0]-P,N[1]=C[1]-y,N[2]=C[2]+P,N[3]=C[3]+y;else{x(e.eye,this._renderSR,oe,this._spatialReference),d(ae,i,oe);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(ae,te[r],2*y),ae[0]*=S,ae[2]*=S,v(N,C,ae)}}if(this._isSpherical)N[0]=this._longitudeCyclical.clamp(N[0]),N[2]=this._longitudeCyclical.clamp(N[2]),N[1]=Math.max(N[1],-O),N[3]=Math.min(N[3],O);else{const e=M(C,l,he),t=M(N,l,ce);b(e,t)&&(N[2]=N[0],N[3]=N[1])}const A=Math.abs(C[2]-C[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,A),r.pixelRatioAdjustment=r.mapUnitsPerPixel/A}_precompileShaders(){return!!this.renderer.hasOverlays&&(this.renderer.precompileShaders(this.view.state),!0)}_drawOverlays(e,t=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const r=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const s=this.renderer.computeValidity();this.renderer.releaseRenderTargets(),this.renderer.drawOverlays(t);return s!==this.renderer.computeValidity()&&this.updateOverlayParameters(Y.UPDATE),r?(this.surface.requestRender(e),e===Y.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(Y.BACKGROUND),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:b(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),I(e,s,i)}get test(){}};function ie(e,t){const r=1e-5,s=L.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],se.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],se.prototype,"running",null),e([h()],se.prototype,"_placementDirty",void 0),e([h()],se.prototype,"_contentUpdated",void 0),e([h()],se.prototype,"_isSpherical",null),e([h()],se.prototype,"worldToPCSRatio",null),e([h()],se.prototype,"renderer",void 0),e([h({constructOnly:!0})],se.prototype,"view",void 0),e([h({constructOnly:!0})],se.prototype,"surface",void 0),e([h()],se.prototype,"suspended",null),e([h()],se.prototype,"updating",null),e([h({type:Boolean})],se.prototype,"rendersOccludedDraped",null),se=e([c("esri.views.3d.terrain.OverlayManager")],se);class ne{constructor(){this.inner=S(),this.outer=S(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=ee}}const ae=O(),oe=g(),le=new ne,he=S(),ce=S(),de=U();var ue;!function(e){e[e.NONE=0]="NONE",e[e.EXTENT=1]="EXTENT",e[e.RERENDER_ONLY=2]="RERENDER_ONLY"}(ue||(ue={}));export{se as OverlayManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{Cyclical as r,cyclicalPI as s}from"../../../core/Cyclical.js";import has from"../../../core/has.js";import{clamp as i,deg2rad as n}from"../../../core/mathUtils.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{watch as o,sync as l}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 c}from"../../../core/accessorSupport/decorators/subclass.js";import{subtract as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as u,d as p,c as m,j as _}from"../../../chunks/vec32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{t as y,b as f,g as v}from"../../../chunks/vec42.js";import{fromValues as R,create as O}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as w}from"../../../geometry/ellipsoidUtils.js";import{projectVectorToVector as x}from"../../../geometry/projection/projectVectorToVector.js";import{create as S,width as D,copy as T,center as E,height as P,intersection as M,contains as b,intersects as j,offset as I}from"../../../geometry/support/aaBoundingRect.js";import{create as U,wrap as C}from"../../../geometry/support/ray.js";import{k as N,b as A,t as q}from"../../../chunks/sphere.js";import{angleAroundAxis as G}from"../../../geometry/support/vector.js";import{y2lat as V}from"../../../geometry/support/webMercatorUtils.js";import{viewAngle as F}from"../state/utils/viewUtils.js";import{debugFlags as L}from"../support/debugFlags.js";import{DebugPoint as B}from"../support/debugUtils.js";import{OverlayIndex as H}from"./interfaces.js";import{OverlayRenderer as k}from"./OverlayRenderer.js";import{RenderRequestType as Y}from"../webgl-engine/lib/basicInterfaces.js";import{Intersector as z}from"../webgl-engine/lib/Intersector.js";import{fromValues as W}from"../webgl-engine/lib/LocalOriginFactory.js";import{SortedRenderGeometryRenderer as X}from"../webgl-engine/lib/SortedRenderGeometryRenderer.js";import{applyTextureResizeModulo as K}from"../webgl-engine/lib/textureUtils.js";import{removeLoadedShaderModules as Z}from"../webgl-engine/parts/renderUtils.js";import{TaskPriority as J,noBudget as Q}from"../../support/Scheduler.js";import{Yield as $}from"../../support/Yield.js";const ee=1.3,te=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let re,se=class extends t{constructor(e){super(e),this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._latestOriginId=0,this._maxResolution=has("esri-mobile")?2048:4096}initialize(){const e=this.view;this.renderer=new k({parent:this}),e.stage.renderer.plugins.add(this.renderer);const t=()=>this.requestRender();this._groundIntersector=new z(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([o((()=>this.renderer.hasHighlights),t),this.renderer.events.on("has-water",(()=>e.stage?.renderer.updateHasFlags())),this.renderer.events.on("content-changed",t),o((()=>e.state.camera.pixelRatio),t),o((()=>e.state.alignPixelEnabled),t),this.renderer.events.on("textures-disposed",(()=>this.surface.requestRender())),o((()=>[e.pointsOfInterest?.renderPointOfView,e.pointsOfInterest?.centerOnSurfaceFrequent?.location]),(()=>this.setPlacementDirty())),o((()=>[e.state?.pixelRatio,e.state?.contentPixelRatio]),(()=>this.setPlacementDirty()),l),this.surface.on("elevation-change",(()=>this.setPlacementDirty())),e.on("resize",(()=>this.setPlacementDirty())),e.resourceController.scheduler.registerTask(J.OVERLAY,this),e.stage.renderView.events.on("force-camera-for-screenshot",(e=>{this._updateOverlays(Q,e.camera,Y.BACKGROUND),this.renderer.hasOverlays&&this._drawOverlays(Y.BACKGROUND,e)}))]),e.stage.renderer.overlay=this}destroy(){this.view?.stage&&(this.view.stage.renderer.plugins.remove(this.renderer),this.view.stage.renderer.overlay=null),re&&(re.hide(),re=null),this.renderer=a(this.renderer)}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.renderer.longitudeCyclical=null;const t=this.view.renderSpatialReference;null!=e&&null!=t?(this._renderSR=t,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this.renderer.longitudeCyclical=e.isWebMercator?new r(-20037508.342787,20037508.342787):new r(-180,180))):this.renderer.disposeOverlays()}get running(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||L.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get worldToPCSRatio(){return null!=this._spatialReference&&this._spatialReference.isGeographic&&!this.view.state.isLocal?w(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return ee/this.view.resolutionScale}get _longitudeCyclical(){return this.renderer.longitudeCyclical}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get rendersOccludedDraped(){return this.renderer.rendersOccludedDraped}render(){if(this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.hasOverlays)return this._precompileShaders()?this._drawOverlays(Y.UPDATE):null}get hasOverlays(){return this.renderer.hasOverlays}registerDrapeSource(e,t){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources),this.renderer.registerDrapeSource(e,t),this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("running")}registerGeometryDrapeSource(e){const t=new X({stage:this.view.stage,drapeSource:e,rendererContext:this.renderer});return this.registerDrapeSource(e,t),t}_updateDrapeSourceExtent(e){2===this.renderer.overlays.length&&null!=e.setDrapingExtent&&null!=this._spatialReference&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("running"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.requestRender()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this._updateOverlays(e,this.view.state.contentCamera,Y.UPDATE)}_updateOverlays(e,t,r){if(!this._spatialReference)return $;const s=this._computeOverlayResolution(t);this._computeOverlayExtents(t,s,le),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,le.stretch);const i=this._updateOverlay(H.INNER,le.inner,s,1*le.pixelRatioAdjustment,le.mapUnitsPerPixel),n=D(le.inner)/D(le.outer),a=this._updateOverlay(H.OUTER,le.outer,s,n*le.pixelRatioAdjustment,le.mapUnitsPerPixel);i!==ue.EXTENT&&a!==ue.EXTENT||(this._drapeSources.forEach((e=>this._updateDrapeSourceExtent(e))),this.updateOverlayParameters(r)),i===ue.NONE&&a===ue.NONE||this.requestRender(),this._placementDirty=!1,e.madeProgress()}_computeOverlayResolution(e){const t=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*t,s=e.fullHeight/e.pixelRatio*t,i=Math.ceil(1.5*Math.max(r,s));return K(i,this._maxResolution)}_updateOverlay(e,t,r,s,i){if(0===this.renderer.overlays.length)return ue.NONE;const n=this.renderer.overlays[e],a=n.mapUnitsPerPixel;if(n.mapUnitsPerPixel=i,n.pixelRatio=s,ie(t,n.extent)&&r===n.resolution)return a===i?ue.NONE:ue.RERENDER_ONLY;T(n.extent,t),n.resolution=r;const o=E(n.extent);return n.renderLocalOrigin=W(o[0],o[1],0,"OV_"+this._latestOriginId++),ue.EXTENT}updateOverlayParameters(e){this.surface.allTiles.forAll((e=>this.updateTileOverlayParameters(e))),this.surface.requestRender(e)}updateTileOverlayParameters(e){if(!e.renderData)return;const t=e.renderData.overlay;if(0===this.renderer.overlays.length)this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t);else{const[r,s]=this.renderer.overlays,i=e.extent;this._rectInsideRect(r.extent,i)||this._rectanglesOverlap(i,r.extent)||this._rectanglesOverlap(i,s.extent)?(this._setTileOverlayData(i,H.INNER,t),this._setTileOverlayData(i,H.OUTER,t)):(this._clearTileOverlayData(H.INNER,t),this._clearTileOverlayData(H.OUTER,t))}}overlayPixelSizeInMapUnits(e,t){if(0===this.renderer.overlays.length)return t();const r=this.renderer.overlays[H.INNER],s=this.renderer.overlays[H.OUTER],i=this._pointIsInExtent(e,r.extent)?r:s;return(i.extent[2]-i.extent[0])/i.resolution}_setTileOverlayData(e,t,r){if(0===this.renderer.overlays.length)return;const s=this.renderer.overlays[t].extent,i=D(s),n=P(s);let a=e[0];if(this._longitudeCyclical){a=this._longitudeCyclical.minimalMonotonic(s[0],a);const t=this._longitudeCyclical.minimalMonotonic(s[0],e[2]);a>t&&(a=t-(e[2]-e[0]))}r.setScale(t,D(e)/i,P(e)/n),r.setOffset(t,(a-s[0])/i,(e[1]-s[1])/n)}_clearTileOverlayData(e,t){t.setScale(e,-1,-1),t.setOffset(e,-1,-1)}reloadShaders(){Z(),this.requestRender(),this.runTask(Q)}requestRender(e=Y.UPDATE){this.renderer.hasOverlays?(e===Y.UPDATE?(this._contentUpdated=!0,this._drawTexturesDirty=!0):this._drawTexturesAnimateDirty=!0,this.view.stage.renderView.requestRender(e)):this.setPlacementDirty()}_intersectGroundFromView(e,t,r,s,i){const n=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,de,t,r);if(null==n)return!1;const a=n.origin,o=u(oe,n.origin,n.direction);this._groundIntersector.reset(a,o,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,a,o);const l=this._groundIntersector.results.min;return l.getIntersectionPoint(i)&&l.withinDistance(s)}_findHorizonBasedPointOfInterest(e,t){let r=.5;const n=.55,a=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,h=i(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:a+l,e.aboveGround?a-l:1/0),c=e.aboveGround;if("global"===this.view.viewingMode){const t=oe;N(A(q,w(this.view.spatialReference).radius+h),C(e.eye,e.viewForward),t),p(t,t,e.eye);const i=s.normalize(G(e.viewForward,t,e.viewRight))/e.fovY+.5,a=i<=0||i>=1?.5:n;r=c?a*i:i+a*(1-i)}else{const t=.5*Math.PI-Math.acos(-e.viewForward[2]),s=Math.tan(t),a=R(0,s,1,0),o=y(a,a,e.projectionMatrix)[1],l=i(.5+.5*o,0,1);r=1===l||0===l?.5:c?l*n:1-(1-l)*n}return this._intersectGroundFromView(e,.5,r,o.distance,t)}_computeOverlayExtents(e,t,r){const s=this.view.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,i=g();this._findHorizonBasedPointOfInterest(e,i)||m(i,s),L.OVERLAY_SHOW_CENTER?(null==re&&(re=new B(this.view.graphics,"red")),re.show(i,this._renderSR)):null!=re&&re.hide();const a=Math.max(.1,_(e.eye,i)),o=F(this.view.renderCoordsHelper,s,e.eye);this._overlaySREqualsRenderSR||x(i,this._renderSR,i,this._spatialReference);const l=this.surface.extent,h=!this._isSpherical&&this._spatialReference?.isGeographic,c=h&&this._spatialReference?1/w(this._spatialReference).metersPerDegree:1,u=this.view.state.contentPixelRatio,p=e.perScreenPixelRatio/u*a*c;r.mapUnitsPerPixel=p/this.worldToPCSRatio,r.stretch=this._overlayStretch;let y=t*p/2*r.stretch,R=!1,O=h?90:1/0;this._isSpherical&&l&&this._spatialReference&&(this._spatialReference.isWebMercator?(y/=Math.cos(V(i[1])),O=l[3]):(R=!0,y/=w(this._spatialReference).metersPerDegree,O=90),y>=O&&(y=O,i[1]=0,this._spatialReference.isWebMercator&&(i[0]=0)));let S=1;R&&(S=1/Math.max(.2,Math.cos(Math.abs(n(i[1])))),y*S>180&&(S=180/y),r.mapUnitsPerPixel*=S);const E=Math.log(2)/12;y=Math.exp(Math.round(Math.log(y)/E)*E);const P=y*S,j=32,I=.5*t/(j*P),U=.5*t/(j*y);i[0]=Math.round(i[0]*I)/I,i[1]=Math.round(i[1]*U)/U;const C=r.inner;C[0]=i[0]-P,C[1]=i[1]-y,C[2]=i[0]+P,C[3]=i[1]+y,this._isSpherical&&this._shiftExtentToFitBounds(C,1/0,O);const N=r.outer;if(6*P>D(l))T(N,l);else{if(Math.PI/2-Math.abs(o-Math.PI/2)<=.25*Math.PI)N[0]=C[0]-P,N[1]=C[1]-y,N[2]=C[2]+P,N[3]=C[3]+y;else{x(e.eye,this._renderSR,oe,this._spatialReference),d(ae,i,oe);let t=-Math.atan2(ae[1],ae[0])+.125*Math.PI;t<0&&(t+=2*Math.PI);const r=Math.floor(t/(.25*Math.PI));f(ae,te[r],2*y),ae[0]*=S,ae[2]*=S,v(N,C,ae)}}if(this._isSpherical)N[0]=this._longitudeCyclical.clamp(N[0]),N[2]=this._longitudeCyclical.clamp(N[2]),N[1]=Math.max(N[1],-O),N[3]=Math.min(N[3],O);else{const e=M(C,l,he),t=M(N,l,ce);b(e,t)&&(N[2]=N[0],N[3]=N[1])}const A=Math.abs(C[2]-C[0])/t;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,A),r.pixelRatioAdjustment=r.mapUnitsPerPixel/A}_precompileShaders(){return!!this.renderer.hasOverlays&&(this.renderer.precompileShaders(this.view.state),!0)}_drawOverlays(e,t=this.view.state){if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const r=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const s=this.renderer.computeValidity();this.renderer.releaseRenderTargets(),this.renderer.drawOverlays(t);return s!==this.renderer.computeValidity()&&this.updateOverlayParameters(Y.UPDATE),r?(this.surface.requestRender(e),e===Y.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(Y.BACKGROUND),this.renderer}_rectanglesOverlap(e,t){return null!=e&&(this._longitudeCyclical?(this._longitudeCyclical.contains(t[0],t[2],e[0])||this._longitudeCyclical.contains(t[0],t[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],t[0]))&&!(e[1]>t[3]||e[3]<t[1]):j(e,t))}_rectInsideRect(e,t){return null!=t&&(this._longitudeCyclical?this._longitudeCyclical.contains(e[0],e[2],t[0])&&this._longitudeCyclical.contains(e[0],e[2],t[2])&&t[1]>e[1]&&t[3]<e[3]:b(e,t))}_pointIsInExtent(e,t){if(this._longitudeCyclical)return this._longitudeCyclical.contains(t[0],t[2],e.x)&&e.y>=t[1]&&e.y<=t[3];const r=e.x,s=e.y;return r>t[0]&&r<t[2]&&s>t[1]&&s<t[3]}_shiftExtentToFitBounds(e,t,r){let s=0,i=0;e[0]<-t?s=e[0]+t:e[2]>t&&(s=t-e[2]),e[1]<-r?i=e[1]+r:e[3]>r&&(i=r-e[3]),I(e,s,i)}get test(){}};function ie(e,t){const r=1e-5,s=L.TESTS_DISABLE_OPTIMIZATIONS?0:r*Math.max(e[2]-e[0],e[3]-e[1],t[2]-t[0],t[3]-t[1]);return Math.abs(t[0]-e[0])<=s&&Math.abs(t[1]-e[1])<=s&&Math.abs(t[2]-e[2])<=s&&Math.abs(t[3]-e[3])<=s}e([h()],se.prototype,"_spatialReference",void 0),e([h({readOnly:!0})],se.prototype,"running",null),e([h()],se.prototype,"_placementDirty",void 0),e([h()],se.prototype,"_contentUpdated",void 0),e([h()],se.prototype,"_isSpherical",null),e([h()],se.prototype,"worldToPCSRatio",null),e([h()],se.prototype,"renderer",void 0),e([h({constructOnly:!0})],se.prototype,"view",void 0),e([h({constructOnly:!0})],se.prototype,"surface",void 0),e([h()],se.prototype,"suspended",null),e([h()],se.prototype,"updating",null),e([h({type:Boolean})],se.prototype,"rendersOccludedDraped",null),se=e([c("esri.views.3d.terrain.OverlayManager")],se);class ne{constructor(){this.inner=S(),this.outer=S(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=ee}}const ae=O(),oe=g(),le=new ne,he=S(),ce=S(),de=U();var ue;!function(e){e[e.NONE=0]="NONE",e[e.EXTENT=1]="EXTENT",e[e.RERENDER_ONLY=2]="RERENDER_ONLY"}(ue||(ue={}));export{se as OverlayManager};