@arcgis/core 4.31.0-next.20240821 → 4.31.0-next.20240823

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 (376) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{24e38b7d1e9984a1472e.js → 033032715c3b04e0fc7d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{cfc93bbd35cc4bfde7c0.js → 045336db17aae6eef68f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/04de7b2937d5ca7c23e2.js +1 -0
  5. package/assets/esri/core/workers/chunks/12a4b3706162872c2b41.js +769 -0
  6. package/assets/esri/core/workers/chunks/142b1336533fa2ac470b.js +47 -0
  7. package/assets/esri/core/workers/chunks/185e596f86767c22f951.js +1 -0
  8. package/assets/esri/core/workers/chunks/{cd8d595d577b74817623.js → 1a4b3820136fb615b730.js} +1 -1
  9. package/assets/esri/core/workers/chunks/29b157b41dfa16da886b.js +1 -0
  10. package/assets/esri/core/workers/chunks/300b57846114fedd12be.js +1 -0
  11. package/assets/esri/core/workers/chunks/{3f75b7ed24b440b4508a.js → 3d5f37c2f355260e6dc6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a9eba26d62b62592cee1.js → 42861d54a336146753d8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4c8deac4bf72a5e2597a.js +1 -0
  14. package/assets/esri/core/workers/chunks/52107d450c55450f5c04.js +274 -0
  15. package/assets/esri/core/workers/chunks/6d54222301b6d819c904.js +1 -0
  16. package/assets/esri/core/workers/chunks/{eb0f180ed20af220a82e.js → 6ddece9cd94b60efe3d7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{566844774388a031fd74.js → 7125cff7fd288ff7bd5f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/74de734a20b4cd2d7efb.js +1 -0
  19. package/assets/esri/core/workers/chunks/7712a23dc68220edaa64.js +1 -0
  20. package/assets/esri/core/workers/chunks/{ea561b2460e634a643fc.js → 7f35380809e7de99c302.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7f3d49b667e9b46449e7.js +1 -0
  22. package/assets/esri/core/workers/chunks/8a2faf12938e811a9fc9.js +1 -0
  23. package/assets/esri/core/workers/chunks/{796c64b9caa1303e26ed.js → 8af503fa88c1668872eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e2a6f77c05d0818e3f74.js → 8e42ce8305cefba5debc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/93169e55e472fec4bc50.js +1 -0
  26. package/assets/esri/core/workers/chunks/985c1f42aab564008c0d.js +1 -0
  27. package/assets/esri/core/workers/chunks/9a32d9d720cb81abfba2.js +1 -0
  28. package/assets/esri/core/workers/chunks/b171d57b4d0142f687d0.js +1 -0
  29. package/assets/esri/core/workers/chunks/d5e376893cd47605a438.js +1 -0
  30. package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +1 -0
  31. package/assets/esri/core/workers/chunks/f11ae249cc8e995bbccc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{65d8011cf756b066cade.js → f218316de8b4635653b2.js} +1 -1
  33. package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
  34. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  35. package/assets/esri/themes/base/_core.scss +2 -0
  36. package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
  37. package/assets/esri/themes/base/widgets/_GridControls.scss +86 -0
  38. package/assets/esri/themes/base/widgets/_Print.scss +13 -15
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/Print/t9n/Print.json +1 -1
  43. package/assets/esri/widgets/Print/t9n/Print_ar.json +1 -1
  44. package/assets/esri/widgets/Print/t9n/Print_bg.json +1 -1
  45. package/assets/esri/widgets/Print/t9n/Print_bs.json +1 -1
  46. package/assets/esri/widgets/Print/t9n/Print_ca.json +1 -1
  47. package/assets/esri/widgets/Print/t9n/Print_cs.json +1 -1
  48. package/assets/esri/widgets/Print/t9n/Print_da.json +1 -1
  49. package/assets/esri/widgets/Print/t9n/Print_de.json +1 -1
  50. package/assets/esri/widgets/Print/t9n/Print_el.json +1 -1
  51. package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
  52. package/assets/esri/widgets/Print/t9n/Print_es.json +1 -1
  53. package/assets/esri/widgets/Print/t9n/Print_et.json +1 -1
  54. package/assets/esri/widgets/Print/t9n/Print_fi.json +1 -1
  55. package/assets/esri/widgets/Print/t9n/Print_fr.json +1 -1
  56. package/assets/esri/widgets/Print/t9n/Print_he.json +1 -1
  57. package/assets/esri/widgets/Print/t9n/Print_hr.json +1 -1
  58. package/assets/esri/widgets/Print/t9n/Print_hu.json +1 -1
  59. package/assets/esri/widgets/Print/t9n/Print_id.json +1 -1
  60. package/assets/esri/widgets/Print/t9n/Print_it.json +1 -1
  61. package/assets/esri/widgets/Print/t9n/Print_ja.json +1 -1
  62. package/assets/esri/widgets/Print/t9n/Print_ko.json +1 -1
  63. package/assets/esri/widgets/Print/t9n/Print_lt.json +1 -1
  64. package/assets/esri/widgets/Print/t9n/Print_lv.json +1 -1
  65. package/assets/esri/widgets/Print/t9n/Print_nb.json +1 -1
  66. package/assets/esri/widgets/Print/t9n/Print_nl.json +1 -1
  67. package/assets/esri/widgets/Print/t9n/Print_pl.json +1 -1
  68. package/assets/esri/widgets/Print/t9n/Print_pt-BR.json +1 -1
  69. package/assets/esri/widgets/Print/t9n/Print_pt-PT.json +1 -1
  70. package/assets/esri/widgets/Print/t9n/Print_ro.json +1 -1
  71. package/assets/esri/widgets/Print/t9n/Print_ru.json +1 -1
  72. package/assets/esri/widgets/Print/t9n/Print_sk.json +1 -1
  73. package/assets/esri/widgets/Print/t9n/Print_sl.json +1 -1
  74. package/assets/esri/widgets/Print/t9n/Print_sr.json +1 -1
  75. package/assets/esri/widgets/Print/t9n/Print_sv.json +1 -1
  76. package/assets/esri/widgets/Print/t9n/Print_th.json +1 -1
  77. package/assets/esri/widgets/Print/t9n/Print_tr.json +1 -1
  78. package/assets/esri/widgets/Print/t9n/Print_uk.json +1 -1
  79. package/assets/esri/widgets/Print/t9n/Print_vi.json +1 -1
  80. package/assets/esri/widgets/Print/t9n/Print_zh-CN.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/Print_zh-HK.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/Print_zh-TW.json +1 -1
  83. package/assets/esri/widgets/support/GridControls/t9n/GridControls.json +1 -0
  84. package/assets/esri/widgets/support/GridControls/t9n/GridControls_en.json +1 -0
  85. package/chunks/CloudsComposition.glsl.js +3 -3
  86. package/chunks/ComponentShader.glsl.js +53 -61
  87. package/chunks/DefaultMaterial.glsl.js +1 -1
  88. package/chunks/FocusAreaColor.glsl.js +12 -0
  89. package/chunks/FocusAreaMask.glsl.js +5 -0
  90. package/chunks/Laserlines.glsl.js +1 -1
  91. package/chunks/Path.glsl.js +22 -17
  92. package/chunks/PointRenderer.glsl.js +3 -3
  93. package/chunks/Precipitation.glsl.js +1 -1
  94. package/chunks/Terrain.glsl.js +1 -1
  95. package/chunks/WaterSurface.glsl.js +18 -18
  96. package/chunks/boundedPlane.js +1 -1
  97. package/chunks/cameraUtilsPlanar.js +1 -1
  98. package/chunks/cameraUtilsSpherical.js +1 -1
  99. package/chunks/sphere.js +1 -1
  100. package/chunks/terrainUtilsPlanar.js +1 -1
  101. package/chunks/vec32.js +1 -1
  102. package/chunks/vxlLayer.js +1 -1
  103. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  104. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  105. package/core/mathUtils.js +1 -1
  106. package/core/perspectiveUtils.js +1 -1
  107. package/exports/csv.js +1 -1
  108. package/geometry/operators/support/converterAPI.js +1 -1
  109. package/geometry/projection/localLinearScaleFactors.js +1 -1
  110. package/geometry/support/buffer/internals/Vec3.js +1 -1
  111. package/geometry/support/clipRay.js +1 -1
  112. package/geometry/support/coordinateSystem.js +1 -1
  113. package/geometry/support/frustum.js +1 -1
  114. package/geometry/support/heightModelInfoUtils.js +1 -1
  115. package/geometry/support/lineSegment.js +1 -1
  116. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  117. package/geometry/support/meshUtils/rotate.js +1 -1
  118. package/geometry/support/meshUtils/scale.js +1 -1
  119. package/geometry/support/plane.js +1 -1
  120. package/geometry/support/polygonUtils.js +1 -1
  121. package/geometry/support/ray.js +1 -1
  122. package/geometry/support/sphere.js +1 -1
  123. package/geometry/support/sphereUtils.js +5 -0
  124. package/geometry/support/triangle.js +1 -1
  125. package/geometry/support/vector.js +1 -1
  126. package/interfaces.d.ts +68 -9
  127. package/layers/FocusAreaLayer.js +5 -0
  128. package/layers/VoxelLayer.js +1 -1
  129. package/layers/VoxelWasmPerSceneView.js +1 -1
  130. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  131. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  132. package/layers/video/VideoCameraSensorModel.js +1 -1
  133. package/package.json +1 -1
  134. package/support/revision.js +1 -1
  135. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  136. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  137. package/symbols/support/Symbol3DMaterial.js +1 -1
  138. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  139. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  140. package/views/2d/grid/GridView2D.js +1 -1
  141. package/views/2d/grid/constants.js +5 -0
  142. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  143. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  144. package/views/2d/layerViewModuleImportUtils.js +1 -1
  145. package/views/2d/support/highlightGroupUtils.js +1 -1
  146. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  148. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  149. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  151. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  152. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  153. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  154. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  155. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  156. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  157. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  158. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  160. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  161. package/views/3d/analysis/support/measurementUtils.js +1 -1
  162. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  163. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  164. package/views/3d/camera/constraintUtils/common.js +1 -1
  165. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  166. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  167. package/views/3d/camera/intersectionUtils.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  170. package/views/3d/environment/CloudsParameters.js +1 -1
  171. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  172. package/views/3d/environment/Fog.js +1 -1
  173. package/views/3d/environment/MarsAtmosphere.js +1 -1
  174. package/views/3d/interactive/Manipulator3D.js +1 -1
  175. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  176. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  177. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  178. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  179. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  180. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  181. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  182. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  183. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  184. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  185. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  186. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  187. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  188. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  189. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  190. package/views/3d/layerViewModuleImportUtils.js +1 -1
  191. package/views/3d/layers/FocusAreaLayerView3D.js +5 -0
  192. package/views/3d/layers/I3SMeshView3D.js +1 -1
  193. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  195. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  196. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  197. package/views/3d/layers/VoxelGraphic.js +5 -0
  198. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  200. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  209. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  210. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  211. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  212. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  213. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  214. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  215. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  216. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  217. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  218. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  219. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  220. package/views/3d/layers/support/uvUtils.js +1 -1
  221. package/views/3d/state/NearFarHeuristic.js +1 -1
  222. package/views/3d/state/ViewStateManager.js +1 -1
  223. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  224. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  225. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  226. package/views/3d/state/controllers/RotateController.js +1 -1
  227. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  228. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  229. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  230. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  231. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  232. package/views/3d/state/utils/navigationUtils.js +1 -1
  233. package/views/3d/state/utils/viewUtils.js +1 -1
  234. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  235. package/views/3d/support/cameraUtilsInternal.js +1 -1
  236. package/views/3d/support/geometryUtils/ray.js +1 -1
  237. package/views/3d/support/intersectionUtils.js +1 -1
  238. package/views/3d/support/mathUtils.js +1 -1
  239. package/views/3d/support/orientedBoundingBox.js +1 -1
  240. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  241. package/views/3d/support/sunUtils.js +1 -1
  242. package/views/3d/support/viewpointUtils.js +1 -1
  243. package/views/3d/terrain/OverlayRenderer.js +1 -1
  244. package/views/3d/terrain/PatchRenderData.js +1 -1
  245. package/views/3d/terrain/SphericalPatch.js +1 -1
  246. package/views/3d/terrain/TerrainRenderer.js +1 -1
  247. package/views/3d/terrain/TerrainSurface.js +1 -1
  248. package/views/3d/terrain/Tile.js +1 -1
  249. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  250. package/views/3d/webgl/RenderCamera.js +1 -1
  251. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  252. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  253. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  255. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  256. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  257. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  258. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  260. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  261. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -1
  262. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -6
  263. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
  264. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +13 -0
  265. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +11 -13
  267. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +4 -4
  268. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +1 -4
  269. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
  270. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  271. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
  272. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  273. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  274. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorRenderNodeTechnique.js +5 -0
  275. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskRenderNodeTechnique.js +5 -0
  276. package/views/3d/webgl-engine/effects/focusArea/FocusAreaParameters.js +5 -0
  277. package/views/3d/webgl-engine/effects/focusArea/FocusAreaRenderNode.js +5 -0
  278. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  279. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  280. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  281. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  282. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  283. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  284. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  285. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  286. package/views/3d/webgl-engine/lib/Path.js +1 -1
  287. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  288. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  289. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  290. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  291. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  292. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  293. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  294. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  295. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  296. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  297. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  298. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  299. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  301. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  302. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  303. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  309. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  311. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  312. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +5 -0
  313. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +5 -0
  314. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  315. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  316. package/views/draw/support/helpMessageUtils3d.js +1 -1
  317. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  318. package/views/input/gamepad/GamepadSource.js +1 -1
  319. package/views/interactive/coordinateHelper.js +1 -1
  320. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  321. package/views/interactive/sketch/constraints.js +1 -1
  322. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  323. package/views/interactive/snapping/GridSnappingEngine.js +5 -0
  324. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  325. package/views/interactive/snapping/SnappingOptions.js +1 -1
  326. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  327. package/views/interactive/snapping/snappingUtils.js +1 -1
  328. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  329. package/views/support/angularMeasurementUtils.js +1 -1
  330. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  331. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  332. package/views/support/geometry3dUtils.js +1 -1
  333. package/webscene/Slide.js +1 -1
  334. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  335. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  336. package/widgets/Feature/FeatureMedia.js +1 -1
  337. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  338. package/widgets/FeatureTable/Grid/Column.js +1 -1
  339. package/widgets/FeatureTable.js +1 -1
  340. package/widgets/GridControls/GridControlsViewModel.d.ts +4 -0
  341. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  342. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  343. package/widgets/Print/CustomTemplate.js +1 -1
  344. package/widgets/Print/PrintViewModel.js +1 -1
  345. package/widgets/Print/TemplateOptions.js +1 -1
  346. package/widgets/Print/utils.js +5 -0
  347. package/widgets/Print.js +1 -1
  348. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  349. package/widgets/support/GridControls/GridControlsViewModel.d.ts +4 -0
  350. package/widgets/support/GridControls/GridControlsViewModel.js +5 -0
  351. package/widgets/support/GridControls/VisibleElements.js +5 -0
  352. package/widgets/support/GridControls/gridUtils.js +5 -0
  353. package/widgets/support/GridControls.d.ts +4 -0
  354. package/widgets/support/GridControls.js +5 -0
  355. package/widgets/support/exportUtils.js +1 -1
  356. package/assets/esri/core/workers/chunks/14dc47896456e3c66b24.js +0 -1
  357. package/assets/esri/core/workers/chunks/2e88af8ab1e2713e7655.js +0 -1
  358. package/assets/esri/core/workers/chunks/3b204e75b613bcfbc8b9.js +0 -1
  359. package/assets/esri/core/workers/chunks/3e57f493d5a9d7aa7a48.js +0 -1
  360. package/assets/esri/core/workers/chunks/4e5ae81c612543130d9a.js +0 -1
  361. package/assets/esri/core/workers/chunks/4e746f8fca1d932dd684.js +0 -1
  362. package/assets/esri/core/workers/chunks/544eec13338b2d71680f.js +0 -1
  363. package/assets/esri/core/workers/chunks/5e7e12863cbed07451d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/6c129767cda74aa672e0.js +0 -1
  365. package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +0 -1
  366. package/assets/esri/core/workers/chunks/7802e70422f4151b95bc.js +0 -1
  367. package/assets/esri/core/workers/chunks/920557db2bd107a3c579.js +0 -1
  368. package/assets/esri/core/workers/chunks/9443b9ec03f25c723c2c.js +0 -47
  369. package/assets/esri/core/workers/chunks/991295637f51e8207efe.js +0 -1
  370. package/assets/esri/core/workers/chunks/ace8b6351ed35b03499b.js +0 -1
  371. package/assets/esri/core/workers/chunks/b1e4896acfae0bf9a9a8.js +0 -1
  372. package/assets/esri/core/workers/chunks/ca12b1c470e67ca7b30e.js +0 -1
  373. package/assets/esri/core/workers/chunks/cd9f48dcee2a1fc261ed.js +0 -774
  374. package/assets/esri/core/workers/chunks/d3626c01d2569d84e01e.js +0 -1
  375. package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
  376. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +0 -31
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{s as t,g as r,j as e,a as n,m as s,c as o,n as i,b as f}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{g as a}from"../../../../chunks/sphere.js";import{planeFromPoints as u}from"../../support/mathUtils.js";import{geodesicArea as c}from"../../../support/geodesicAreaMeasurementUtils.js";function g(s,o){const i=a(o);t(i,0,0,0);for(let t=0;t<s.length;++t)r(i,i,s[t]);e(i,i,1/s.length);let f=0;for(let t=0;t<s.length;++t)f=Math.max(f,n(i,s[t]));o[3]=Math.sqrt(f)}function h(t,r){if(t.length<3)throw new Error("need at least 3 points to fit a plane");u(t[0],t[1],t[2],r)}function p(t,r){return s(t,r)+t[3]}function m(t,r,e,n){const s=b;return o(s.rings[0][0],t),o(s.rings[0][1],r),o(s.rings[0][2],e),o(s.rings[0][3],t),s.spatialReference=n,c(s)}function j(e,n=null,l=!0){const a=1e-6,u=(t,r)=>{if(0===r[0]&&0===r[1]&&0===r[2])return!1;for(let e=0;e<t.length;++e)if(s(r,t[e])<-a)return!1;return!0};if(0===e.length)return!1;if(1===e.length)return n&&o(n,e[0]),!0;t(x,0,0,0);for(let t=0;t<e.length;++t)r(x,x,e[t]);if(i(x,x),u(e,x))return n&&o(n,x),!0;if(!l)return!1;for(let t=0;t<e.length;++t)for(let r=0;r<e.length;++r)if(t!==r&&(f(x,e[t],e[r]),i(x,x),u(e,x)))return n&&o(n,x),!0;return!1}function M(t){return"mouse"!==t.pointerType||0===t.button}const b={hasM:!1,hasZ:!0,rings:[[l(),l(),l(),l()]],spatialReference:null,type:"polygon"},x=l();export{h as bestFitPlane,g as boundingSphere,j as fitHemisphere,M as isPrimaryPointerAction,p as planePointDistance,m as triangleAreaGeodesic};
5
+ import{a as t,g as r,j as e,s as n,l as s,c as o,n as i,b as l}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{g as a}from"../../../../chunks/sphere.js";import{planeFromPoints as u}from"../../support/mathUtils.js";import{geodesicArea as c}from"../../../support/geodesicAreaMeasurementUtils.js";function g(s,o){const i=a(o);t(i,0,0,0);for(let t=0;t<s.length;++t)r(i,i,s[t]);e(i,i,1/s.length);let l=0;for(let t=0;t<s.length;++t)l=Math.max(l,n(i,s[t]));o[3]=Math.sqrt(l)}function h(t,r){if(t.length<3)throw new Error("need at least 3 points to fit a plane");u(t[0],t[1],t[2],r)}function p(t,r){return s(t,r)+t[3]}function m(t,r,e,n){const s=b;return o(s.rings[0][0],t),o(s.rings[0][1],r),o(s.rings[0][2],e),o(s.rings[0][3],t),s.spatialReference=n,c(s)}function j(e,n=null,f=!0){const a=1e-6,u=(t,r)=>{if(0===r[0]&&0===r[1]&&0===r[2])return!1;for(let e=0;e<t.length;++e)if(s(r,t[e])<-a)return!1;return!0};if(0===e.length)return!1;if(1===e.length)return n&&o(n,e[0]),!0;t(x,0,0,0);for(let t=0;t<e.length;++t)r(x,x,e[t]);if(i(x,x),u(e,x))return n&&o(n,x),!0;if(!f)return!1;for(let t=0;t<e.length;++t)for(let r=0;r<e.length;++r)if(t!==r&&(l(x,e[t],e[r]),i(x,x),u(e,x)))return n&&o(n,x),!0;return!1}function M(t){return"mouse"!==t.pointerType||0===t.button}const b={hasM:!1,hasZ:!0,rings:[[f(),f(),f(),f()]],spatialReference:null,type:"polygon"},x=f();export{h as bestFitPlane,g as boundingSphere,j as fitHemisphere,M as isPrimaryPointerAction,p as planePointDistance,m as triangleAreaGeodesic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{Milliseconds as t,millisecondsFromSeconds as i}from"../../../../core/time.js";import{f as e,l as r,c as n}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Camera as s}from"./Camera.js";import a from"../../webgl/RenderCamera.js";import{Animation as o}from"../../../animation/pointToPoint/Animation.js";class c{get finished(){return this.currentTime>=this._animation.time}get time(){return this._animation.time}constructor(i){this.currentTime=t(0),this._animation=new o((()=>new s(i))),this._current=new s(i)}update(i,m,s){const{source:a,target:o}=this._animation.definition,c=e(h,m.center,i.center),u=r(c);u>=1e-5?(c[0]/=u,c[1]/=u,c[2]/=u):(c[0]=0,c[1]=1,c[0]=0),n(a.direction,c),n(o.direction,c),a.copyFromRenderCamera(i),o.copyFromRenderCamera(m),this._current.copyFrom(a),this._animation.update(a,o,s),this.currentTime=t(0),i.almostEquals(m)&&(this.currentTime=this._animation.time)}cameraAt(t,i){return this._animation.cameraAt(t,this._current),i=i||new a,this._current.copyToRenderCamera(i),i}step(e,r){return this.finished||(this.currentTime=t(this.currentTime+i(e)),this.currentTime>=this.time&&(this.currentTime=this.time)),this.cameraAt(this.currentTime/this.time,r)}}const h=m();export{c as Animation};
5
+ import{Milliseconds as t,millisecondsFromSeconds as i}from"../../../../core/time.js";import{f as e,m as r,c as n}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Camera as s}from"./Camera.js";import a from"../../webgl/RenderCamera.js";import{Animation as o}from"../../../animation/pointToPoint/Animation.js";class c{get finished(){return this.currentTime>=this._animation.time}get time(){return this._animation.time}constructor(i){this.currentTime=t(0),this._animation=new o((()=>new s(i))),this._current=new s(i)}update(i,m,s){const{source:a,target:o}=this._animation.definition,c=e(h,m.center,i.center),u=r(c);u>=1e-5?(c[0]/=u,c[1]/=u,c[2]/=u):(c[0]=0,c[1]=1,c[0]=0),n(a.direction,c),n(o.direction,c),a.copyFromRenderCamera(i),o.copyFromRenderCamera(m),this._current.copyFrom(a),this._animation.update(a,o,s),this.currentTime=t(0),i.almostEquals(m)&&(this.currentTime=this._animation.time)}cameraAt(t,i){return this._animation.cameraAt(t,this._current),i=i||new a,this._current.copyToRenderCamera(i),i}step(e,r){return this.finished||(this.currentTime=t(this.currentTime+i(e)),this.currentTime>=this.time&&(this.currentTime=this.time)),this.cameraAt(this.currentTime/this.time,r)}}const h=m();export{c as Animation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as t}from"../../../../core/mathUtils.js";import{transpose as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{l as s,p as a,o,c as h,f as n,t as r,j as c,b as _,m as p,g as m,n as f}from"../../../../chunks/vec32.js";import{create as l,clone as d,UNIT_Z as M,UNIT_Y as v,UNIT_X as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as u}from"../../../ViewingMode.js";import{angle as w,slerp as y}from"../../support/mathUtils.js";class P{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(t){this.viewingMode=t,this.center=l(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=d(O),this._fov=55,this._size=1}pixelsPerPanAtZoom(t){return this._size/2/(this._zoomToPanScale*t)}zoomAtPixelsPerPan(t){return this._size/2/(this._zoomToPanScale*t)}pixelsPerRotate(){const t=Math.max(Math.cos(Math.abs(this._pitch)),.5);return this._size/2/t}compareTo(t,i){if(this.viewingMode===u.Global){const e=(s(this.center)+s(t.center))/2;i.pan=w(this.center,t.center)*e}else i.pan=a(this.center,t.center);let e=Math.abs(t._yaw-this._yaw);e>=Math.PI&&(e=2*Math.PI-e);const o=Math.abs(t._pitch-this._pitch);i.rotate=Math.max(e,o),i.fov=t.fov-this.fov,i.sourceZoom=this._distance,i.targetZoom=t._distance}interpolate(i,e,s){this.viewingMode===u.Global?y(i.center,e.center,s.pan,this.center):o(this.center,i.center,e.center,s.pan),this._distance=isFinite(e.distance)?t(i.distance,e.distance+s.zoomOffset,s.zoom):i.distance,this._pitch=t(i.pitch,e.pitch,s.rotate);let a=i._yaw;const h=e._yaw;Math.abs(h-a)>=Math.PI&&(a+=2*(a<h?1:-1)*Math.PI),this._yaw=t(a,h,s.rotate),this._fov=t(i.fov,e.fov,s.fov)}copyFrom(t){h(this.center,t.center),this._pitch=t.pitch,this._yaw=t.yaw,this._distance=t.distance,h(this.direction,t.direction),this._size=t.size,this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov),this.viewingMode=t.viewingMode}copyFromRenderCamera(t){const i=this._lookAtOrientation(t.center,F);h(this.center,t.center),n(I,t.center,t.eye),r(I,I,i),r(k,t.up,i),this._distance=s(I),0!==this._distance&&(I[0]/=this._distance,I[1]/=this._distance,I[2]/=this._distance),this._pitch=z(I),this._yaw=x(I,k),this._size=Math.sqrt(t.width*t.width+t.height*t.height),this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(t){const e=this._lookAtOrientation(this.center,F);i(e,e),this._axisAngleVec3(S,this._pitch-Math.PI/2,O,I),this._axisAngleVec3(V,this._yaw,I,I),this._axisAngleVec3(S,this._pitch-Math.PI/2,V,k),this._axisAngleVec3(V,this._yaw,k,k),c(I,I,this._distance),r(I,I,e),r(k,k,e),t.center=this.center,t.eye=n(I,this.center,I),t.up=k,t.fov=this._fov}_axisAngleVec3(t,i,e,s){const a=Math.cos(i),o=Math.sin(i);return c(A,e,a),_(b,t,e),c(b,b,o),c(j,t,(1-a)*p(t,e)),m(s,m(s,A,b),j)}_lookAtOrientation(t,i=e()){return this._upAtLookAt(t,j),_(A,this.direction,j),f(A,A),0===A[0]&&0===A[1]&&0===A[2]&&h(A,S),_(b,j,A),f(b,b),i[0]=A[0],i[1]=b[0],i[2]=j[0],i[3]=A[1],i[4]=b[1],i[5]=j[1],i[6]=A[2],i[7]=b[2],i[8]=j[2],i}_upAtLookAt(t,i){return this.viewingMode===u.Local?h(i,V):f(i,t)}}function z(t){return Math.PI-w(V,t)}function x(t,i){const e=T;return Math.abs(i[2])<.5?(h(e,i),t[2]>0&&c(e,e,-1)):h(e,t),_(b,e,V),f(b,b),w(S,b,V)}const A=l(),b=l(),j=l(),I=l(),k=l(),T=l(),V=M,O=v,S=g,F=e();export{P as Camera};
5
+ import{lerp as t}from"../../../../core/mathUtils.js";import{transpose as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{m as s,p as a,o,c as h,f as n,t as r,j as c,b as _,l as p,g as m,n as f}from"../../../../chunks/vec32.js";import{create as l,clone as d,UNIT_Z as M,UNIT_Y as v,UNIT_X as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as u}from"../../../ViewingMode.js";import{angle as w,slerp as y}from"../../support/mathUtils.js";class P{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(t){this.viewingMode=t,this.center=l(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=d(O),this._fov=55,this._size=1}pixelsPerPanAtZoom(t){return this._size/2/(this._zoomToPanScale*t)}zoomAtPixelsPerPan(t){return this._size/2/(this._zoomToPanScale*t)}pixelsPerRotate(){const t=Math.max(Math.cos(Math.abs(this._pitch)),.5);return this._size/2/t}compareTo(t,i){if(this.viewingMode===u.Global){const e=(s(this.center)+s(t.center))/2;i.pan=w(this.center,t.center)*e}else i.pan=a(this.center,t.center);let e=Math.abs(t._yaw-this._yaw);e>=Math.PI&&(e=2*Math.PI-e);const o=Math.abs(t._pitch-this._pitch);i.rotate=Math.max(e,o),i.fov=t.fov-this.fov,i.sourceZoom=this._distance,i.targetZoom=t._distance}interpolate(i,e,s){this.viewingMode===u.Global?y(i.center,e.center,s.pan,this.center):o(this.center,i.center,e.center,s.pan),this._distance=isFinite(e.distance)?t(i.distance,e.distance+s.zoomOffset,s.zoom):i.distance,this._pitch=t(i.pitch,e.pitch,s.rotate);let a=i._yaw;const h=e._yaw;Math.abs(h-a)>=Math.PI&&(a+=2*(a<h?1:-1)*Math.PI),this._yaw=t(a,h,s.rotate),this._fov=t(i.fov,e.fov,s.fov)}copyFrom(t){h(this.center,t.center),this._pitch=t.pitch,this._yaw=t.yaw,this._distance=t.distance,h(this.direction,t.direction),this._size=t.size,this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov),this.viewingMode=t.viewingMode}copyFromRenderCamera(t){const i=this._lookAtOrientation(t.center,F);h(this.center,t.center),n(I,t.center,t.eye),r(I,I,i),r(k,t.up,i),this._distance=s(I),0!==this._distance&&(I[0]/=this._distance,I[1]/=this._distance,I[2]/=this._distance),this._pitch=z(I),this._yaw=x(I,k),this._size=Math.sqrt(t.width*t.width+t.height*t.height),this._fov=t.fov,this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(t){const e=this._lookAtOrientation(this.center,F);i(e,e),this._axisAngleVec3(S,this._pitch-Math.PI/2,O,I),this._axisAngleVec3(V,this._yaw,I,I),this._axisAngleVec3(S,this._pitch-Math.PI/2,V,k),this._axisAngleVec3(V,this._yaw,k,k),c(I,I,this._distance),r(I,I,e),r(k,k,e),t.center=this.center,t.eye=n(I,this.center,I),t.up=k,t.fov=this._fov}_axisAngleVec3(t,i,e,s){const a=Math.cos(i),o=Math.sin(i);return c(A,e,a),_(b,t,e),c(b,b,o),c(j,t,(1-a)*p(t,e)),m(s,m(s,A,b),j)}_lookAtOrientation(t,i=e()){return this._upAtLookAt(t,j),_(A,this.direction,j),f(A,A),0===A[0]&&0===A[1]&&0===A[2]&&h(A,S),_(b,j,A),f(b,b),i[0]=A[0],i[1]=b[0],i[2]=j[0],i[3]=A[1],i[4]=b[1],i[5]=j[1],i[6]=A[2],i[7]=b[2],i[8]=j[2],i}_upAtLookAt(t,i){return this.viewingMode===u.Local?h(i,V):f(i,t)}}function z(t){return Math.PI-w(V,t)}function x(t,i){const e=T;return Math.abs(i[2])<.5?(h(e,i),t[2]>0&&c(e,e,-1)):h(e,t),_(b,e,V),f(b,b),w(S,b,V)}const A=l(),b=l(),j=l(),I=l(),k=l(),T=l(),V=M,O=v,S=g,F=e();export{P as Camera};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{c as m,j as n,m as a}from"../../../../chunks/vec32.js";import{ConstraintOptions as t}from"./ConstraintOptions.js";import{ConstraintTypes as i}from"./ConstraintTypes.js";function o(m,n){return!!(m&n)}function r(m,n,a,t,i,o){0!==m&&(a?(o.min=Math.min(o.min,n),o.max=Math.max(o.max,n)):null!=t?(o.min-=Math.max(0,(n-o.min)*(1-t)),o.max+=Math.max(0,(n-o.max)*(1-t))):i&&(o.min-=Math.max(0,n-o.min-i),o.max+=Math.max(0,n-o.max-i)))}const s=new t(i.NONE);function x(t,i,o,r){return i=i||t.viewForward,m(r,i),n(r,r,Math.sign(a(i,o))),r}export{r as adjustRangeForInteraction,s as defaultConstraintOptions,o as hasConstraintType,x as interactionDirectionTowardsConstraintMinimization};
5
+ import{c as n,j as a,l as m}from"../../../../chunks/vec32.js";import{ConstraintOptions as t}from"./ConstraintOptions.js";import{ConstraintTypes as i}from"./ConstraintTypes.js";function o(n,a){return!!(n&a)}function r(n,a,m,t,i,o){0!==n&&(m?(o.min=Math.min(o.min,a),o.max=Math.max(o.max,a)):null!=t?(o.min-=Math.max(0,(a-o.min)*(1-t)),o.max+=Math.max(0,(a-o.max)*(1-t))):i&&(o.min-=Math.max(0,a-o.min-i),o.max+=Math.max(0,a-o.max-i)))}const s=new t(i.NONE);function x(t,i,o,r){return i=i||t.viewForward,n(r,i),a(r,r,Math.sign(m(i,o))),r}export{r as adjustRangeForInteraction,s as defaultConstraintOptions,o as hasConstraintType,x as interactionDirectionTowardsConstraintMinimization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{l as e,f as t,g as E,j as r}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as o}from"../intersectionUtils.js";function s(n,s,_=i.EYE){const a=n.state.constraints;if(!a.collision.enabled)return!1;const f=o(n,s.eye),N=n.renderCoordsHelper.getAltitude(s.eye),A=f+a.collision.elevationMargin;if(N>=A)return!1;const C=e(s.eye);if(t(c,s.center,s.eye),s.eye=n.renderCoordsHelper.setAltitude(l,A,s.eye),_===i.EYE_AND_CENTER)s.center=E(c,s.eye,c);else if(_===i.EYE_AND_CENTER_SCALE){const e=(C-N+A)/C;s.center=r(c,s.center,e)}return!0}var i;!function(e){e[e.EYE=0]="EYE",e[e.EYE_AND_CENTER=1]="EYE_AND_CENTER",e[e.EYE_AND_CENTER_SCALE=2]="EYE_AND_CENTER_SCALE"}(i||(i={}));const c=n(),l=n();export{i as Mode,s as applySurfaceCollisionConstraint};
5
+ import{m as e,f as t,g as E,j as r}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{surfaceElevationBelowRenderLocation as o}from"../intersectionUtils.js";function s(n,s,l=i.EYE){const a=n.state.constraints;if(!a.collision.enabled)return!1;const f=o(n,s.eye),N=n.renderCoordsHelper.getAltitude(s.eye),A=f+a.collision.elevationMargin;if(N>=A)return!1;const C=e(s.eye);if(t(c,s.center,s.eye),s.eye=n.renderCoordsHelper.setAltitude(_,A,s.eye),l===i.EYE_AND_CENTER)s.center=E(c,s.eye,c);else if(l===i.EYE_AND_CENTER_SCALE){const e=(C-N+A)/C;s.center=r(c,s.center,e)}return!0}var i;!function(e){e[e.EYE=0]="EYE",e[e.EYE_AND_CENTER=1]="EYE_AND_CENTER",e[e.EYE_AND_CENTER_SCALE=2]="EYE_AND_CENTER_SCALE"}(i||(i={}));const c=n(),_=n();export{i as Mode,s as applySurfaceCollisionConstraint};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{clamp as t,acosClamped as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{fromRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as o,h as c,j as u,g as l,p as m,m as f,n as d,l as p,q as y}from"../../../../chunks/vec32.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import{j as C,a as T,t as I}from"../../../../chunks/sphere.js";import{hasConstraintType as O,defaultConstraintOptions as A,adjustRangeForInteraction as D}from"./common.js";import{ConstraintTypes as S}from"./ConstraintTypes.js";import{InteractionType as j}from"./InteractionType.js";import{TiltMode as x}from"./TiltMode.js";import{viewAngle as R}from"../../state/utils/viewUtils.js";function w(t,r,n,i=!0){V.eyeCenterDistance=0,V.requiresTwoSteps=!1;const a=U(t,r,n,A,V);if(0===a)return!1;switch(s(_,-a,r.viewRight),n.tiltMode){case x.LOOK_AROUND:c(K,r.viewForward,_),u(K,K,V.eyeCenterDistance),r.center=l(z,r.eye,K);break;case x.TUMBLE:o(K,r.center,r.eye),c(K,K,_),r.eye=o(z,r.center,K);break;default:e(n.tiltMode)}return r.up=c(z,r.up,_),!V.requiresTwoSteps||!i||w(t,r,n,!1)}function U(e,t,r,n=A,i){if(!e.state.constraints.tilt)return 0;const s=t.distance,a=e.state.constraints.tilt(s,J);return k(e,r,a),n.interactionType===j.TUMBLE&&O(n.selection,S.ALTITUDE)&&B(e,n.interactionStartCamera,a),r.tiltMode===x.LOOK_AROUND||n.tiltMode===x.LOOK_AROUND?L(e,t,a,i):P(e,t,a)}function P(e,r,n){const i=R(e.renderCoordsHelper,r.center,r.eye),s=i-t(i,n.min,n.max);return v(s)?s:0}function L(e,t,r,n){switch(n&&(n.requiresTwoSteps=!1),e.viewingMode){case"global":return q(e,t,r,n);case"local":return g(e,t,r,n)}}function g(e,r,n,i){const s=R(e.renderCoordsHelper,r.center,r.eye),a=t(s,n.min,n.max),o=s-a;if(!v(o))return 0;if(i){const t=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,n=e.renderCoordsHelper.getAltitude(r.eye)-t,s=Math.cos(a);Math.abs(s)>1e-4?i.eyeCenterDistance=n/s:i.eyeCenterDistance=r.distance}return o}function q(e,r,n,i){const s=b(e,r,Q),a=t(s.tiltAtCenter,n.min,n.max);if(!v(s.tiltAtCenter-a))return 0;let o,c;return s.centerIsOnSurface?(o=H(s),c=F(s,o)):(o=s.constraints.clampTilt(s.eyeCenterDistance,s.tiltAtCenter),i&&o<Math.PI/2&&(i.requiresTwoSteps=!0,o=Math.PI/2-1e-5),c=N(s,o)),i&&(i.eyeCenterDistance=E(s,o)),c}function b(e,t,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,s=i+h(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,i,z);return n.eyeCenterDistance=t.distance,n.centerIsOnSurface=!1,null!=a?(n.eyeCenterDistance=m(t.eye,a),n.tiltAtCenter=R(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=R(e.renderCoordsHelper,t.center,t.eye):(C(T(I,s),t.ray,z),n.eyeCenterDistance=m(t.eye,z),n.tiltAtCenter=r(-f(t.viewForward,d(z,z)))),n.radius=s,n.eyeRadius=p(t.eye),n.constraints=e.state.constraints,n}function v(e){return Math.abs(e)>1e-9}function H(e){const{constraints:t,eyeCenterDistance:r,tiltAtCenter:n}=e;let i=n,s=t.clampTilt(r,n);const a=E(e,s);if(t.clampTilt(a,n)===s)return s;let o=0;for(;o<10&&v(s-i);){const r=(i+s)/2,n=E(e,r);v(t.clampTilt(n,r)-r)?i=r:s=r,o++}return s}function E(e,r){if(!e.centerIsOnSurface)return e.eyeCenterDistance;const i=Math.PI-t(r,0,Math.PI),s=n(e.radius/e.eyeRadius*Math.sin(i)),a=Math.PI-i-s,o=Math.sin(a)/Math.sin(i);if(e.eyeRadius<e.radius&&o>1){const t=Math.PI-s,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return o*e.eyeRadius}function F(e,t){const r=n(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),i=n(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?r-i:i-r}function N(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function k(e,t,r){if(t.interactionType===j.NONE)return;const{interactionStartCamera:n,interactionFactor:i}=t;if(!n)return;const{min:s,max:a}=r,o=U(e,n,A,t),c=0===o?0:R(e.renderCoordsHelper,n.center,n.eye);r.min=s,r.max=a,t.interactionType===j.TUMBLE?(O(t.selection,S.ALTITUDE)&&B(e,n,r),D(o,c,!0,i,G,r)):D(o,c,!1,i,G,r)}function B(e,t,n){const i=e.state.constraints;if(e.state.isLocal||!i.altitude||!t)return;const s=y(t.center),a=Math.sqrt(s),o=t.distance,c=h(e.spatialReference).radius,u=i.altitude.min+c,l=i.altitude.max+c,m=(u*u-o*o-s)/(-2*a*o),f=(l*l-o*o-s)/(-2*a*o);n.min=Math.max(n.min,Math.min(Math.PI-r(f),n.max)),n.max=Math.min(n.max,Math.PI-r(m))}const K=M(),_=a(),z=M(),G=i(5),J={min:0,max:0},Q={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,tiltAtCenter:0},V={eyeCenterDistance:0,requiresTwoSteps:!1};export{w as applyTiltConstraint,U as getTiltConstraintError};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{clamp as t,acosClamped as r,asinClamped as n,deg2rad as i}from"../../../../core/mathUtils.js";import{fromRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{f as o,h as c,j as u,g as l,p as m,l as f,n as d,m as p,q as y}from"../../../../chunks/vec32.js";import{create as M}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as h}from"../../../../geometry/ellipsoidUtils.js";import{j as C,a as T,t as I}from"../../../../chunks/sphere.js";import{hasConstraintType as O,defaultConstraintOptions as A,adjustRangeForInteraction as D}from"./common.js";import{ConstraintTypes as S}from"./ConstraintTypes.js";import{InteractionType as j}from"./InteractionType.js";import{TiltMode as x}from"./TiltMode.js";import{viewAngle as R}from"../../state/utils/viewUtils.js";function w(t,r,n,i=!0){V.eyeCenterDistance=0,V.requiresTwoSteps=!1;const a=U(t,r,n,A,V);if(0===a)return!1;switch(s(_,-a,r.viewRight),n.tiltMode){case x.LOOK_AROUND:c(K,r.viewForward,_),u(K,K,V.eyeCenterDistance),r.center=l(z,r.eye,K);break;case x.TUMBLE:o(K,r.center,r.eye),c(K,K,_),r.eye=o(z,r.center,K);break;default:e(n.tiltMode)}return r.up=c(z,r.up,_),!V.requiresTwoSteps||!i||w(t,r,n,!1)}function U(e,t,r,n=A,i){if(!e.state.constraints.tilt)return 0;const s=t.distance,a=e.state.constraints.tilt(s,J);return k(e,r,a),n.interactionType===j.TUMBLE&&O(n.selection,S.ALTITUDE)&&B(e,n.interactionStartCamera,a),r.tiltMode===x.LOOK_AROUND||n.tiltMode===x.LOOK_AROUND?L(e,t,a,i):P(e,t,a)}function P(e,r,n){const i=R(e.renderCoordsHelper,r.center,r.eye),s=i-t(i,n.min,n.max);return v(s)?s:0}function L(e,t,r,n){switch(n&&(n.requiresTwoSteps=!1),e.viewingMode){case"global":return q(e,t,r,n);case"local":return g(e,t,r,n)}}function g(e,r,n,i){const s=R(e.renderCoordsHelper,r.center,r.eye),a=t(s,n.min,n.max),o=s-a;if(!v(o))return 0;if(i){const t=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,n=e.renderCoordsHelper.getAltitude(r.eye)-t,s=Math.cos(a);Math.abs(s)>1e-4?i.eyeCenterDistance=n/s:i.eyeCenterDistance=r.distance}return o}function q(e,r,n,i){const s=b(e,r,Q),a=t(s.tiltAtCenter,n.min,n.max);if(!v(s.tiltAtCenter-a))return 0;let o,c;return s.centerIsOnSurface?(o=H(s),c=F(s,o)):(o=s.constraints.clampTilt(s.eyeCenterDistance,s.tiltAtCenter),i&&o<Math.PI/2&&(i.requiresTwoSteps=!0,o=Math.PI/2-1e-5),c=N(s,o)),i&&(i.eyeCenterDistance=E(s,o)),c}function b(e,t,n){const i=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,s=i+h(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,i,z);return n.eyeCenterDistance=t.distance,n.centerIsOnSurface=!1,null!=a?(n.eyeCenterDistance=m(t.eye,a),n.tiltAtCenter=R(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0):e.state.isLocal?n.tiltAtCenter=R(e.renderCoordsHelper,t.center,t.eye):(C(T(I,s),t.ray,z),n.eyeCenterDistance=m(t.eye,z),n.tiltAtCenter=r(-f(t.viewForward,d(z,z)))),n.radius=s,n.eyeRadius=p(t.eye),n.constraints=e.state.constraints,n}function v(e){return Math.abs(e)>1e-9}function H(e){const{constraints:t,eyeCenterDistance:r,tiltAtCenter:n}=e;let i=n,s=t.clampTilt(r,n);const a=E(e,s);if(t.clampTilt(a,n)===s)return s;let o=0;for(;o<10&&v(s-i);){const r=(i+s)/2,n=E(e,r);v(t.clampTilt(n,r)-r)?i=r:s=r,o++}return s}function E(e,r){if(!e.centerIsOnSurface)return e.eyeCenterDistance;const i=Math.PI-t(r,0,Math.PI),s=n(e.radius/e.eyeRadius*Math.sin(i)),a=Math.PI-i-s,o=Math.sin(a)/Math.sin(i);if(e.eyeRadius<e.radius&&o>1){const t=Math.PI-s,r=Math.PI-i-t;return Math.sin(r)/Math.sin(i)*e.eyeRadius}return o*e.eyeRadius}function F(e,t){const r=n(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),i=n(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?r-i:i-r}function N(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function k(e,t,r){if(t.interactionType===j.NONE)return;const{interactionStartCamera:n,interactionFactor:i}=t;if(!n)return;const{min:s,max:a}=r,o=U(e,n,A,t),c=0===o?0:R(e.renderCoordsHelper,n.center,n.eye);r.min=s,r.max=a,t.interactionType===j.TUMBLE?(O(t.selection,S.ALTITUDE)&&B(e,n,r),D(o,c,!0,i,G,r)):D(o,c,!1,i,G,r)}function B(e,t,n){const i=e.state.constraints;if(e.state.isLocal||!i.altitude||!t)return;const s=y(t.center),a=Math.sqrt(s),o=t.distance,c=h(e.spatialReference).radius,u=i.altitude.min+c,l=i.altitude.max+c,m=(u*u-o*o-s)/(-2*a*o),f=(l*l-o*o-s)/(-2*a*o);n.min=Math.max(n.min,Math.min(Math.PI-r(f),n.max)),n.max=Math.min(n.max,Math.PI-r(m))}const K=M(),_=a(),z=M(),G=i(5),J={min:0,max:0},Q={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,tiltAtCenter:0},V={eyeCenterDistance:0,requiresTwoSteps:!1};export{w as applyTiltConstraint,U as getTiltConstraintError};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{c as e,a as r,j as t,f as n,g as i,m as o,l as s}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as l}from"../../../geometry/support/aaBoundingRect.js";import{newIntersector as d}from"../webgl-engine/lib/Intersector.js";function u(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,M,n)&&l(t,M)}function f(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function g(o,s,a,c){const l=o.state.camera.clone();s&&a&&c&&(l.eye=s,l.center=a,l.up=c),p(o,l.ray,b)||e(b,l.center);const d=o.state.constraints,u=d.minimumPoiDistance;if(r(l.eye,b)<u){const r=d.collision.enabled;e(j,l.viewForward),t(j,j,u),r?l.eye=n(M,b,j):i(b,l.eye,j);const s=o.renderCoordsHelper,a=s.getAltitude(l.eye),c=d.collision.elevationMargin;r&&a<c&&(n(j,b,l.eye),l.eye=s.setAltitude(M,c,l.eye),i(b,l.eye,j))}return l.center=b,l}function m(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=f(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic,{far:s}=o.compute(t,n,e.renderDataExtent,i,w),a=s*s;return r(t,n)>a}function p(e,r,t){let n=v[e.viewingMode];n||(n=d(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,v[e.viewingMode]=n);const{isGlobal:i}=e.state;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||m(e,r.origin,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||m(e,r.origin,t))||!!i&&y(r,t,c(e.spatialReference).radius))}function y(e,r,n){const a=o(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/s(e.direction)),i(r,r,e.origin),!0}const v={},M=a(),b=a(),j=a(),w={near:0,far:0};export{g as cameraOnContentAlongViewDirection,u as eyeWithinExtent,f as surfaceElevationBelowRenderLocation};
5
+ import{c as e,s as r,j as t,f as n,g as i,l as o,m as s}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as l}from"../../../geometry/support/aaBoundingRect.js";import{newIntersector as d}from"../webgl-engine/lib/Intersector.js";function u(e,r,t,n){return null!=e.renderCoordsHelper.fromRenderCoords(r.eye,M,n)&&l(t,M)}function f(e,r){return e.elevationProvider?e.elevationProvider.getElevation(r[0],r[1],r[2],e.renderCoordsHelper.spatialReference,"ground")??0:0}function g(o,s,a,c){const l=o.state.camera.clone();s&&a&&c&&(l.eye=s,l.center=a,l.up=c),p(o,l.ray,b)||e(b,l.center);const d=o.state.constraints,u=d.minimumPoiDistance;if(r(l.eye,b)<u){const r=d.collision.enabled;e(j,l.viewForward),t(j,j,u),r?l.eye=n(M,b,j):i(b,l.eye,j);const s=o.renderCoordsHelper,a=s.getAltitude(l.eye),c=d.collision.elevationMargin;r&&a<c&&(n(j,b,l.eye),l.eye=s.setAltitude(M,c,l.eye),i(b,l.eye,j))}return l.center=b,l}function m(e,t,n){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;const i=f(e,t),o=e.stateManager.constraintsManager.nearFarHeuristic,{far:s}=o.compute(t,n,e.renderDataExtent,i,w),a=s*s;return r(t,n)>a}function p(e,r,t){let n=v[e.viewingMode];n||(n=d(e.state.viewingMode),n.options.backfacesTerrain=!e.state.isGlobal,n.options.invisibleTerrain=!0,v[e.viewingMode]=n);const{isGlobal:i}=e.state;return!(!e.sceneIntersectionHelper.intersectRay(r,n,t)||m(e,r.origin,t))||(!(!e.renderCoordsHelper.intersectManifold(r,0,t)||m(e,r.origin,t))||!!i&&y(r,t,c(e.spatialReference).radius))}function y(e,r,n){const a=o(e.origin,e.origin)-n*n,c=a>0?Math.sqrt(a)/3:1;return t(r,e.direction,c/s(e.direction)),i(r,r,e.origin),!0}const v={},M=a(),b=a(),j=a(),w={near:0,far:0};export{g as cameraOnContentAlongViewDirection,u as eyeWithinExtent,f as surfaceElevationBelowRenderLocation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{unitRGBAFromColor as e}from"../../../core/colorUtils.js";import t from"../../../core/Handles.js";import{clamp as s,lerp as i,smoothstep as a}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{set as n}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{s as h,l as m,q as c}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import{AtmosphereType as l}from"./AtmosphereType.js";import{atmosphereHeight as _,innerAtmosphereDepth as T,computeInnerAltitudeFade as f}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as b,ChapmanAtmosphereTechnique as q}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as g}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as v}from"../webgl/formats.js";import{createQuadVAO as w,Layout as P}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as E}from"../webgl-engine/lib/textureUtils.js";import{A as x}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as R}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as j}from"../../webgl/enums.js";import z from"../../../webscene/background/ColorBackground.js";class B{constructor(s,i){this._view=s,this._context=i,this.type=l.Realistic,this._handles=new t,this._compositingPassParameters=new x,this._passParameters=new b,this._rootTileElevationMin=NaN,this._lowerBoundEarthRadius=p.radius,this._fadeHaze=0,this._updateRadius(p.radius);const a=this._context.renderContext.rctx;this._updateRootTileElevationBounds(),this._handles.add([r((()=>this._view?.basemapTerrain?.rootTileElevationBounds),(()=>this._view?.basemapTerrain?this._updateRootTileElevationBounds():null)),r((()=>this._view?.basemapTerrain?.visibleElevationBounds),(()=>this._view?.basemapTerrain?this._updateVisibleElevationBounds():null)),r((()=>this._view?.environment.background),(t=>{const s=t instanceof z?e(t.color):d;h(this._passParameters.backgroundColor,s[0]*s[3],s[1]*s[3],s[2]*s[3])}),o)]);const n=new g;n.haze=!1,this._atmosphereTechnique=this._context.techniques.acquire(q,n),this._compositingTechnique=this._context.techniques.acquire(R,n),n.haze=!0,this._atmosphereHazeTechnique=this._context.techniques.acquire(q,n),this._compositingHazeTechnique=this._context.techniques.acquire(R,n),n.reduced=!0,n.haze=!1,this._atmosphereReducedTechnique=this._context.techniques.acquire(q,n),n.haze=!0,this._atmosphereHazeReducedTechnique=this._context.techniques.acquire(q,n),this._vao=w(a,P.Pos2Tex)}destroy(){this._handles.destroy(),this._compositingTechnique.release(),this._compositingHazeTechnique.release(),this._atmosphereTechnique.release(),this._atmosphereHazeTechnique.release(),this._atmosphereReducedTechnique.release(),this._atmosphereHazeReducedTechnique.release(),this._vao.dispose()}render(e,t,s){this._render(e,s?this._atmosphereTechnique:this._atmosphereReducedTechnique,t,s,!1)}renderHaze(e,t,s,i){this._fadeHaze=s,this._render(e,i?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,t,i,!0)}_render(e,t,s,a,r){if(!e.bindParameters.mainDepth)return;const o=e.rctx,n=s.get(r?"transparent-color":"opaque-color"),h=n.getAttachment(o.gl.DEPTH_STENCIL_ATTACHMENT),c=e.bindParameters.camera;if(this._update(c),a)n.detachDepth(),o.bindFramebuffer(n.fbo),o.bindTechnique(t,e.bindParameters,this._passParameters),this._renderCommon(o),n.attachDepth(h);else{const s=o.getViewport(),a=m(c.eye)-p.radius;let u;if(a<_){const e=Math.min(1,Math.max(0,a/_));u=r?i(.4,.5,e):i(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(a-_)/(15*_)));u=r?i(.5,1,e):i(.3,.6,e)}const d=E(Math.round(u*c.fullViewport[2])),l=E(Math.round(u*c.fullViewport[3]));o.setViewport(0,0,d,l);const T=this._context.fbos.acquire(d,l,r?"chapman haze":"chapman",v.RGBA);o.bindFramebuffer(T.fbo),o.clearFramebuffer([0,0,0,1],!0,!0),o.bindTechnique(t,e.bindParameters,this._passParameters),this._renderCommon(o),o.setViewport(s.x,s.y,s.width,s.height),this._compositingPassParameters.color=T.getTexture(),n.detachDepth(),o.bindFramebuffer(n.fbo);const f=r?this._compositingHazeTechnique:this._compositingTechnique;o.bindTechnique(f,e.bindParameters,this._compositingPassParameters),o.screen.draw(),n.attachDepth(h),T.release()}}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(j.TRIANGLE_STRIP,0,4))}_updateRootTileElevationBounds(){const e=this._view.basemapTerrain.rootTileElevationBounds.min;e!==this._rootTileElevationMin&&(this._rootTileElevationMin=e,this._lowerBoundEarthRadius=p.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=H(p.radius+this._view.basemapTerrain.visibleElevationBounds.min);e<this._lowerBoundEarthRadius&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,n(this._passParameters.radii,e,e+_),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-T)*T)}_update(e){if(!e)return;const t=c(e.eye),r=Math.sqrt(t),o=t-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((r-this._passParameters.radii[0])/_,0,1);u(this._passParameters.heightParameters,r,t,o,n),this._passParameters.altitudeFade=f(r-this._lowerBoundEarthRadius),this._passParameters.hazeStrength=i(i(.6,1,a(9500,10500,r-p.radius)),1,this._fadeHaze)}}function H(e){return e*Math.cos(Math.PI/16/16)}export{B as ChapmanAtmosphere};
5
+ import{unitRGBAFromColor as e}from"../../../core/colorUtils.js";import t from"../../../core/Handles.js";import{clamp as s,lerp as i,smoothstep as a}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{set as n}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{a as h,m,q as c}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import{AtmosphereType as l}from"./AtmosphereType.js";import{atmosphereHeight as _,innerAtmosphereDepth as T,computeInnerAltitudeFade as f}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as b,ChapmanAtmosphereTechnique as q}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as g}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as v}from"../webgl/formats.js";import{createQuadVAO as w,Layout as P}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as E}from"../webgl-engine/lib/textureUtils.js";import{A as x}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as R}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as j}from"../../webgl/enums.js";import z from"../../../webscene/background/ColorBackground.js";class B{constructor(s,i){this._view=s,this._context=i,this.type=l.Realistic,this._handles=new t,this._compositingPassParameters=new x,this._passParameters=new b,this._rootTileElevationMin=NaN,this._lowerBoundEarthRadius=p.radius,this._fadeHaze=0,this._updateRadius(p.radius);const a=this._context.renderContext.rctx;this._updateRootTileElevationBounds(),this._handles.add([r((()=>this._view?.basemapTerrain?.rootTileElevationBounds),(()=>this._view?.basemapTerrain?this._updateRootTileElevationBounds():null)),r((()=>this._view?.basemapTerrain?.visibleElevationBounds),(()=>this._view?.basemapTerrain?this._updateVisibleElevationBounds():null)),r((()=>this._view?.environment.background),(t=>{const s=t instanceof z?e(t.color):d;h(this._passParameters.backgroundColor,s[0]*s[3],s[1]*s[3],s[2]*s[3])}),o)]);const n=new g;n.haze=!1,this._atmosphereTechnique=this._context.techniques.acquire(q,n),this._compositingTechnique=this._context.techniques.acquire(R,n),n.haze=!0,this._atmosphereHazeTechnique=this._context.techniques.acquire(q,n),this._compositingHazeTechnique=this._context.techniques.acquire(R,n),n.reduced=!0,n.haze=!1,this._atmosphereReducedTechnique=this._context.techniques.acquire(q,n),n.haze=!0,this._atmosphereHazeReducedTechnique=this._context.techniques.acquire(q,n),this._vao=w(a,P.Pos2Tex)}destroy(){this._handles.destroy(),this._compositingTechnique.release(),this._compositingHazeTechnique.release(),this._atmosphereTechnique.release(),this._atmosphereHazeTechnique.release(),this._atmosphereReducedTechnique.release(),this._atmosphereHazeReducedTechnique.release(),this._vao.dispose()}render(e,t,s){this._render(e,s?this._atmosphereTechnique:this._atmosphereReducedTechnique,t,s,!1)}renderHaze(e,t,s,i){this._fadeHaze=s,this._render(e,i?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,t,i,!0)}_render(e,t,s,a,r){if(!e.bindParameters.mainDepth)return;const o=e.rctx,n=s.get(r?"transparent-color":"opaque-color"),h=n.getAttachment(o.gl.DEPTH_STENCIL_ATTACHMENT),c=e.bindParameters.camera;if(this._update(c),a)n.detachDepth(),o.bindFramebuffer(n.fbo),o.bindTechnique(t,e.bindParameters,this._passParameters),this._renderCommon(o),n.attachDepth(h);else{const s=o.getViewport(),a=m(c.eye)-p.radius;let u;if(a<_){const e=Math.min(1,Math.max(0,a/_));u=r?i(.4,.5,e):i(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(a-_)/(15*_)));u=r?i(.5,1,e):i(.3,.6,e)}const d=E(Math.round(u*c.fullViewport[2])),l=E(Math.round(u*c.fullViewport[3]));o.setViewport(0,0,d,l);const T=this._context.fbos.acquire(d,l,r?"chapman haze":"chapman",v.RGBA);o.bindFramebuffer(T.fbo),o.clearFramebuffer([0,0,0,1],!0,!0),o.bindTechnique(t,e.bindParameters,this._passParameters),this._renderCommon(o),o.setViewport(s.x,s.y,s.width,s.height),this._compositingPassParameters.color=T.getTexture(),n.detachDepth(),o.bindFramebuffer(n.fbo);const f=r?this._compositingHazeTechnique:this._compositingTechnique;o.bindTechnique(f,e.bindParameters,this._compositingPassParameters),o.screen.draw(),n.attachDepth(h),T.release()}}_renderCommon(e){null!=this._vao&&(e.bindVAO(this._vao),e.drawArrays(j.TRIANGLE_STRIP,0,4))}_updateRootTileElevationBounds(){const e=this._view.basemapTerrain.rootTileElevationBounds.min;e!==this._rootTileElevationMin&&(this._rootTileElevationMin=e,this._lowerBoundEarthRadius=p.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=H(p.radius+this._view.basemapTerrain.visibleElevationBounds.min);e<this._lowerBoundEarthRadius&&this._updateRadius(e)}_updateRadius(e){this._lowerBoundEarthRadius=e,n(this._passParameters.radii,e,e+_),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-T)*T)}_update(e){if(!e)return;const t=c(e.eye),r=Math.sqrt(t),o=t-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((r-this._passParameters.radii[0])/_,0,1);u(this._passParameters.heightParameters,r,t,o,n),this._passParameters.altitudeFade=f(r-this._lowerBoundEarthRadius),this._passParameters.hazeStrength=i(i(.6,1,a(9500,10500,r-p.radius)),1,this._fadeHaze)}}function H(e){return e*Math.cos(Math.PI/16/16)}export{B as ChapmanAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import"../webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js";import"../webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import"../webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../webgl-engine/core/shaderModules/Float3PassUniform.js";import"../webgl-engine/core/shaderModules/interfaces.js";import"../webgl-engine/core/shaderModules/Matrix4PassUniform.js";import"../webgl-engine/core/shaderModules/ShaderBuilder.js";import"../webgl-engine/lib/VertexAttribute.js";export{b as build}from"../../../chunks/CloudsComposition.glsl.js";
5
+ import"../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import"../webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js";import"../webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import"../webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import"../webgl-engine/core/shaderModules/Float3PassUniform.js";import"../webgl-engine/core/shaderModules/interfaces.js";import"../webgl-engine/core/shaderModules/Matrix4PassUniform.js";import"../webgl-engine/core/shaderModules/ShaderBuilder.js";import"../webgl-engine/lib/VertexAttribute.js";export{b as build}from"../../../chunks/CloudsComposition.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../core/mathUtils.js";import{rotate as a}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as e,n as o,j as r,f as h,c as d}from"../../../chunks/vec32.js";import{create as n,fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as F,fromPoints as l,axis as f}from"../../../geometry/support/axisAngleDegrees.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import{CloudsTextureChannels as u,CloudsFading as _,ensureClouds as m}from"./CloudsData.js";import{weatherHeightLimit as E}from"./weather.js";import{RenderState as D}from"../../support/RenderState.js";class A{constructor(){this.readChannels=u.RG,this.state=_.Finished,this.startTime=0,this.startTimeHeightFade=0,this.cameraPositionLastFrame=n(),this.parallax=new C,this.parallaxNew=new C,this.pointOnGround=n(),this.fadeMode=O.HIDE,this.fadeFactor=0,this.opacity=0}updateParallax(t){const s=this.parallax,o=e(t.eye);if(s.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(o*o-p.radius*p.radius,0))/o,l(g,s.anchorPointClouds,S),a(s.transform,i,S[3],f(S)),this.fadeMode===O.CROSS_FADE){const t=this.parallaxNew;l(g,t.anchorPointClouds,S),a(t.transform,i,S[3],f(S))}}updateFading(t,a,i,s){this.isFading&&this._advanceFading(i,s),this._evaluateFading(t,a,i)}_evaluateFading(t,a,i){const s=t.relativeElevation,e=this._calculateDistanceToAnchorPoint(t);if((s>1.7*E||s<-E||e>v)&&this.opacity>0)this._setFade(O.HIDE,i);else if(!this.isFading)if((s>E||s<-.35*E||e>x)&&this.opacity>0)this._setFade(O.FADE_OUT,i);else if(s<=E&&s>=-.35*E&&a===D.IDLE&&m(this.data)){if(0===this.opacity)return void this._setFade(O.FADE_IN,i);(e>N||this.state===_.Fading)&&this._setFade(O.CROSS_FADE,i)}}_advanceFading(t,a){this._switchReadChannels(),this._updateAnchorPoint(),this._advanceFadingFactorAndOpacity(t,a)}_advanceFadingFactorAndOpacity(a,i){if(this.fadeFactor<1)return this.fadeFactor=i?t((a-this.startTime)/(M*i),0,1):1,this.fadeMode===O.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===O.FADE_IN&&(this.opacity=this.fadeFactor),void(this.fadeMode===O.CROSS_FADE&&(this.opacity=1));this.fadeFactor=0,this.fadeMode===O.FADE_OUT&&(this.opacity=0),this.fadeMode===O.FADE_IN&&(this.opacity=1),this.fadeMode===O.CROSS_FADE&&(this.opacity=1),this.fadeMode=O.NONE}_switchReadChannels(){const t=this.fadeMode===O.CROSS_FADE&&1===this.fadeFactor,a=this.fadeMode===O.FADE_IN&&0===this.fadeFactor;this.state===_.Fading&&(t||a)&&(this.readChannels=1-this.readChannels,this.state=_.Finished)}_calculateDistanceToAnchorPoint(t){return o(this.pointOnGround,t.eye),r(this.pointOnGround,this.pointOnGround,p.radius),e(h(y,this.parallax.anchorPointClouds,this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===O.CROSS_FADE&&(0===this.fadeFactor&&d(this.parallaxNew.anchorPointClouds,this.pointOnGround),1===this.fadeFactor&&d(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds)),this.fadeMode===O.FADE_IN&&0===this.fadeFactor&&d(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(t,a){switch(t){case O.HIDE:this.opacity=0;break;case O.FADE_OUT:this.opacity=1;break;case O.FADE_IN:this.opacity=0;break;case O.CROSS_FADE:this.opacity=1}this.fadeMode=t,this.fadeFactor=0,this.startTime=a}get isFading(){return this.fadeMode===O.FADE_OUT||this.fadeMode===O.FADE_IN||this.fadeMode===O.CROSS_FADE}}var O;!function(t){t[t.NONE=0]="NONE",t[t.HIDE=1]="HIDE",t[t.FADE_OUT=2]="FADE_OUT",t[t.FADE_IN=3]="FADE_IN",t[t.CROSS_FADE=4]="CROSS_FADE"}(O||(O={}));class C{constructor(){this.anchorPointClouds=n(),this.radiusCurvatureCorrection=0,this.transform=s()}}const g=c(0,0,1),S=F(),y=n(),M=1.25,N=34e3,x=64e3,v=2e5;export{A as CloudsParameters,O as FadeMode,N as crossFadeDistanceThreshold,x as fadeOutDistanceThreshold,v as hideDistanceThreshold};
5
+ import{clamp as t}from"../../../core/mathUtils.js";import{rotate as a}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{m as e,n as o,j as r,f as h,c as d}from"../../../chunks/vec32.js";import{create as n,fromValues as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as F,fromPoints as l,axis as f}from"../../../geometry/support/axisAngleDegrees.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import{CloudsTextureChannels as u,CloudsFading as _,ensureClouds as m}from"./CloudsData.js";import{weatherHeightLimit as E}from"./weather.js";import{RenderState as D}from"../../support/RenderState.js";class A{constructor(){this.readChannels=u.RG,this.state=_.Finished,this.startTime=0,this.startTimeHeightFade=0,this.cameraPositionLastFrame=n(),this.parallax=new C,this.parallaxNew=new C,this.pointOnGround=n(),this.fadeMode=O.HIDE,this.fadeFactor=0,this.opacity=0}updateParallax(t){const s=this.parallax,o=e(t.eye);if(s.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(o*o-p.radius*p.radius,0))/o,l(g,s.anchorPointClouds,S),a(s.transform,i,S[3],f(S)),this.fadeMode===O.CROSS_FADE){const t=this.parallaxNew;l(g,t.anchorPointClouds,S),a(t.transform,i,S[3],f(S))}}updateFading(t,a,i,s){this.isFading&&this._advanceFading(i,s),this._evaluateFading(t,a,i)}_evaluateFading(t,a,i){const s=t.relativeElevation,e=this._calculateDistanceToAnchorPoint(t);if((s>1.7*E||s<-E||e>v)&&this.opacity>0)this._setFade(O.HIDE,i);else if(!this.isFading)if((s>E||s<-.35*E||e>x)&&this.opacity>0)this._setFade(O.FADE_OUT,i);else if(s<=E&&s>=-.35*E&&a===D.IDLE&&m(this.data)){if(0===this.opacity)return void this._setFade(O.FADE_IN,i);(e>N||this.state===_.Fading)&&this._setFade(O.CROSS_FADE,i)}}_advanceFading(t,a){this._switchReadChannels(),this._updateAnchorPoint(),this._advanceFadingFactorAndOpacity(t,a)}_advanceFadingFactorAndOpacity(a,i){if(this.fadeFactor<1)return this.fadeFactor=i?t((a-this.startTime)/(M*i),0,1):1,this.fadeMode===O.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===O.FADE_IN&&(this.opacity=this.fadeFactor),void(this.fadeMode===O.CROSS_FADE&&(this.opacity=1));this.fadeFactor=0,this.fadeMode===O.FADE_OUT&&(this.opacity=0),this.fadeMode===O.FADE_IN&&(this.opacity=1),this.fadeMode===O.CROSS_FADE&&(this.opacity=1),this.fadeMode=O.NONE}_switchReadChannels(){const t=this.fadeMode===O.CROSS_FADE&&1===this.fadeFactor,a=this.fadeMode===O.FADE_IN&&0===this.fadeFactor;this.state===_.Fading&&(t||a)&&(this.readChannels=1-this.readChannels,this.state=_.Finished)}_calculateDistanceToAnchorPoint(t){return o(this.pointOnGround,t.eye),r(this.pointOnGround,this.pointOnGround,p.radius),e(h(y,this.parallax.anchorPointClouds,this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===O.CROSS_FADE&&(0===this.fadeFactor&&d(this.parallaxNew.anchorPointClouds,this.pointOnGround),1===this.fadeFactor&&d(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds)),this.fadeMode===O.FADE_IN&&0===this.fadeFactor&&d(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(t,a){switch(t){case O.HIDE:this.opacity=0;break;case O.FADE_OUT:this.opacity=1;break;case O.FADE_IN:this.opacity=0;break;case O.CROSS_FADE:this.opacity=1}this.fadeMode=t,this.fadeFactor=0,this.startTime=a}get isFading(){return this.fadeMode===O.FADE_OUT||this.fadeMode===O.FADE_IN||this.fadeMode===O.CROSS_FADE}}var O;!function(t){t[t.NONE=0]="NONE",t[t.HIDE=1]="HIDE",t[t.FADE_OUT=2]="FADE_OUT",t[t.FADE_IN=3]="FADE_IN",t[t.CROSS_FADE=4]="CROSS_FADE"}(O||(O={}));class C{constructor(){this.anchorPointClouds=n(),this.radiusCurvatureCorrection=0,this.transform=s()}}const g=c(0,0,1),S=F(),y=n(),M=1.25,N=34e3,x=64e3,v=2e5;export{A as CloudsParameters,O as FadeMode,N as crossFadeDistanceThreshold,x as fadeOutDistanceThreshold,v as hideDistanceThreshold};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{lerp as t}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i,initial as a,sync as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{l,c as d,o as u}from"../../../chunks/vec32.js";import{fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import{isMoon as c,isEarth as _,isMars as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as w}from"../../ViewingMode.js";import{AtmosphereType as f}from"./AtmosphereType.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as v}from"./CloudsComposition.js";import{isReadyCloudsData as P,CloudsFading as R}from"./CloudsData.js";import{CloudsGenerator as x}from"./CloudsGenerator.js";import{FadeMode as b}from"./CloudsParameters.js";import{cloudPresets as A}from"./CloudsPresets.js";import{Fog as F,FogParameters as N}from"./Fog.js";import{LocalAtmosphere as W}from"./LocalAtmosphere.js";import j from"./MarsAtmosphere.js";import{Precipitation as E}from"./Precipitation.js";import{Stars as C}from"./Stars.js";import{weatherHeightLimit as M}from"./weather.js";import{SyncRenderPlugin as O,ConsumesDepth as z,ConsumesNone as T}from"../webgl-engine/effects/RenderPlugin.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";let U=class extends O{constructor(e){super(e),this.produces=new Map([[S.OPAQUE_ENVIRONMENT,()=>null!=this._atmosphere||null!=this._stars],[S.TRANSPARENT_ENVIRONMENT,()=>null!=this._atmosphere]]),this._context=null,this._atmosphere=null,this._oldWeatherParameters=new L,this._newWeatherParameters=new L,this._fadedWeatherParameters=new L,this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){this.removeHandles(),this.uninitializeRenderContext(),null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this),this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return null!=this.atmosphere?this.atmosphere.type:f.None}consumes(){return this._atmosphereType===f.Realistic?z:T}updateAnimation(e){return null!=this._precipitation&&this._precipitation.update(e)}get updating(){return!(!this._stars?.updating&&!this._clouds?.running)}get weatherVisible(){return l(this.view.state.camera.eye)-m(this.view.spatialReference).radius<=M}get usedMemory(){return this._clouds?.usedMemory??0}get _stars(){const e=this.view,t=e.environment?.starsEnabled??!1,r=this._get("_stars");return t&&null!=this._context?r??new C({view:e,requestRender:()=>this._setNeedsRender()}):(s(r),null)}get _precipitation(){const e=this._get("_precipitation");if(!this._precipitationEnabled||null==this._context)return s(e),null;const t=this.view,r=this._context;return null!=e&&e.context===r?e:(s(e),new E({context:r,view:t}))}get _clouds(){const e=this._get("_clouds");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context;return s(e),new x({context:r,view:t,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const e=this._get("_cloudsComposition");if(!this.weatherEnabled||null==this._context)return s(e),null;const t=this.view.state.viewingMode,r=this._context.renderContext.rctx,i=m(this.view.spatialReference).radius;return null!=e&&e.viewingMode===t&&e.planetRadius===i?e:(s(e),new v({rctx:r,viewingMode:t,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const e=this._get("_fog");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context,i=this._context.renderContext.rctx,a=this.view.state.viewingMode;return new F({context:r,view:t,rctx:i,viewingMode:a})}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(e=null){this._context=e;const t=()=>this._setNeedsRender();this.addHandles([r((()=>({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled})),(e=>this._updateAtmosphere(e)),i),r((()=>this._stars),t),r((()=>this._precipitation),t),r((()=>this._clouds),(()=>this._updateWeather()),a),r((()=>this._fog),(()=>this._updateFogHaze()),a),r((()=>this.view.state.mode),(()=>this._setNeedsRender()),o),r((()=>this._weatherUpdateParameters),(()=>{this._updateWeather(),this._updateFogHaze()}),i)])}uninitializeRenderContext(){this._context=null,this._atmosphere=s(this._atmosphere),this._set("_stars",s(this._stars)),this._set("_precipitation",s(this._precipitation)),this._set("_clouds",s(this._clouds)),this._set("_cloudsComposition",s(this._cloudsComposition)),this._set("_fog",s(this._fog))}prepareRender(e){e.bindParameters.cloudsFade.data=P(this._clouds)?this._clouds:null,"local"!==this.view.viewingMode&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&(this._updateWeatherFading(e.bindParameters,e.time),e.bindParameters.cloudsFade.state===R.Finished&&null!=this._clouds&&0===this._clouds.coverage&&!1===this._clouds.running&&(this._clouds.destroyFrameBufferCube(),e.bindParameters.cloudsFade.data=null))}renderNode(e,t,s){switch(e.bindParameters.slot){case S.OPAQUE_ENVIRONMENT:this._stars?.render(e),null!=this.atmosphere&&(this.atmosphere.render(e,s,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._cloudsComposition&&null!=e.bindParameters.cloudsFade.data&&(this.weatherVisible&&null!=this._clouds&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(e)),e.bindParameters.cloudsFade.isFading&&this._context&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&this._context.requestRender());break;case S.TRANSPARENT_ENVIRONMENT:if(this.atmosphere&&(this.atmosphere.renderHaze(e,s,this._weatherParameters.hazeAmount,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._weatherParameters.fog.amount>0&&null!=this._fog&&this._fog.render(e,s,this._weatherParameters.fog),this._precipitation)){const t=this.view.environment.weather;"rainy"!==t.type&&"snowy"!==t.type||this._precipitation.render(e,t.precipitation,t.type)}}}updateLighting(e,t,s,r){this._context?.renderContext.bindParameters.updateLighting(e,t,s,r),this._context?.requestRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return null==e?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeatherFading(e,t){e.cloudsFade.updateFading(e.camera,this.view.state.mode,t,this.view.qualitySettings.fadeDuration),e.cloudsFade.updateParallax(e.camera),e.weatherFading&&(V(e),this._updateFogAtmoshpere(e))}_updateFogAtmoshpere(e){e.cloudsFade.fadeMode!==b.CROSS_FADE&&e.cloudsFade.fadeMode!==b.FADE_IN?this._fadeWeather(0):this._fadeWeather(e.cloudsFade.fadeFactor)}_fadeWeather(e){const{_newWeatherParameters:t,_oldWeatherParameters:s}=this;e>=1?this._weatherParameters=t:(this._fadedWeatherParameters.lerp(s,t,e),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const e=this._weatherUpdateParameters;null!=e&&null!=this._clouds&&(this._clouds.applyPreset(A[e.type],e.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){null!=this._context&&this._context.requestRender()}_updateFogHaze(){const e=this._weatherUpdateParameters;if(null==this._fog||null==e||null==this._context)return;const s=this._context.renderContext.bindParameters;switch(this._oldWeatherParameters.copyFrom(this._weatherParameters),e.type){case"foggy":this._newWeatherParameters.fog.strength=t(3e-5,.005,e.weatherAdjustment**3),d(this._newWeatherParameters.fog.color,k),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;case"rainy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,q),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=0,this._setNeedsRender();break;case"snowy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,k),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}s.weatherFading?this._fadeWeather(0):this._fadeWeather(1)}_updateAtmosphere(e){const t=this._selectAtmosphereType(e);if(t!==f.None&&this._context){if(!this._atmosphere||this._atmosphere.type!==t){this._atmosphere=s(this._atmosphere);const e=this._getAtmosphereClass(t);e&&(this._atmosphere=new e(this.view,this._context))}}else this._atmosphere=s(this._atmosphere);this._setNeedsRender()}_getAtmosphereClass(e){switch(e){case f.Realistic:return y;case f.Local:return W;case f.Mars:return j;default:case f.None:return null}}_selectAtmosphereType(e){const{enabled:t,viewingMode:s}=e;return!t||c(this.view.spatialReference)?f.None:s===w.Local?f.Local:null!=this._context&&_(this.view.spatialReference)?f.Realistic:g(this.view.spatialReference)?f.Mars:f.None}get test(){}};e([n({constructOnly:!0})],U.prototype,"view",void 0),e([n({readOnly:!0})],U.prototype,"atmosphere",null),e([n({readOnly:!0})],U.prototype,"_atmosphereType",null),e([n({type:Boolean,readOnly:!0})],U.prototype,"updating",null),e([n({readOnly:!0})],U.prototype,"weatherVisible",null),e([n()],U.prototype,"_context",void 0),e([n()],U.prototype,"_atmosphere",void 0),e([n({readOnly:!0})],U.prototype,"_stars",null),e([n({readOnly:!0})],U.prototype,"_precipitation",null),e([n({readOnly:!0})],U.prototype,"_clouds",null),e([n({readOnly:!0})],U.prototype,"_cloudsComposition",null),e([n({readOnly:!0})],U.prototype,"_fog",null),e([n({readOnly:!0})],U.prototype,"weatherEnabled",null),e([n({readOnly:!0})],U.prototype,"_precipitationEnabled",null),e([n({readOnly:!0})],U.prototype,"_weatherUpdateParameters",null),U=e([h("esri.views.3d.environment.EnvironmentRenderer")],U);class L{constructor(){this.fog=new N,this.hazeAmount=1}copyFrom(e){this.fog.amount=e.fog.amount,this.hazeAmount=e.hazeAmount,this.fog.strength=e.fog.strength,d(this.fog.color,e.fog.color)}lerp(e,s,r){this.fog.amount=t(e.fog.amount,s.fog.amount,r),this.hazeAmount=t(e.hazeAmount,s.hazeAmount,r),this.fog.strength=t(e.fog.strength,s.fog.strength,r),u(this.fog.color,e.fog.color,s.fog.color,r)}}function V(e){e.cloudsFade.fadeMode!==b.CROSS_FADE&&e.cloudsFade.fadeMode!==b.FADE_IN?e.fadeLighting(0):e.fadeLighting(e.cloudsFade.fadeFactor)}const q=p(.5,.5,.5),k=p(1.5,1.5,1.5);export{U as EnvironmentRenderer,L as WeatherParameters};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{lerp as t}from"../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i,initial as a,sync as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{m as l,c as d,o as u}from"../../../chunks/vec32.js";import{fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import{isMoon as c,isEarth as _,isMars as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as w}from"../../ViewingMode.js";import{AtmosphereType as f}from"./AtmosphereType.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as v}from"./CloudsComposition.js";import{isReadyCloudsData as P,CloudsFading as R}from"./CloudsData.js";import{CloudsGenerator as x}from"./CloudsGenerator.js";import{FadeMode as b}from"./CloudsParameters.js";import{cloudPresets as A}from"./CloudsPresets.js";import{Fog as F,FogParameters as N}from"./Fog.js";import{LocalAtmosphere as W}from"./LocalAtmosphere.js";import j from"./MarsAtmosphere.js";import{Precipitation as E}from"./Precipitation.js";import{Stars as C}from"./Stars.js";import{weatherHeightLimit as M}from"./weather.js";import{SyncRenderPlugin as O,ConsumesDepth as z,ConsumesNone as T}from"../webgl-engine/effects/RenderPlugin.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";let U=class extends O{constructor(e){super(e),this.produces=new Map([[S.OPAQUE_ENVIRONMENT,()=>null!=this._atmosphere||null!=this._stars],[S.TRANSPARENT_ENVIRONMENT,()=>null!=this._atmosphere]]),this._context=null,this._atmosphere=null,this._oldWeatherParameters=new L,this._newWeatherParameters=new L,this._fadedWeatherParameters=new L,this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){this.removeHandles(),this.uninitializeRenderContext(),null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this),this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return null!=this.atmosphere?this.atmosphere.type:f.None}consumes(){return this._atmosphereType===f.Realistic?z:T}updateAnimation(e){return null!=this._precipitation&&this._precipitation.update(e)}get updating(){return!(!this._stars?.updating&&!this._clouds?.running)}get weatherVisible(){return l(this.view.state.camera.eye)-m(this.view.spatialReference).radius<=M}get usedMemory(){return this._clouds?.usedMemory??0}get _stars(){const e=this.view,t=e.environment?.starsEnabled??!1,r=this._get("_stars");return t&&null!=this._context?r??new C({view:e,requestRender:()=>this._setNeedsRender()}):(s(r),null)}get _precipitation(){const e=this._get("_precipitation");if(!this._precipitationEnabled||null==this._context)return s(e),null;const t=this.view,r=this._context;return null!=e&&e.context===r?e:(s(e),new E({context:r,view:t}))}get _clouds(){const e=this._get("_clouds");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context;return s(e),new x({context:r,view:t,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const e=this._get("_cloudsComposition");if(!this.weatherEnabled||null==this._context)return s(e),null;const t=this.view.state.viewingMode,r=this._context.renderContext.rctx,i=m(this.view.spatialReference).radius;return null!=e&&e.viewingMode===t&&e.planetRadius===i?e:(s(e),new v({rctx:r,viewingMode:t,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const e=this._get("_fog");if(!this.weatherEnabled||null==this._context)return s(e),null;if(null!=e)return e;const t=this.view,r=this._context,i=this._context.renderContext.rctx,a=this.view.state.viewingMode;return new F({context:r,view:t,rctx:i,viewingMode:a})}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(e=null){this._context=e;const t=()=>this._setNeedsRender();this.addHandles([r((()=>({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled})),(e=>this._updateAtmosphere(e)),i),r((()=>this._stars),t),r((()=>this._precipitation),t),r((()=>this._clouds),(()=>this._updateWeather()),a),r((()=>this._fog),(()=>this._updateFogHaze()),a),r((()=>this.view.state.mode),(()=>this._setNeedsRender()),o),r((()=>this._weatherUpdateParameters),(()=>{this._updateWeather(),this._updateFogHaze()}),i)])}uninitializeRenderContext(){this._context=null,this._atmosphere=s(this._atmosphere),this._set("_stars",s(this._stars)),this._set("_precipitation",s(this._precipitation)),this._set("_clouds",s(this._clouds)),this._set("_cloudsComposition",s(this._cloudsComposition)),this._set("_fog",s(this._fog))}prepareRender(e){e.bindParameters.cloudsFade.data=P(this._clouds)?this._clouds:null,"local"!==this.view.viewingMode&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&(this._updateWeatherFading(e.bindParameters,e.time),e.bindParameters.cloudsFade.state===R.Finished&&null!=this._clouds&&0===this._clouds.coverage&&!1===this._clouds.running&&(this._clouds.destroyFrameBufferCube(),e.bindParameters.cloudsFade.data=null))}renderNode(e,t,s){switch(e.bindParameters.slot){case S.OPAQUE_ENVIRONMENT:this._stars?.render(e),null!=this.atmosphere&&(this.atmosphere.render(e,s,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._cloudsComposition&&null!=e.bindParameters.cloudsFade.data&&(this.weatherVisible&&null!=this._clouds&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(e)),e.bindParameters.cloudsFade.isFading&&this._context&&null!=e.bindParameters.cloudsFade.data?.cubeMap&&this._context.requestRender());break;case S.TRANSPARENT_ENVIRONMENT:if(this.atmosphere&&(this.atmosphere.renderHaze(e,s,this._weatherParameters.hazeAmount,this.view?._stage?.renderer?.fullResolutionAtmosphere),this._weatherParameters.fog.amount>0&&null!=this._fog&&this._fog.render(e,s,this._weatherParameters.fog),this._precipitation)){const t=this.view.environment.weather;"rainy"!==t.type&&"snowy"!==t.type||this._precipitation.render(e,t.precipitation,t.type)}}}updateLighting(e,t,s,r){this._context?.renderContext.bindParameters.updateLighting(e,t,s,r),this._context?.requestRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return null==e?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeatherFading(e,t){e.cloudsFade.updateFading(e.camera,this.view.state.mode,t,this.view.qualitySettings.fadeDuration),e.cloudsFade.updateParallax(e.camera),e.weatherFading&&(V(e),this._updateFogAtmoshpere(e))}_updateFogAtmoshpere(e){e.cloudsFade.fadeMode!==b.CROSS_FADE&&e.cloudsFade.fadeMode!==b.FADE_IN?this._fadeWeather(0):this._fadeWeather(e.cloudsFade.fadeFactor)}_fadeWeather(e){const{_newWeatherParameters:t,_oldWeatherParameters:s}=this;e>=1?this._weatherParameters=t:(this._fadedWeatherParameters.lerp(s,t,e),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const e=this._weatherUpdateParameters;null!=e&&null!=this._clouds&&(this._clouds.applyPreset(A[e.type],e.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){null!=this._context&&this._context.requestRender()}_updateFogHaze(){const e=this._weatherUpdateParameters;if(null==this._fog||null==e||null==this._context)return;const s=this._context.renderContext.bindParameters;switch(this._oldWeatherParameters.copyFrom(this._weatherParameters),e.type){case"foggy":this._newWeatherParameters.fog.strength=t(3e-5,.005,e.weatherAdjustment**3),d(this._newWeatherParameters.fog.color,k),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;case"rainy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,q),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=0,this._setNeedsRender();break;case"snowy":this._newWeatherParameters.fog.strength=t(4e-6,2e-4,(e.effect??0)**3),d(this._newWeatherParameters.fog.color,k),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}s.weatherFading?this._fadeWeather(0):this._fadeWeather(1)}_updateAtmosphere(e){const t=this._selectAtmosphereType(e);if(t!==f.None&&this._context){if(!this._atmosphere||this._atmosphere.type!==t){this._atmosphere=s(this._atmosphere);const e=this._getAtmosphereClass(t);e&&(this._atmosphere=new e(this.view,this._context))}}else this._atmosphere=s(this._atmosphere);this._setNeedsRender()}_getAtmosphereClass(e){switch(e){case f.Realistic:return y;case f.Local:return W;case f.Mars:return j;default:case f.None:return null}}_selectAtmosphereType(e){const{enabled:t,viewingMode:s}=e;return!t||c(this.view.spatialReference)?f.None:s===w.Local?f.Local:null!=this._context&&_(this.view.spatialReference)?f.Realistic:g(this.view.spatialReference)?f.Mars:f.None}get test(){}};e([n({constructOnly:!0})],U.prototype,"view",void 0),e([n({readOnly:!0})],U.prototype,"atmosphere",null),e([n({readOnly:!0})],U.prototype,"_atmosphereType",null),e([n({type:Boolean,readOnly:!0})],U.prototype,"updating",null),e([n({readOnly:!0})],U.prototype,"weatherVisible",null),e([n()],U.prototype,"_context",void 0),e([n()],U.prototype,"_atmosphere",void 0),e([n({readOnly:!0})],U.prototype,"_stars",null),e([n({readOnly:!0})],U.prototype,"_precipitation",null),e([n({readOnly:!0})],U.prototype,"_clouds",null),e([n({readOnly:!0})],U.prototype,"_cloudsComposition",null),e([n({readOnly:!0})],U.prototype,"_fog",null),e([n({readOnly:!0})],U.prototype,"weatherEnabled",null),e([n({readOnly:!0})],U.prototype,"_precipitationEnabled",null),e([n({readOnly:!0})],U.prototype,"_weatherUpdateParameters",null),U=e([h("esri.views.3d.environment.EnvironmentRenderer")],U);class L{constructor(){this.fog=new N,this.hazeAmount=1}copyFrom(e){this.fog.amount=e.fog.amount,this.hazeAmount=e.hazeAmount,this.fog.strength=e.fog.strength,d(this.fog.color,e.fog.color)}lerp(e,s,r){this.fog.amount=t(e.fog.amount,s.fog.amount,r),this.hazeAmount=t(e.hazeAmount,s.hazeAmount,r),this.fog.strength=t(e.fog.strength,s.fog.strength,r),u(this.fog.color,e.fog.color,s.fog.color,r)}}function V(e){e.cloudsFade.fadeMode!==b.CROSS_FADE&&e.cloudsFade.fadeMode!==b.FADE_IN?e.fadeLighting(0):e.fadeLighting(e.cloudsFade.fadeFactor)}const q=p(.5,.5,.5),k=p(1.5,1.5,1.5);export{U as EnvironmentRenderer,L as WeatherParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{smoothstep as e}from"../../../core/mathUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{n as a,m as i,j as n,o as c,l as m}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{atmosphereHeight as u}from"./atmosphereUtils.js";import{F as l}from"../../../chunks/Fog.glsl.js";import{FogTechnique as d}from"./FogTechnique.js";import{weatherHeightLimit as g}from"./weather.js";const f=.95,_=1;let j=class extends s{constructor(t){super(t),this._passParameters=new l,this._technique=new d(t);const s=p(t.view.spatialReference);this._planetRadius=s.radius,this._atmosphereRadius=s.radius+u}destroy(){this._technique.release()}set strength(t){this._passParameters.fogStrength=t}get strength(){return this._passParameters.fogStrength}render(t,s,e){if(this._update(t,e),this._passParameters.fogAmount<=0)return;if(!this._technique.compiled)return void this.context.requestRender();const r=t.rctx,o=s.get("transparent-color"),a=o.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);o.attachDepth(null),r.bindFramebuffer(o.fbo),t.rctx.bindTechnique(this._technique,t.bindParameters,this._passParameters),t.rctx.screen.draw(),o.attachDepth(a)}_update(t,s){const r=t.bindParameters.camera;a(P,r.eye);const o=Math.max(0,i(P,t.bindParameters.lighting.mainLight.direction)),h=s.color;n(v,h,.1),c(this._passParameters.fogColor,v,h,o);const p=m(r.eye),u=p*p;this._passParameters.atmosphereC=u-this._atmosphereRadius**2,this._passParameters.fogAmount=(1-e(f*g,_*g,Math.abs(p-this._planetRadius)))*s.amount,this._passParameters.fogStrength=s.strength}};t([r({constructOnly:!0})],j.prototype,"context",void 0),t([r({constructOnly:!0})],j.prototype,"view",void 0),t([r({constructOnly:!0})],j.prototype,"rctx",void 0),t([r({constructOnly:!0})],j.prototype,"viewingMode",void 0),j=t([o("esri.views.3d.environment.Fog")],j);class y{constructor(){this.color=h(),this.strength=0,this.amount=0}}const P=h(),v=h();export{j as Fog,y as FogParameters};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{smoothstep as e}from"../../../core/mathUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{n as a,l as i,j as n,o as c,m}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{atmosphereHeight as u}from"./atmosphereUtils.js";import{F as l}from"../../../chunks/Fog.glsl.js";import{FogTechnique as d}from"./FogTechnique.js";import{weatherHeightLimit as g}from"./weather.js";const f=.95,_=1;let j=class extends s{constructor(t){super(t),this._passParameters=new l,this._technique=new d(t);const s=p(t.view.spatialReference);this._planetRadius=s.radius,this._atmosphereRadius=s.radius+u}destroy(){this._technique.release()}set strength(t){this._passParameters.fogStrength=t}get strength(){return this._passParameters.fogStrength}render(t,s,e){if(this._update(t,e),this._passParameters.fogAmount<=0)return;if(!this._technique.compiled)return void this.context.requestRender();const r=t.rctx,o=s.get("transparent-color"),a=o.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);o.attachDepth(null),r.bindFramebuffer(o.fbo),t.rctx.bindTechnique(this._technique,t.bindParameters,this._passParameters),t.rctx.screen.draw(),o.attachDepth(a)}_update(t,s){const r=t.bindParameters.camera;a(P,r.eye);const o=Math.max(0,i(P,t.bindParameters.lighting.mainLight.direction)),h=s.color;n(v,h,.1),c(this._passParameters.fogColor,v,h,o);const p=m(r.eye),u=p*p;this._passParameters.atmosphereC=u-this._atmosphereRadius**2,this._passParameters.fogAmount=(1-e(f*g,_*g,Math.abs(p-this._planetRadius)))*s.amount,this._passParameters.fogStrength=s.strength}};t([r({constructOnly:!0})],j.prototype,"context",void 0),t([r({constructOnly:!0})],j.prototype,"view",void 0),t([r({constructOnly:!0})],j.prototype,"rctx",void 0),t([r({constructOnly:!0})],j.prototype,"viewingMode",void 0),j=t([o("esri.views.3d.environment.Fog")],j);class y{constructor(){this.color=h(),this.strength=0,this.amount=0}}const P=h(),v=h();export{j as Fog,y as FogParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{lerp as e,clamp as t}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{lookAt as a}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{l as h,j as m,g as p,p as c,b as u,q as l}from"../../../chunks/vec32.js";import{create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as f}from"../../../geometry/support/FloatArray.js";import{AtmosphereType as g}from"./AtmosphereType.js";import{computeInnerAltitudeFade as b,innerAtmosphereDepth as x}from"./atmosphereUtils.js";import{S as j}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as R}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as V,SimpleAtmosphereGeometry as w}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as P}from"../support/mathUtils.js";import{glLayout as q}from"../support/buffer/glUtil.js";import{newLayout as y}from"../support/buffer/InterleavedLayout.js";import{Default3D as T}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as v}from"../webgl-engine/lib/glUtil3D.js";import{project as S}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as M}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as F}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as C}from"../../webgl/BufferObject.js";import{TextureWrapMode as U,PrimitiveType as W,Usage as I}from"../../webgl/enums.js";import{Texture as O}from"../../webgl/Texture.js";import{TextureDescriptor as D}from"../../webgl/TextureDescriptor.js";import{vertexCount as L}from"../../webgl/Util.js";const E=128,G=-x,H=0,N=50,k=()=>1-511/512,B=P([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class z{constructor(e,t){this.view=e,this.type=g.Mars,this._passParameters=new j,this._vaoCount=0,this._texV1=1;const s=d(e.spatialReference);this._planetRadius=s.radius,this._outerRimWidth=s.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+G)/this._planetRadius,this._middleRimFactor=(this._planetRadius+H)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=H/this._outerRimWidth,this._texVScale=this._texV1-this._texV0,this._techniques=t.techniques;const a=t.renderContext.rctx;this._cameraChangeHandle=r((()=>this.view.state?.camera),(()=>t.requestRender()),i),this._vao=this._createRibbon(a),this._vaoCount=L(this._vao,"geometry"),this._fadeVao=v(a),this._fadeVaoCount=L(this._fadeVao,"geometry");const o=new D;o.wrapMode=U.CLAMP_TO_EDGE,o.flipped=!0,o.width=1,o.height=512,this._passParameters.texture=new O(a,o,A);const n=new V;n.geometry=w.Cone,this._coneTechnique=this._techniques.acquire(R,n),n.geometry=w.Underground,this._undergroundTechnique=this._techniques.acquire(R,n)}destroy(){this._coneTechnique.release(),this._undergroundTechnique.release(),this._cameraChangeHandle.remove(),this._passParameters.texture=s(this._passParameters.texture),this._fadeVao.dispose(),this._vao.dispose()}render(e){const t=e.bindParameters.camera;this._update(t);const s=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(s.bindTechnique(this._coneTechnique,e.bindParameters,this._passParameters),s.bindVAO(this._vao),s.drawArrays(W.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(s.bindTechnique(this._undergroundTechnique,e.bindParameters,this._passParameters),s.bindVAO(this._fadeVao),s.drawArrays(W.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(s){const r=_(),i=this._planetRadius,a=h(s.eye),o=a-i;if(o<0){const e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const p=Math.max(N,o),c=i+G;this._passParameters.innerScale=Y(i+p,i,c)-1,this._passParameters.altitudeFade=b(o),m(r,s.eye,(i+N)/a),J(r,s.center,s.up,i,this._passParameters.silhouette);const u=this._computeScreenRimWidth(s,r,s.up,this._passParameters.silhouette),l=k(),d=B(o);let f=this._texV0+l*this._texVScale,g=this._texV0+u*d*this._texVScale;if(o>N){J(s.eye,s.center,s.up,i,this._passParameters.silhouette);const r=this._computeScreenRimWidth(s,s.eye,s.up,this._passParameters.silhouette),a=t((r-1.5)/(u-1.5),0,1);f=this._texV0+a*l*this._texVScale,g=this._texV0+e(this._texV1,u*d,a)*this._texVScale}n(this._passParameters.texV,f,g)}_createRibbon(e){const t=f(3+3*E*3),s=new Uint32Array(3*E*5);t[0]=0,t[1]=0,t[2]=-1;for(let a=0;a<E;a++){const e=9*a+3;t[e]=a,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=a,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=a,t[e+7]=this._outerRimFactor,t[e+8]=1;const r=3*a+1,i=a===E-1?1:r+3,o=15*a;s[o]=r,s[o+1]=r+1,s[o+2]=i+1,s[o+3]=i+1,s[o+4]=i,s[o+5]=r,s[o+6]=r+1,s[o+7]=r+2,s[o+8]=i+2,s[o+9]=i+2,s[o+10]=i+1,s[o+11]=r+1,s[o+12]=r,s[o+13]=i,s[o+14]=0}const r=Z.createBuffer(s.length),i=r.position;for(let a=0;a<s.length;++a){const e=3*s[a];i.set(a,0,t[e]),i.set(a,1,t[e+1]),i.set(a,2,t[e+2])}return new M(e,T,new Map([["geometry",q(Z)]]),new Map([["geometry",C.createVertex(e,I.STATIC_DRAW,r.buffer)]]))}_computeScreenRimWidth(e,t,s,r){return p(Q,r.center,r.v2),m(X,Q,this._outerRimFactor),a(K,t,Q,s),S(Q,K,e.projectionMatrix,e.viewport,Q),S(X,K,e.projectionMatrix,e.viewport,X),c(Q,X)/e.height}}function J(e,t,s,r,i){const a=h(e),o=r*Math.sqrt(a*a-r*r)/a,n=Math.sqrt(r*r-o*o),p=i.v1,c=i.v2;return m(i.center,e,n/a),u(p,e,t),l(p)<1&&u(p,e,s),m(p,p,o/h(p)),u(c,p,e),m(c,c,o/h(c)),o}const K=o(),Q=_(),X=_();function Y(e,t,s){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-s*s)+t*s)}const Z=y().vec3f(F.POSITION);export{z as default};
5
+ import{lerp as e,clamp as t}from"../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{lookAt as a}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{m as h,j as m,g as p,p as c,b as u,q as _}from"../../../chunks/vec32.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../../geometry/ellipsoidUtils.js";import{newFloatArray as f}from"../../../geometry/support/FloatArray.js";import{AtmosphereType as g}from"./AtmosphereType.js";import{computeInnerAltitudeFade as b,innerAtmosphereDepth as x}from"./atmosphereUtils.js";import{S as j}from"../../../chunks/SimpleAtmosphere.glsl.js";import{SimpleAtmosphereTechnique as R}from"./SimpleAtmosphereTechnique.js";import{SimpleAtmosphereTechniqueConfiguration as V,SimpleAtmosphereGeometry as w}from"./SimpleAtmosphereTechniqueConfiguration.js";import{marsAtmosphereTextureSimple as A}from"./resources/MarsAtmosphereTexture.js";import{makePiecewiseLinearFunction as P}from"../support/mathUtils.js";import{glLayout as q}from"../support/buffer/glUtil.js";import{newLayout as y}from"../support/buffer/InterleavedLayout.js";import{Default3D as T}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{createQuadVAO as v}from"../webgl-engine/lib/glUtil3D.js";import{project as S}from"../webgl-engine/lib/Util.js";import{VertexArrayObject as M}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as F}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as C}from"../../webgl/BufferObject.js";import{TextureWrapMode as U,PrimitiveType as W,Usage as I}from"../../webgl/enums.js";import{Texture as O}from"../../webgl/Texture.js";import{TextureDescriptor as D}from"../../webgl/TextureDescriptor.js";import{vertexCount as L}from"../../webgl/Util.js";const E=128,G=-x,H=0,N=50,k=()=>1-511/512,B=P([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);class z{constructor(e,t){this.view=e,this.type=g.Mars,this._passParameters=new j,this._vaoCount=0,this._texV1=1;const s=d(e.spatialReference);this._planetRadius=s.radius,this._outerRimWidth=s.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+G)/this._planetRadius,this._middleRimFactor=(this._planetRadius+H)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=H/this._outerRimWidth,this._texVScale=this._texV1-this._texV0,this._techniques=t.techniques;const a=t.renderContext.rctx;this._cameraChangeHandle=r((()=>this.view.state?.camera),(()=>t.requestRender()),i),this._vao=this._createRibbon(a),this._vaoCount=L(this._vao,"geometry"),this._fadeVao=v(a),this._fadeVaoCount=L(this._fadeVao,"geometry");const o=new D;o.wrapMode=U.CLAMP_TO_EDGE,o.flipped=!0,o.width=1,o.height=512,this._passParameters.texture=new O(a,o,A);const n=new V;n.geometry=w.Cone,this._coneTechnique=this._techniques.acquire(R,n),n.geometry=w.Underground,this._undergroundTechnique=this._techniques.acquire(R,n)}destroy(){this._coneTechnique.release(),this._undergroundTechnique.release(),this._cameraChangeHandle.remove(),this._passParameters.texture=s(this._passParameters.texture),this._fadeVao.dispose(),this._vao.dispose()}render(e){const t=e.bindParameters.camera;this._update(t);const s=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(s.bindTechnique(this._coneTechnique,e.bindParameters,this._passParameters),s.bindVAO(this._vao),s.drawArrays(W.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(s.bindTechnique(this._undergroundTechnique,e.bindParameters,this._passParameters),s.bindVAO(this._fadeVao),s.drawArrays(W.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(s){const r=l(),i=this._planetRadius,a=h(s.eye),o=a-i;if(o<0){const e=Math.min(-o/5e3,1);this._passParameters.undergroundFadeAlpha=e}else this._passParameters.undergroundFadeAlpha=0;const p=Math.max(N,o),c=i+G;this._passParameters.innerScale=Y(i+p,i,c)-1,this._passParameters.altitudeFade=b(o),m(r,s.eye,(i+N)/a),J(r,s.center,s.up,i,this._passParameters.silhouette);const u=this._computeScreenRimWidth(s,r,s.up,this._passParameters.silhouette),_=k(),d=B(o);let f=this._texV0+_*this._texVScale,g=this._texV0+u*d*this._texVScale;if(o>N){J(s.eye,s.center,s.up,i,this._passParameters.silhouette);const r=this._computeScreenRimWidth(s,s.eye,s.up,this._passParameters.silhouette),a=t((r-1.5)/(u-1.5),0,1);f=this._texV0+a*_*this._texVScale,g=this._texV0+e(this._texV1,u*d,a)*this._texVScale}n(this._passParameters.texV,f,g)}_createRibbon(e){const t=f(3+3*E*3),s=new Uint32Array(3*E*5);t[0]=0,t[1]=0,t[2]=-1;for(let a=0;a<E;a++){const e=9*a+3;t[e]=a,t[e+1]=this._innerRimFactor,t[e+2]=-1,t[e+3]=a,t[e+4]=this._middleRimFactor,t[e+5]=0,t[e+6]=a,t[e+7]=this._outerRimFactor,t[e+8]=1;const r=3*a+1,i=a===E-1?1:r+3,o=15*a;s[o]=r,s[o+1]=r+1,s[o+2]=i+1,s[o+3]=i+1,s[o+4]=i,s[o+5]=r,s[o+6]=r+1,s[o+7]=r+2,s[o+8]=i+2,s[o+9]=i+2,s[o+10]=i+1,s[o+11]=r+1,s[o+12]=r,s[o+13]=i,s[o+14]=0}const r=Z.createBuffer(s.length),i=r.position;for(let a=0;a<s.length;++a){const e=3*s[a];i.set(a,0,t[e]),i.set(a,1,t[e+1]),i.set(a,2,t[e+2])}return new M(e,T,new Map([["geometry",q(Z)]]),new Map([["geometry",C.createVertex(e,I.STATIC_DRAW,r.buffer)]]))}_computeScreenRimWidth(e,t,s,r){return p(Q,r.center,r.v2),m(X,Q,this._outerRimFactor),a(K,t,Q,s),S(Q,K,e.projectionMatrix,e.viewport,Q),S(X,K,e.projectionMatrix,e.viewport,X),c(Q,X)/e.height}}function J(e,t,s,r,i){const a=h(e),o=r*Math.sqrt(a*a-r*r)/a,n=Math.sqrt(r*r-o*o),p=i.v1,c=i.v2;return m(i.center,e,n/a),u(p,e,t),_(p)<1&&u(p,e,s),m(p,p,o/h(p)),u(c,p,e),m(c,c,o/h(c)),o}const K=o(),Q=l(),X=l();function Y(e,t,s){return e*e/(Math.sqrt(e*e-t*t)*Math.sqrt(e*e-s*s)+t*s)}const Z=y().vec3f(F.POSITION);export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as n,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{g as p,t as b,h as v,j as y,c as j,a as L,s as S,f as R}from"../../../chunks/vec32.js";import{create as O,ZEROS as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as A,projectPoint as E}from"../../../geometry/projection.js";import{computeENUToSphericalPCPFLocalRotation as D}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as F}from"../../../geometry/projection/projectors.js";import{containsPointObject as z}from"../../../geometry/support/aaBoundingRect.js";import{create as P,distance2 as C,fromPoints as I,closestRayDistance2 as x}from"../../../geometry/support/lineSegment.js";import{create as M,fromPositionAndNormal as k,intersectRay as U}from"../../../geometry/support/plane.js";import{create as W}from"../../../geometry/support/ray.js";import{sv3d as B}from"../../../geometry/support/vectorStacks.js";import{clonePoint as N,hydratedSpatialReference as H}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as q}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as G}from"../support/ElevationProvider.js";import{fromScreen as V}from"../support/geometryUtils/ray.js";import Y from"../webgl/RenderCamera.js";import{Object3D as J}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as K}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as Q}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as X,ManipulatorStateFlags as Z}from"../../interactive/interfaces.js";import $ from"../../../geometry/Point.js";class ee{constructor(e){this.metadata=void 0,this._camera=new Y,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new $({x:0,y:0,z:0}),this._elevationAlignedLocation=new $,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=X.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:r(),renderScreenPointArray:n(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){N(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){N(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=H(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),n=o*this.screenLocation.pixelSize,a=V(this._camera,s,re);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=x(I(e,o,oe),a);if(null!=l&&l<n*n){const t=p(B.get(),e,o);y(t,t,.5);const i=c(B.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=V(this._camera,s,re);if(null==c)return null;const h=l(ne,n),d=b(ue,e,h),_=v(ge,t,n);k(_,d,le);const u=_e;if(U(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=V(this._camera,s,re);if(null==h)return null;const d=l(ne,n),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);k(u,_,le);const g=_e;if(!U(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],n);for(let t=1;t<s.length;t++){const i=v(de,s[t],n),o=C(I(e,i,oe),g);if(null!=o&&o<a*a){const t=p(B.get(),e,i);y(t,t,.5);const s=c(B.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new Q(t,{pickable:!1,updatePolicy:K.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new $({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,fe,e.spatialReference)&&z(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=q(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=G(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(G(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(G(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?Z.Focused:Z.Unfocused)|(this.selected?Z.Selected:Z.Unselected),o=this._noDisplayCount>0;for(const{stateMask:r,objects:n}of i){if(o){for(const e of n)e.visible=!1;continue}const e=(r&Z.All)!==Z.None,i=(r&X.All)!==X.None,a=!e||(s&r)==(r&Z.All),c=!i||(this.state&r)==(r&X.All);if(a&&c)for(const s of n)s.visible=!0,s.transformation=t;else for(const t of n)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new J({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return F(t,0,he,0,o.radius),D(s(he[0]),s(he[1]),i),!0}}}const se=r(),oe=P(),re=W(),ne=h(),ae=m(),ce=m(),le=M(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=O(),fe=new $({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
5
+ import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as n,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{g as p,t as b,h as v,j as y,c as j,s as L,a as S,f as R}from"../../../chunks/vec32.js";import{create as O,ZEROS as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as A,projectPoint as E}from"../../../geometry/projection.js";import{computeENUToSphericalPCPFLocalRotation as D}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as F}from"../../../geometry/projection/projectors.js";import{containsPointObject as z}from"../../../geometry/support/aaBoundingRect.js";import{create as P,distance2 as C,fromPoints as I,closestRayDistance2 as x}from"../../../geometry/support/lineSegment.js";import{create as M,fromPositionAndNormal as k,intersectRay as U}from"../../../geometry/support/plane.js";import{create as W}from"../../../geometry/support/ray.js";import{sv3d as B}from"../../../geometry/support/vectorStacks.js";import{clonePoint as N,hydratedSpatialReference as H}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as q}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as G}from"../support/ElevationProvider.js";import{fromScreen as V}from"../support/geometryUtils/ray.js";import Y from"../webgl/RenderCamera.js";import{Object3D as J}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as K}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as Q}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as X,ManipulatorStateFlags as Z}from"../../interactive/interfaces.js";import $ from"../../../geometry/Point.js";class ee{constructor(e){this.metadata=void 0,this._camera=new Y,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new $({x:0,y:0,z:0}),this._elevationAlignedLocation=new $,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=X.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:r(),renderScreenPointArray:n(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){N(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){N(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=H(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),n=o*this.screenLocation.pixelSize,a=V(this._camera,s,re);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=x(I(e,o,oe),a);if(null!=l&&l<n*n){const t=p(B.get(),e,o);y(t,t,.5);const i=c(B.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=V(this._camera,s,re);if(null==c)return null;const h=l(ne,n),d=b(ue,e,h),_=v(ge,t,n);k(_,d,le);const u=_e;if(U(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=V(this._camera,s,re);if(null==h)return null;const d=l(ne,n),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);k(u,_,le);const g=_e;if(!U(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],n);for(let t=1;t<s.length;t++){const i=v(de,s[t],n),o=C(I(e,i,oe),g);if(null!=o&&o<a*a){const t=p(B.get(),e,i);y(t,t,.5);const s=c(B.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new Q(t,{pickable:!1,updatePolicy:K.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),A(this._location.spatialReference,this.view.spatialReference)||(this.location=new $({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){E(this.location,fe,e.spatialReference)&&z(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=q(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=G(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(G(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(G(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?Z.Focused:Z.Unfocused)|(this.selected?Z.Selected:Z.Unselected),o=this._noDisplayCount>0;for(const{stateMask:r,objects:n}of i){if(o){for(const e of n)e.visible=!1;continue}const e=(r&Z.All)!==Z.None,i=(r&X.All)!==X.None,a=!e||(s&r)==(r&Z.All),c=!i||(this.state&r)==(r&X.All);if(a&&c)for(const s of n)s.visible=!0,s.transformation=t;else for(const t of n)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new J({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return F(t,0,he,0,o.radius),D(s(he[0]),s(he[1]),i),!0}}}const se=r(),oe=P(),re=W(),ne=h(),ae=m(),ce=m(),le=M(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=O(),fe=new $({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../geometry.js";import{screenPointObjectToArray as e,castScreenPointArray as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{l as t,c as o,b as l,f as s,m as c,j as a,g as i}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPoint as p}from"../../../../geometry/projection.js";import{intersectRay as m,create as d,getNormal as f,fromPositionAndNormal as g}from"../../../../geometry/support/plane.js";import{create as E,closestPoints as y}from"../../../../geometry/support/ray.js";import{projectPoint as S}from"../../../../geometry/support/vector.js";import{sv2d as j}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as R}from"../../../../support/elevationInfoUtils.js";import{fromScreen as v}from"../../support/geometryUtils/ray.js";import{newIntersector as x}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as b,IntersectorType as w}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{terrainId as I}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{EventPipeline as H}from"../../../interactive/dragEventPipeline.js";import U from"../../../../geometry/Point.js";function O(e,n){return P(e,(()=>n))}function C(e){return P(e,(e=>e.plane))}function P(r,t){const o=u(),l=u();let s=!1;return c=>{const a=t(c);if("start"===c.action){const t=e(c.screenStart,n(j.get())),l=v(r.state.camera,t,K);null!=l&&(s=m(a,l,o))}if(!s)return null;const i=e(c.screenEnd,n(j.get())),u=v(r.state.camera,i,K);return null==u?null:m(a,u,l)?{...c,renderStart:o,renderEnd:l,plane:a,ray:u}:null}}function T(e,n,t=0,o=null,l=null){let s=null;return c=>{if("start"===c.action&&(s=e.sceneIntersectionHelper.intersectElevationFromScreen(r(c.screenStart.x,c.screenStart.y),n,t,l),null!=s&&null!=o&&!p(s,s,o)))return null;if(null==s)return null;const a=e.sceneIntersectionHelper.intersectElevationFromScreen(r(c.screenEnd.x,c.screenEnd.y),n,t,l);return null!=a&&(null==o||p(a,a,o))?{...c,mapStart:s,mapEnd:a}:null}}function D(e,n,r,t=null,o=null){return T(e,r,R(n,e,r),t,o)}function M(e,n,r,t){const o=r.toMap(e.screenStart);return null!=o?D(n,o,r.elevationInfo,t):null}function N(e,n){const r=B,t=J,o=d();e.renderCoordsHelper.worldUpAtPosition(n,r);const c=l(f(o),r,s(t,n,e.state.camera.eye));return l(c,c,r),g(n,c,o)}function G(e,n,r){let t=null;const o=new H;return o.next(O(e,N(e,n))).next(h(e,n)).next(A(e,r)).next((e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,t=e})),e=>(t=null,o.execute(e),t)}function h(e,n){const r=u(),l=t(n);e.renderCoordsHelper.worldUpAtPosition(n,r);const p=u(),m=u(),d=o=>{if(s(o,o,n),S(r,o,o),"global"===e.viewingMode){t(o)*Math.sign(c(r,o))<.001-l&&s(o,a(o,r,.001),n)}return i(o,o,n),o};return e=>(e.renderStart=d(o(p,e.renderStart)),e.renderEnd=d(o(m,e.renderEnd)),e)}function k(r,t){const o=o=>{const l=e(o,n(j.get())),s=v(r.state.camera,l,K);return null==s?null:y(t,s,B,J)[1]};return e=>{const n=o(e.screenStart);if(null==n)return null;const r=o(e.screenEnd);return null==r?null:{...e,renderStart:n,renderEnd:r}}}function A(e,n){const r=e.renderCoordsHelper;return e=>{const t=r.fromRenderCoords(e.renderStart,new U({spatialReference:n})),o=r.fromRenderCoords(e.renderEnd,new U({spatialReference:n}));return null!=t&&null!=o?{...e,mapStart:t,mapEnd:o}:null}}var F;function q(e){let n=null;return r=>{switch(r.action){case"start":n=e.disableDisplay();break;case"end":case"cancel":null!=n&&(n.remove(),n=null)}return r}}function z(n,t=null){const o=x(n.state.viewingMode);o.options.selectionMode=!0,o.options.store=b.MIN,o.options.hud=!1;const l=r(),s={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},c=u(),a=t??n.spatialReference,i=r=>{n.map.ground&&n.map.ground.opacity<1?s.exclude.add(I):s.exclude.delete(I),n.sceneIntersectionHelper.intersectIntersectorScreen(e(r,l),o,s);const t=o.results.min;let i;if(t.getIntersectionPoint(c))i=t.intersector===w.TERRAIN?F.GROUND:F.OTHER;else{if(!o.results.ground.getIntersectionPoint(c))return null;i=F.GROUND}return{location:n.renderCoordsHelper.fromRenderCoords(c,new U({spatialReference:a})),surfaceType:i}};let p;return e=>{if("start"===e.action){const n=i(e.screenStart);p=null!=n?n.location:null}if(null==p)return null;const n=i(e.screenEnd);return null!=n?.location?{...e,mapStart:p,mapEnd:n.location,surfaceType:n.surfaceType}:null}}!function(e){e[e.GROUND=0]="GROUND",e[e.OTHER=1]="OTHER"}(F||(F={}));const B=u(),J=u(),K=E();export{F as SurfaceType,A as convertToMapCoordinates,q as hideManipulatorWhileDragging,h as projectToWorldUp,z as screenToMap3D,D as screenToMapXYAtLocation,M as screenToMapXYForManipulatedObject,O as screenToRenderPlane,C as screenToRenderPlaneFromEvent,k as screenToRenderRay,G as screenToZConstrained};
5
+ import"../../../../geometry.js";import{screenPointObjectToArray as e,castScreenPointArray as n,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{m as t,c as o,b as l,f as s,l as c,j as a,g as i}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPoint as p}from"../../../../geometry/projection.js";import{intersectRay as m,create as d,getNormal as f,fromPositionAndNormal as g}from"../../../../geometry/support/plane.js";import{create as E,closestPoints as y}from"../../../../geometry/support/ray.js";import{projectPoint as S}from"../../../../geometry/support/vector.js";import{sv2d as j}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as R}from"../../../../support/elevationInfoUtils.js";import{fromScreen as v}from"../../support/geometryUtils/ray.js";import{newIntersector as x}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as b,IntersectorType as w}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{terrainId as I}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{EventPipeline as H}from"../../../interactive/dragEventPipeline.js";import U from"../../../../geometry/Point.js";function O(e,n){return P(e,(()=>n))}function C(e){return P(e,(e=>e.plane))}function P(r,t){const o=u(),l=u();let s=!1;return c=>{const a=t(c);if("start"===c.action){const t=e(c.screenStart,n(j.get())),l=v(r.state.camera,t,K);null!=l&&(s=m(a,l,o))}if(!s)return null;const i=e(c.screenEnd,n(j.get())),u=v(r.state.camera,i,K);return null==u?null:m(a,u,l)?{...c,renderStart:o,renderEnd:l,plane:a,ray:u}:null}}function T(e,n,t=0,o=null,l=null){let s=null;return c=>{if("start"===c.action&&(s=e.sceneIntersectionHelper.intersectElevationFromScreen(r(c.screenStart.x,c.screenStart.y),n,t,l),null!=s&&null!=o&&!p(s,s,o)))return null;if(null==s)return null;const a=e.sceneIntersectionHelper.intersectElevationFromScreen(r(c.screenEnd.x,c.screenEnd.y),n,t,l);return null!=a&&(null==o||p(a,a,o))?{...c,mapStart:s,mapEnd:a}:null}}function D(e,n,r,t=null,o=null){return T(e,r,R(n,e,r),t,o)}function M(e,n,r,t){const o=r.toMap(e.screenStart);return null!=o?D(n,o,r.elevationInfo,t):null}function N(e,n){const r=B,t=J,o=d();e.renderCoordsHelper.worldUpAtPosition(n,r);const c=l(f(o),r,s(t,n,e.state.camera.eye));return l(c,c,r),g(n,c,o)}function G(e,n,r){let t=null;const o=new H;return o.next(O(e,N(e,n))).next(h(e,n)).next(A(e,r)).next((e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,t=e})),e=>(t=null,o.execute(e),t)}function h(e,n){const r=u(),l=t(n);e.renderCoordsHelper.worldUpAtPosition(n,r);const p=u(),m=u(),d=o=>{if(s(o,o,n),S(r,o,o),"global"===e.viewingMode){t(o)*Math.sign(c(r,o))<.001-l&&s(o,a(o,r,.001),n)}return i(o,o,n),o};return e=>(e.renderStart=d(o(p,e.renderStart)),e.renderEnd=d(o(m,e.renderEnd)),e)}function k(r,t){const o=o=>{const l=e(o,n(j.get())),s=v(r.state.camera,l,K);return null==s?null:y(t,s,B,J)[1]};return e=>{const n=o(e.screenStart);if(null==n)return null;const r=o(e.screenEnd);return null==r?null:{...e,renderStart:n,renderEnd:r}}}function A(e,n){const r=e.renderCoordsHelper;return e=>{const t=r.fromRenderCoords(e.renderStart,new U({spatialReference:n})),o=r.fromRenderCoords(e.renderEnd,new U({spatialReference:n}));return null!=t&&null!=o?{...e,mapStart:t,mapEnd:o}:null}}var F;function q(e){let n=null;return r=>{switch(r.action){case"start":n=e.disableDisplay();break;case"end":case"cancel":null!=n&&(n.remove(),n=null)}return r}}function z(n,t=null){const o=x(n.state.viewingMode);o.options.selectionMode=!0,o.options.store=b.MIN,o.options.hud=!1;const l=r(),s={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},c=u(),a=t??n.spatialReference,i=r=>{n.map.ground&&n.map.ground.opacity<1?s.exclude.add(I):s.exclude.delete(I),n.sceneIntersectionHelper.intersectIntersectorScreen(e(r,l),o,s);const t=o.results.min;let i;if(t.getIntersectionPoint(c))i=t.intersector===w.TERRAIN?F.GROUND:F.OTHER;else{if(!o.results.ground.getIntersectionPoint(c))return null;i=F.GROUND}return{location:n.renderCoordsHelper.fromRenderCoords(c,new U({spatialReference:a})),surfaceType:i}};let p;return e=>{if("start"===e.action){const n=i(e.screenStart);p=null!=n?n.location:null}if(null==p)return null;const n=i(e.screenEnd);return null!=n?.location?{...e,mapStart:p,mapEnd:n.location,surfaceType:n.surfaceType}:null}}!function(e){e[e.GROUND=0]="GROUND",e[e.OTHER=1]="OTHER"}(F||(F={}));const B=u(),J=u(),K=E();export{F as SurfaceType,A as convertToMapCoordinates,q as hideManipulatorWhileDragging,h as projectToWorldUp,z as screenToMap3D,D as screenToMapXYAtLocation,M as screenToMapXYForManipulatedObject,O as screenToRenderPlane,C as screenToRenderPlaneFromEvent,k as screenToRenderRay,G as screenToZConstrained};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as s}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as o,when as n,syncAndInitial as a,initial as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{s as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as w}from"../meshFastUpdateUtils.js";import{Settings as y}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as I}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as L}from"../../../layers/graphics/GraphicState.js";import{RenderOccludedFlag as S}from"../../../webgl-engine/lib/Material.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as G}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as x}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as C,ElevationDrawSurface as O}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as T}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as b}from"../../../../../core/accessorSupport/trackingUtils.js";let z=class extends D{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new y({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,s=this._createGraphicState=new L({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(s),o((()=>({element:this._outlineVisualElement,isDraped:s.isDraped})),(({element:e,isDraped:t})=>{e&&(e.isDraped=t)}),a),b((()=>{T(this.tooltipInfos.mesh,this.geometryToPlace)})),this._setupLoadingIndicator(s),...w(s)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new x({view:this.view,manipulators:this.manipulators,geometryType:G(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new O(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),s();const a=this._settings,c=a.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=a.visualElements.zVerticalLine,h=new V({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:S.OccludeAndTransparent,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o((()=>a.visualElements.zVerticalLine),(e=>e.apply(h)),l),o((()=>({selectedColor:t(a.colors.selected),outlineColor:t(a.manipulators.vertex.outlineColor)})),(({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),l),s((()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement),this._verticalLineVisualElement=r(this._verticalLineVisualElement)}))]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:s}=this.view;p(A,e[0],e[1],e[2]),U.setFromElevationInfo(this.elevationInfo),A[2]=j(A,s,U,i);i.toRenderCoords(A,this.view.spatialReference,A)?(t.setStartEndFromWorldDownAtLocation(A),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,s();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,a=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o((()=>a.visualElements.lineObjects.outline),(e=>e.apply(c)),l),o((()=>a.visualElements.lineObjects.shadowStyle),(e=>e.apply(c)),l),s((()=>{this._outlineVisualElement=r(this._outlineVisualElement)}))]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,s();const{view:n}=this,a=this._settings,c=a.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o((()=>({color:t(a.manipulators.vertex.color),outlineColor:t(a.manipulators.vertex.outlineColor)})),(({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),l),s((()=>{this._verticesVisualElement=r(this._verticesVisualElement)}))]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"!==this.geometryType||"point"!==e?.type)super.updateGraphicGeometry(e);else{const t=this.geometryToPlace;t?.centerAt(e),T(this.tooltipInfos.mesh,t);const i=this._graphic;t&&i.geometry===t||(i.geometry=t)}}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const r=s((()=>{t.loading=!1}));let o;const l=()=>o&&cancelAnimationFrame(o);return i([n((()=>e.displaying),(()=>{l(),o=requestAnimationFrame((()=>r.remove()))}),{...a,once:!0}),s(l),r])}};e([c({constructOnly:!0})],z.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],z.prototype,"geometryType",void 0),e([c()],z.prototype,"type",void 0),e([c({constructOnly:!0})],z.prototype,"view",void 0),z=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],z);const U=new I,A=h();export{z as DrawGraphicTool3D};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,when as n,syncAndInitial as a,initial as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{a as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as w}from"../meshFastUpdateUtils.js";import{Settings as y}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as I}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as L}from"../../../layers/graphics/GraphicState.js";import{RenderOccludedFlag as S}from"../../../webgl-engine/lib/Material.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as G}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as x}from"../../../../draw/DrawOperation.js";import{SceneDrawSurface as C,ElevationDrawSurface as O}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as T}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as b}from"../../../../../core/accessorSupport/trackingUtils.js";let z=class extends D{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new y({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new L({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o((()=>({element:this._outlineVisualElement,isDraped:r.isDraped})),(({element:e,isDraped:t})=>{e&&(e.isDraped=t)}),a),b((()=>{T(this.tooltipInfos.mesh,this.geometryToPlace)})),this._setupLoadingIndicator(r),...w(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new x({view:this.view,manipulators:this.manipulators,geometryType:G(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new O(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const a=this._settings,c=a.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=a.visualElements.zVerticalLine,h=new V({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:S.OccludeAndTransparent,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o((()=>a.visualElements.zVerticalLine),(e=>e.apply(h)),l),o((()=>({selectedColor:t(a.colors.selected),outlineColor:t(a.manipulators.vertex.outlineColor)})),(({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),l),r((()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)}))]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(A,e[0],e[1],e[2]),U.setFromElevationInfo(this.elevationInfo),A[2]=j(A,r,U,i);i.toRenderCoords(A,this.view.spatialReference,A)?(t.setStartEndFromWorldDownAtLocation(A),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,a=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o((()=>a.visualElements.lineObjects.outline),(e=>e.apply(c)),l),o((()=>a.visualElements.lineObjects.shadowStyle),(e=>e.apply(c)),l),r((()=>{this._outlineVisualElement=s(this._outlineVisualElement)}))]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,a=this._settings,c=a.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o((()=>({color:t(a.manipulators.vertex.color),outlineColor:t(a.manipulators.vertex.outlineColor)})),(({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),l),r((()=>{this._verticesVisualElement=s(this._verticesVisualElement)}))]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"!==this.geometryType||"point"!==e?.type)super.updateGraphicGeometry(e);else{const t=this.geometryToPlace;t?.centerAt(e),T(this.tooltipInfos.mesh,t);const i=this._graphic;t&&i.geometry===t||(i.geometry=t)}}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const s=r((()=>{t.loading=!1}));let o;const l=()=>o&&cancelAnimationFrame(o);return i([n((()=>e.displaying),(()=>{l(),o=requestAnimationFrame((()=>s.remove()))}),{...a,once:!0}),r(l),s])}};e([c({constructOnly:!0})],z.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],z.prototype,"geometryType",void 0),e([c()],z.prototype,"type",void 0),e([c({constructOnly:!0})],z.prototype,"view",void 0),z=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],z);const U=new I,A=h();export{z as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{removeHandles as e,handlesGroup as t,destroyHandle as n,refHandle as a}from"../../../../core/handleUtils.js";import{deg2rad as l}from"../../../../core/mathUtils.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{signal as s}from"../../../../core/signal.js";import{s as r,g as c,j as m}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as p}from"../Manipulator3D.js";import{GrabbingState as h}from"./GrabbingState.js";import{manipulatedObjectGeometry as d}from"./manipulatedObjectUtils.js";import{ManipulatorState as f}from"./ManipulatorState.js";import{ManipulatorType as v}from"./ManipulatorType.js";import{Settings as g}from"./settings.js";import{ExtendedLineVisualElement as b}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as E}from"../visualElements/LaserlineVisualElement.js";import{OutlineVisualElement as j}from"../visualElements/OutlineVisualElement.js";import{RenderOccludedFlag as w}from"../../webgl-engine/lib/Material.js";function y(t){const{object:n}=t,a=S(t),l=[a,M(t,a.visualElement)];return n.maskOccludee&&l.push(n.maskOccludee()),{visualElement:a.visualElement,remove:()=>e(l)}}function S(e){const{view:a,object:l}=e,s=d(l),r=new j({view:a,geometry:D(s)?s:null,elevationInfo:l.elevationInfo,attached:!1,isDecoration:!0}),c=new g({getTheme:()=>a.effectiveTheme}),m=()=>{r.attached=l.visible},u=t([i((()=>c.visualElements.lineObjects.outline),(e=>e.apply(r)),o),i((()=>c.visualElements.lineObjects.shadowStyle),(e=>e.apply(r)),o),i((()=>l.visible),m),i((()=>l.isDraped),(e=>{r.isDraped=e}),o),l.on("committed",(()=>{const e=d(l);r.geometry=D(e)?e:null})),n(r)]);return m(),{visualElement:r,remove:()=>u.remove()}}function M(r,c){const{object:m,view:u}=r,p=[],v=m.elevationInfo,j="on-the-ground"===v.mode||!v.offset&&"absolute-height"!==v.mode,y=new f,S=new g({getTheme:()=>u.effectiveTheme}),M=S.visualElements,L=new b({view:u,extensionType:M.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:w.OccludeAndTransparent,isDecoration:!0}),A=l(M.heightPlaneAngleCutoff),x=new E({view:u,attached:!1,angleCutoff:A,isDecoration:!0}),C=s(1);p.push(i((()=>({lineShadowStyle:S.visualElements.lineObjects.shadowStyle,pointShadowStyle:S.visualElements.pointObjects.shadowStyle,alpha:C.value})),(({lineShadowStyle:e,pointShadowStyle:t,alpha:n})=>{e.apply(c,n),t.apply(L,n)}),o));const V=s(1);p.push(i((()=>({heightPlane:S.visualElements.heightPlane,alpha:V.value})),(({heightPlane:e,alpha:t})=>e.apply(x,t)),o));const P=()=>{y.update(r);const e=d(m);if(!m.visible||j&&(m.isDraped||!D(e)||!e.hasZ))return c.laserlineEnabled=!1,L.attached=!1,void(x.attached=!1);c.laserlineEnabled=!0;const t=y.grabbingState&h.XY?M.laserlineAlphaMultiplier:1;C.value=t;const n=y.grabbingState&h.Z?M.laserlineAlphaMultiplier:1;V.value=n,T(L,y),O(r,c,x,y)};p.push(i((()=>S.visualElements.zVerticalLine),(e=>e.apply(L)),o)),p.push(m.on("committed",P),i((()=>m.visible),P),c.events.on("attachment-origin-changed",P),n(L),n(x));const U=[],X=()=>{e(U),U.length=0,r.forEachManipulator((e=>U.push(e.events.on("grab-changed",P)))),r.forEachManipulator((e=>U.push(e.events.on("select-changed",P)))),P()};return X(),p.push(r.onManipulatorsChanged(X),a((()=>t(U)))),t(p)}function T(e,t){const n=1===t.numSelected?t.firstSelected:t.numSelected>1&&null!=t.firstGrabbedXY?t.firstGrabbedXY:null;null!=n?(e.setStartEndFromWorldDownAtLocation(n.renderLocation),e.attached=!0):e.attached=!1}function O(e,t,n,a){if(a.numSelected>0){r(L,0,0,0);let t=0;e.forEachManipulator(((e,n)=>{n===v.TRANSLATE_XY&&e.selected&&e instanceof p&&(c(L,L,e.renderLocation),t++)})),t>0?(n.heightManifoldTarget=m(L,L,1/t),n.attached=!0):n.attached=!1}else{const a=t.attachmentOrigin;null!=a&&e.view.renderCoordsHelper.toRenderCoords(a,L)?(n.heightManifoldTarget=L,n.attached=!0):n.attached=!1}}function D(e){return null!=e&&("polygon"===e.type||"polyline"===e.type)}const L=u();export{y as createVisualElements};
5
+ import{removeHandles as e,handlesGroup as t,destroyHandle as n,refHandle as a}from"../../../../core/handleUtils.js";import{deg2rad as l}from"../../../../core/mathUtils.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{signal as s}from"../../../../core/signal.js";import{a as r,g as c,j as m}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as p}from"../Manipulator3D.js";import{GrabbingState as h}from"./GrabbingState.js";import{manipulatedObjectGeometry as d}from"./manipulatedObjectUtils.js";import{ManipulatorState as f}from"./ManipulatorState.js";import{ManipulatorType as v}from"./ManipulatorType.js";import{Settings as g}from"./settings.js";import{ExtendedLineVisualElement as b}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as E}from"../visualElements/LaserlineVisualElement.js";import{OutlineVisualElement as j}from"../visualElements/OutlineVisualElement.js";import{RenderOccludedFlag as w}from"../../webgl-engine/lib/Material.js";function y(t){const{object:n}=t,a=S(t),l=[a,M(t,a.visualElement)];return n.maskOccludee&&l.push(n.maskOccludee()),{visualElement:a.visualElement,remove:()=>e(l)}}function S(e){const{view:a,object:l}=e,s=d(l),r=new j({view:a,geometry:D(s)?s:null,elevationInfo:l.elevationInfo,attached:!1,isDecoration:!0}),c=new g({getTheme:()=>a.effectiveTheme}),m=()=>{r.attached=l.visible},u=t([i((()=>c.visualElements.lineObjects.outline),(e=>e.apply(r)),o),i((()=>c.visualElements.lineObjects.shadowStyle),(e=>e.apply(r)),o),i((()=>l.visible),m),i((()=>l.isDraped),(e=>{r.isDraped=e}),o),l.on("committed",(()=>{const e=d(l);r.geometry=D(e)?e:null})),n(r)]);return m(),{visualElement:r,remove:()=>u.remove()}}function M(r,c){const{object:m,view:u}=r,p=[],v=m.elevationInfo,j="on-the-ground"===v.mode||!v.offset&&"absolute-height"!==v.mode,y=new f,S=new g({getTheme:()=>u.effectiveTheme}),M=S.visualElements,L=new b({view:u,extensionType:M.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:w.OccludeAndTransparent,isDecoration:!0}),A=l(M.heightPlaneAngleCutoff),x=new E({view:u,attached:!1,angleCutoff:A,isDecoration:!0}),C=s(1);p.push(i((()=>({lineShadowStyle:S.visualElements.lineObjects.shadowStyle,pointShadowStyle:S.visualElements.pointObjects.shadowStyle,alpha:C.value})),(({lineShadowStyle:e,pointShadowStyle:t,alpha:n})=>{e.apply(c,n),t.apply(L,n)}),o));const V=s(1);p.push(i((()=>({heightPlane:S.visualElements.heightPlane,alpha:V.value})),(({heightPlane:e,alpha:t})=>e.apply(x,t)),o));const P=()=>{y.update(r);const e=d(m);if(!m.visible||j&&(m.isDraped||!D(e)||!e.hasZ))return c.laserlineEnabled=!1,L.attached=!1,void(x.attached=!1);c.laserlineEnabled=!0;const t=y.grabbingState&h.XY?M.laserlineAlphaMultiplier:1;C.value=t;const n=y.grabbingState&h.Z?M.laserlineAlphaMultiplier:1;V.value=n,T(L,y),O(r,c,x,y)};p.push(i((()=>S.visualElements.zVerticalLine),(e=>e.apply(L)),o)),p.push(m.on("committed",P),i((()=>m.visible),P),c.events.on("attachment-origin-changed",P),n(L),n(x));const U=[],X=()=>{e(U),U.length=0,r.forEachManipulator((e=>U.push(e.events.on("grab-changed",P)))),r.forEachManipulator((e=>U.push(e.events.on("select-changed",P)))),P()};return X(),p.push(r.onManipulatorsChanged(X),a((()=>t(U)))),t(p)}function T(e,t){const n=1===t.numSelected?t.firstSelected:t.numSelected>1&&null!=t.firstGrabbedXY?t.firstGrabbedXY:null;null!=n?(e.setStartEndFromWorldDownAtLocation(n.renderLocation),e.attached=!0):e.attached=!1}function O(e,t,n,a){if(a.numSelected>0){r(L,0,0,0);let t=0;e.forEachManipulator(((e,n)=>{n===v.TRANSLATE_XY&&e.selected&&e instanceof p&&(c(L,L,e.renderLocation),t++)})),t>0?(n.heightManifoldTarget=m(L,L,1/t),n.attached=!0):n.attached=!1}else{const a=t.attachmentOrigin;null!=a&&e.view.renderCoordsHelper.toRenderCoords(a,L)?(n.heightManifoldTarget=L,n.attached=!0):n.attached=!1}}function D(e){return null!=e&&("polygon"===e.type||"polyline"===e.type)}const L=u();export{y as createVisualElements};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import r from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{makeHandle as e,handlesGroup as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{watch as s,initial as n}from"../../../../../core/reactiveUtils.js";import{fromTranslation as l,fromZRotation as p,multiply as u,fromRotation as h,fromScaling as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as f}from"../../../../../chunks/vec32.js";import{fromValues as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as _,sm4d as g}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as M}from"../../Manipulator3D.js";import{RenderObject as w}from"../../RenderObject.js";import{screenToMapXYAtLocation as j}from"../dragEventPipeline3D.js";import{ManipulatorType as v}from"../ManipulatorType.js";import{discRadius as b,discTranslateArrowOffset as A,discHeight as T,discTranslateArrowSize as y}from"./config.js";import{Manipulation as I}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as x}from"./moveUtils.js";import{CullFaceOptions as D}from"../../../webgl-engine/lib/basicInterfaces.js";import{createExtrudedTriangle as S,transformInPlace as E}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as P}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as O}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as R,dragAtLocation as U,constrainToMapAxis as L,addScreenDelta as k}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as q}from"../../../../interactive/interfaces.js";class C extends I{constructor(t){super(),this._handles=new a,this._arrowManipulatorInfos=new Array,this._angle=0,this._scale=1,this._radius=b,this._updateAfterDrag=!1,this.events=new r,this._tool=t.tool,this._view=t.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),null!=t.radius&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}set orthogonalAvailable(t){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t)}destroy(){this._handles=o(this._handles),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:r}of this._arrowManipulatorInfos)t(r,v.TRANSLATE_XY)}createManipulatedObjectDragPipeline(t,r,a){if(!r.operations)return e();const i=r.operations.data.spatialReference,o=r.graphic;return x(r,a,(a=>this.createDragPipeline(((r,e,i,o,s)=>(({steps:e,cancel:i}=t(r,e,i,o,s)),a(r,e,i))),r.elevationInfo,i,o)))}createDragPipeline(t,r,a,e){return i(this._arrowManipulatorInfos.map((({manipulator:i},o)=>R(i,((i,s,n,l,p)=>{const u=s.next((t=>({...t,manipulatorType:v.TRANSLATE_XY}))).next(U(this._view,i.elevationAlignedLocation)).next(j(this._view,i.elevationAlignedLocation,r,a,e)).next(L(i.location,this.angle+(o+1)*Math.PI*.5)).next(k());t(i,u,n,l,p)})))))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t<this._arrowManipulatorInfos.length;t++)this._updateArrowManipulator(this._arrowManipulatorInfos[t],t);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:t,transform:r},a){const e=this._radius/b,i=y*e,o=i*Math.sqrt(3)/2,s=S(this._opaqueMaterial,o,i/2,i/2,T);E(s,l(g.get(),f(_.get(),0,-o/3,0))),t.renderObjects=[new w(s,q.Focused),new w(s.instantiate({material:this._transparentMaterial}),q.Unfocused)],t.radius=o/3*2*1.2;const n=p(g.get(),a*Math.PI/2),h=l(g.get(),f(_.get(),0,A*e,0));u(r,n,h)}_createManipulators(){for(let t=0;t<4;t++){const r=this._createArrowManipulator(t);this._arrowManipulatorInfos.push(r)}this._updateManipulatorTransform()}_updateManipulatorTransform(){const t=this.angle,r=h(g.get(),t,d(0,0,1));if(null==r)return;const a=c(g.get(),f(_.get(),this.displayScale,this.displayScale,this.displayScale)),e=u(g.get(),a,r);for(const i of this._arrowManipulatorInfos){const t=u(g.get(),e,i.transform);i.manipulator.modelTransform=t}}_createArrowManipulator(t){const r=new M({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:d(0,0,1)}}),a={manipulator:r,transform:m()};return this._updateArrowManipulator(a,t),this._handles.add(r.events.on("drag",(t=>{this._updateAfterDrag&&"end"===t.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)}))),a}_createMaterial(r=1){const a=new O({cullFace:D.Back,renderOccluded:P.Transparent,isDecoration:!0});return this._handles.add(s((()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor)),(t=>{t[3]*=r,a.setParameters({color:t})}),n)),a}get test(){}}export{C as MoveXYAxisManipulation};
5
+ import t from"../../../../../Color.js";import a from"../../../../../core/Evented.js";import r from"../../../../../core/Handles.js";import{makeHandle as e,handlesGroup as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{watch as s,initial as n}from"../../../../../core/reactiveUtils.js";import{fromTranslation as l,fromZRotation as p,multiply as u,fromRotation as h,fromScaling as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as f}from"../../../../../chunks/vec32.js";import{fromValues as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as _,sm4d as g}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as M}from"../../Manipulator3D.js";import{RenderObject as w}from"../../RenderObject.js";import{screenToMapXYAtLocation as j}from"../dragEventPipeline3D.js";import{ManipulatorType as v}from"../ManipulatorType.js";import{discRadius as b,discTranslateArrowOffset as A,discHeight as T,discTranslateArrowSize as y}from"./config.js";import{Manipulation as I}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as x}from"./moveUtils.js";import{CullFaceOptions as D}from"../../../webgl-engine/lib/basicInterfaces.js";import{createExtrudedTriangle as S,transformInPlace as E}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as P}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as O}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as R,dragAtLocation as U,constrainToMapAxis as L,addScreenDelta as k}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as q}from"../../../../interactive/interfaces.js";class C extends I{constructor(t){super(),this._handles=new r,this._arrowManipulatorInfos=new Array,this._angle=0,this._scale=1,this._radius=b,this._updateAfterDrag=!1,this.events=new a,this._tool=t.tool,this._view=t.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),null!=t.radius&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}set orthogonalAvailable(t){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t)}destroy(){this._handles=o(this._handles),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:a}of this._arrowManipulatorInfos)t(a,v.TRANSLATE_XY)}createManipulatedObjectDragPipeline(t,a,r){if(!a.operations)return e();const i=a.operations.data.spatialReference,o=a.graphic;return x(a,r,(r=>this.createDragPipeline(((a,e,i,o,s)=>(({steps:e,cancel:i}=t(a,e,i,o,s)),r(a,e,i))),a.elevationInfo,i,o)))}createDragPipeline(t,a,r,e){return i(this._arrowManipulatorInfos.map((({manipulator:i},o)=>R(i,((i,s,n,l,p)=>{const u=s.next((t=>({...t,manipulatorType:v.TRANSLATE_XY}))).next(U(this._view,i.elevationAlignedLocation)).next(j(this._view,i.elevationAlignedLocation,a,r,e)).next(L(i.location,this.angle+(o+1)*Math.PI*.5)).next(k());t(i,u,n,l,p)})))))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t<this._arrowManipulatorInfos.length;t++)this._updateArrowManipulator(this._arrowManipulatorInfos[t],t);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:t,transform:a},r){const e=this._radius/b,i=y*e,o=i*Math.sqrt(3)/2,s=S(this._opaqueMaterial,o,i/2,i/2,T);E(s,l(g.get(),f(_.get(),0,-o/3,0))),t.renderObjects=[new w(s,q.Focused),new w(s.instantiate({material:this._transparentMaterial}),q.Unfocused)],t.radius=o/3*2*1.2;const n=p(g.get(),r*Math.PI/2),h=l(g.get(),f(_.get(),0,A*e,0));u(a,n,h)}_createManipulators(){for(let t=0;t<4;t++){const a=this._createArrowManipulator(t);this._arrowManipulatorInfos.push(a)}this._updateManipulatorTransform()}_updateManipulatorTransform(){const t=this.angle,a=h(g.get(),t,d(0,0,1));if(null==a)return;const r=c(g.get(),f(_.get(),this.displayScale,this.displayScale,this.displayScale)),e=u(g.get(),r,a);for(const i of this._arrowManipulatorInfos){const t=u(g.get(),e,i.transform);i.manipulator.modelTransform=t}}_createArrowManipulator(t){const a=new M({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:d(0,0,1)}}),r={manipulator:a,transform:m()};return this._updateArrowManipulator(r,t),this._handles.add(a.events.on("drag",(t=>{this._updateAfterDrag&&"end"===t.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)}))),r}_createMaterial(a=1){const r=new O({cullFace:D.Back,renderOccluded:P.Transparent,isDecoration:!0});return this._handles.add(s((()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor)),(t=>{t[3]*=a,r.setParameters({color:t})}),n)),r}get test(){}}export{C as MoveXYAxisManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import e from"../../../../../core/Handles.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{fromScaling as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as l}from"../../../../../chunks/vec32.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as c,sm4d as m}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as u}from"../../Manipulator3D.js";import{RenderObject as h}from"../../RenderObject.js";import{screenToMapXYAtLocation as d}from"../dragEventPipeline3D.js";import{ManipulatorType as _}from"../ManipulatorType.js";import{discRadius as f,geometrySegments as g,discHeight as j,discCollisionRadius as M}from"./config.js";import{Manipulation as T}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as v}from"./moveUtils.js";import{SnapToScene as S}from"../snapping/SnapToScene.js";import{CullFaceOptions as w}from"../../../webgl-engine/lib/basicInterfaces.js";import{createCylinderGeometry as b}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as y}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as x}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as E,dragAtLocation as A,addScreenDelta as D}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as P}from"../../../../interactive/interfaces.js";class O extends T{constructor(t){super(),this._handles=new e,this._snapToScene=new S,this._scale=1,this._radius=f,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),null!=t.snapToScene&&(this.snapToScene=t.snapToScene),null!=t.radius&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles=a(this._handles),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(t){t(this._manipulator,_.TRANSLATE_XY)}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(t){this._snapToScene.enabled=t}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(t,e,a){if(!e.operations)return i();const r=e.graphic,s=e.elevationInfo,o=e.operations.data.spatialReference;return v(e,a,(e=>this.createDragPipeline(((i,a,r,s,o)=>(({steps:a,cancel:r}=t(i,a,r,s,o)),e(i,a,r))),s,o,r)))}createDragPipeline(t,e,i,a){const r=this._view;return E(this._manipulator,((s,o,n,l,p)=>{const c=o.next(A(r,s.elevationAlignedLocation)).next(d(r,s.elevationAlignedLocation,e,i,a)).next(...this._snapToScene.createDragEventPipelineStep(r,e)).next((t=>({...t,manipulatorType:_.TRANSLATE_XY}))).next(D());t(s,c,n,l,p)}))}_updateManipulatorTransform(){const t=o(m.get(),l(c.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=t}_createManipulator(){const t=this._view;this._manipulator=new u({view:t,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:p(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){const t=b(this._discMaterial,j,1,g,p(0,0,1),p(0,0,0));t.transformation=o(n(),p(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new h(t,P.Focused),new h(t.instantiate({material:this._discMaterialTransparent}),P.Unfocused)],this._manipulator.radius=M*(this._radius/f)}_createMaterial(e=1){const i=new x({cullFace:w.Back,renderOccluded:y.Transparent,isDecoration:!0});return this._handles.add(r((()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor)),(t=>{t[3]*=e,i.setParameters({color:t})}),s)),i}get test(){}}export{O as MoveXYDiscManipulation};
5
+ import t from"../../../../../Color.js";import e from"../../../../../core/Handles.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{fromScaling as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as l}from"../../../../../chunks/vec32.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as c,sm4d as m}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as u}from"../../Manipulator3D.js";import{RenderObject as h}from"../../RenderObject.js";import{screenToMapXYAtLocation as d}from"../dragEventPipeline3D.js";import{ManipulatorType as _}from"../ManipulatorType.js";import{discRadius as f,geometrySegments as g,discHeight as j,discCollisionRadius as M}from"./config.js";import{Manipulation as T}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as v}from"./moveUtils.js";import{SnapToScene as S}from"../snapping/SnapToScene.js";import{CullFaceOptions as w}from"../../../webgl-engine/lib/basicInterfaces.js";import{createCylinderGeometry as b}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as y}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as x}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as E,dragAtLocation as A,addScreenDelta as D}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as P}from"../../../../interactive/interfaces.js";class O extends T{constructor(t){super(),this._handles=new e,this._snapToScene=new S,this._scale=1,this._radius=f,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),null!=t.snapToScene&&(this.snapToScene=t.snapToScene),null!=t.radius&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles=a(this._handles),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(t){t(this._manipulator,_.TRANSLATE_XY)}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(t){this._snapToScene.enabled=t}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(t,e,a){if(!e.operations)return i();const r=e.graphic,s=e.elevationInfo,o=e.operations.data.spatialReference;return v(e,a,(e=>this.createDragPipeline(((i,a,r,s,o)=>(({steps:a,cancel:r}=t(i,a,r,s,o)),e(i,a,r))),s,o,r)))}createDragPipeline(t,e,i,a){const r=this._view;return E(this._manipulator,((s,o,n,l,p)=>{const c=o.next(A(r,s.elevationAlignedLocation)).next(d(r,s.elevationAlignedLocation,e,i,a)).next(...this._snapToScene.createDragEventPipelineStep(r,e)).next((t=>({...t,manipulatorType:_.TRANSLATE_XY}))).next(D());t(s,c,n,l,p)}))}_updateManipulatorTransform(){const t=o(m.get(),l(c.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=t}_createManipulator(){const t=this._view;this._manipulator=new u({view:t,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:p(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){const t=b(this._discMaterial,j,1,g,p(0,0,1),p(0,0,0));t.transformation=o(n(),p(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new h(t,P.Focused),new h(t.instantiate({material:this._discMaterialTransparent}),P.Unfocused)],this._manipulator.radius=M*(this._radius/f)}_createMaterial(e=1){const i=new x({cullFace:w.Back,renderOccluded:y.Transparent,isDecoration:!0});return this._handles.add(r((()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor)),(t=>{t[3]*=e,i.setParameters({color:t})}),s)),i}get test(){}}export{O as MoveXYDiscManipulation};